aboutsummaryrefslogtreecommitdiffstats
path: root/packages/main
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2021-12-23 17:19:52 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2021-12-23 17:54:03 +0100
commita8c4df8744ac0d9e6a889af3ad3dcbd3e100ee0a (patch)
treed10c6ab5daa20f49594dfcc3b842dff4e963a670 /packages/main
parentbuild: Enable typescript composite mode and clean (diff)
downloadsophie-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.ts20
-rw-r--r--packages/main/src/index.ts20
-rw-r--r--packages/main/src/stores/RootStore.ts20
-rw-r--r--packages/main/vite.config.js21
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
1import type { App, BrowserWindow } from 'electron'; 21import 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
1import { app, BrowserWindow } from 'electron'; 21import { app, BrowserWindow } from 'electron';
2import { getSnapshot, onPatch } from 'mobx-state-tree'; 22import { getSnapshot, onPatch } from 'mobx-state-tree';
3import { join } from 'path'; 23import { 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
1import { Instance, types } from 'mobx-state-tree'; 21import { Instance, types } from 'mobx-state-tree';
2import { sharedStore } from '@sophie/shared'; 22import { 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
3import { builtinModules } from 'module'; 3import { builtinModules } from 'module';
4 4
5// `resolveJsonModule` is disabled for this package, but vite will load the json nevertheless. 5import { makeConfig, node } from '../../config/vite-common';
6// @ts-expect-error
7import { node } from '../../.electron-vendors.cache.json';
8 6
9/** @type string */ 7/** @type string */
10const PACKAGE_ROOT = __dirname; 8const 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 */
16const config = { 14const 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
45export default config; 32export default config;