From 8426ee0eb2e6ab0318a442c48efacaf585e9cfaf Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 30 Jul 2026 17:11:29 +0800 Subject: [PATCH] chore: replace Oxfmt with Prettier --- .prettierignore | 2 + .vscode/settings.json | 8 +- AGENTS.md | 2 +- examples/app-react/package.json | 4 +- examples/app-vanilla/package.json | 4 +- examples/lib-node/package.json | 8 +- examples/lib-react/package.json | 8 +- oxfmt.config.ts | 6 - package.json | 9 +- packages/rstack/package.json | 30 +-- packages/rstack/src/staged.ts | 5 +- pnpm-lock.yaml | 311 +++++++++--------------------- pnpm-workspace.yaml | 2 +- prettier.config.mjs | 6 + rstack.config.ts | 8 +- scripts/dictionary.txt | 1 - 16 files changed, 139 insertions(+), 275 deletions(-) create mode 100644 .prettierignore delete mode 100644 oxfmt.config.ts create mode 100644 prettier.config.mjs diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..4e1804a --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +**/dist/** +pnpm-lock.yaml diff --git a/.vscode/settings.json b/.vscode/settings.json index 9016a3b..9f7026e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,15 +13,15 @@ "**/.DS_Store": true }, "mdx.validate.validateFileLinks": "ignore", - "editor.defaultFormatter": "oxc.oxc-vscode", + "editor.defaultFormatter": "esbenp.prettier-vscode", "js/ts.tsdk.path": "node_modules/typescript/lib", "[typescript]": { - "editor.defaultFormatter": "oxc.oxc-vscode" + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[javascript]": { - "editor.defaultFormatter": "oxc.oxc-vscode" + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[mdx]": { - "editor.defaultFormatter": "oxc.oxc-vscode" + "editor.defaultFormatter": "esbenp.prettier-vscode" } } diff --git a/AGENTS.md b/AGENTS.md index d2c9f46..8a2d17e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,7 +4,7 @@ - Use repo Node.js/pnpm versions (`package.json`) - `pnpm` workspace; shared deps in `pnpm-workspace.yaml` catalogs -- TypeScript, Rsbuild/Rslib/Rstest/Rslint, Oxfmt +- TypeScript, Rsbuild/Rslib/Rstest/Rslint, Prettier ## Commands diff --git a/examples/app-react/package.json b/examples/app-react/package.json index 18e0e70..843c433 100644 --- a/examples/app-react/package.json +++ b/examples/app-react/package.json @@ -6,8 +6,8 @@ "build": "rs build", "dev": "rs dev", "lint": "rs lint", - "test": "rs test", - "preview": "rs preview" + "preview": "rs preview", + "test": "rs test" }, "dependencies": { "react": "catalog:", diff --git a/examples/app-vanilla/package.json b/examples/app-vanilla/package.json index 12cf4e8..f29c32d 100644 --- a/examples/app-vanilla/package.json +++ b/examples/app-vanilla/package.json @@ -6,8 +6,8 @@ "build": "rs build", "dev": "rs dev", "lint": "rs lint", - "test": "rs test", - "preview": "rs preview" + "preview": "rs preview", + "test": "rs test" }, "devDependencies": { "@testing-library/dom": "catalog:", diff --git a/examples/lib-node/package.json b/examples/lib-node/package.json index 63d47b9..9bdddb6 100644 --- a/examples/lib-node/package.json +++ b/examples/lib-node/package.json @@ -1,17 +1,17 @@ { "name": "@examples/lib-node", "private": true, - "files": [ - "dist" - ], "type": "module", - "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" } }, + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], "scripts": { "build": "rs lib", "dev": "rs lib -w", diff --git a/examples/lib-react/package.json b/examples/lib-react/package.json index ea18cba..ef8daef 100644 --- a/examples/lib-react/package.json +++ b/examples/lib-react/package.json @@ -1,17 +1,17 @@ { "name": "@examples/lib-react", "private": true, - "files": [ - "dist" - ], "type": "module", - "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" } }, + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], "scripts": { "build": "rs lib", "dev": "rs lib -w", diff --git a/oxfmt.config.ts b/oxfmt.config.ts deleted file mode 100644 index 7f4c3ac..0000000 --- a/oxfmt.config.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { defineConfig } from 'oxfmt'; - -export default defineConfig({ - singleQuote: true, - ignorePatterns: ['**/dist/**', 'pnpm-lock.yaml'], -}); diff --git a/package.json b/package.json index 633c3b8..9ee4578 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,16 @@ { "name": "rstack-monorepo", "private": true, - "license": "MIT", "repository": "https://github.com/rstackjs/rstack-cli", + "license": "MIT", "type": "module", "scripts": { "build": "pnpm --filter './packages/**' build", - "check:format": "oxfmt . --check", + "check:format": "prettier . --check --experimental-cli", "check:spell": "pnpm dlx cspell && heading-case", "doc": "pnpm --dir website dev", "doc:build": "node --run build && pnpm --dir website build", - "format": "oxfmt . && heading-case --write", + "format": "prettier . --write --experimental-cli && heading-case --write", "lint": "rs lint --type-check", "prepare": "node scripts/rs.js setup", "test": "pnpm --filter './packages/**' test" @@ -19,7 +19,8 @@ "@types/node": "catalog:", "cspell-ban-words": "catalog:", "heading-case": "catalog:", - "oxfmt": "catalog:", + "prettier": "catalog:", + "prettier-plugin-packagejson": "catalog:", "rstack": "workspace:*", "typescript": "catalog:" }, diff --git a/packages/rstack/package.json b/packages/rstack/package.json index 7a0b31c..fe34902 100644 --- a/packages/rstack/package.json +++ b/packages/rstack/package.json @@ -1,20 +1,9 @@ { "name": "rstack", "version": "0.2.0", - "license": "MIT", "repository": "https://github.com/rstackjs/rstack-cli", - "bin": { - "rs": "./bin/rs.js", - "rstack": "./bin/rs.js" - }, - "files": [ - "bin", - "dist", - "types", - "THIRD_PARTY_NOTICES.md" - ], + "license": "MIT", "type": "module", - "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", @@ -47,10 +36,17 @@ }, "./package.json": "./package.json" }, - "publishConfig": { - "access": "public", - "registry": "https://registry.npmjs.org/" + "types": "./dist/index.d.ts", + "bin": { + "rs": "./bin/rs.js", + "rstack": "./bin/rs.js" }, + "files": [ + "bin", + "dist", + "types", + "THIRD_PARTY_NOTICES.md" + ], "scripts": { "build": "rslib", "dev": "rslib -w", @@ -84,5 +80,9 @@ }, "engines": { "node": ">=22.12.0" + }, + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" } } diff --git a/packages/rstack/src/staged.ts b/packages/rstack/src/staged.ts index 483454f..abfdb91 100644 --- a/packages/rstack/src/staged.ts +++ b/packages/rstack/src/staged.ts @@ -16,10 +16,7 @@ export type StagedFunctionTask = { }; export type StagedTask = - | string - | StagedFunctionTask - | StagedTaskGenerator - | (string | StagedTaskGenerator)[]; + string | StagedFunctionTask | StagedTaskGenerator | (string | StagedTaskGenerator)[]; export type StagedConfig = Record | StagedTaskGenerator; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6f35e17..270eae0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -79,12 +79,12 @@ catalogs: lint-staged: specifier: ^17.2.0 version: 17.2.0 - oxfmt: - specifier: ^0.60.0 - version: 0.60.0 prettier: specifier: 3.9.6 version: 3.9.6 + prettier-plugin-packagejson: + specifier: ^3.0.2 + version: 3.0.2 react: specifier: ^19.2.8 version: 19.2.8 @@ -117,9 +117,12 @@ importers: heading-case: specifier: 'catalog:' version: 1.1.4 - oxfmt: + prettier: + specifier: 'catalog:' + version: 3.9.6 + prettier-plugin-packagejson: specifier: 'catalog:' - version: 0.60.0 + version: 3.0.2(prettier@3.9.6) rstack: specifier: workspace:* version: link:packages/rstack @@ -492,128 +495,6 @@ packages: '@emnapi/core': ^1.7.1 '@emnapi/runtime': ^1.7.1 - '@oxfmt/binding-android-arm-eabi@0.60.0': - resolution: {integrity: sha512-1q4q4Jc8FlOMVojEisyFAVyl8h1yawNv6phjgmhGVEDeyeOdsSnSr9x0+D4mOnEKvpO5L4mxKZ/DP9X6U3A/Mw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [android] - - '@oxfmt/binding-android-arm64@0.60.0': - resolution: {integrity: sha512-tD41I6nCt9k8SQXft0CSjjU9jg6SwG7uMu7PxodSEHXl+GDW0868oy6tTtoJkyUze8YKFgTpz/k5LuPUnFiGLw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [android] - - '@oxfmt/binding-darwin-arm64@0.60.0': - resolution: {integrity: sha512-TTpzPug96Zxdyb46KvTyIUQDdsqbumXh2TKG9C23PCT0kF7JkW56Z/quPuG9rqOFKQIi1gpRNZ7DX18LwxXPnw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [darwin] - - '@oxfmt/binding-darwin-x64@0.60.0': - resolution: {integrity: sha512-CnOoWgQ7L+JL/YQaRJ+NyATciSfcftncm7y3kqyte1cGtFEGnStaCd1TAyrinkfQ7nRBfHrTs1/vTwUJr3WF2Q==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [darwin] - - '@oxfmt/binding-freebsd-x64@0.60.0': - resolution: {integrity: sha512-ychJo7S3hZxdO6eDZ9zM6F2lM9fpJS3EKS5CAUSWyprdLYxTu4gbaUKV/VBPTcMJwQa2Bpo+643y3OJ537pihA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [freebsd] - - '@oxfmt/binding-linux-arm-gnueabihf@0.60.0': - resolution: {integrity: sha512-36IH5o55T2Fx7E0feDttt+mifxN6yk9pWv4KfhAIsP0dFnUq27331OwbpOsZdoXF9soOLWm7mQUz5+UUmyec4g==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [linux] - - '@oxfmt/binding-linux-arm-musleabihf@0.60.0': - resolution: {integrity: sha512-G1Ve7lAa6sFBolVI2LWHfEAqy0YKh4vnioH8uYO9kAEdgM7mR40IksIx9/Zk4+vbYew/sGa4J9Q4tZ3n9gXDHA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [linux] - - '@oxfmt/binding-linux-arm64-gnu@0.60.0': - resolution: {integrity: sha512-LTQdRBf6uzj/h7Xk6lKzbGD2hrF/fK4YI9LIN1c0509tPUn8wRa3mCmrFQpEWJPLYGFrLFFMTYW1Ljj6VqW2Hw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@oxfmt/binding-linux-arm64-musl@0.60.0': - resolution: {integrity: sha512-2JMo3XPxMPx3hiqddSZYyaH+fKJm6cz0u8n1naYjP/CdOQOZW34i8lKBUfmbWiuFvd6KoYXLmhAyBuvojsYS7Q==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@oxfmt/binding-linux-ppc64-gnu@0.60.0': - resolution: {integrity: sha512-L3C+nBD13lr306tr/PjM3RMll+BVqgFrIgUyoeHuai5oueJrRLgO3j+GO5/Cbhtkf5PSlHYTI1JY7iqBd1qa6A==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [ppc64] - os: [linux] - libc: [glibc] - - '@oxfmt/binding-linux-riscv64-gnu@0.60.0': - resolution: {integrity: sha512-M4MsmvqlxFiPtSRGyBYQSZxchEf463AOyd+Dh4/9xDpjWBsRtDUTDMFN5EdHinjVK1/eDJQ8MLpcYjpYayaCnA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [riscv64] - os: [linux] - libc: [glibc] - - '@oxfmt/binding-linux-riscv64-musl@0.60.0': - resolution: {integrity: sha512-OH+9UskYuxRB+GxqdGkVN8f5UpwhqG8YscNo1wl8+KJ62cd7wZdGga6iGLJIf8kibF1WBwvlfDUx3cez/VXwFg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [riscv64] - os: [linux] - libc: [musl] - - '@oxfmt/binding-linux-s390x-gnu@0.60.0': - resolution: {integrity: sha512-y7AAFutt9wFWBFOAn6+BHaV39usZmcr3YYH2385f+NHgPNpIF9HpqKp0jgUxPaUOCyG3oaX5VhJduL1Nw164rw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [s390x] - os: [linux] - libc: [glibc] - - '@oxfmt/binding-linux-x64-gnu@0.60.0': - resolution: {integrity: sha512-yKZ9+CXAI+1RO5nH/4Z/9M6DAsfOzd5bw/gtWk81KB4mpalMaRRSXfouc5/tHxazDmBek55HNPepNYBgaCew0Q==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@oxfmt/binding-linux-x64-musl@0.60.0': - resolution: {integrity: sha512-bCUGaF6hJOYnQzLJdHLZbvGsOd5oSvGAyJhPAKum2uyLYUuXmP8vqg690DWi2hqcnIoYpqSqCrjzE5aiUAgwQg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [musl] - - '@oxfmt/binding-openharmony-arm64@0.60.0': - resolution: {integrity: sha512-GrUeZOvzP30ExxfCuQiyofuUGI+OmvAgFwOO5w5p9mGPlxcyuqI+6Sy9fAKFFfLQrqKYWFgc5sYA2Unj/29nPg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [openharmony] - - '@oxfmt/binding-win32-arm64-msvc@0.60.0': - resolution: {integrity: sha512-WD4Q954kUl2TDJV/6q7UnE2rlKk047kXLJsr4bJ2mXRaAqNXcmV3nwKUsGCc3mz/jYDBnXtJEaBErJEybK8iQQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [win32] - - '@oxfmt/binding-win32-ia32-msvc@0.60.0': - resolution: {integrity: sha512-HqDekjr8JXzVDUP1YthDZ1Y3CBEcuZT4WX3B+1kaxj8CvZA8Y2YhcEsXqoSop3tVsgjACxjnFQFDkBo0r/jq1Q==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [ia32] - os: [win32] - - '@oxfmt/binding-win32-x64-msvc@0.60.0': - resolution: {integrity: sha512-tz78yhmGPKboTMHCHSaUqXK8JrmoSejgDcWeqAtg2s07ZGKQ3rH5Jn8NuXPGNG33CDbY2e9NoQWXIVEmKO21Rw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [win32] - '@parcel/watcher-android-arm64@2.5.6': resolution: {integrity: sha512-YQxSS34tPF/6ZG7r/Ih9xy+kP/WwediEUsqmtf0cuCV5TPPKw/PQHRhueUo6JdeFJaqV3pyjm0GdYjZotbRt/A==} engines: {node: '>= 10.0.0'} @@ -1333,10 +1214,18 @@ packages: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} + detect-indent@7.0.2: + resolution: {integrity: sha512-y+8xyqdGLL+6sh0tVeHcfP/QDd8gUgbasolJJpY7NgeQGSZ739bDtSiaiDgtoicy+mtYB81dKLxO9xRhCyIB3A==} + engines: {node: '>=12.20'} + detect-libc@2.1.2: resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} engines: {node: '>=8'} + detect-newline@4.0.1: + resolution: {integrity: sha512-qE3Veg1YXzGHQhlA6jzebZN2qVf6NX+A7m7qlhCGG30dJixrAQhYOsJjsnBjJkCSmuOPpCk30145fr8FV0bzog==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + devlop@1.1.0: resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} @@ -1392,6 +1281,15 @@ packages: extend@3.0.2: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + flexsearch@0.8.212: resolution: {integrity: sha512-wSyJr1GUWoOOIISRu+X2IXiOcVfg9qqBRyCPRUdLMIGJqPzMo+jMRlvE83t14v1j0dRMEaBbER/adQjp6Du2pw==} @@ -1399,6 +1297,9 @@ packages: resolution: {integrity: sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==} engines: {node: '>=18'} + git-hooks-list@4.2.1: + resolution: {integrity: sha512-WNvqJjOxxs/8ZP9+DWdwWJ7cDsd60NHf39XnD82pDVrKO5q7xfPqpkK6hwEAmBa/ZSEE4IOoR75EzbbIuwGlMw==} + happy-dom@20.11.1: resolution: {integrity: sha512-XSt8tMzbW9ymE7687xztkO1ckR7qJNQ3LywY9vlYGhGi3zXrGBHuUo2Cl1ztZaICW+1eAGdkLbj6iwVqDT33kg==} engines: {node: '>=20.0.0'} @@ -1749,19 +1650,6 @@ packages: oniguruma-to-es@4.3.6: resolution: {integrity: sha512-csuQ9x3Yr0cEIs/Zgx/OEt9iBw9vqIunAPQkx19R/fiMq2oGVTgcMqO/V3Ybqefr1TBvosI6jU539ksaBULJyA==} - oxfmt@0.60.0: - resolution: {integrity: sha512-fViX6i+gJuZWY+jI/fnR6WRbRj70GZ9RlCd30MygJrHTUNc4DxvKHWw8vBjMjffv3PgU5qWDR0AzmojQByqaZA==} - engines: {node: ^20.19.0 || >=22.12.0} - hasBin: true - peerDependencies: - svelte: ^5.0.0 - vite-plus: '*' - peerDependenciesMeta: - svelte: - optional: true - vite-plus: - optional: true - parse-entities@4.0.2: resolution: {integrity: sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==} @@ -1783,6 +1671,14 @@ packages: resolution: {integrity: sha512-Mz8SaolMd8nB+G13WkORcxQKHZ/NE4xXevtkJHVuG+guo9/wYKlIMTKAqGdEmYOXR2ijPjTYNHssizdaVSUNdQ==} engines: {node: ^10 || ^12 || >=14} + prettier-plugin-packagejson@3.0.2: + resolution: {integrity: sha512-kmoj3hEynXwoHDo8ZhmWAIjRBoQWCDUVackiWfSDWdgD0rS3LGB61T9zoVbume/cotYdCoadUh4sqViAmXvpBQ==} + peerDependencies: + prettier: ^3 + peerDependenciesMeta: + prettier: + optional: true + prettier@3.9.6: resolution: {integrity: sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==} engines: {node: '>=14'} @@ -2081,6 +1977,11 @@ packages: scroll-into-view-if-needed@3.1.0: resolution: {integrity: sha512-49oNpRjWRvnU8NyGVmUaYG4jtTkNonFZI86MmGRDqBphEK2EXT9gdEUoQPZhuBM8yWHxCWbobltqYO5M4XrUvQ==} + semver@7.8.5: + resolution: {integrity: sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==} + engines: {node: '>=10'} + hasBin: true + set-cookie-parser@2.7.2: resolution: {integrity: sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==} @@ -2088,6 +1989,14 @@ packages: resolution: {integrity: sha512-oR+qDVi2OjX1tmDpyv+3KviX01KzO6Af+0NNnKnsp9491UEGz2YpxTuJboS/6VhYpTdqzmuJBuiTlrAWWJAssw==} engines: {node: '>=20'} + sort-object-keys@2.1.0: + resolution: {integrity: sha512-SOiEnthkJKPv2L6ec6HMwhUcN0/lppkeYuN1x63PbyPRrgSPIuBJCiYxYyvWRTtjMlOi14vQUCGUJqS6PLVm8g==} + + sort-package-json@3.7.1: + resolution: {integrity: sha512-ssk1HG7whF8N/T1IsNAQrtHG5Cbdi0rAgRJZXYBr9hF5xaHnBNzUx/W6LcthEW7FhOwvZssbESZuO+GxssqAyA==} + engines: {node: '>=20'} + hasBin: true + source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} @@ -2132,9 +2041,9 @@ packages: resolution: {integrity: sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==} engines: {node: '>=18'} - tinypool@2.1.0: - resolution: {integrity: sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw==} - engines: {node: ^20.0.0 || >=22.0.0} + tinyglobby@0.2.17: + resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} + engines: {node: '>=12.0.0'} toggle-selection@1.0.6: resolution: {integrity: sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ==} @@ -2339,63 +2248,6 @@ snapshots: '@tybys/wasm-util': 0.10.3 optional: true - '@oxfmt/binding-android-arm-eabi@0.60.0': - optional: true - - '@oxfmt/binding-android-arm64@0.60.0': - optional: true - - '@oxfmt/binding-darwin-arm64@0.60.0': - optional: true - - '@oxfmt/binding-darwin-x64@0.60.0': - optional: true - - '@oxfmt/binding-freebsd-x64@0.60.0': - optional: true - - '@oxfmt/binding-linux-arm-gnueabihf@0.60.0': - optional: true - - '@oxfmt/binding-linux-arm-musleabihf@0.60.0': - optional: true - - '@oxfmt/binding-linux-arm64-gnu@0.60.0': - optional: true - - '@oxfmt/binding-linux-arm64-musl@0.60.0': - optional: true - - '@oxfmt/binding-linux-ppc64-gnu@0.60.0': - optional: true - - '@oxfmt/binding-linux-riscv64-gnu@0.60.0': - optional: true - - '@oxfmt/binding-linux-riscv64-musl@0.60.0': - optional: true - - '@oxfmt/binding-linux-s390x-gnu@0.60.0': - optional: true - - '@oxfmt/binding-linux-x64-gnu@0.60.0': - optional: true - - '@oxfmt/binding-linux-x64-musl@0.60.0': - optional: true - - '@oxfmt/binding-openharmony-arm64@0.60.0': - optional: true - - '@oxfmt/binding-win32-arm64-msvc@0.60.0': - optional: true - - '@oxfmt/binding-win32-ia32-msvc@0.60.0': - optional: true - - '@oxfmt/binding-win32-x64-msvc@0.60.0': - optional: true - '@parcel/watcher-android-arm64@2.5.6': optional: true @@ -3008,9 +2860,13 @@ snapshots: dequal@2.0.3: {} + detect-indent@7.0.2: {} + detect-libc@2.1.2: optional: true + detect-newline@4.0.1: {} + devlop@1.1.0: dependencies: dequal: 2.0.3 @@ -3076,10 +2932,16 @@ snapshots: extend@3.0.2: {} + fdir@6.5.0(picomatch@4.0.5): + optionalDependencies: + picomatch: 4.0.5 + flexsearch@0.8.212: {} get-east-asian-width@1.6.0: {} + git-hooks-list@4.2.1: {} + happy-dom@20.11.1: dependencies: '@types/node': 24.13.3 @@ -3778,30 +3640,6 @@ snapshots: regex: 6.1.0 regex-recursion: 6.0.2 - oxfmt@0.60.0: - dependencies: - tinypool: 2.1.0 - optionalDependencies: - '@oxfmt/binding-android-arm-eabi': 0.60.0 - '@oxfmt/binding-android-arm64': 0.60.0 - '@oxfmt/binding-darwin-arm64': 0.60.0 - '@oxfmt/binding-darwin-x64': 0.60.0 - '@oxfmt/binding-freebsd-x64': 0.60.0 - '@oxfmt/binding-linux-arm-gnueabihf': 0.60.0 - '@oxfmt/binding-linux-arm-musleabihf': 0.60.0 - '@oxfmt/binding-linux-arm64-gnu': 0.60.0 - '@oxfmt/binding-linux-arm64-musl': 0.60.0 - '@oxfmt/binding-linux-ppc64-gnu': 0.60.0 - '@oxfmt/binding-linux-riscv64-gnu': 0.60.0 - '@oxfmt/binding-linux-riscv64-musl': 0.60.0 - '@oxfmt/binding-linux-s390x-gnu': 0.60.0 - '@oxfmt/binding-linux-x64-gnu': 0.60.0 - '@oxfmt/binding-linux-x64-musl': 0.60.0 - '@oxfmt/binding-openharmony-arm64': 0.60.0 - '@oxfmt/binding-win32-arm64-msvc': 0.60.0 - '@oxfmt/binding-win32-ia32-msvc': 0.60.0 - '@oxfmt/binding-win32-x64-msvc': 0.60.0 - parse-entities@4.0.2: dependencies: '@types/unist': 2.0.11 @@ -3828,6 +3666,12 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 + prettier-plugin-packagejson@3.0.2(prettier@3.9.6): + dependencies: + sort-package-json: 3.7.1 + optionalDependencies: + prettier: 3.9.6 + prettier@3.9.6: {} pretty-format@27.5.1: @@ -4134,6 +3978,8 @@ snapshots: dependencies: compute-scroll-into-view: 3.1.1 + semver@7.8.5: {} + set-cookie-parser@2.7.2: {} shiki@4.3.1: @@ -4147,6 +3993,18 @@ snapshots: '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.4 + sort-object-keys@2.1.0: {} + + sort-package-json@3.7.1: + dependencies: + detect-indent: 7.0.2 + detect-newline: 4.0.1 + git-hooks-list: 4.2.1 + is-plain-obj: 4.1.0 + semver: 7.8.5 + sort-object-keys: 2.1.0 + tinyglobby: 0.2.17 + source-map-js@1.2.1: {} source-map@0.7.6: {} @@ -4184,7 +4042,10 @@ snapshots: tinyexec@1.2.4: {} - tinypool@2.1.0: {} + tinyglobby@0.2.17: + dependencies: + fdir: 6.5.0(picomatch@4.0.5) + picomatch: 4.0.5 toggle-selection@1.0.6: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index a017793..3f69109 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -36,8 +36,8 @@ catalog: 'happy-dom': '^20.11.1' 'heading-case': '^1.1.4' 'lint-staged': '^17.2.0' - 'oxfmt': '^0.60.0' prettier: '3.9.6' + 'prettier-plugin-packagejson': '^3.0.2' 'react': '^19.2.8' 'react-dom': '^19.2.8' 'rsbuild-plugin-open-graph': '^1.1.3' diff --git a/prettier.config.mjs b/prettier.config.mjs new file mode 100644 index 0000000..809ddb8 --- /dev/null +++ b/prettier.config.mjs @@ -0,0 +1,6 @@ +/** @type {import('prettier').Config} */ +export default { + plugins: ['prettier-plugin-packagejson'], + printWidth: 100, + singleQuote: true, +}; diff --git a/rstack.config.ts b/rstack.config.ts index 55e08ad..8a4bf2e 100644 --- a/rstack.config.ts +++ b/rstack.config.ts @@ -39,6 +39,10 @@ define.lint(async () => { }); define.staged({ - '*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}': ['rs lint --fix', 'oxfmt --no-error-on-unmatched-pattern'], - '*.{json,jsonc,md,mdx,css,html,yml,yaml}': 'oxfmt --no-error-on-unmatched-pattern', + '*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}': [ + 'rs lint --fix', + 'prettier --write --experimental-cli --no-error-on-unmatched-pattern', + ], + '*.{json,jsonc,md,mdx,css,html,yml,yaml}': + 'prettier --write --experimental-cli --no-error-on-unmatched-pattern', }); diff --git a/scripts/dictionary.txt b/scripts/dictionary.txt index b28f1a6..2e55352 100644 --- a/scripts/dictionary.txt +++ b/scripts/dictionary.txt @@ -5,7 +5,6 @@ fnames huskyrc llms nosystem -oxfmt rsbuild rslib rslint