From 8fea6f826036dfd66766a0a6d7649d534e9f75e9 Mon Sep 17 00:00:00 2001 From: Timeless0911 <1604889533@qq.com> Date: Thu, 6 Jun 2024 16:29:27 +0800 Subject: [PATCH] chore: add prettier-plugin-packagejson --- .prettierrc.json | 3 +- e2e/package.json | 6 +-- package.json | 1 + packages/core/package.json | 4 +- pnpm-lock.yaml | 88 ++++++++++++++++++++++++++++++++++++-- 5 files changed, 93 insertions(+), 9 deletions(-) diff --git a/.prettierrc.json b/.prettierrc.json index 544138be4..c1c5323b0 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,3 +1,4 @@ { - "singleQuote": true + "singleQuote": true, + "plugins": ["prettier-plugin-packagejson"] } diff --git a/e2e/package.json b/e2e/package.json index 11b95c1ea..4093e92d7 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -2,12 +2,12 @@ "name": "@rslib/e2e", "private": true, "type": "module", - "scripts": { - "test": "playwright test" - }, "imports": { "#helper": "./scripts/helper.ts" }, + "scripts": { + "test": "playwright test" + }, "devDependencies": { "@playwright/test": "1.43.1", "@rslib/core": "workspace:*", diff --git a/package.json b/package.json index 280104c6c..359caa99d 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "cross-env": "^7.0.3", "nano-staged": "^0.8.0", "prettier": "^3.2.4", + "prettier-plugin-packagejson": "^2.5.0", "simple-git-hooks": "^2.10.0", "vitest": "^1.5.0" }, diff --git a/packages/core/package.json b/packages/core/package.json index 88c34550d..27d769df9 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -37,11 +37,11 @@ }, "dependencies": { "@rsbuild/core": "0.6.2", - "@rsbuild/shared": "0.6.2", - "commander": "^12.0.0" + "@rsbuild/shared": "0.6.2" }, "devDependencies": { "@rslib/tsconfig": "workspace:*", + "commander": "^12.0.0", "typescript": "^5.4.5" }, "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a85b6ab08..301798b4c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,6 +26,9 @@ importers: prettier: specifier: ^3.2.4 version: 3.2.5 + prettier-plugin-packagejson: + specifier: ^2.5.0 + version: 2.5.0(prettier@3.2.5) simple-git-hooks: specifier: ^2.10.0 version: 2.10.0 @@ -68,13 +71,13 @@ importers: '@rsbuild/shared': specifier: 0.6.2 version: 0.6.2(@swc/helpers@0.5.3) - commander: - specifier: ^12.0.0 - version: 12.0.0 devDependencies: '@rslib/tsconfig': specifier: workspace:* version: link:../../scripts/tsconfig + commander: + specifier: ^12.0.0 + version: 12.0.0 typescript: specifier: ^5.4.5 version: 5.4.5 @@ -904,6 +907,10 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} + '@pkgr/core@0.1.1': + resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} + engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} + '@playwright/test@1.43.1': resolution: {integrity: sha512-HgtQzFgNEEo4TE22K/X7sYTYNqEMMTZmFS8kTq6m8hXj+m1D8TgwgIbumHddJa9h4yl4GkKb8/bgAl2+g7eDgA==} engines: {node: '>=16'} @@ -1399,6 +1406,14 @@ packages: resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} engines: {node: '>=8'} + detect-indent@7.0.1: + resolution: {integrity: sha512-Mc7QhQ8s+cLrnUfU/Ji94vG/r8M26m8f++vyres4ZoojaRDpZ1eSIh/EpzLNwlWuvzSZ3UbDFspjFvTDXe6e/g==} + engines: {node: '>=12.20'} + + detect-newline@4.0.1: + resolution: {integrity: sha512-qE3Veg1YXzGHQhlA6jzebZN2qVf6NX+A7m7qlhCGG30dJixrAQhYOsJjsnBjJkCSmuOPpCk30145fr8FV0bzog==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + diff-sequences@29.6.3: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -1600,6 +1615,10 @@ packages: resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} engines: {node: '>= 0.4'} + get-stdin@9.0.0: + resolution: {integrity: sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA==} + engines: {node: '>=12'} + get-stream@8.0.1: resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} engines: {node: '>=16'} @@ -1608,6 +1627,9 @@ packages: resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} engines: {node: '>= 0.4'} + git-hooks-list@3.1.0: + resolution: {integrity: sha512-LF8VeHeR7v+wAbXqfgRlTSX/1BJR9Q1vEMR8JAz1cEg6GX07+zyj3sAdDvYjj/xnlIfVuGgj4qBei1K3hKH+PA==} + glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -1792,6 +1814,10 @@ packages: resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} engines: {node: '>=0.10.0'} + is-plain-obj@4.1.0: + resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} + engines: {node: '>=12'} + is-plain-object@2.0.4: resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==} engines: {node: '>=0.10.0'} @@ -2214,6 +2240,14 @@ packages: resolution: {integrity: sha512-MkXsENfftWSRpzCzImcp4FRsCc3y1opwB73CfCNWyzMqArju2CrlMHlqB7VexKiPEOjGMbttv1r9fSCn5S610w==} engines: {node: '>=10'} + prettier-plugin-packagejson@2.5.0: + resolution: {integrity: sha512-6XkH3rpin5QEQodBSVNg+rBo4r91g/1mCaRwS1YGdQJZ6jwqrg2UchBsIG9tpS1yK1kNBvOt84OILsX8uHzBGg==} + peerDependencies: + prettier: '>= 1.16.0' + peerDependenciesMeta: + prettier: + optional: true + prettier@2.8.8: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} @@ -2405,6 +2439,13 @@ packages: engines: {node: '>=6'} hasBin: true + sort-object-keys@1.1.3: + resolution: {integrity: sha512-855pvK+VkU7PaKYPc+Jjnmt4EzejQHyhhF33q31qG8x7maDzkeFhAAThdCYay11CISO+qAMwjOBP+fPZe0IPyg==} + + sort-package-json@2.10.0: + resolution: {integrity: sha512-MYecfvObMwJjjJskhxYfuOADkXp1ZMMnCFC8yhp+9HDsk7HhR336hd7eiBs96lTXfiqmUNI+WQCeCMRBhl251g==} + hasBin: true + source-map-js@1.2.0: resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} engines: {node: '>=0.10.0'} @@ -2504,6 +2545,10 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} + synckit@0.9.0: + resolution: {integrity: sha512-7RnqIMq572L8PeEzKeBINYEJDDxpcH8JEgLwUqBd3TkofhFRbkq4QLR0u+36avGAhCRbk2nnmjcW9SE531hPDg==} + engines: {node: ^14.18.0 || >=16.0.0} + table@6.8.2: resolution: {integrity: sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA==} engines: {node: '>=10.0.0'} @@ -3593,6 +3638,8 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 + '@pkgr/core@0.1.1': {} + '@playwright/test@1.43.1': dependencies: playwright: 1.43.1 @@ -4087,6 +4134,10 @@ snapshots: detect-indent@6.1.0: {} + detect-indent@7.0.1: {} + + detect-newline@4.0.1: {} + diff-sequences@29.6.3: {} dir-glob@3.0.1: @@ -4406,6 +4457,8 @@ snapshots: has-symbols: 1.0.3 hasown: 2.0.2 + get-stdin@9.0.0: {} + get-stream@8.0.1: {} get-symbol-description@1.0.2: @@ -4414,6 +4467,8 @@ snapshots: es-errors: 1.3.0 get-intrinsic: 1.2.4 + git-hooks-list@3.1.0: {} + glob-parent@5.1.2: dependencies: is-glob: 4.0.3 @@ -4576,6 +4631,8 @@ snapshots: is-plain-obj@1.1.0: {} + is-plain-obj@4.1.0: {} + is-plain-object@2.0.4: dependencies: isobject: 3.0.1 @@ -4963,6 +5020,13 @@ snapshots: path-exists: 4.0.0 which-pm: 2.0.0 + prettier-plugin-packagejson@2.5.0(prettier@3.2.5): + dependencies: + sort-package-json: 2.10.0 + synckit: 0.9.0 + optionalDependencies: + prettier: 3.2.5 + prettier@2.8.8: {} prettier@3.2.5: {} @@ -5163,6 +5227,19 @@ snapshots: wcwidth: 1.0.1 yargs: 15.4.1 + sort-object-keys@1.1.3: {} + + sort-package-json@2.10.0: + dependencies: + detect-indent: 7.0.1 + detect-newline: 4.0.1 + get-stdin: 9.0.0 + git-hooks-list: 3.1.0 + globby: 13.2.2 + is-plain-obj: 4.1.0 + semver: 7.6.0 + sort-object-keys: 1.1.3 + source-map-js@1.2.0: {} source-map-support@0.5.21: @@ -5267,6 +5344,11 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} + synckit@0.9.0: + dependencies: + '@pkgr/core': 0.1.1 + tslib: 2.6.2 + table@6.8.2: dependencies: ajv: 8.12.0