Move scripts into separate folders

This commit is contained in:
schroda
2025-02-17 02:45:02 +01:00
parent 0a34ae01ba
commit 1ae98afa34
9 changed files with 23 additions and 23 deletions

View File

@@ -93,7 +93,7 @@ module.exports = {
}, },
}, },
{ {
files: ['tools/scripts/*'], files: ['tools/scripts/**/*'],
rules: { rules: {
'no-relative-import-paths/no-relative-import-paths': 'off', 'no-relative-import-paths/no-relative-import-paths': 'off',
'import/no-extraneous-dependencies': ['error', { devDependencies: true }], 'import/no-extraneous-dependencies': ['error', { devDependencies: true }],

View File

@@ -12,16 +12,16 @@
"build-md5": "find build -type f | sort | xargs md5sum | awk '{ print $1 }' | tr -d '\n' | md5sum| awk '{ print $1 }' > buildZip/md5sum ", "build-md5": "find build -type f | sort | xargs md5sum | awk '{ print $1 }' | tr -d '\n' | md5sum| awk '{ print $1 }' > buildZip/md5sum ",
"build-zip": "cd build && rev=$(git rev-list HEAD --count) && echo r$rev > revision && zip -9 -r ../buildZip/Suwayomi-WebUI-r$rev *", "build-zip": "cd build && rev=$(git rev-list HEAD --count) && echo r$rev > revision && zip -9 -r ../buildZip/Suwayomi-WebUI-r$rev *",
"lint": "eslint src --ext .ts,.tsx,.js,.jsx --max-warnings=0 --cache", "lint": "eslint src --ext .ts,.tsx,.js,.jsx --max-warnings=0 --cache",
"createCommitChangelog": "tsx tools/scripts/createCommitChangelog.ts", "createCommitChangelog": "tsx tools/scripts/release/createCommitChangelog.ts",
"createTranslationChangelog": "tsx tools/scripts/createTranslationChangelog.ts", "createTranslationChangelog": "tsx tools/scripts/release/createTranslationChangelog.ts",
"createReleaseChangelog": "tsx tools/scripts/createReleaseChangelog.ts", "createReleaseChangelog": "tsx tools/scripts/release/createReleaseChangelog.ts",
"updateDeps": "tsx tools/scripts/updateDependencies.ts", "updateDeps": "tsx tools/scripts/updateDependencies.ts",
"gql:codegen-base": "graphql-codegen --config gql_codegen.ts", "gql:codegen-base": "graphql-codegen --config gql_codegen.ts",
"gql:codegen-formatter": "tsx tools/scripts/codegenFormatter.ts", "gql:codegen-formatter": "tsx tools/scripts/codegenFormatter.ts",
"gql:codegen": "yarn gql:codegen-base & yarn gql:codegen-formatter", "gql:codegen": "yarn gql:codegen-base & yarn gql:codegen-formatter",
"i18n:gen-resources": "tsx tools/scripts/generatei18nResources.ts", "i18n:gen-resources": "tsx tools/scripts/weblate/generatei18nResources.ts",
"dayjs:gen-locales-array": "tsx tools/scripts/generateDayJsLocales.ts", "dayjs:gen-locales-array": "tsx tools/scripts/dayjs/generateDayJsLocales.ts",
"dayjs:gen-locales-import": "tsx tools/scripts/generateDayJsLocalesImport.ts", "dayjs:gen-locales-import": "tsx tools/scripts/dayjs/generateDayJsLocalesImport.ts",
"dayjs:gen-locales": "yarn dayjs:gen-locales-array && yarn dayjs:gen-locales-import", "dayjs:gen-locales": "yarn dayjs:gen-locales-array && yarn dayjs:gen-locales-import",
"prepare": "husky" "prepare": "husky"
}, },

View File

@@ -9,8 +9,8 @@
import path from 'path'; import path from 'path';
import fs from 'fs'; import fs from 'fs';
const outputFilePath = path.join(import.meta.dirname, '../../src/lib/dayjs/Locales.ts'); const outputFilePath = path.join(import.meta.dirname, '../../../src/lib/dayjs/Locales.ts');
const resourcesDirPath = path.join(import.meta.dirname, '../../node_modules/dayjs/locale'); const resourcesDirPath = path.join(import.meta.dirname, '../../../node_modules/dayjs/locale');
const dayjsLocaleFileNames = fs.readdirSync(resourcesDirPath); const dayjsLocaleFileNames = fs.readdirSync(resourcesDirPath);

View File

@@ -9,8 +9,8 @@
import path from 'path'; import path from 'path';
import fs from 'fs'; import fs from 'fs';
const outputFilePath = path.join(import.meta.dirname, '../../src/lib/dayjs/LocaleImporter.ts'); const outputFilePath = path.join(import.meta.dirname, '../../../src/lib/dayjs/LocaleImporter.ts');
const resourcesDirPath = path.join(import.meta.dirname, '../../node_modules/dayjs/locale'); const resourcesDirPath = path.join(import.meta.dirname, '../../../node_modules/dayjs/locale');
const dayjsLocaleFileNames = fs.readdirSync(resourcesDirPath); const dayjsLocaleFileNames = fs.readdirSync(resourcesDirPath);

View File

@@ -8,7 +8,7 @@
import yargs from 'yargs'; import yargs from 'yargs';
import { hideBin } from 'yargs/helpers'; import { hideBin } from 'yargs/helpers';
import { createCommitChangelog } from './release/CommitChangelog.utils.ts'; import { createCommitChangelog } from './CommitChangelog.utils.ts';
const { sha } = yargs(hideBin(process.argv)) const { sha } = yargs(hideBin(process.argv))
.options({ .options({

View File

@@ -9,9 +9,9 @@
import yargs from 'yargs'; import yargs from 'yargs';
import { hideBin } from 'yargs/helpers'; import { hideBin } from 'yargs/helpers';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { createCommitChangelog } from './release/CommitChangelog.utils.ts'; import { createCommitChangelog } from './CommitChangelog.utils.ts';
import { createTranslationChangelog } from './release/TranslationChangelog.utils.ts'; import { createTranslationChangelog } from './TranslationChangelog.utils.ts';
import { validateWeblateDates } from './weblate/Weblate.utils.ts'; import { validateWeblateDates } from '../weblate/Weblate.utils.ts';
const { sha, date } = yargs(hideBin(process.argv)) const { sha, date } = yargs(hideBin(process.argv))
.options({ .options({

View File

@@ -8,8 +8,8 @@
import yargs from 'yargs'; import yargs from 'yargs';
import { hideBin } from 'yargs/helpers'; import { hideBin } from 'yargs/helpers';
import { createTranslationChangelog } from './release/TranslationChangelog.utils.ts'; import { createTranslationChangelog } from './TranslationChangelog.utils.ts';
import { TRANSLATION_CHANGELOG_YARG_OPTIONS_DEFAULT } from './weblate/Weblate.constants.ts'; import { TRANSLATION_CHANGELOG_YARG_OPTIONS_DEFAULT } from '../weblate/Weblate.constants.ts';
const { afterDate, beforeDate, requiredContributionCount, keepKnownContributors } = yargs(hideBin(process.argv)) const { afterDate, beforeDate, requiredContributionCount, keepKnownContributors } = yargs(hideBin(process.argv))
.options({ .options({

View File

@@ -1,7 +1,7 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"include": [ "include": [
"./*" "./**/*"
], ],
"compilerOptions": { "compilerOptions": {
"moduleResolution": "node" "moduleResolution": "node"

View File

@@ -12,12 +12,12 @@ import {
fetchWeblateLanguageStats, fetchWeblateLanguageStats,
getWeblateLanguageStatsFor, getWeblateLanguageStatsFor,
meetsTranslatedPercentThreshold as meetsTranslatedPercentThresholdBase, meetsTranslatedPercentThreshold as meetsTranslatedPercentThresholdBase,
} from './weblate/Weblate.utils.ts'; } from './Weblate.utils.ts';
import { WeblateLanguageStatistic } from './weblate/Weblate.types.ts'; import { WeblateLanguageStatistic } from './Weblate.types.ts';
import { TRANSLATED_PERCENT_THRESHOLD } from './weblate/Weblate.constants.ts'; import { TRANSLATED_PERCENT_THRESHOLD } from './Weblate.constants.ts';
const outputFilePath = path.join(import.meta.dirname, '../../src/i18n/index.ts'); const outputFilePath = path.join(import.meta.dirname, '../../../src/i18n/index.ts');
const resourcesDirPath = path.join(import.meta.dirname, '../../public/locales'); const resourcesDirPath = path.join(import.meta.dirname, '../../../public/locales');
const extractLanguageCode = (resourceFileNames: string): string => const extractLanguageCode = (resourceFileNames: string): string =>
path.basename(resourceFileNames, path.extname(resourceFileNames)); path.basename(resourceFileNames, path.extname(resourceFileNames));