diff options
| author | Acid Chicken (硫酸鶏) <root@acid-chicken.com> | 2024-02-17 13:34:50 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-17 13:34:50 +0900 |
| commit | acba96c1d34572ed7bd454462c2462d2a32369f4 (patch) | |
| tree | 9960987a3d6b39847bcf252514eca58650f9d59c /scripts/build-assets.mjs | |
| parent | feat: add link to local note in initial comment of abuse note (#13347) (diff) | |
| download | sharkey-acba96c1d34572ed7bd454462c2462d2a32369f4.tar.gz sharkey-acba96c1d34572ed7bd454462c2462d2a32369f4.tar.bz2 sharkey-acba96c1d34572ed7bd454462c2462d2a32369f4.zip | |
feat: license violation protection (#13285)
* spec(frontend): aboutページにリポジトリ・フィードバックのURLを表示させる
Cherry-picked from MisskeyIO#441
Cherry-picked from MisskeyIO#438
* feat: license violation protection
* build: fix typo
* build: fix typo
* fix: farewell to the static type land
* fix: key typo
* fix: import typo
* fix: properly interpret `prominently`
* docs: add disclaimer
* docs: update CHANGELOG
* chore: add gap
---------
Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com>
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
Diffstat (limited to 'scripts/build-assets.mjs')
| -rw-r--r-- | scripts/build-assets.mjs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/build-assets.mjs b/scripts/build-assets.mjs index bafb1da5d9..e7684d7cc9 100644 --- a/scripts/build-assets.mjs +++ b/scripts/build-assets.mjs @@ -5,7 +5,9 @@ import * as fs from 'node:fs/promises'; import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; import cssnano from 'cssnano'; +import * as yaml from 'js-yaml'; import postcss from 'postcss'; import * as terser from 'terser'; @@ -14,8 +16,19 @@ import generateDTS from '../locales/generateDTS.js'; import meta from '../package.json' assert { type: "json" }; import buildTarball from './tarball.mjs'; +const configDir = fileURLToPath(new URL('../.config', import.meta.url)); +const configPath = process.env.MISSKEY_CONFIG_YML + ? path.resolve(configDir, process.env.MISSKEY_CONFIG_YML) + : process.env.NODE_ENV === 'test' + ? path.resolve(configDir, 'test.yml') + : path.resolve(configDir, 'default.yml'); + let locales = buildLocales(); +async function loadConfig() { + return fs.readFile(configPath, 'utf-8').then(data => yaml.load(data)).catch(() => null); +} + async function copyFrontendFonts() { await fs.cp('./packages/frontend/node_modules/three/examples/fonts', './built/_frontend_dist_/fonts', { dereference: true, recursive: true }); } @@ -78,7 +91,7 @@ async function build() { copyBackendViews(), buildBackendScript(), buildBackendStyle(), - buildTarball(), + loadConfig().then(config => config?.publishTarballInsteadOfProvideRepositoryUrl && buildTarball()), ]); } |