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/shared | |
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/shared')
-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 |
6 files changed, 109 insertions, 15 deletions
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; |