Switch to "pnpm" from "yarn"

This commit is contained in:
schroda
2026-05-15 15:11:47 +02:00
parent 7a5b5624e7
commit c19f7164e0
15 changed files with 11107 additions and 10186 deletions

View File

@@ -14,13 +14,13 @@ jobs:
node-version-file: 'package.json' node-version-file: 'package.json'
- name: Install modules - name: Install modules
run: yarn ci run: pnpm ci
- name: Run ESLint - name: Run ESLint
run: yarn lint run: pnpm lint
- name: Run TSC - name: Run TSC
run: yarn tsc run: pnpm tsc
- name: Build app - name: Build app
run: yarn build run: pnpm build

View File

@@ -34,15 +34,15 @@ jobs:
with: with:
path: | path: |
**/node_modules **/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Build webUI - name: Build webUI
run: | run: |
cd master cd master
yarn ci pnpm ci
yarn build pnpm build
yarn build-zip pnpm build-zip
yarn build-md5 pnpm build-md5
ls buildZip ls buildZip
- name: Generate Tag Name - name: Generate Tag Name

View File

@@ -39,7 +39,7 @@ jobs:
with: with:
path: | path: |
**/node_modules **/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Generate Tag Name - name: Generate Tag Name
id: GenTagName id: GenTagName
@@ -49,10 +49,10 @@ jobs:
- name: Build webUI - name: Build webUI
run: | run: |
yarn ci pnpm ci
yarn build pnpm build
yarn build-zip pnpm build-zip
yarn build-md5 pnpm build-md5
- name: Rename artifact - name: Rename artifact
run: | run: |

View File

@@ -36,19 +36,19 @@ jobs:
with: with:
path: | path: |
**/node_modules **/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install dependencies - name: Install dependencies
run: | run: |
cd master cd master
yarn ci pnpm ci
- name: Update i18n resources - name: Update i18n resources
run: | run: |
cd master cd master
echo "WEBLATE_TOKEN=${{ secrets.MY_SECRET }}" > .env echo "WEBLATE_TOKEN=${{ secrets.MY_SECRET }}" > .env
yarn i18n:gen-resources pnpm i18n:gen-resources
yarn manga:gen-type-tags pnpm manga:gen-type-tags
- name: Push changes - name: Push changes
run: | run: |

View File

@@ -1 +1 @@
yarn lint-staged pnpm lint-staged

View File

