From 64d34f595cb5dcef3f6880cba3c39147a48539c6 Mon Sep 17 00:00:00 2001 From: trivernis Date: Sun, 24 Dec 2023 17:16:24 +0100 Subject: [PATCH 01/11] Change loadConfig to load all yaml files in the config directory --- package.json | 6 +- packages/backend/package.json | 3 +- packages/backend/src/config.ts | 24 +++++--- pnpm-lock.yaml | 109 +++++---------------------------- 4 files changed, 38 insertions(+), 104 deletions(-) diff --git a/package.json b/package.json index 6fad6f8bf..f267db967 100644 --- a/package.json +++ b/package.json @@ -45,8 +45,8 @@ "lodash": "4.17.21" }, "dependencies": { - "execa": "8.0.1", "cssnano": "6.0.2", + "execa": "8.0.1", "js-yaml": "4.1.0", "postcss": "8.4.32", "terser": "5.26.0", @@ -58,7 +58,7 @@ "cross-env": "7.0.3", "cypress": "13.6.1", "eslint": "8.56.0", - "start-server-and-test": "2.0.3", - "ncp": "2.0.0" + "ncp": "2.0.0", + "start-server-and-test": "2.0.3" } } diff --git a/packages/backend/package.json b/packages/backend/package.json index aaf30bef1..cda2da911 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -109,6 +109,7 @@ "file-type": "18.7.0", "fluent-ffmpeg": "2.1.2", "form-data": "4.0.0", + "glob": "^10.3.10", "got": "14.0.0", "happy-dom": "10.0.3", "hpagent": "1.2.0", @@ -122,8 +123,8 @@ "json5": "2.2.3", "jsonld": "8.3.2", "jsrsasign": "10.9.0", - "meilisearch": "0.36.0", "megalodon": "workspace:*", + "meilisearch": "0.36.0", "microformats-parser": "2.0.2", "mime-types": "2.1.35", "misskey-js": "workspace:*", diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts index 4a4d7e831..9b6c2afde 100644 --- a/packages/backend/src/config.ts +++ b/packages/backend/src/config.ts @@ -8,6 +8,7 @@ import { fileURLToPath } from 'node:url'; import { dirname, resolve } from 'node:path'; import * as yaml from 'js-yaml'; import type { RedisOptions } from 'ioredis'; +import { globSync } from 'glob'; type RedisOptionsSource = Partial & { host: string; @@ -185,19 +186,26 @@ const dir = `${_dirname}/../../../.config`; /** * Path of configuration file */ -const path = process.env.MISSKEY_CONFIG_YML - ? resolve(dir, process.env.MISSKEY_CONFIG_YML) +const cfgDir = process.env.MISSKEY_CONFIG_DIR + ? resolve(dir, process.env.MISSKEY_CONFIG_DIR) : process.env.NODE_ENV === 'test' - ? resolve(dir, 'test.yml') - : resolve(dir, 'default.yml'); + ? resolve(dir, './test/') + : dir; export function loadConfig(): Config { const meta = JSON.parse(fs.readFileSync(`${_dirname}/../../../built/meta.json`, 'utf-8')); - const clientManifestExists = fs.existsSync(_dirname + '/../../../built/_vite_/manifest.json'); - const clientManifest = clientManifestExists ? - JSON.parse(fs.readFileSync(`${_dirname}/../../../built/_vite_/manifest.json`, 'utf-8')) + const clientManifestExists = fs.existsSync(`${_dirname}/../../../built/_vite_/manifest.json`); + const clientManifest = clientManifestExists + ? JSON.parse(fs.readFileSync(`${_dirname}/../../../built/_vite_/manifest.json`, 'utf-8')) : { 'src/_boot_.ts': { file: 'src/_boot_.ts' } }; - const config = yaml.load(fs.readFileSync(path, 'utf-8')) as Source; + + const config = globSync(`${cfgDir}/*.{yaml,yml}`) + .map(path => fs.readFileSync(path, 'utf-8')) + .map(contents => yaml.load(contents) as Source) + .reduce( + (acc: Source, cur: Source) => Object.assign(acc, cur), + {} as Source, + ) as Source; const url = tryCreateUrl(config.url); const version = meta.version; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ec05ad348..193d294f2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -208,6 +208,9 @@ importers: form-data: specifier: 4.0.0 version: 4.0.0 + glob: + specifier: ^10.3.10 + version: 10.3.10 got: specifier: 14.0.0 version: 14.0.0 @@ -870,10 +873,10 @@ importers: version: 7.6.5 '@storybook/vue3': specifier: 7.6.5 - version: 7.6.5(@vue/compiler-core@3.3.8)(vue@3.3.12) + version: 7.6.5(@vue/compiler-core@3.3.12)(vue@3.3.12) '@storybook/vue3-vite': specifier: 7.6.5 - version: 7.6.5(@vue/compiler-core@3.3.8)(typescript@5.3.3)(vite@5.0.10)(vue@3.3.12) + version: 7.6.5(@vue/compiler-core@3.3.12)(typescript@5.3.3)(vite@5.0.10)(vue@3.3.12) '@testing-library/vue': specifier: 8.0.1 version: 8.0.1(@vue/compiler-sfc@3.3.12)(vue@3.3.12) @@ -978,7 +981,7 @@ importers: version: 7.6.5 storybook-addon-misskey-theme: specifier: github:misskey-dev/storybook-addon-misskey-theme - version: github.com/misskey-dev/storybook-addon-misskey-theme/cf583db098365b2ccc81a82f63ca9c93bc32b640(@storybook/blocks@7.6.5)(@storybook/components@7.5.3)(@storybook/core-events@7.6.5)(@storybook/manager-api@7.6.5)(@storybook/preview-api@7.6.5)(@storybook/theming@7.6.5)(@storybook/types@7.6.5)(react-dom@18.2.0)(react@18.2.0) + version: github.com/misskey-dev/storybook-addon-misskey-theme/cf583db098365b2ccc81a82f63ca9c93bc32b640(@storybook/blocks@7.6.5)(@storybook/components@7.6.5)(@storybook/core-events@7.6.5)(@storybook/manager-api@7.6.5)(@storybook/preview-api@7.6.5)(@storybook/theming@7.6.5)(@storybook/types@7.6.5)(react-dom@18.2.0)(react@18.2.0) summaly: specifier: github:misskey-dev/summaly version: github.com/misskey-dev/summaly/d2a3e07205c3c9769bc5a7b42031c8884b5a25c8 @@ -6691,17 +6694,6 @@ packages: - supports-color dev: true - /@storybook/channels@7.5.3: - resolution: {integrity: sha512-dhWuV2o2lmxH0RKuzND8jxYzvSQTSmpE13P0IT/k8+I1up/rSNYOBQJT6SalakcNWXFAMXguo/8E7ApmnKKcEw==} - dependencies: - '@storybook/client-logger': 7.5.3 - '@storybook/core-events': 7.5.3 - '@storybook/global': 5.0.0 - qs: 6.11.1 - telejson: 7.2.0 - tiny-invariant: 1.3.1 - dev: true - /@storybook/channels@7.6.5: resolution: {integrity: sha512-FIlNkyfQy9uHoJfAFL2/wO3ASGJELFvBzURBE2rcEF/TS7GcUiqWnBfiDxAbwSEjSOm2F0eEq3UXhaZEjpJHDw==} dependencies: @@ -6765,12 +6757,6 @@ packages: - utf-8-validate dev: true - /@storybook/client-logger@7.5.3: - resolution: {integrity: sha512-vUFYALypjix5FoJ5M/XUP6KmyTnQJNW1poHdW7WXUVSg+lBM6E5eAtjTm0hdxNNDH8KSrdy24nCLra5h0X0BWg==} - dependencies: - '@storybook/global': 5.0.0 - dev: true - /@storybook/client-logger@7.6.5: resolution: {integrity: sha512-S5aROWgssqg7tcs9lgW5wmCAz4SxMAtioiyVj5oFecmPCbQtFVIAREYzeoxE4GfJL+plrfRkum4BzziANn8EhQ==} dependencies: @@ -6798,29 +6784,6 @@ packages: - supports-color dev: true - /@storybook/components@7.5.3(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-M3+cjvEsDGLUx8RvK5wyF6/13LNlUnKbMgiDE8Sxk/v/WPpyhOAIh/B8VmrU1psahS61Jd4MTkFmLf1cWau1vw==} - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - dependencies: - '@radix-ui/react-select': 1.2.2(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-toolbar': 1.0.4(react-dom@18.2.0)(react@18.2.0) - '@storybook/client-logger': 7.5.3 - '@storybook/csf': 0.1.0 - '@storybook/global': 5.0.0 - '@storybook/theming': 7.5.3(react-dom@18.2.0)(react@18.2.0) - '@storybook/types': 7.5.3 - memoizerific: 1.11.3 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - use-resize-observer: 9.1.0(react-dom@18.2.0)(react@18.2.0) - util-deprecate: 1.0.2 - transitivePeerDependencies: - - '@types/react' - - '@types/react-dom' - dev: true - /@storybook/components@7.6.5(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-w4ZucbBBZ+NKMWlJKVj2I/bMBBq7gzDp9lzc4+8QaQ3vUPXKqc1ilIPYo/7UR5oxwDVMZocmMSgl9L8lvf7+Mw==} peerDependencies: @@ -6882,12 +6845,6 @@ packages: - supports-color dev: true - /@storybook/core-events@7.5.3: - resolution: {integrity: sha512-DFOpyQ22JD5C1oeOFzL8wlqSWZzrqgDfDbUGP8xdO4wJu+FVTxnnWN6ZYLdTPB1u27DOhd7TzjQMfLDHLu7kbQ==} - dependencies: - ts-dedent: 2.2.0 - dev: true - /@storybook/core-events@7.6.5: resolution: {integrity: sha512-zk2q/qicYXAzHA4oV3GDbIql+Kd4TOHUgDE8e4jPCOPp856z2ScqEKUAbiJizs6eEJOH4nW9Db1kuzgrBVEykQ==} dependencies: @@ -6970,12 +6927,6 @@ packages: - supports-color dev: true - /@storybook/csf@0.1.0: - resolution: {integrity: sha512-uk+jMXCZ8t38jSTHk2o5btI+aV2Ksbvl6DoOv3r6VaCM1KZqeuMwtwywIQdflkA8/6q/dKT8z8L+g8hC4GC3VQ==} - dependencies: - type-fest: 2.19.0 - dev: true - /@storybook/csf@0.1.2: resolution: {integrity: sha512-ePrvE/pS1vsKR9Xr+o+YwdqNgHUyXvg+1Xjx0h9LrVx7Zq4zNe06pd63F5EvzTbCbJsHj7GHr9tkiaqm7U8WRA==} dependencies: @@ -7205,20 +7156,6 @@ packages: ts-dedent: 2.2.0 dev: true - /@storybook/theming@7.5.3(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-Cjmthe1MAk0z4RKCZ7m72gAD8YD0zTAH97z5ryM1Qv84QXjiCQ143fGOmYz1xEQdNFpOThPcwW6FEccLHTkVcg==} - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - dependencies: - '@emotion/use-insertion-effect-with-fallbacks': 1.0.0(react@18.2.0) - '@storybook/client-logger': 7.5.3 - '@storybook/global': 5.0.0 - memoizerific: 1.11.3 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - dev: true - /@storybook/theming@7.6.5(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-RpcWT0YEgiobO41McVPDfQQHHFnjyr1sJnNTPJIvOUgSfURdgSj17mQVxtD5xcXcPWUdle5UhIOrCixHbL/NNw==} peerDependencies: @@ -7233,15 +7170,6 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: true - /@storybook/types@7.5.3: - resolution: {integrity: sha512-iu5W0Kdd6nysN5CPkY4GRl+0BpxRTdSfBIJak7mb6xCIHSB5t1tw4BOuqMQ5EgpikRY3MWJ4gY647QkWBX3MNQ==} - dependencies: - '@storybook/channels': 7.5.3 - '@types/babel__core': 7.20.5 - '@types/express': 4.17.17 - file-system-cache: 2.3.0 - dev: true - /@storybook/types@7.6.5: resolution: {integrity: sha512-Q757v+fYZZSaEpks/zDL5YgXRozxkgKakXFc+BoQHK5q5sVhJ+0jvpLJiAQAniIIaMIkqY/G24Kd6Uo6UdKBCg==} dependencies: @@ -7251,7 +7179,7 @@ packages: file-system-cache: 2.3.0 dev: true - /@storybook/vue3-vite@7.6.5(@vue/compiler-core@3.3.8)(typescript@5.3.3)(vite@5.0.10)(vue@3.3.12): + /@storybook/vue3-vite@7.6.5(@vue/compiler-core@3.3.12)(typescript@5.3.3)(vite@5.0.10)(vue@3.3.12): resolution: {integrity: sha512-7wUCq2Lrjlekftd5ha3hG0GSGbbzuc370cKkBqSmwFuOfI38z5+VeYt7nDtAlncxcpVSH7DejTGRuKTlC7NyYg==} engines: {node: ^14.18 || >=16} peerDependencies: @@ -7259,7 +7187,7 @@ packages: dependencies: '@storybook/builder-vite': 7.6.5(typescript@5.3.3)(vite@5.0.10) '@storybook/core-server': 7.6.5 - '@storybook/vue3': 7.6.5(@vue/compiler-core@3.3.8)(vue@3.3.12) + '@storybook/vue3': 7.6.5(@vue/compiler-core@3.3.12)(vue@3.3.12) '@vitejs/plugin-vue': 4.5.2(vite@5.0.10)(vue@3.3.12) magic-string: 0.30.5 vite: 5.0.10(@types/node@20.10.5)(sass@1.69.5)(terser@5.26.0) @@ -7276,7 +7204,7 @@ packages: - vue dev: true - /@storybook/vue3@7.6.5(@vue/compiler-core@3.3.8)(vue@3.3.12): + /@storybook/vue3@7.6.5(@vue/compiler-core@3.3.12)(vue@3.3.12): resolution: {integrity: sha512-tv/9rVc3XXDOJu5hfZtKhrhM8x4GTLKon62Rmaxlq06weqkGlfBi/V/g1EZ7OE71Pi+woKS/TX7p9qbRrvgahg==} engines: {node: '>=16.0.0'} peerDependencies: @@ -7288,7 +7216,7 @@ packages: '@storybook/global': 5.0.0 '@storybook/preview-api': 7.6.5 '@storybook/types': 7.6.5 - '@vue/compiler-core': 3.3.8 + '@vue/compiler-core': 3.3.12 lodash: 4.17.21 ts-dedent: 2.2.0 type-fest: 2.19.0 @@ -8048,6 +7976,7 @@ packages: /@types/node@20.10.5: resolution: {integrity: sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw==} + requiresBuild: true dependencies: undici-types: 5.26.5 @@ -12799,7 +12728,7 @@ packages: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 5.1.2 + minimatch: 5.1.6 once: 1.4.0 /global-dirs@3.0.1: @@ -15060,12 +14989,6 @@ packages: dependencies: brace-expansion: 1.1.11 - /minimatch@5.1.2: - resolution: {integrity: sha512-bNH9mmM9qsJ2X4r2Nat1B//1dJVcn3+iBLa3IgqJ7EbGaDNepL9QSHOxN4ng33s52VMMhhIfgCYDk3C4ZmlDAg==} - engines: {node: '>=10'} - dependencies: - brace-expansion: 2.0.1 - /minimatch@5.1.6: resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} engines: {node: '>=10'} @@ -17304,7 +17227,7 @@ packages: /readdir-glob@1.1.2: resolution: {integrity: sha512-6RLVvwJtVwEDfPdn6X6Ille4/lxGl0ATOY4FN/B9nxQcgOazvvI0nodiD19ScKq0PvA/29VpaOQML36o5IzZWA==} dependencies: - minimatch: 5.1.2 + minimatch: 5.1.6 dev: false /readdirp@3.6.0: @@ -18888,6 +18811,7 @@ packages: /ts-case-convert@2.0.2: resolution: {integrity: sha512-vdKfx1VAdpvEBOBv5OpVu5ZFqRg9HdTI4sYt6qqMeICBeNyXvitrarCnFWNDAki51IKwCyx+ZssY46Q9jH5otA==} dev: true + bundledDependencies: [] /ts-dedent@2.2.0: resolution: {integrity: sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==} @@ -19256,6 +19180,7 @@ packages: /undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + requiresBuild: true /undici@5.22.1: resolution: {integrity: sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw==} @@ -20281,7 +20206,7 @@ packages: sharp: 0.31.3 dev: false - github.com/misskey-dev/storybook-addon-misskey-theme/cf583db098365b2ccc81a82f63ca9c93bc32b640(@storybook/blocks@7.6.5)(@storybook/components@7.5.3)(@storybook/core-events@7.6.5)(@storybook/manager-api@7.6.5)(@storybook/preview-api@7.6.5)(@storybook/theming@7.6.5)(@storybook/types@7.6.5)(react-dom@18.2.0)(react@18.2.0): + github.com/misskey-dev/storybook-addon-misskey-theme/cf583db098365b2ccc81a82f63ca9c93bc32b640(@storybook/blocks@7.6.5)(@storybook/components@7.6.5)(@storybook/core-events@7.6.5)(@storybook/manager-api@7.6.5)(@storybook/preview-api@7.6.5)(@storybook/theming@7.6.5)(@storybook/types@7.6.5)(react-dom@18.2.0)(react@18.2.0): resolution: {tarball: https://codeload.github.com/misskey-dev/storybook-addon-misskey-theme/tar.gz/cf583db098365b2ccc81a82f63ca9c93bc32b640} id: github.com/misskey-dev/storybook-addon-misskey-theme/cf583db098365b2ccc81a82f63ca9c93bc32b640 name: storybook-addon-misskey-theme @@ -20303,7 +20228,7 @@ packages: optional: true dependencies: '@storybook/blocks': 7.6.5(react-dom@18.2.0)(react@18.2.0) - '@storybook/components': 7.5.3(react-dom@18.2.0)(react@18.2.0) + '@storybook/components': 7.6.5(react-dom@18.2.0)(react@18.2.0) '@storybook/core-events': 7.6.5 '@storybook/manager-api': 7.6.5(react-dom@18.2.0)(react@18.2.0) '@storybook/preview-api': 7.6.5 From df7f4aa3ecd7f883cd6d71a31711f46bab77d28e Mon Sep 17 00:00:00 2001 From: trivernis Date: Wed, 27 Dec 2023 16:08:37 +0100 Subject: [PATCH 02/11] Add support for glob syntax to config file env variables This change allows loading config files using glob syntax, for exakple `production-*.yml` to load all config files prefixed with *production*. With this change the config file can also be configured using two additional env variables `SHARKEY_CONFIG_YML` and `SHARKEY_CONFIG_FILE`. --- packages/backend/src/config.ts | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts index 9b6c2afde..99a3ed0f7 100644 --- a/packages/backend/src/config.ts +++ b/packages/backend/src/config.ts @@ -183,14 +183,27 @@ const _dirname = dirname(_filename); */ const dir = `${_dirname}/../../../.config`; +function buildPath() { + const envVars = ['MISSKEY_CONFIG_YML', 'SHARKEY_CONFIG_YML', 'SHARKEY_CONFIG_FILE']; + const envCfgFile = envVars + .map(v => process.env[v]) + .map(v => v ? resolve(dir, v) : undefined) + .find(v => !!v); + + if (envCfgFile) { + return envCfgFile; + } + if (process.env.NODE_ENV === 'test') { + return resolve(dir, 'test.yml'); + } + + return resolve(dir, 'default.yml'); +} + /** - * Path of configuration file + * Path of configuration file. Supports loading multiple files using glob syntax */ -const cfgDir = process.env.MISSKEY_CONFIG_DIR - ? resolve(dir, process.env.MISSKEY_CONFIG_DIR) - : process.env.NODE_ENV === 'test' - ? resolve(dir, './test/') - : dir; +const path = buildPath(); export function loadConfig(): Config { const meta = JSON.parse(fs.readFileSync(`${_dirname}/../../../built/meta.json`, 'utf-8')); @@ -199,7 +212,7 @@ export function loadConfig(): Config { ? JSON.parse(fs.readFileSync(`${_dirname}/../../../built/_vite_/manifest.json`, 'utf-8')) : { 'src/_boot_.ts': { file: 'src/_boot_.ts' } }; - const config = globSync(`${cfgDir}/*.{yaml,yml}`) + const config = globSync(path) .map(path => fs.readFileSync(path, 'utf-8')) .map(contents => yaml.load(contents) as Source) .reduce( From 93094bcb7206f79c67bd69536a2ce51aeda0ddc8 Mon Sep 17 00:00:00 2001 From: trivernis Date: Wed, 27 Dec 2023 16:35:14 +0100 Subject: [PATCH 03/11] Keep only the changes to loading the config files using glob patterns --- packages/backend/src/config.ts | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts index 99a3ed0f7..24a0296aa 100644 --- a/packages/backend/src/config.ts +++ b/packages/backend/src/config.ts @@ -183,33 +183,20 @@ const _dirname = dirname(_filename); */ const dir = `${_dirname}/../../../.config`; -function buildPath() { - const envVars = ['MISSKEY_CONFIG_YML', 'SHARKEY_CONFIG_YML', 'SHARKEY_CONFIG_FILE']; - const envCfgFile = envVars - .map(v => process.env[v]) - .map(v => v ? resolve(dir, v) : undefined) - .find(v => !!v); - - if (envCfgFile) { - return envCfgFile; - } - if (process.env.NODE_ENV === 'test') { - return resolve(dir, 'test.yml'); - } - - return resolve(dir, 'default.yml'); -} - /** - * Path of configuration file. Supports loading multiple files using glob syntax + * Path of configuration file */ -const path = buildPath(); +const path = process.env.MISSKEY_CONFIG_YML + ? resolve(dir, process.env.MISSKEY_CONFIG_YML) + : process.env.NODE_ENV === 'test' + ? resolve(dir, 'test.yml') + : resolve(dir, 'default.yml'); export function loadConfig(): Config { const meta = JSON.parse(fs.readFileSync(`${_dirname}/../../../built/meta.json`, 'utf-8')); const clientManifestExists = fs.existsSync(`${_dirname}/../../../built/_vite_/manifest.json`); - const clientManifest = clientManifestExists - ? JSON.parse(fs.readFileSync(`${_dirname}/../../../built/_vite_/manifest.json`, 'utf-8')) + const clientManifest = clientManifestExists ? + JSON.parse(fs.readFileSync(`${_dirname}/../../../built/_vite_/manifest.json`, 'utf-8')) : { 'src/_boot_.ts': { file: 'src/_boot_.ts' } }; const config = globSync(path) From 06d110a7739b3dff34916e5d443d930333b5bcce Mon Sep 17 00:00:00 2001 From: trivernis Date: Wed, 27 Dec 2023 20:56:13 +0100 Subject: [PATCH 04/11] Lock glob to exact package version 10.3.10 --- packages/backend/package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/backend/package.json b/packages/backend/package.json index 032193616..37a54039d 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -109,7 +109,7 @@ "file-type": "18.7.0", "fluent-ffmpeg": "2.1.2", "form-data": "4.0.0", - "glob": "^10.3.10", + "glob": "10.3.10", "got": "14.0.0", "happy-dom": "10.0.3", "hpagent": "1.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4a9777ea2..39e943e56 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -209,7 +209,7 @@ importers: specifier: 4.0.0 version: 4.0.0 glob: - specifier: ^10.3.10 + specifier: 10.3.10 version: 10.3.10 got: specifier: 14.0.0 @@ -7224,7 +7224,7 @@ packages: ts-dedent: 2.2.0 type-fest: 2.19.0 vue: 3.3.12(typescript@5.3.3) - vue-component-type-helpers: 1.8.26 + vue-component-type-helpers: 1.8.27 transitivePeerDependencies: - encoding - supports-color @@ -19627,8 +19627,8 @@ packages: /vscode-textmate@8.0.0: resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==} - /vue-component-type-helpers@1.8.26: - resolution: {integrity: sha512-CIwb7s8cqUuPpHDk+0DY8EJ/x8tzdzqw8ycX8hhw1GnbngTgSsIceHAqrrLjmv8zXi+j5XaiqYRQMw8sKyyjkw==} + /vue-component-type-helpers@1.8.27: + resolution: {integrity: sha512-0vOfAtI67UjeO1G6UiX5Kd76CqaQ67wrRZiOe7UAb9Jm6GzlUr/fC7CV90XfwapJRjpCMaZFhv1V0ajWRmE9Dg==} dev: true /vue-component-type-helpers@1.8.4: From f2d452271456ba8a7a25dff623e175fd80e1cc97 Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 29 Dec 2023 15:03:32 +0000 Subject: [PATCH 05/11] change all "renote" to "boost" #272 #273 #274 --- locales/en-US.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index c1e39778b..6d7a2b9b8 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -46,7 +46,7 @@ pin: "Pin to profile" unpin: "Unpin from profile" copyContent: "Copy contents" copyLink: "Copy link" -copyLinkRenote: "Copy renote link" +copyLinkRenote: "Copy boost link" delete: "Delete" deleteAndEdit: "Delete and edit" deleteAndEditConfirm: "Are you sure you want to redraft this note? This means you will lose all reactions, boosts, and replies to it." @@ -115,7 +115,7 @@ rmboost: "Unboosted." cantRenote: "This post can't be boosted." cantReRenote: "A boost can't be boosted." quote: "Quote" -inChannelRenote: "Channel-only Renote" +inChannelRenote: "Channel-only Boost" inChannelQuote: "Channel-only Quote" pinnedNote: "Pinned note" pinned: "Pin to profile" @@ -135,8 +135,8 @@ unmarkAsSensitive: "Unmark as sensitive" enterFileName: "Enter filename" mute: "Mute" unmute: "Unmute" -renoteMute: "Mute Renotes" -renoteUnmute: "Unmute Renotes" +renoteMute: "Mute Boosts" +renoteUnmute: "Unmute Boosts" block: "Block" unblock: "Unblock" markAsNSFW: "Mark all media from user as NSFW" @@ -685,7 +685,7 @@ behavior: "Behavior" sample: "Sample" abuseReports: "Reports" reportAbuse: "Report" -reportAbuseRenote: "Report renote" +reportAbuseRenote: "Report boost" reportAbuseOf: "Report {name}" fillAbuseReportDescription: "Please fill in details regarding this report. If it is about a specific note, please include its URL." abuseReported: "Your report has been sent. Thank you very much." @@ -1275,8 +1275,8 @@ _initialTutorial: _visibility: description: "You can limit who can view your note." public: "Your note will be visible for all users." - home: "Public only on the Home timeline. People visiting your profile, via followers, and through renotes can see it." - followers: "Visible to followers only. Only followers can see it and no one else, and it cannot be renoted by others." + home: "Public only on the Home timeline. People visiting your profile, via followers, and through boostss can see it." + followers: "Visible to followers only. Only followers can see it and no one else, and it cannot be boosted by others." direct: "Visible only to specified users, and the recipient will be notified. It can be used as an alternative to direct messaging." doNotSendConfidencialOnDirect1: "Be careful when sending sensitive information!" doNotSendConfidencialOnDirect2: "Administrators of the server can see what you write. Be careful with sensitive information when sending direct notes to users on untrusted servers." @@ -1774,7 +1774,7 @@ _channel: notesCount: "{n} Notes" nameAndDescription: "Name and description" nameOnly: "Name only" - allowRenoteToExternal: "Allow renote and quote outside the channel" + allowRenoteToExternal: "Allow boosts and quote outside the channel" _menuDisplay: sideFull: "Side" sideIcon: "Side (Icons)" @@ -1837,7 +1837,7 @@ _theme: hashtag: "Hashtag" mention: "Mention" mentionMe: "Mentions (Me)" - renote: "Renote" + renote: "Boost" modalBg: "Modal background" divider: "Divider" scrollbarHandle: "Scrollbar handle" @@ -2221,7 +2221,7 @@ _notification: follow: "New followers" mention: "Mentions" reply: "Replies" - renote: "Renotes" + renote: "Boosts" quote: "Quotes" reaction: "Reactions" pollEnded: "Polls ending" @@ -2233,7 +2233,7 @@ _notification: _actions: followBack: "followed you back" reply: "Reply" - renote: "Renote" + renote: "Boost" _deck: alwaysShowMainColumn: "Always show main column" columnAlign: "Align columns" From 3f36b1474d0b313ba112c0cfdf70c4348fe09612 Mon Sep 17 00:00:00 2001 From: trivernis Date: Fri, 29 Dec 2023 15:00:21 +0100 Subject: [PATCH 06/11] Revert toplevel package.json changes --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f267db967..ec9e98175 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sharkey", - "version": "2023.12.0.beta2", + "version": "2023.12.0.beta3", "codename": "shonk", "repository": { "type": "git", @@ -18,7 +18,7 @@ "build-assets": "node ./scripts/build-assets.mjs", "build": "pnpm build-pre && pnpm -r build && pnpm build-assets", "build-storybook": "pnpm --filter frontend build-storybook", - "build-misskey-js-with-types": "pnpm --filter backend build && pnpm --filter backend generate-api-json && ncp packages/backend/built/api.json packages/misskey-js/generator/api.json && pnpm --filter misskey-js update-autogen-code && pnpm --filter misskey-js build", + "build-misskey-js-with-types": "pnpm --filter backend build && pnpm --filter backend generate-api-json && ncp packages/backend/built/api.json packages/misskey-js/generator/api.json && pnpm --filter misskey-js update-autogen-code && pnpm --filter misskey-js build && pnpm --filter misskey-js api", "start": "pnpm check:connect && cd packages/backend && node ./built/boot/entry.js", "start:test": "cd packages/backend && cross-env NODE_ENV=test node ./built/boot/entry.js", "init": "pnpm migrate", @@ -45,8 +45,8 @@ "lodash": "4.17.21" }, "dependencies": { - "cssnano": "6.0.2", "execa": "8.0.1", + "cssnano": "6.0.2", "js-yaml": "4.1.0", "postcss": "8.4.32", "terser": "5.26.0", @@ -58,7 +58,7 @@ "cross-env": "7.0.3", "cypress": "13.6.1", "eslint": "8.56.0", - "ncp": "2.0.0", - "start-server-and-test": "2.0.3" + "start-server-and-test": "2.0.3", + "ncp": "2.0.0" } } From 5f2e07d81fdc8810b8b1cfc3248f8eace9f37e74 Mon Sep 17 00:00:00 2001 From: trivernis Date: Fri, 29 Dec 2023 20:05:07 +0100 Subject: [PATCH 07/11] Revert unnecessary changes to backend package.json --- packages/backend/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/package.json b/packages/backend/package.json index 34c713f69..2aa10b1c9 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -123,8 +123,8 @@ "json5": "2.2.3", "jsonld": "8.3.2", "jsrsasign": "10.9.0", - "megalodon": "workspace:*", "meilisearch": "0.36.0", + "megalodon": "workspace:*", "microformats-parser": "2.0.2", "mime-types": "2.1.35", "misskey-js": "workspace:*", From adf4e9b0b8619d2a325393f0285852dda73f0f84 Mon Sep 17 00:00:00 2001 From: Marie Date: Sat, 30 Dec 2023 04:33:14 +0100 Subject: [PATCH 08/11] chore: remove extra letter on "boosts" --- locales/en-US.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index 6d7a2b9b8..1ac2f4b28 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1275,7 +1275,7 @@ _initialTutorial: _visibility: description: "You can limit who can view your note." public: "Your note will be visible for all users." - home: "Public only on the Home timeline. People visiting your profile, via followers, and through boostss can see it." + home: "Public only on the Home timeline. People visiting your profile, via followers, and through boosts can see it." followers: "Visible to followers only. Only followers can see it and no one else, and it cannot be boosted by others." direct: "Visible only to specified users, and the recipient will be notified. It can be used as an alternative to direct messaging." doNotSendConfidencialOnDirect1: "Be careful when sending sensitive information!" From 9653a6acea0d3628f8062139a35996d899bc3b76 Mon Sep 17 00:00:00 2001 From: Marie Date: Sat, 30 Dec 2023 04:41:56 +0100 Subject: [PATCH 09/11] chore: change feature request to yml Closes #271 --- .gitea/ISSUE_TEMPLATE/02_feature-request.md | 10 --------- .gitea/ISSUE_TEMPLATE/02_feature-request.yml | 22 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 10 deletions(-) delete mode 100644 .gitea/ISSUE_TEMPLATE/02_feature-request.md create mode 100644 .gitea/ISSUE_TEMPLATE/02_feature-request.yml diff --git a/.gitea/ISSUE_TEMPLATE/02_feature-request.md b/.gitea/ISSUE_TEMPLATE/02_feature-request.md deleted file mode 100644 index db73f0dc7..000000000 --- a/.gitea/ISSUE_TEMPLATE/02_feature-request.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: "Feature Request" -about: "Suggest an idea for this project" -title: "feat: " ---- -## Summary - - -## Purpose - \ No newline at end of file diff --git a/.gitea/ISSUE_TEMPLATE/02_feature-request.yml b/.gitea/ISSUE_TEMPLATE/02_feature-request.yml new file mode 100644 index 000000000..d9395b49c --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/02_feature-request.yml @@ -0,0 +1,22 @@ +name: ✨ Feature Request +description: Suggest an idea for this project +title: 'bug: ' + +body: + - type: textarea + attributes: + label: Summary + description: Tell us what the suggestion is + validations: + required: true + - type: textarea + attributes: + label: Purpose + description: Describe the specific problem or need you think this feature will solve, and who it will help. + validations: + required: true + - type: checkboxes + attributes: + label: Do you want to implement this feature yourself? + options: + - label: Yes, I will implement this by myself and send a pull request \ No newline at end of file From 4a729a7f083fc3627ee414eefe7c95c1972b8e0f Mon Sep 17 00:00:00 2001 From: Marie Date: Sat, 30 Dec 2023 04:42:28 +0100 Subject: [PATCH 10/11] chore: add title to bug report template --- .gitea/ISSUE_TEMPLATE/01_bug-report.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/ISSUE_TEMPLATE/01_bug-report.yml b/.gitea/ISSUE_TEMPLATE/01_bug-report.yml index a2cdebe54..6282cc43f 100644 --- a/.gitea/ISSUE_TEMPLATE/01_bug-report.yml +++ b/.gitea/ISSUE_TEMPLATE/01_bug-report.yml @@ -1,5 +1,6 @@ name: 🐛 Bug Report description: Create a report to help us improve +title: 'bug: ' body: - type: markdown From 276f4967bce5822e6ef65f911a1b2cd09bc873c4 Mon Sep 17 00:00:00 2001 From: Marie Date: Sat, 30 Dec 2023 04:42:42 +0100 Subject: [PATCH 11/11] chore: fix title on feature issue template --- .gitea/ISSUE_TEMPLATE/02_feature-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/ISSUE_TEMPLATE/02_feature-request.yml b/.gitea/ISSUE_TEMPLATE/02_feature-request.yml index d9395b49c..d3bf64d86 100644 --- a/.gitea/ISSUE_TEMPLATE/02_feature-request.yml +++ b/.gitea/ISSUE_TEMPLATE/02_feature-request.yml @@ -1,6 +1,6 @@ name: ✨ Feature Request description: Suggest an idea for this project -title: 'bug: ' +title: 'feat: ' body: - type: textarea