diff options
author | Kristóf Marussy <kristof@marussy.com> | 2021-12-23 17:19:52 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2021-12-23 17:54:03 +0100 |
commit | a8c4df8744ac0d9e6a889af3ad3dcbd3e100ee0a (patch) | |
tree | d10c6ab5daa20f49594dfcc3b842dff4e963a670 /packages/main | |
parent | build: Enable typescript composite mode and clean (diff) | |
download | sophie-a8c4df8744ac0d9e6a889af3ad3dcbd3e100ee0a.tar.gz sophie-a8c4df8744ac0d9e6a889af3ad3dcbd3e100ee0a.tar.zst sophie-a8c4df8744ac0d9e6a889af3ad3dcbd3e100ee0a.zip |
chore: Add license headers
Centralizes vite configuration to be able to add license banners to
outputs in one place.
Diffstat (limited to 'packages/main')
-rw-r--r-- | packages/main/src/devTools.ts | 20 | ||||
-rw-r--r-- | packages/main/src/index.ts | 20 | ||||
-rw-r--r-- | packages/main/src/stores/RootStore.ts | 20 | ||||
-rw-r--r-- | packages/main/vite.config.js | 21 |
4 files changed, 64 insertions, 17 deletions
diff --git a/packages/main/src/devTools.ts b/packages/main/src/devTools.ts index d02bfbf..b98974a 100644 --- a/packages/main/src/devTools.ts +++ b/packages/main/src/devTools.ts | |||
@@ -1,3 +1,23 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2021-2022 Kristóf Marussy <kristof@marussy.com> | ||
3 | * | ||
4 | * This file is part of Sophie. | ||
5 | * | ||
6 | * Sophie is free software: you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU Affero General Public License as | ||
8 | * published by the Free Software Foundation, version 3. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU Affero General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU Affero General Public License | ||
16 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
17 | * | ||
18 | * SPDX-License-Identifier: AGPL-3.0-only | ||
19 | */ | ||
20 | |||
1 | import type { App, BrowserWindow } from 'electron'; | 21 | import type { App, BrowserWindow } from 'electron'; |
2 | 22 | ||
3 | /** | 23 | /** |
diff --git a/packages/main/src/index.ts b/packages/main/src/index.ts index dbe6890..90102a7 100644 --- a/packages/main/src/index.ts +++ b/packages/main/src/index.ts | |||
@@ -1,3 +1,23 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2021-2022 Kristóf Marussy <kristof@marussy.com> | ||
3 | * | ||
4 | * This file is part of Sophie. | ||
5 | * | ||
6 | * Sophie is free software: you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU Affero General Public License as | ||
8 | * published by the Free Software Foundation, version 3. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU Affero General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU Affero General Public License | ||
16 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
17 | * | ||
18 | * SPDX-License-Identifier: AGPL-3.0-only | ||
19 | */ | ||
20 | |||
1 | import { app, BrowserWindow } from 'electron'; | 21 | import { app, BrowserWindow } from 'electron'; |
2 | import { getSnapshot, onPatch } from 'mobx-state-tree'; | 22 | import { getSnapshot, onPatch } from 'mobx-state-tree'; |
3 | import { join } from 'path'; | 23 | import { join } from 'path'; |
diff --git a/packages/main/src/stores/RootStore.ts b/packages/main/src/stores/RootStore.ts index a9c1290..edc740c 100644 --- a/packages/main/src/stores/RootStore.ts +++ b/packages/main/src/stores/RootStore.ts | |||
@@ -1,3 +1,23 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2021-2022 Kristóf Marussy <kristof@marussy.com> | ||
3 | * | ||
4 | * This file is part of Sophie. | ||
5 | * | ||
6 | * Sophie is free software: you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU Affero General Public License as | ||
8 | * published by the Free Software Foundation, version 3. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU Affero General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU Affero General Public License | ||
16 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
17 | * | ||
18 | * SPDX-License-Identifier: AGPL-3.0-only | ||
19 | */ | ||
20 | |||
1 | import { Instance, types } from 'mobx-state-tree'; | 21 | import { Instance, types } from 'mobx-state-tree'; |
2 | import { sharedStore } from '@sophie/shared'; | 22 | import { sharedStore } from '@sophie/shared'; |
3 | 23 | ||
diff --git a/packages/main/vite.config.js b/packages/main/vite.config.js index 556fcf8..62e5f48 100644 --- a/packages/main/vite.config.js +++ b/packages/main/vite.config.js | |||
@@ -2,9 +2,7 @@ | |||
2 | 2 | ||
3 | import { builtinModules } from 'module'; | 3 | import { builtinModules } from 'module'; |
4 | 4 | ||
5 | // `resolveJsonModule` is disabled for this package, but vite will load the json nevertheless. | 5 | import { makeConfig, node } from '../../config/vite-common'; |
6 | // @ts-expect-error | ||
7 | import { node } from '../../.electron-vendors.cache.json'; | ||
8 | 6 | ||
9 | /** @type string */ | 7 | /** @type string */ |
10 | const PACKAGE_ROOT = __dirname; | 8 | const PACKAGE_ROOT = __dirname; |
@@ -13,16 +11,10 @@ const PACKAGE_ROOT = __dirname; | |||
13 | * @type {import('vite').UserConfig} | 11 | * @type {import('vite').UserConfig} |
14 | * @see https://vitejs.dev/config/ | 12 | * @see https://vitejs.dev/config/ |
15 | */ | 13 | */ |
16 | const config = { | 14 | const config = makeConfig({ |
17 | mode: process.env.MODE, | ||
18 | root: PACKAGE_ROOT, | 15 | root: PACKAGE_ROOT, |
19 | envDir: process.cwd(), | ||
20 | build: { | 16 | build: { |
21 | sourcemap: 'inline', | 17 | target: node, |
22 | target: `node${node}`, | ||
23 | outDir: 'dist', | ||
24 | assetsDir: '.', | ||
25 | minify: process.env.MODE !== 'development', | ||
26 | lib: { | 18 | lib: { |
27 | entry: 'src/index.ts', | 19 | entry: 'src/index.ts', |
28 | formats: ['cjs'], | 20 | formats: ['cjs'], |
@@ -33,13 +25,8 @@ const config = { | |||
33 | 'electron-devtools-installer', | 25 | 'electron-devtools-installer', |
34 | ...builtinModules, | 26 | ...builtinModules, |
35 | ], | 27 | ], |
36 | output: { | ||
37 | entryFileNames: '[name].cjs', | ||
38 | }, | ||
39 | }, | 28 | }, |
40 | emptyOutDir: true, | ||
41 | brotliSize: false, | ||
42 | }, | 29 | }, |
43 | }; | 30 | }); |
44 | 31 | ||
45 | export default config; | 32 | export default config; |