@@ -6,7 +6,7 @@ This project is built with [Vite](https://vitejs.dev/)
In the project directory, you can run: In the project directory, you can run:
### `yarn dev` ### `pnpm dev`
This command runs the app in development mode.\ This command runs the app in development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser. Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
@@ -14,11 +14,11 @@ Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page reloads when you make edits.\ The page reloads when you make edits.\
Lint errors also appear in the console. Lint errors also appear in the console.
### `yarn preview` ### `pnpm preview`
This command runs the app in a local preview production build. This command runs the app in a local preview production build.
### `yarn build` ### `pnpm build`
This command creates an optimized production build of the app and places it in the `build` folder. This command creates an optimized production build of the app and places it in the `build` folder.
See this section about [Building for Production](https://vitejs.dev/guide/build.html) for more information. See this section about [Building for Production](https://vitejs.dev/guide/build.html) for more information.

View File

@@ -56,8 +56,8 @@
You can add webfonts, meta tags, or analytics to this file. You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag. The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`. To begin the development, run `pnpm start`.
To create a production bundle, use `npm run build` or `yarn build`. To create a production bundle, use `pnpm build`.
--> -->
</body> </body>
</html> </html>

View File

@@ -7,7 +7,7 @@
*/ */
export default { export default {
'*.{ts,tsx,js,jsx}': ['oxfmt --write', 'oxlint --fix', () => `yarn i18n:extract`, 'git add src/i18n/locales/*.po'], '*.{ts,tsx,js,jsx}': ['oxfmt --write', 'oxlint --fix', () => `pnpm i18n:extract`, 'git add src/i18n/locales/*.po'],
'*.{json,md,yml,yaml,css,scss,html,graphql}': 'oxfmt --write', '*.{json,md,yml,yaml,css,scss,html,graphql}': 'oxfmt --write',
'*.{ts,tsx,json}': () => 'yarn tsc', '*.{ts,tsx,json}': () => 'pnpm tsc',
}; };

View File

@@ -4,12 +4,11 @@
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
"ci": "yarn install --frozen-lockfile",
"setup-env-files": "tsx tools/scripts/setupEnvFiles.ts", "setup-env-files": "tsx tools/scripts/setupEnvFiles.ts",
"setup": "yarn ci && yarn setup-env-files", "setup": "pnpm i --frozen-lockfile && pnpm setup-env-files",
"dev": "yarn setup && vite", "dev": "pnpm setup && vite",
"preview": "yarn setup && vite preview", "preview": "pnpm setup && vite preview",
"build": "yarn setup && vite build", "build": "pnpm setup && vite build",
"test": "node -e \"console.log('imagine')\"", "test": "node -e \"console.log('imagine')\"",
"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 *",
@@ -22,12 +21,12 @@
"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": "pnpm gql:codegen-base && pnpm gql:codegen-formatter",
"i18n:extract": "lingui extract --locale en --clean", "i18n:extract": "lingui extract --locale en --clean",
"i18n:gen-resources": "tsx tools/scripts/weblate/generatei18nResources.ts", "i18n:gen-resources": "tsx tools/scripts/weblate/generatei18nResources.ts",
"dayjs:gen-locales-array": "tsx tools/scripts/dayjs/generateDayJsLocales.ts", "dayjs:gen-locales-array": "tsx tools/scripts/dayjs/generateDayJsLocales.ts",
"dayjs:gen-locales-import": "tsx tools/scripts/dayjs/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": "pnpm dayjs:gen-locales-array && pnpm dayjs:gen-locales-import",
"manga:gen-type-tags": "tsx tools/scripts/manga/generateMangaTypeTags.ts", "manga:gen-type-tags": "tsx tools/scripts/manga/generateMangaTypeTags.ts",
"tsc": "tsgo", "tsc": "tsgo",
"tsc:legacy": "tsc", "tsc:legacy": "tsc",
@@ -119,7 +118,6 @@
"lint-staged": "16.4.0", "lint-staged": "16.4.0",
"oxfmt": "0.46.0", "oxfmt": "0.46.0",
"oxlint": "1.61.0", "oxlint": "1.61.0",
"syncyarnlock": "1.0.19",
"terser": "5.46.2", "terser": "5.46.2",
"tsx": "4.21.0", "tsx": "4.21.0",
"typescript": "5.9.3", "typescript": "5.9.3",

11060
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

5
pnpm-workspace.yaml Normal file
View File

@@ -0,0 +1,5 @@
saveExact: true
allowBuilds:
'@swc/core': true
core-js: true
esbuild: true

View File

@@ -85,9 +85,9 @@ const updatedContent = outputContent.replace(
writeFileSync(outputFilePath, updatedContent); writeFileSync(outputFilePath, updatedContent);
execSync('yarn tsc', { stdio: 'inherit' }); execSync('pnpm tsc', { stdio: 'inherit' });
execSync(`yarn oxlint --fix ${OUTPUT_FILE_PATH}`, { stdio: 'inherit' }); execSync(`pnpm oxlint --fix ${OUTPUT_FILE_PATH}`, { stdio: 'inherit' });
execSync(`yarn oxfmt --write ${OUTPUT_FILE_PATH}`, { stdio: 'inherit' }); execSync(`pnpm oxfmt --write ${OUTPUT_FILE_PATH}`, { stdio: 'inherit' });
console.log('Generated MANGA_TAGS_BY_MANGA_TYPE:'); console.log('Generated MANGA_TAGS_BY_MANGA_TYPE:');
Object.entries(translationsByMangaType).forEach(([mangaType, tags]) => { Object.entries(translationsByMangaType).forEach(([mangaType, tags]) => {

View File

@@ -50,7 +50,7 @@ const execYarnOutdated = ({ asJson = false, stdio }: { asJson?: boolean; stdio?:
| string | string
| null => { | null => {
try { try {
execSync(`yarn outdated ${asJson ? '--json' : ''}`, { stdio: !asJson ? stdio : undefined }).toString(); execSync(`pnpm outdated ${asJson ? '--json' : ''}`, { stdio: !asJson ? stdio : undefined }).toString();
return null; return null;
} catch (e: any) { } catch (e: any) {
if (e?.stdout === null) { if (e?.stdout === null) {
@@ -119,15 +119,15 @@ const updateDependencies = () => {
setCaretForDependencies('add', autoUpdatableDependencies); setCaretForDependencies('add', autoUpdatableDependencies);
execSync('yarn', { stdio: 'inherit' }); execSync('pnpm', { stdio: 'inherit' });
log('syncing package.json with yarn.lock...'); log('syncing package.json with yarn.lock...');
execSync('yarn syncyarnlock -s', { stdio: 'inherit' }); execSync('pnpm up --latest --lockfile-only', { stdio: 'inherit' });
log('updating yarn.lock after syncing package.json...'); log('updating yarn.lock after syncing package.json...');
execSync('yarn', { stdio: 'inherit' }); execSync('pnpm', { stdio: 'inherit' });
log('commiting changes...'); log('commiting changes...');

View File

@@ -76,9 +76,9 @@ const generateResources = async () => {
updateI18nIndex(resourceNames); updateI18nIndex(resourceNames);
updateLinguiConfig(resourceNames); updateLinguiConfig(resourceNames);
execSync('yarn tsc', { stdio: 'inherit' }); execSync('pnpm tsc', { stdio: 'inherit' });
execSync(`yarn oxlint --fix ${I18N_INDEX_PATH} ${LINGUI_CONFIG_PATH}`, { stdio: 'inherit' }); execSync(`pnpm oxlint --fix ${I18N_INDEX_PATH} ${LINGUI_CONFIG_PATH}`, { stdio: 'inherit' });
execSync(`yarn oxfmt --write ${I18N_INDEX_PATH} ${LINGUI_CONFIG_PATH}`, { stdio: 'inherit' }); execSync(`pnpm oxfmt --write ${I18N_INDEX_PATH} ${LINGUI_CONFIG_PATH}`, { stdio: 'inherit' });
const hasI18nIndexChanged = execSync('git status --porcelain').toString().includes(I18N_INDEX_PATH); const hasI18nIndexChanged = execSync('git status --porcelain').toString().includes(I18N_INDEX_PATH);
const hasLinguiConfigChanged = execSync('git status --porcelain').toString().includes(LINGUI_CONFIG_PATH); const hasLinguiConfigChanged = execSync('git status --porcelain').toString().includes(LINGUI_CONFIG_PATH);

10142
yarn.lock

File diff suppressed because it is too large Load Diff