aboutsummaryrefslogtreecommitdiffstats
path: root/config/buildConstants.js
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2021-12-31 01:52:28 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2021-12-31 01:56:30 +0100
commit7108c642f4ff6dc5f0c4d30b8a8960064ff8e90f (patch)
treef8c0450a6e1b62f7e7f8470efd375b3659b91b2b /config/buildConstants.js
parentrefactor: Install devtools extensions earlier (diff)
downloadsophie-7108c642f4ff6dc5f0c4d30b8a8960064ff8e90f.tar.gz
sophie-7108c642f4ff6dc5f0c4d30b8a8960064ff8e90f.tar.zst
sophie-7108c642f4ff6dc5f0c4d30b8a8960064ff8e90f.zip
test: Add tests for main package
- Changed jest to run from the root package and reference the packages as projects. This required moving the base jest config file away from the project root. - Module isolation seems to prevent ts-jest from loading the shared package, so we disabled it for now. - To better facilitate mocking, services should be split into interfaces and implementation - Had to downgrade to chald 4.1.2 as per https://github.com/chalk/chalk/releases/tag/v5.0.0 at least until https://github.com/microsoft/TypeScript/issues/46452 is resolved.
Diffstat (limited to 'config/buildConstants.js')
-rw-r--r--config/buildConstants.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/config/buildConstants.js b/config/buildConstants.js
new file mode 100644
index 0000000..4952907
--- /dev/null
+++ b/config/buildConstants.js
@@ -0,0 +1,40 @@
1import { readFileSync } from 'fs';
2import { join } from 'path';
3
4import { fileURLToDirname } from './utils.js';
5
6const thisDir = fileURLToDirname(import.meta.url);
7
8// We import this from a vite config, where top-level await is not available (es2021),
9// so we have to use the synchronous filesystem API.
10const electronVendorsJson = readFileSync(join(thisDir, '../.electron-vendors.cache.json'), 'utf8');
11
12const { chrome: chromeVersion, node: nodeVersion } = JSON.parse(electronVendorsJson);
13
14/** @type {string} */
15export const banner = `/*!
16 * Copyright (C) 2021-2022 Sophie contributors
17 *
18 * This file is part of Sophie.
19 *
20 * Sophie is free software: you can redistribute it and/or modify
21 * it under the terms of the GNU Affero General Public License as
22 * published by the Free Software Foundation, version 3.
23 *
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU Affero General Public License for more details.
28 *
29 * You should have received a copy of the GNU Affero General Public License
30 * along with this program. If not, see <https://www.gnu.org/licenses/>.
31 *
32 * SPDX-License-Identifier: AGPL-3.0-only
33 */
34`;
35
36/** @type {string} */
37export const chrome = `chrome${chromeVersion}`;
38
39/** @type {string} */
40export const node = `node${nodeVersion}`;