aboutsummaryrefslogtreecommitdiffstats
path: root/packages/shared
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/shared
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/shared')
-rw-r--r--packages/shared/src/contextBridge/SophieRenderer.ts20
-rw-r--r--packages/shared/src/index.ts20
-rw-r--r--packages/shared/src/ipc/MainToRendererIpcMessage.ts20
-rw-r--r--packages/shared/src/ipc/RendererToMainIpcMessage.ts20
-rw-r--r--packages/shared/src/stores/SharedStore.ts20
-rw-r--r--packages/shared/vite.config.js24
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
1import { SharedStoreListener } from '../stores/SharedStore'; 21import { SharedStoreListener } from '../stores/SharedStore';
2 22
3export interface SophieRenderer { 23export 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
1export type { SophieRenderer } from './contextBridge/SophieRenderer'; 21export type { SophieRenderer } from './contextBridge/SophieRenderer';
2 22
3export { MainToRendererIpcMessage } from './ipc/MainToRendererIpcMessage'; 23export { 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
1export enum MainToRendererIpcMessage { 21export 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
1export enum RendererToMainIpcMessage { 21export 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
1import { 21import {
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
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 { chrome, makeConfig, node } from '../../config/vite-common';
6// @ts-expect-error
7import { chrome, node } from '../../.electron-vendors.cache.json';
8 6
9/** @type string */ 7/** @type string */
10const PACKAGE_ROOT = __dirname; 8const 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 */
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',
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
44export default config; 38export default config;