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 | |
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')
-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 | ||||
-rw-r--r-- | packages/preload/src/SophieRendererImpl.ts | 20 | ||||
-rw-r--r-- | packages/preload/src/index.ts | 20 | ||||
-rw-r--r-- | packages/preload/vite.config.js | 21 | ||||
-rw-r--r-- | packages/renderer/src/components/StoreProvider.tsx | 20 | ||||
-rw-r--r-- | packages/renderer/src/components/ThemeProvider.tsx | 20 | ||||
-rw-r--r-- | packages/renderer/src/devTools.ts | 20 | ||||
-rw-r--r-- | packages/renderer/src/index.tsx | 20 | ||||
-rw-r--r-- | packages/renderer/src/stores/RootStore.ts | 20 | ||||
-rw-r--r-- | packages/renderer/vite.config.js | 16 | ||||
-rw-r--r-- | packages/shared/src/contextBridge/SophieRenderer.ts | 20 | ||||
-rw-r--r-- | packages/shared/src/index.ts | 20 | ||||
-rw-r--r-- | packages/shared/src/ipc/MainToRendererIpcMessage.ts | 20 | ||||
-rw-r--r-- | packages/shared/src/ipc/RendererToMainIpcMessage.ts | 20 | ||||
-rw-r--r-- | packages/shared/src/stores/SharedStore.ts | 20 | ||||
-rw-r--r-- | packages/shared/vite.config.js | 24 |
19 files changed, 321 insertions, 61 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; |
diff --git a/packages/preload/src/SophieRendererImpl.ts b/packages/preload/src/SophieRendererImpl.ts index e03c89e..1ac8b65 100644 --- a/packages/preload/src/SophieRendererImpl.ts +++ b/packages/preload/src/SophieRendererImpl.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 { ipcRenderer } from 'electron'; | 21 | import { ipcRenderer } from 'electron'; |
2 | import type { IJsonPatch } from 'mobx-state-tree'; | 22 | import type { IJsonPatch } from 'mobx-state-tree'; |
3 | import { | 23 | import { |
diff --git a/packages/preload/src/index.ts b/packages/preload/src/index.ts index 19d1285..ef85f70 100644 --- a/packages/preload/src/index.ts +++ b/packages/preload/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 { contextBridge } from 'electron'; | 21 | import { contextBridge } from 'electron'; |
2 | 22 | ||
3 | import { createSophieRenderer } from './SophieRendererImpl'; | 23 | import { createSophieRenderer } from './SophieRendererImpl'; |
diff --git a/packages/preload/vite.config.js b/packages/preload/vite.config.js index bc37ccb..5af78d9 100644 --- a/packages/preload/vite.config.js +++ b/packages/preload/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 { chrome, makeConfig } from '../../config/vite-common'; |
6 | // @ts-expect-error | ||
7 | import { chrome } 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: chrome, |
22 | target: `chrome${chrome}`, | ||
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'], |
@@ -32,13 +24,8 @@ const config = { | |||
32 | 'electron', | 24 | 'electron', |
33 | ...builtinModules, | 25 | ...builtinModules, |
34 | ], | 26 | ], |
35 | output: { | ||
36 | entryFileNames: '[name].cjs', | ||
37 | }, | ||
38 | }, | 27 | }, |
39 | emptyOutDir: true, | ||
40 | brotliSize: false, | ||
41 | }, | 28 | }, |
42 | }; | 29 | }); |
43 | 30 | ||
44 | export default config; | 31 | export default config; |
diff --git a/packages/renderer/src/components/StoreProvider.tsx b/packages/renderer/src/components/StoreProvider.tsx index 51c39f7..0d9a36c 100644 --- a/packages/renderer/src/components/StoreProvider.tsx +++ b/packages/renderer/src/components/StoreProvider.tsx | |||
@@ -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 React, { createContext, useContext } from 'react'; | 21 | import React, { createContext, useContext } from 'react'; |
2 | 22 | ||
3 | import type { RootStore } from '../stores/RootStore'; | 23 | import type { RootStore } from '../stores/RootStore'; |
diff --git a/packages/renderer/src/components/ThemeProvider.tsx b/packages/renderer/src/components/ThemeProvider.tsx index 8be4f6a..7173a9d 100644 --- a/packages/renderer/src/components/ThemeProvider.tsx +++ b/packages/renderer/src/components/ThemeProvider.tsx | |||
@@ -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 { observer } from 'mobx-react-lite'; | 21 | import { observer } from 'mobx-react-lite'; |
2 | import { | 22 | import { |
3 | unstable_createMuiStrictModeTheme as createTheme, | 23 | unstable_createMuiStrictModeTheme as createTheme, |
diff --git a/packages/renderer/src/devTools.ts b/packages/renderer/src/devTools.ts index 5930c48..ffd99e6 100644 --- a/packages/renderer/src/devTools.ts +++ b/packages/renderer/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 { IAnyStateTreeNode } from 'mobx-state-tree'; | 21 | import type { IAnyStateTreeNode } from 'mobx-state-tree'; |
2 | 22 | ||
3 | /** | 23 | /** |
diff --git a/packages/renderer/src/index.tsx b/packages/renderer/src/index.tsx index 34b21de..901d137 100644 --- a/packages/renderer/src/index.tsx +++ b/packages/renderer/src/index.tsx | |||
@@ -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 '@fontsource/roboto/300.css'; | 21 | import '@fontsource/roboto/300.css'; |
2 | import '@fontsource/roboto/400.css'; | 22 | import '@fontsource/roboto/400.css'; |
3 | import '@fontsource/roboto/500.css'; | 23 | import '@fontsource/roboto/500.css'; |
diff --git a/packages/renderer/src/stores/RootStore.ts b/packages/renderer/src/stores/RootStore.ts index 86efac6..f24ea4d 100644 --- a/packages/renderer/src/stores/RootStore.ts +++ b/packages/renderer/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 { | 21 | import { |
2 | applySnapshot, | 22 | applySnapshot, |
3 | applyPatch, | 23 | applyPatch, |
diff --git a/packages/renderer/vite.config.js b/packages/renderer/vite.config.js index 87c2d0c..100e182 100644 --- a/packages/renderer/vite.config.js +++ b/packages/renderer/vite.config.js | |||
@@ -5,9 +5,7 @@ | |||
5 | import { builtinModules } from 'module'; | 5 | import { builtinModules } from 'module'; |
6 | import react from '@vitejs/plugin-react'; | 6 | import react from '@vitejs/plugin-react'; |
7 | 7 | ||
8 | // `resolveJsonModule` is disabled for this package, but vite will load the json nevertheless. | 8 | import { chrome, makeConfig } from '../../config/vite-common'; |
9 | // @ts-expect-error | ||
10 | import { chrome } from '../../.electron-vendors.cache.json'; | ||
11 | 9 | ||
12 | /** @type string */ | 10 | /** @type string */ |
13 | const PACKAGE_ROOT = __dirname; | 11 | const PACKAGE_ROOT = __dirname; |
@@ -16,8 +14,7 @@ const PACKAGE_ROOT = __dirname; | |||
16 | * @type {import('vite').UserConfig} | 14 | * @type {import('vite').UserConfig} |
17 | * @see https://vitejs.dev/config/ | 15 | * @see https://vitejs.dev/config/ |
18 | */ | 16 | */ |
19 | const config = { | 17 | const config = makeConfig({ |
20 | mode: process.env.MODE, | ||
21 | root: PACKAGE_ROOT, | 18 | root: PACKAGE_ROOT, |
22 | plugins: [ | 19 | plugins: [ |
23 | react(), | 20 | react(), |
@@ -29,10 +26,7 @@ const config = { | |||
29 | }, | 26 | }, |
30 | }, | 27 | }, |
31 | build: { | 28 | build: { |
32 | sourcemap: true, | 29 | target: chrome, |
33 | target: `chrome${chrome}`, | ||
34 | outDir: 'dist', | ||
35 | assetsDir: '.', | ||
36 | rollupOptions: { | 30 | rollupOptions: { |
37 | external: [ | 31 | external: [ |
38 | 'mst-middlewares', | 32 | 'mst-middlewares', |
@@ -40,9 +34,7 @@ const config = { | |||
40 | ...builtinModules, | 34 | ...builtinModules, |
41 | ], | 35 | ], |
42 | }, | 36 | }, |
43 | emptyOutDir: true, | ||
44 | brotliSize: false, | ||
45 | }, | 37 | }, |
46 | }; | 38 | }); |
47 | 39 | ||
48 | export default config; | 40 | export default config; |
diff --git a/packages/shared/src/contextBridge/SophieRenderer.ts b/packages/shared/src/contextBridge/SophieRenderer.ts index c878595..0d82d56 100644 --- a/packages/shared/src/contextBridge/SophieRenderer.ts +++ b/packages/shared/src/contextBridge/SophieRenderer.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 { SharedStoreListener } from '../stores/SharedStore'; | 21 | import { SharedStoreListener } from '../stores/SharedStore'; |
2 | 22 | ||
3 | export interface SophieRenderer { | 23 | export interface SophieRenderer { |
diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts index 7f192bd..250700f 100644 --- a/packages/shared/src/index.ts +++ b/packages/shared/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 | export type { SophieRenderer } from './contextBridge/SophieRenderer'; | 21 | export type { SophieRenderer } from './contextBridge/SophieRenderer'; |
2 | 22 | ||
3 | export { MainToRendererIpcMessage } from './ipc/MainToRendererIpcMessage'; | 23 | export { MainToRendererIpcMessage } from './ipc/MainToRendererIpcMessage'; |
diff --git a/packages/shared/src/ipc/MainToRendererIpcMessage.ts b/packages/shared/src/ipc/MainToRendererIpcMessage.ts index 2ddca80..e68d676 100644 --- a/packages/shared/src/ipc/MainToRendererIpcMessage.ts +++ b/packages/shared/src/ipc/MainToRendererIpcMessage.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 | export enum MainToRendererIpcMessage { | 21 | export enum MainToRendererIpcMessage { |
2 | SharedStoreSnapshot = "sophie-shared-store-snapshot", | 22 | SharedStoreSnapshot = "sophie-shared-store-snapshot", |
3 | SharedStorePatch = "sophie-shared-store-patch", | 23 | SharedStorePatch = "sophie-shared-store-patch", |
diff --git a/packages/shared/src/ipc/RendererToMainIpcMessage.ts b/packages/shared/src/ipc/RendererToMainIpcMessage.ts index c4c682d..a7aa664 100644 --- a/packages/shared/src/ipc/RendererToMainIpcMessage.ts +++ b/packages/shared/src/ipc/RendererToMainIpcMessage.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 | export enum RendererToMainIpcMessage { | 21 | export enum RendererToMainIpcMessage { |
2 | SharedStoreSnapshotRequest = "sophie-shared-store-snapshot-request", | 22 | SharedStoreSnapshotRequest = "sophie-shared-store-snapshot-request", |
3 | ButtonClick = "sophie-button-click" | 23 | ButtonClick = "sophie-button-click" |
diff --git a/packages/shared/src/stores/SharedStore.ts b/packages/shared/src/stores/SharedStore.ts index 31504be..7fd65b7 100644 --- a/packages/shared/src/stores/SharedStore.ts +++ b/packages/shared/src/stores/SharedStore.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 { | 21 | import { |
2 | IJsonPatch, | 22 | IJsonPatch, |
3 | Instance, | 23 | Instance, |
diff --git a/packages/shared/vite.config.js b/packages/shared/vite.config.js index a3efc87..76bd965 100644 --- a/packages/shared/vite.config.js +++ b/packages/shared/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 { chrome, makeConfig, node } from '../../config/vite-common'; |
6 | // @ts-expect-error | ||
7 | import { chrome, 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,21 +11,19 @@ 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', | ||
22 | target: [ | 17 | target: [ |
23 | `chrome${chrome}`, | 18 | chrome, |
24 | `node${node}` | 19 | node, |
25 | ], | 20 | ], |
26 | outDir: 'dist', | ||
27 | lib: { | 21 | lib: { |
28 | entry: 'src/index.ts', | 22 | entry: 'src/index.ts', |
29 | formats: ['cjs', 'es'], | 23 | formats: [ |
30 | fileName: (format) => format === 'cjs' ? 'index.cjs' : `index.${format}.js`, | 24 | 'cjs', |
25 | 'es', | ||
26 | ], | ||
31 | }, | 27 | }, |
32 | rollupOptions: { | 28 | rollupOptions: { |
33 | external: [ | 29 | external: [ |
@@ -36,9 +32,7 @@ const config = { | |||
36 | ...builtinModules, | 32 | ...builtinModules, |
37 | ], | 33 | ], |
38 | }, | 34 | }, |
39 | emptyOutDir: true, | ||
40 | brotliSize: false, | ||
41 | }, | 35 | }, |
42 | }; | 36 | }); |
43 | 37 | ||
44 | export default config; | 38 | export default config; |