diff --git a/package.json b/package.json index 27d2c5d4d..895a2de81 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "react": "18.2.0", "react-dom": "18.2.0", "require-from-string": "2.0.2", - "sort-package-json": "2.1.0", + "sort-package-json": "2.6.0", "storybook": "7.6.5", "ts-jest": "29.1.1", "tsconfig-paths-webpack-plugin": "4.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7e04f8c91..92ff95685 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -161,8 +161,8 @@ importers: specifier: 2.0.2 version: 2.0.2 sort-package-json: - specifier: 2.1.0 - version: 2.1.0 + specifier: 2.6.0 + version: 2.6.0 storybook: specifier: 7.6.5 version: 7.6.5 @@ -613,8 +613,8 @@ importers: specifier: 3.4.5 version: 3.4.5(@babel/core@7.23.5)(@babel/preset-env@7.23.5)(@babel/preset-typescript@7.23.3)(@swc/core@1.3.100)(@swc/helpers@0.5.3)(rollup@4.9.4)(typescript@5.3.3) sort-package-json: - specifier: 1.57.0 - version: 1.57.0 + specifier: 2.6.0 + version: 2.6.0 tslib: specifier: 2.6.2 version: 2.6.2 @@ -6502,13 +6502,6 @@ packages: resolution: {integrity: sha512-frsJrz2t/CeGifcu/6uRo4b+SzAwT4NYCVPu1GN8IB9XTzrpPkGuV0tmh9mN+/L0PklAlsC3u5Fxt0ju00LXIw==} dev: true - /@types/glob@7.2.0: - resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} - dependencies: - '@types/minimatch': 5.1.2 - '@types/node': 18.16.19 - dev: false - /@types/graceful-fs@4.1.9: resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} dependencies: @@ -6580,10 +6573,6 @@ packages: resolution: {integrity: sha512-iJt33IQnVRkqeqC7PzBHPTC6fDlRNRW8vjrgqtScAhrmMwe8c4Eo7+fUGTa+XdWrpEgpyKWMYmi2dIwMAYRzPw==} dev: true - /@types/minimatch@5.1.2: - resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} - dev: false - /@types/minimist@1.2.2: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} dev: true @@ -6610,10 +6599,6 @@ packages: resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} dev: false - /@types/node@18.16.19: - resolution: {integrity: sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA==} - dev: false - /@types/node@18.19.3: resolution: {integrity: sha512-k5fggr14DwAytoA/t8rPrIz++lXK7/DqckthCmoZOKNsEbJkId4Z//BqgApXBUGrGddrigYa1oqheo/7YmW4rg==} dependencies: @@ -8772,6 +8757,7 @@ packages: /detect-indent@6.1.0: resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} engines: {node: '>=8'} + dev: true /detect-indent@7.0.1: resolution: {integrity: sha512-Mc7QhQ8s+cLrnUfU/Ji94vG/r8M26m8f++vyres4ZoojaRDpZ1eSIh/EpzLNwlWuvzSZ3UbDFspjFvTDXe6e/g==} @@ -8786,11 +8772,11 @@ packages: /detect-newline@3.1.0: resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} engines: {node: '>=8'} + dev: true /detect-newline@4.0.0: resolution: {integrity: sha512-1aXUEPdfGdzVPFpzGJJNgq9o81bGg1s09uxTWsqBlo9PI332uyJRQq13+LK/UN4JfxJbFdCXonUFQ9R/p7yCtw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dev: true /detect-node-es@1.1.0: resolution: {integrity: sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==} @@ -10014,6 +10000,10 @@ packages: engines: {node: '>=8'} dev: true + /get-stdin@9.0.0: + resolution: {integrity: sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA==} + engines: {node: '>=12'} + /get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} @@ -10050,13 +10040,8 @@ packages: - supports-color dev: true - /git-hooks-list@1.0.3: - resolution: {integrity: sha512-Y7wLWcrLUXwk2noSka166byGCvhMtDRpgHdzCno1UQv/n/Hegp++a2xBWJL1lJarnKD3SWaljD+0z1ztqxuKyQ==} - dev: false - /git-hooks-list@3.0.0: resolution: {integrity: sha512-XDfdemBGJIMAsHHOONHQxEH5dX2kCpE6MGZ1IsNvBuDPBZM3p4EAwAC7ygMjn/1/x+BJX0TK1ara1Zrh7JCFdQ==} - dev: true /github-slugger@1.5.0: resolution: {integrity: sha512-wIh+gKBI9Nshz2o46B0B3f5k/W+WI9ZAv6y5Dn5WJ5SK1t0TnDimB4WE5rmTD05ZAIn8HALCZVmCsvj0w0v0lw==} @@ -10109,6 +10094,7 @@ packages: minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 + dev: true /glob@8.1.0: resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} @@ -10137,20 +10123,6 @@ packages: dependencies: define-properties: 1.2.1 - /globby@10.0.0: - resolution: {integrity: sha512-3LifW9M4joGZasyYPz2A1U74zbC/45fvpXUvO/9KbSa+VV0aGZarWkfdgKyR9sExNP0t0x0ss/UMJpNpcaTspw==} - engines: {node: '>=8'} - dependencies: - '@types/glob': 7.2.0 - array-union: 2.1.0 - dir-glob: 3.0.1 - fast-glob: 3.3.2 - glob: 7.2.3 - ignore: 5.3.0 - merge2: 1.4.1 - slash: 3.0.0 - dev: false - /globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} @@ -10162,17 +10134,6 @@ packages: merge2: 1.4.1 slash: 3.0.0 - /globby@13.1.2: - resolution: {integrity: sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - dir-glob: 3.0.1 - fast-glob: 3.3.2 - ignore: 5.3.0 - merge2: 1.4.1 - slash: 4.0.0 - dev: true - /globby@13.2.2: resolution: {integrity: sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -10182,7 +10143,6 @@ packages: ignore: 5.3.0 merge2: 1.4.1 slash: 4.0.0 - dev: false /gopd@1.0.1: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} @@ -10713,11 +10673,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /is-plain-obj@2.1.0: - resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} - engines: {node: '>=8'} - dev: false - /is-plain-obj@4.1.0: resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} engines: {node: '>=12'} @@ -13860,28 +13815,17 @@ packages: /sort-object-keys@1.1.3: resolution: {integrity: sha512-855pvK+VkU7PaKYPc+Jjnmt4EzejQHyhhF33q31qG8x7maDzkeFhAAThdCYay11CISO+qAMwjOBP+fPZe0IPyg==} - /sort-package-json@1.57.0: - resolution: {integrity: sha512-FYsjYn2dHTRb41wqnv+uEqCUvBpK3jZcTp9rbz2qDTmel7Pmdtf+i2rLaaPMRZeSVM60V3Se31GyWFpmKs4Q5Q==} + /sort-package-json@2.6.0: + resolution: {integrity: sha512-XSQ+lY9bAYA8ZsoChcEoPlgcSMaheziEp1beox1JVxy1SV4F2jSq9+h2rJ+3mC/Dhu9Ius1DLnInD5AWcsDXZw==} hasBin: true - dependencies: - detect-indent: 6.1.0 - detect-newline: 3.1.0 - git-hooks-list: 1.0.3 - globby: 10.0.0 - is-plain-obj: 2.1.0 - sort-object-keys: 1.1.3 - dev: false - - /sort-package-json@2.1.0: - resolution: {integrity: sha512-M5ctkdnn7znAkoVQJ0Y+PHDUieyXMhydPyW7r2J9ZM0Iwc3BTyEf5cmoSRfHNo07FEvzWwnphcP7GlrAX164UQ==} dependencies: detect-indent: 7.0.1 detect-newline: 4.0.0 + get-stdin: 9.0.0 git-hooks-list: 3.0.0 - globby: 13.1.2 + globby: 13.2.2 is-plain-obj: 4.1.0 sort-object-keys: 1.1.3 - dev: true /source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} diff --git a/tools/nx-plugins/npm-package/build/set-package-defaults.ts b/tools/nx-plugins/npm-package/build/set-package-defaults.ts index aee9a75a2..bf397cdeb 100644 --- a/tools/nx-plugins/npm-package/build/set-package-defaults.ts +++ b/tools/nx-plugins/npm-package/build/set-package-defaults.ts @@ -1,6 +1,6 @@ import path from 'node:path'; import type * as ReadPackage from 'read-pkg'; -import sortPkgJson from 'sort-package-json'; +import type * as SortPkgJson from 'sort-package-json'; import type { JsonObject } from 'type-fest'; import type * as WritePackage from 'write-pkg'; import type { BuildExecutorOptions } from './schema'; @@ -69,6 +69,10 @@ export const setPackageDefaults = async ( ); } + const { default: sortPkgJson } = (await esmModuleImport( + 'sort-package-json', + )) as typeof SortPkgJson; + const sortedPkg = sortPkgJson({ ...pkgDefaults, ...pkg, diff --git a/tools/nx-plugins/npm-package/package.json b/tools/nx-plugins/npm-package/package.json index 7f3997332..8174403b3 100644 --- a/tools/nx-plugins/npm-package/package.json +++ b/tools/nx-plugins/npm-package/package.json @@ -11,7 +11,7 @@ "read-pkg": "9.0.1", "rollup": "4.9.4", "rollup-plugin-ts": "3.4.5", - "sort-package-json": "1.57.0", + "sort-package-json": "2.6.0", "tslib": "2.6.2", "type-fest": "4.9.0", "typescript": "5.3.3",