From a8c4df8744ac0d9e6a889af3ad3dcbd3e100ee0a Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Thu, 23 Dec 2021 17:19:52 +0100 Subject: chore: Add license headers Centralizes vite configuration to be able to add license banners to outputs in one place. --- .../shared/src/contextBridge/SophieRenderer.ts | 20 ++++++++++++++++++ packages/shared/src/index.ts | 20 ++++++++++++++++++ .../shared/src/ipc/MainToRendererIpcMessage.ts | 20 ++++++++++++++++++ .../shared/src/ipc/RendererToMainIpcMessage.ts | 20 ++++++++++++++++++ packages/shared/src/stores/SharedStore.ts | 20 ++++++++++++++++++ packages/shared/vite.config.js | 24 ++++++++-------------- 6 files changed, 109 insertions(+), 15 deletions(-) (limited to 'packages/shared') 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 @@ +/* + * Copyright (C) 2021-2022 Kristóf Marussy + * + * This file is part of Sophie. + * + * Sophie is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { SharedStoreListener } from '../stores/SharedStore'; 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 @@ +/* + * Copyright (C) 2021-2022 Kristóf Marussy + * + * This file is part of Sophie. + * + * Sophie is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + export type { SophieRenderer } from './contextBridge/SophieRenderer'; 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 @@ +/* + * Copyright (C) 2021-2022 Kristóf Marussy + * + * This file is part of Sophie. + * + * Sophie is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + export enum MainToRendererIpcMessage { SharedStoreSnapshot = "sophie-shared-store-snapshot", 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 @@ +/* + * Copyright (C) 2021-2022 Kristóf Marussy + * + * This file is part of Sophie. + * + * Sophie is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + export enum RendererToMainIpcMessage { SharedStoreSnapshotRequest = "sophie-shared-store-snapshot-request", 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 @@ +/* + * Copyright (C) 2021-2022 Kristóf Marussy + * + * This file is part of Sophie. + * + * Sophie is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { IJsonPatch, 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 @@ import { builtinModules } from 'module'; -// `resolveJsonModule` is disabled for this package, but vite will load the json nevertheless. -// @ts-expect-error -import { chrome, node } from '../../.electron-vendors.cache.json'; +import { chrome, makeConfig, node } from '../../config/vite-common'; /** @type string */ const PACKAGE_ROOT = __dirname; @@ -13,21 +11,19 @@ const PACKAGE_ROOT = __dirname; * @type {import('vite').UserConfig} * @see https://vitejs.dev/config/ */ -const config = { - mode: process.env.MODE, +const config = makeConfig({ root: PACKAGE_ROOT, - envDir: process.cwd(), build: { - sourcemap: 'inline', target: [ - `chrome${chrome}`, - `node${node}` + chrome, + node, ], - outDir: 'dist', lib: { entry: 'src/index.ts', - formats: ['cjs', 'es'], - fileName: (format) => format === 'cjs' ? 'index.cjs' : `index.${format}.js`, + formats: [ + 'cjs', + 'es', + ], }, rollupOptions: { external: [ @@ -36,9 +32,7 @@ const config = { ...builtinModules, ], }, - emptyOutDir: true, - brotliSize: false, }, -}; +}); export default config; -- cgit v1.2.3-54-g00ecf