feat(core): add support for pnpm v8 (#15925)

This commit is contained in:
Miroslav Jonaš 2023-04-06 16:41:35 +02:00 committed by GitHub
parent e58a05986d
commit 443d45d74d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 20776 additions and 231 deletions

View File

@ -1,23 +1,22 @@
export default `lockfileVersion: 5.4
importers:
specifiers:
'@nrwl/devkit': 15.0.13
eslint-plugin-disable-autofix: npm:@mattlewis92/eslint-plugin-disable-autofix@3.0.0
postgres: github.com/charsleysa/postgres/3b1a01b2da3e2fafb1a79006f838eff11a8de3cb
react: 18.2.0
typescript: 4.8.4
yargs: 17.6.2
.:
specifiers:
'@nrwl/devkit': 15.0.13
eslint-plugin-disable-autofix: npm:@mattlewis92/eslint-plugin-disable-autofix@3.0.0
postgres: github.com/charsleysa/postgres/3b1a01b2da3e2fafb1a79006f838eff11a8de3cb
react: 18.2.0
typescript: 4.8.4
yargs: 17.6.2
dependencies:
'@nrwl/devkit': 15.0.13_nx@15.3.0+typescript@4.8.4
eslint-plugin-disable-autofix: /@mattlewis92/eslint-plugin-disable-autofix/3.0.0
postgres: github.com/charsleysa/postgres/3b1a01b2da3e2fafb1a79006f838eff11a8de3cb
typescript: 4.8.4
yargs: 17.6.2
devDependencies:
react: 18.2.0
dependencies:
'@nrwl/devkit': 15.0.13_nx@15.3.0+typescript@4.8.4
eslint-plugin-disable-autofix: /@mattlewis92/eslint-plugin-disable-autofix/3.0.0
postgres: github.com/charsleysa/postgres/3b1a01b2da3e2fafb1a79006f838eff11a8de3cb
typescript: 4.8.4
yargs: 17.6.2
devDependencies:
react: 18.2.0
packages:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,981 @@
export default `lockfileVersion: '6.0'
dependencies:
'@nrwl/devkit':
specifier: 15.4.5
version: 15.4.5(nx@15.4.5)(typescript@4.8.4)
nx:
specifier: 15.4.5
version: 15.4.5
typescript:
specifier: 4.8.4
version: 4.8.4
yargs:
specifier: 17.6.2
version: 17.6.2
packages:
/@nodelib/fs.scandir@2.1.5:
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
engines: {node: '>= 8'}
dependencies:
'@nodelib/fs.stat': 2.0.5
run-parallel: 1.2.0
dev: false
/@nodelib/fs.stat@2.0.5:
resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==}
engines: {node: '>= 8'}
dev: false
/@nodelib/fs.walk@1.2.8:
resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==}
engines: {node: '>= 8'}
dependencies:
'@nodelib/fs.scandir': 2.1.5
fastq: 1.15.0
dev: false
/@nrwl/cli@15.4.5:
resolution: {integrity: sha512-f13s0/hzS9jsV1+QPr1Lp3Um+3dOHD8gEP2h7uw17rEPrtJ5ggRKMj/HcZ9dkT9zDM9EmPtVTb6k38ON+NWcUw==}
dependencies:
nx: 15.4.5
transitivePeerDependencies:
- '@swc-node/register'
- '@swc/core'
- debug
dev: false
/@nrwl/devkit@15.4.5(nx@15.4.5)(typescript@4.8.4):
resolution: {integrity: sha512-oag+wJgusKz+rwvgcVy9i8bNtTo7ikbjVVtSOmyVBE0ZrgN1CMFjugBj4FEjKGtd73djjpvW9Mm36uJRujrc2w==}
peerDependencies:
nx: '>= 14 <= 16'
dependencies:
'@phenomnomnominal/tsquery': 4.1.1(typescript@4.8.4)
ejs: 3.1.9
ignore: 5.2.4
nx: 15.4.5
semver: 7.3.4
tslib: 2.5.0
transitivePeerDependencies:
- typescript
dev: false
/@nrwl/tao@15.4.5:
resolution: {integrity: sha512-UMtxXxTWqbyZOdyD9Zt2IsDY/JVXIFZtY6pO4jPha7+UIHWf2Zi8Dszs6UoUTS4mqpNMIkKymwpZGtkDTfiAJA==}
hasBin: true
dependencies:
nx: 15.4.5
transitivePeerDependencies:
- '@swc-node/register'
- '@swc/core'
- debug
dev: false
/@parcel/watcher@2.0.4:
resolution: {integrity: sha512-cTDi+FUDBIUOBKEtj+nhiJ71AZVlkAsQFuGQTun5tV9mwQBQgZvhCzG+URPQc8myeN32yRVZEfVAPCs1RW+Jvg==}
engines: {node: '>= 10.0.0'}
requiresBuild: true
dependencies:
node-addon-api: 3.2.1
node-gyp-build: 4.6.0
dev: false
/@phenomnomnominal/tsquery@4.1.1(typescript@4.8.4):
resolution: {integrity: sha512-jjMmK1tnZbm1Jq5a7fBliM4gQwjxMU7TFoRNwIyzwlO+eHPRCFv/Nv+H/Gi1jc3WR7QURG8D5d0Tn12YGrUqBQ==}
peerDependencies:
typescript: ^3 || ^4
dependencies:
esquery: 1.5.0
typescript: 4.8.4
dev: false
/@yarnpkg/lockfile@1.1.0:
resolution: {integrity: sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==}
dev: false
/@yarnpkg/parsers@3.0.0-rc.42:
resolution: {integrity: sha512-eW9Mbegmb5bJjwawJM9ghjUjUqciNMhC6L7XrQPF/clXS5bbP66MstsgCT5hy9VlfUh/CfBT+0Wucf531dMjHA==}
engines: {node: '>=14.15.0'}
dependencies:
js-yaml: 3.14.1
tslib: 2.5.0
dev: false
/@zkochan/js-yaml@0.0.6:
resolution: {integrity: sha512-nzvgl3VfhcELQ8LyVrYOru+UtAy1nrygk2+AGbTm8a5YcO6o8lSjAT+pfg3vJWxIoZKOUhrK6UU7xW/+00kQrg==}
hasBin: true
dependencies:
argparse: 2.0.1
dev: false
/ansi-colors@4.1.3:
resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==}
engines: {node: '>=6'}
dev: false
/ansi-regex@5.0.1:
resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
engines: {node: '>=8'}
dev: false
/ansi-styles@4.3.0:
resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}
engines: {node: '>=8'}
dependencies:
color-convert: 2.0.1
dev: false
/anymatch@3.1.3:
resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==}
engines: {node: '>= 8'}
dependencies:
normalize-path: 3.0.0
picomatch: 2.3.1
dev: false
/argparse@1.0.10:
resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==}
dependencies:
sprintf-js: 1.0.3
dev: false
/argparse@2.0.1:
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
dev: false
/async@3.2.4:
resolution: {integrity: sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==}
dev: false
/asynckit@0.4.0:
resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
dev: false
/axios@1.3.4:
resolution: {integrity: sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ==}
dependencies:
follow-redirects: 1.15.2
form-data: 4.0.0
proxy-from-env: 1.1.0
transitivePeerDependencies:
- debug
dev: false
/balanced-match@1.0.2:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
dev: false
/base64-js@1.5.1:
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
dev: false
/binary-extensions@2.2.0:
resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==}
engines: {node: '>=8'}
dev: false
/bl@4.1.0:
resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==}
dependencies:
buffer: 5.7.1
inherits: 2.0.4
readable-stream: 3.6.2
dev: false
/brace-expansion@1.1.11:
resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==}
dependencies:
balanced-match: 1.0.2
concat-map: 0.0.1
dev: false
/brace-expansion@2.0.1:
resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==}
dependencies:
balanced-match: 1.0.2
dev: false
/braces@3.0.2:
resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==}
engines: {node: '>=8'}
dependencies:
fill-range: 7.0.1
dev: false
/buffer@5.7.1:
resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==}
dependencies:
base64-js: 1.5.1
ieee754: 1.2.1
dev: false
/chalk@4.1.0:
resolution: {integrity: sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==}
engines: {node: '>=10'}
dependencies:
ansi-styles: 4.3.0
supports-color: 7.2.0
dev: false
/chalk@4.1.2:
resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
engines: {node: '>=10'}
dependencies:
ansi-styles: 4.3.0
supports-color: 7.2.0
dev: false
/chokidar@3.5.3:
resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==}
engines: {node: '>= 8.10.0'}
dependencies:
anymatch: 3.1.3
braces: 3.0.2
glob-parent: 5.1.2
is-binary-path: 2.1.0
is-glob: 4.0.3
normalize-path: 3.0.0
readdirp: 3.6.0
optionalDependencies:
fsevents: 2.3.2
dev: false
/cli-cursor@3.1.0:
resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==}
engines: {node: '>=8'}
dependencies:
restore-cursor: 3.1.0
dev: false
/cli-spinners@2.6.1:
resolution: {integrity: sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==}
engines: {node: '>=6'}
dev: false
/cliui@7.0.4:
resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==}
dependencies:
string-width: 4.2.3
strip-ansi: 6.0.1
wrap-ansi: 7.0.0
dev: false
/cliui@8.0.1:
resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
engines: {node: '>=12'}
dependencies:
string-width: 4.2.3
strip-ansi: 6.0.1
wrap-ansi: 7.0.0
dev: false
/color-convert@2.0.1:
resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
engines: {node: '>=7.0.0'}
dependencies:
color-name: 1.1.4
dev: false
/color-name@1.1.4:
resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
dev: false
/combined-stream@1.0.8:
resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
engines: {node: '>= 0.8'}
dependencies:
delayed-stream: 1.0.0
dev: false
/concat-map@0.0.1:
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
dev: false
/define-lazy-prop@2.0.0:
resolution: {integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==}
engines: {node: '>=8'}
dev: false
/delayed-stream@1.0.0:
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
engines: {node: '>=0.4.0'}
dev: false
/dotenv@10.0.0:
resolution: {integrity: sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==}
engines: {node: '>=10'}
dev: false
/duplexer@0.1.2:
resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==}
dev: false
/ejs@3.1.9:
resolution: {integrity: sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==}
engines: {node: '>=0.10.0'}
hasBin: true
dependencies:
jake: 10.8.5
dev: false
/emoji-regex@8.0.0:
resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
dev: false
/end-of-stream@1.4.4:
resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==}
dependencies:
once: 1.4.0
dev: false
/enquirer@2.3.6:
resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==}
engines: {node: '>=8.6'}
dependencies:
ansi-colors: 4.1.3
dev: false
/escalade@3.1.1:
resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==}
engines: {node: '>=6'}
dev: false
/escape-string-regexp@1.0.5:
resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==}
engines: {node: '>=0.8.0'}
dev: false
/esprima@4.0.1:
resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==}
engines: {node: '>=4'}
hasBin: true
dev: false
/esquery@1.5.0:
resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==}
engines: {node: '>=0.10'}
dependencies:
estraverse: 5.3.0
dev: false
/estraverse@5.3.0:
resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==}
engines: {node: '>=4.0'}
dev: false
/fast-glob@3.2.7:
resolution: {integrity: sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==}
engines: {node: '>=8'}
dependencies:
'@nodelib/fs.stat': 2.0.5
'@nodelib/fs.walk': 1.2.8
glob-parent: 5.1.2
merge2: 1.4.1
micromatch: 4.0.5
dev: false
/fastq@1.15.0:
resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==}
dependencies:
reusify: 1.0.4
dev: false
/figures@3.2.0:
resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==}
engines: {node: '>=8'}
dependencies:
escape-string-regexp: 1.0.5
dev: false
/filelist@1.0.4:
resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==}
dependencies:
minimatch: 5.1.6
dev: false
/fill-range@7.0.1:
resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==}
engines: {node: '>=8'}
dependencies:
to-regex-range: 5.0.1
dev: false
/flat@5.0.2:
resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==}
hasBin: true
dev: false
/follow-redirects@1.15.2:
resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==}
engines: {node: '>=4.0'}
peerDependencies:
debug: '*'
peerDependenciesMeta:
debug:
optional: true
dev: false
/form-data@4.0.0:
resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==}
engines: {node: '>= 6'}
dependencies:
asynckit: 0.4.0
combined-stream: 1.0.8
mime-types: 2.1.35
dev: false
/fs-constants@1.0.0:
resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==}
dev: false
/fs-extra@10.1.0:
resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==}
engines: {node: '>=12'}
dependencies:
graceful-fs: 4.2.11
jsonfile: 6.1.0
universalify: 2.0.0
dev: false
/fs.realpath@1.0.0:
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
dev: false
/fsevents@2.3.2:
resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin]
requiresBuild: true
dev: false
optional: true
/get-caller-file@2.0.5:
resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
engines: {node: 6.* || 8.* || >= 10.*}
dev: false
/glob-parent@5.1.2:
resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}
engines: {node: '>= 6'}
dependencies:
is-glob: 4.0.3
dev: false
/glob@7.1.4:
resolution: {integrity: sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==}
dependencies:
fs.realpath: 1.0.0
inflight: 1.0.6
inherits: 2.0.4
minimatch: 3.0.5
once: 1.4.0
path-is-absolute: 1.0.1
dev: false
/graceful-fs@4.2.11:
resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
dev: false
/has-flag@4.0.0:
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
engines: {node: '>=8'}
dev: false
/ieee754@1.2.1:
resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}
dev: false
/ignore@5.2.4:
resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==}
engines: {node: '>= 4'}
dev: false
/inflight@1.0.6:
resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==}
dependencies:
once: 1.4.0
wrappy: 1.0.2
dev: false
/inherits@2.0.4:
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
dev: false
/is-binary-path@2.1.0:
resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==}
engines: {node: '>=8'}
dependencies:
binary-extensions: 2.2.0
dev: false
/is-docker@2.2.1:
resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==}
engines: {node: '>=8'}
hasBin: true
dev: false
/is-extglob@2.1.1:
resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
engines: {node: '>=0.10.0'}
dev: false
/is-fullwidth-code-point@3.0.0:
resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
engines: {node: '>=8'}
dev: false
/is-glob@4.0.3:
resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
engines: {node: '>=0.10.0'}
dependencies:
is-extglob: 2.1.1
dev: false
/is-number@7.0.0:
resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
engines: {node: '>=0.12.0'}
dev: false
/is-wsl@2.2.0:
resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==}
engines: {node: '>=8'}
dependencies:
is-docker: 2.2.1
dev: false
/jake@10.8.5:
resolution: {integrity: sha512-sVpxYeuAhWt0OTWITwT98oyV0GsXyMlXCF+3L1SuafBVUIr/uILGRB+NqwkzhgXKvoJpDIpQvqkUALgdmQsQxw==}
engines: {node: '>=10'}
hasBin: true
dependencies:
async: 3.2.4
chalk: 4.1.2
filelist: 1.0.4
minimatch: 3.1.2
dev: false
/js-yaml@3.14.1:
resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==}
hasBin: true
dependencies:
argparse: 1.0.10
esprima: 4.0.1
dev: false
/js-yaml@4.1.0:
resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==}
hasBin: true
dependencies:
argparse: 2.0.1
dev: false
/json5@2.2.3:
resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==}
engines: {node: '>=6'}
hasBin: true
dev: false
/jsonc-parser@3.2.0:
resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==}
dev: false
/jsonfile@6.1.0:
resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==}
dependencies:
universalify: 2.0.0
optionalDependencies:
graceful-fs: 4.2.11
dev: false
/lru-cache@6.0.0:
resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}
engines: {node: '>=10'}
dependencies:
yallist: 4.0.0
dev: false
/merge2@1.4.1:
resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
engines: {node: '>= 8'}
dev: false
/micromatch@4.0.5:
resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==}
engines: {node: '>=8.6'}
dependencies:
braces: 3.0.2
picomatch: 2.3.1
dev: false
/mime-db@1.52.0:
resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
engines: {node: '>= 0.6'}
dev: false
/mime-types@2.1.35:
resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
engines: {node: '>= 0.6'}
dependencies:
mime-db: 1.52.0
dev: false
/mimic-fn@2.1.0:
resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==}
engines: {node: '>=6'}
dev: false
/minimatch@3.0.5:
resolution: {integrity: sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==}
dependencies:
brace-expansion: 1.1.11
dev: false
/minimatch@3.1.2:
resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
dependencies:
brace-expansion: 1.1.11
dev: false
/minimatch@5.1.6:
resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==}
engines: {node: '>=10'}
dependencies:
brace-expansion: 2.0.1
dev: false
/minimist@1.2.8:
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
dev: false
/node-addon-api@3.2.1:
resolution: {integrity: sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==}
dev: false
/node-gyp-build@4.6.0:
resolution: {integrity: sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==}
hasBin: true
dev: false
/normalize-path@3.0.0:
resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}
engines: {node: '>=0.10.0'}
dev: false
/npm-run-path@4.0.1:
resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==}
engines: {node: '>=8'}
dependencies:
path-key: 3.1.1
dev: false
/nx@15.4.5:
resolution: {integrity: sha512-1spZL6sgOV8JJJuN8W5CLtJYwTOnlyaV32jPXfidavU0QMS8MP+rW3+NUQ9Uzc1UYhOu8llZWtnen93neVGQRw==}
hasBin: true
requiresBuild: true
peerDependencies:
'@swc-node/register': ^1.4.2
'@swc/core': ^1.2.173
peerDependenciesMeta:
'@swc-node/register':
optional: true
'@swc/core':
optional: true
dependencies:
'@nrwl/cli': 15.4.5
'@nrwl/tao': 15.4.5
'@parcel/watcher': 2.0.4
'@yarnpkg/lockfile': 1.1.0
'@yarnpkg/parsers': 3.0.0-rc.42
'@zkochan/js-yaml': 0.0.6
axios: 1.3.4
chalk: 4.1.0
chokidar: 3.5.3
cli-cursor: 3.1.0
cli-spinners: 2.6.1
cliui: 7.0.4
dotenv: 10.0.0
enquirer: 2.3.6
fast-glob: 3.2.7
figures: 3.2.0
flat: 5.0.2
fs-extra: 10.1.0
glob: 7.1.4
ignore: 5.2.4
js-yaml: 4.1.0
jsonc-parser: 3.2.0
minimatch: 3.0.5
npm-run-path: 4.0.1
open: 8.4.2
semver: 7.3.4
string-width: 4.2.3
strong-log-transformer: 2.1.0
tar-stream: 2.2.0
tmp: 0.2.1
tsconfig-paths: 4.2.0
tslib: 2.5.0
v8-compile-cache: 2.3.0
yargs: 17.6.2
yargs-parser: 21.1.1
transitivePeerDependencies:
- debug
dev: false
/once@1.4.0:
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
dependencies:
wrappy: 1.0.2
dev: false
/onetime@5.1.2:
resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==}
engines: {node: '>=6'}
dependencies:
mimic-fn: 2.1.0
dev: false
/open@8.4.2:
resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==}
engines: {node: '>=12'}
dependencies:
define-lazy-prop: 2.0.0
is-docker: 2.2.1
is-wsl: 2.2.0
dev: false
/path-is-absolute@1.0.1:
resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}
engines: {node: '>=0.10.0'}
dev: false
/path-key@3.1.1:
resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
engines: {node: '>=8'}
dev: false
/picomatch@2.3.1:
resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
engines: {node: '>=8.6'}
dev: false
/proxy-from-env@1.1.0:
resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
dev: false
/queue-microtask@1.2.3:
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
dev: false
/readable-stream@3.6.2:
resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==}
engines: {node: '>= 6'}
dependencies:
inherits: 2.0.4
string_decoder: 1.3.0
util-deprecate: 1.0.2
dev: false
/readdirp@3.6.0:
resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}
engines: {node: '>=8.10.0'}
dependencies:
picomatch: 2.3.1
dev: false
/require-directory@2.1.1:
resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
engines: {node: '>=0.10.0'}
dev: false
/restore-cursor@3.1.0:
resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==}
engines: {node: '>=8'}
dependencies:
onetime: 5.1.2
signal-exit: 3.0.7
dev: false
/reusify@1.0.4:
resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==}
engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
dev: false
/rimraf@3.0.2:
resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==}
hasBin: true
dependencies:
glob: 7.1.4
dev: false
/run-parallel@1.2.0:
resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
dependencies:
queue-microtask: 1.2.3
dev: false
/safe-buffer@5.2.1:
resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
dev: false
/semver@7.3.4:
resolution: {integrity: sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==}
engines: {node: '>=10'}
hasBin: true
dependencies:
lru-cache: 6.0.0
dev: false
/signal-exit@3.0.7:
resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
dev: false
/sprintf-js@1.0.3:
resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==}
dev: false
/string-width@4.2.3:
resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}
engines: {node: '>=8'}
dependencies:
emoji-regex: 8.0.0
is-fullwidth-code-point: 3.0.0
strip-ansi: 6.0.1
dev: false
/string_decoder@1.3.0:
resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==}
dependencies:
safe-buffer: 5.2.1
dev: false
/strip-ansi@6.0.1:
resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
engines: {node: '>=8'}
dependencies:
ansi-regex: 5.0.1
dev: false
/strip-bom@3.0.0:
resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==}
engines: {node: '>=4'}
dev: false
/strong-log-transformer@2.1.0:
resolution: {integrity: sha512-B3Hgul+z0L9a236FAUC9iZsL+nVHgoCJnqCbN588DjYxvGXaXaaFbfmQ/JhvKjZwsOukuR72XbHv71Qkug0HxA==}
engines: {node: '>=4'}
hasBin: true
dependencies:
duplexer: 0.1.2
minimist: 1.2.8
through: 2.3.8
dev: false
/supports-color@7.2.0:
resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
engines: {node: '>=8'}
dependencies:
has-flag: 4.0.0
dev: false
/tar-stream@2.2.0:
resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==}
engines: {node: '>=6'}
dependencies:
bl: 4.1.0
end-of-stream: 1.4.4
fs-constants: 1.0.0
inherits: 2.0.4
readable-stream: 3.6.2
dev: false
/through@2.3.8:
resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==}
dev: false
/tmp@0.2.1:
resolution: {integrity: sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==}
engines: {node: '>=8.17.0'}
dependencies:
rimraf: 3.0.2
dev: false
/to-regex-range@5.0.1:
resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
engines: {node: '>=8.0'}
dependencies:
is-number: 7.0.0
dev: false
/tsconfig-paths@4.2.0:
resolution: {integrity: sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==}
engines: {node: '>=6'}
dependencies:
json5: 2.2.3
minimist: 1.2.8
strip-bom: 3.0.0
dev: false
/tslib@2.5.0:
resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==}
dev: false
/typescript@4.8.4:
resolution: {integrity: sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==}
engines: {node: '>=4.2.0'}
hasBin: true
dev: false
/universalify@2.0.0:
resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==}
engines: {node: '>= 10.0.0'}
dev: false
/util-deprecate@1.0.2:
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
dev: false
/v8-compile-cache@2.3.0:
resolution: {integrity: sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==}
dev: false
/wrap-ansi@7.0.0:
resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
engines: {node: '>=10'}
dependencies:
ansi-styles: 4.3.0
string-width: 4.2.3
strip-ansi: 6.0.1
dev: false
/wrappy@1.0.2:
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
dev: false
/y18n@5.0.8:
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
engines: {node: '>=10'}
dev: false
/yallist@4.0.0:
resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==}
dev: false
/yargs-parser@21.1.1:
resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
engines: {node: '>=12'}
dev: false
/yargs@17.6.2:
resolution: {integrity: sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==}
engines: {node: '>=12'}
dependencies:
cliui: 8.0.1
escalade: 3.1.1
get-caller-file: 2.0.5
require-directory: 2.1.1
string-width: 4.2.3
y18n: 5.0.8
yargs-parser: 21.1.1
dev: false
`;

View File

@ -1,18 +1,16 @@
export default `lockfileVersion: 5.4
importers:
specifiers:
'@nrwl/devkit': 15.4.5
nx: 15.4.5
typescript: 4.8.4
yargs: 17.6.2
.:
specifiers:
'@nrwl/devkit': 15.4.5
nx: 15.4.5
typescript: 4.8.4
yargs: 17.6.2
dependencies:
'@nrwl/devkit': 15.4.5_nx@15.4.5+typescript@4.8.4
nx: 15.4.5
typescript: 4.8.4
yargs: 17.6.2
dependencies:
'@nrwl/devkit': 15.4.5_nx@15.4.5+typescript@4.8.4
nx: 15.4.5
typescript: 4.8.4
yargs: 17.6.2
packages:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,15 @@
export default `lockfileVersion: '6.0'
dependencies:
typescript:
specifier: 4.8.4
version: 4.8.4
packages:
/typescript@4.8.4:
resolution: {integrity: sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==}
engines: {node: '>=4.2.0'}
hasBin: true
dev: false
`;

View File

@ -1,12 +1,10 @@
export default `lockfileVersion: 5.4
importers:
specifiers:
typescript: 4.8.4
.:
specifiers:
typescript: 4.8.4
dependencies:
typescript: 4.8.4
dependencies:
typescript: 4.8.4
packages:

View File

@ -179,6 +179,11 @@ export function createLockFile(
'If you run `npm install --package-lock-only` in your output folder it will regenerate the correct pruned lockfile.'
);
}
if (packageManager === 'pnpm') {
additionalInfo.push(
'If you run `pnpm install --lockfile-only` in your output folder it will regenerate the correct pruned lockfile.'
);
}
output.error({
title: 'An error occured while creating pruned lockfile',
bodyLines: errorBodyLines(e, additionalInfo),

View File

@ -27,7 +27,7 @@ describe('NPM lock file utility', () => {
});
it('should parse root lock file', async () => {
expect(Object.keys(graph.externalNodes).length).toEqual(1285); // 1143
expect(Object.keys(graph.externalNodes).length).toEqual(1285);
});
it('should prune lock file', async () => {
@ -151,7 +151,7 @@ describe('NPM lock file utility', () => {
const builder = new ProjectGraphBuilder();
parseNpmLockfile(JSON.stringify(rootV2LockFile), builder);
const graph = builder.getUpdatedProjectGraph();
expect(Object.keys(graph.externalNodes).length).toEqual(212); // 202
expect(Object.keys(graph.externalNodes).length).toEqual(212);
expect(graph.externalNodes['npm:minimatch']).toMatchInlineSnapshot(`
Object {
@ -336,7 +336,7 @@ describe('NPM lock file utility', () => {
const builder = new ProjectGraphBuilder();
parseNpmLockfile(JSON.stringify(rootLockFile), builder);
const graph = builder.getUpdatedProjectGraph();
expect(Object.keys(graph.externalNodes).length).toEqual(369); // 338
expect(Object.keys(graph.externalNodes).length).toEqual(369);
});
it('should parse v3', async () => {
const rootLockFile = require(joinPathFragments(
@ -347,7 +347,7 @@ describe('NPM lock file utility', () => {
const builder = new ProjectGraphBuilder();
parseNpmLockfile(JSON.stringify(rootLockFile), builder);
const graph = builder.getUpdatedProjectGraph();
expect(Object.keys(graph.externalNodes).length).toEqual(369); //338
expect(Object.keys(graph.externalNodes).length).toEqual(369);
});
});

View File

@ -112,47 +112,85 @@ describe('pnpm LockFile utility', () => {
let graph: ProjectGraph;
let lockFile: string;
beforeEach(() => {
lockFile = require(joinPathFragments(
__dirname,
'__fixtures__/nextjs/pnpm-lock.yaml'
)).default;
const builder = new ProjectGraphBuilder();
parsePnpmLockfile(lockFile, builder);
graph = builder.getUpdatedProjectGraph();
describe('v5.4', () => {
beforeEach(() => {
lockFile = require(joinPathFragments(
__dirname,
'__fixtures__/nextjs/pnpm-lock.yaml'
)).default;
const builder = new ProjectGraphBuilder();
parsePnpmLockfile(lockFile, builder);
graph = builder.getUpdatedProjectGraph();
});
it('should parse root lock file', async () => {
expect(Object.keys(graph.externalNodes).length).toEqual(1280);
});
it('should prune lock file', async () => {
const appPackageJson = require(joinPathFragments(
__dirname,
'__fixtures__/nextjs/app/package.json'
));
// this is our pruned lock file structure
const prunedGraph = pruneProjectGraph(graph, appPackageJson);
// our pruning keep all transitive peer deps, mainly cypress and eslint
// which adds 119 more deps
// but it's still possible to run `pnpm install --frozen-lockfile` on it (there are e2e tests for that)
expect(Object.keys(prunedGraph.externalNodes).length).toEqual(
863 + 119
);
// this should not fail
expect(() =>
stringifyPnpmLockfile(prunedGraph, lockFile, appPackageJson)
).not.toThrow();
});
});
it('should parse root lock file', async () => {
expect(Object.keys(graph.externalNodes).length).toEqual(1280); ///1143
});
describe('v6.0', () => {
beforeEach(() => {
lockFile = require(joinPathFragments(
__dirname,
'__fixtures__/nextjs/pnpm-lock-v6.yaml'
)).default;
const builder = new ProjectGraphBuilder();
parsePnpmLockfile(lockFile, builder);
graph = builder.getUpdatedProjectGraph();
});
it('should prune lock file', async () => {
const appPackageJson = require(joinPathFragments(
__dirname,
'__fixtures__/nextjs/app/package.json'
));
// this is original generated lock file
// const appLockFile = require(joinPathFragments(
// __dirname,
// '__fixtures__/nextjs/app/pnpm-lock.yaml'
// )).default;
it('should parse root lock file', async () => {
expect(Object.keys(graph.externalNodes).length).toEqual(1296);
});
// const appGraph = parsePnpmLockfile(appLockFile);
// expect(Object.keys(appGraph.externalNodes).length).toEqual(863);
it('should prune lock file', async () => {
const appPackageJson = require(joinPathFragments(
__dirname,
'__fixtures__/nextjs/app/package.json'
));
// this is original generated lock file
const appLockFile = require(joinPathFragments(
__dirname,
'__fixtures__/nextjs/app/pnpm-lock-v6.yaml'
)).default;
// this is our pruned lock file structure
const prunedGraph = pruneProjectGraph(graph, appPackageJson);
// meeroslav: our pruning keep all transitive peer deps, mainly cypress and eslint
// which adds 119 more deps
// but it's still possible to run `pnpm install --frozen-lockfile` on it (there are e2e tests for that)
expect(Object.keys(prunedGraph.externalNodes).length).toEqual(863 + 119);
const builder = new ProjectGraphBuilder();
parsePnpmLockfile(appLockFile, builder);
const appGraph = builder.getUpdatedProjectGraph();
expect(Object.keys(appGraph.externalNodes).length).toEqual(864);
// this should not fail
const result = stringifyPnpmLockfile(
prunedGraph,
lockFile,
appPackageJson
);
// this is our pruned lock file structure
const prunedGraph = pruneProjectGraph(graph, appPackageJson);
expect(Object.keys(prunedGraph.externalNodes).length).toEqual(
864 + 117 // peer cypress adds additional 117 deps
);
// this should not fail
expect(() =>
stringifyPnpmLockfile(prunedGraph, lockFile, appPackageJson)
).not.toThrow();
});
});
});
@ -189,7 +227,7 @@ describe('pnpm LockFile utility', () => {
const builder = new ProjectGraphBuilder();
parsePnpmLockfile(lockFile, builder);
const graph = builder.getUpdatedProjectGraph();
expect(Object.keys(graph.externalNodes).length).toEqual(213); //202
expect(Object.keys(graph.externalNodes).length).toEqual(213);
expect(graph.externalNodes['npm:minimatch']).toMatchInlineSnapshot(`
Object {
@ -310,7 +348,7 @@ describe('pnpm LockFile utility', () => {
const builder = new ProjectGraphBuilder();
parsePnpmLockfile(lockFile, builder);
const graph = builder.getUpdatedProjectGraph();
expect(Object.keys(graph.externalNodes).length).toEqual(370); //337
expect(Object.keys(graph.externalNodes).length).toEqual(370);
expect(Object.keys(graph.dependencies).length).toEqual(213);
expect(graph.dependencies['npm:@nrwl/devkit'].length).toEqual(6);
});
@ -364,53 +402,108 @@ describe('pnpm LockFile utility', () => {
)).default,
};
vol.fromJSON(fileSys, '/root');
lockFile = require(joinPathFragments(
__dirname,
'__fixtures__/pruning/pnpm-lock.yaml'
)).default;
const builder = new ProjectGraphBuilder();
parsePnpmLockfile(lockFile, builder);
graph = builder.getUpdatedProjectGraph();
});
it('should prune single package', () => {
const typescriptPackageJson = require(joinPathFragments(
__dirname,
'__fixtures__/pruning/typescript/package.json'
));
const prunedGraph = pruneProjectGraph(graph, typescriptPackageJson);
const result = stringifyPnpmLockfile(
prunedGraph,
lockFile,
typescriptPackageJson
);
expect(result).toEqual(
require(joinPathFragments(
describe('v5.4', () => {
beforeEach(() => {
lockFile = require(joinPathFragments(
__dirname,
'__fixtures__/pruning/typescript/pnpm-lock.yaml'
)).default
);
'__fixtures__/pruning/pnpm-lock.yaml'
)).default;
const builder = new ProjectGraphBuilder();
parsePnpmLockfile(lockFile, builder);
graph = builder.getUpdatedProjectGraph();
});
it('should prune single package', () => {
const typescriptPackageJson = require(joinPathFragments(
__dirname,
'__fixtures__/pruning/typescript/package.json'
));
const prunedGraph = pruneProjectGraph(graph, typescriptPackageJson);
const result = stringifyPnpmLockfile(
prunedGraph,
lockFile,
typescriptPackageJson
);
expect(result).toEqual(
require(joinPathFragments(
__dirname,
'__fixtures__/pruning/typescript/pnpm-lock.yaml'
)).default
);
});
it('should prune multi packages', () => {
const multiPackageJson = require(joinPathFragments(
__dirname,
'__fixtures__/pruning/devkit-yargs/package.json'
));
const prunedGraph = pruneProjectGraph(graph, multiPackageJson);
const result = stringifyPnpmLockfile(
prunedGraph,
lockFile,
multiPackageJson
);
expect(result).toEqual(
require(joinPathFragments(
__dirname,
'__fixtures__/pruning/devkit-yargs/pnpm-lock.yaml'
)).default
);
});
});
it('should prune multi packages', () => {
const multiPackageJson = require(joinPathFragments(
__dirname,
'__fixtures__/pruning/devkit-yargs/package.json'
));
const prunedGraph = pruneProjectGraph(graph, multiPackageJson);
const result = stringifyPnpmLockfile(
prunedGraph,
lockFile,
multiPackageJson
);
expect(result).toEqual(
require(joinPathFragments(
describe('v6.0', () => {
beforeEach(() => {
lockFile = require(joinPathFragments(
__dirname,
'__fixtures__/pruning/devkit-yargs/pnpm-lock.yaml'
)).default
);
'__fixtures__/pruning/pnpm-lock-v6.yaml'
)).default;
const builder = new ProjectGraphBuilder();
parsePnpmLockfile(lockFile, builder);
graph = builder.getUpdatedProjectGraph();
});
it('should prune single package', () => {
const typescriptPackageJson = require(joinPathFragments(
__dirname,
'__fixtures__/pruning/typescript/package.json'
));
const prunedGraph = pruneProjectGraph(graph, typescriptPackageJson);
const result = stringifyPnpmLockfile(
prunedGraph,
lockFile,
typescriptPackageJson
);
expect(result).toEqual(
require(joinPathFragments(
__dirname,
'__fixtures__/pruning/typescript/pnpm-lock-v6.yaml'
)).default
);
});
it('should prune multi packages', () => {
const multiPackageJson = require(joinPathFragments(
__dirname,
'__fixtures__/pruning/devkit-yargs/package.json'
));
const prunedGraph = pruneProjectGraph(graph, multiPackageJson);
const result = stringifyPnpmLockfile(
prunedGraph,
lockFile,
multiPackageJson
);
expect(result).toEqual(
require(joinPathFragments(
__dirname,
'__fixtures__/pruning/devkit-yargs/pnpm-lock-v6.yaml'
)).default
);
});
});
});

View File

@ -5,6 +5,7 @@ import type {
PackageSnapshots,
} from '@pnpm/lockfile-types';
import {
isV6Lockfile,
loadPnpmHoistedDepsDefinition,
parseAndNormalizePnpmLockfile,
stringifyToPnpmYaml,
@ -40,7 +41,10 @@ function addNodes(
Object.entries(data.packages).forEach(([key, snapshot]) => {
const packageName = findPackageName(key, snapshot, data);
const version = findVersion(key, packageName).split('_')[0];
const rawVersion = findVersion(key, packageName);
const version = isV6Lockfile(data)
? rawVersion.split('(')[0]
: rawVersion.split('_')[0];
// we don't need to keep duplicates, we can just track the keys
const existingNode = nodes.get(packageName)?.get(version);
@ -103,7 +107,7 @@ function getHoistedVersion(
k.startsWith(`/${packageName}/`)
);
if (key) {
version = key.slice(key.lastIndexOf('/') + 1).split('_')[0];
version = getVersion(key, packageName).split('_')[0];
} else {
// pnpm might not hoist every package
// similarly those packages will not be available to be used via import
@ -145,11 +149,12 @@ export function stringifyPnpmLockfile(
packageJson: NormalizedPackageJson
): string {
const data = parseAndNormalizePnpmLockfile(rootLockFileContent);
const { lockfileVersion, packages } = data;
const output: Lockfile = {
lockfileVersion: data.lockfileVersion,
lockfileVersion,
importers: {
'.': mapRootSnapshot(packageJson, data.packages, graph.externalNodes),
'.': mapRootSnapshot(packageJson, packages, graph.externalNodes),
},
packages: sortObjectByKeys(
mapSnapshots(data.packages, graph.externalNodes)
@ -188,27 +193,35 @@ function findOriginalKeys(
const snapshot = packages[key];
// standard package
if (key.startsWith(`/${packageName}/${version}`)) {
matchedKeys.push([returnFullKey ? key : key.split('/').pop(), snapshot]);
matchedKeys.push([
returnFullKey ? key : getVersion(key, packageName),
snapshot,
]);
}
// tarball package
if (key === version) {
matchedKeys.push([version, snapshot]);
}
// alias package
if (
version.startsWith('npm:') &&
key.startsWith(
`/${version.slice(4, version.lastIndexOf('@'))}/${version.slice(
version.lastIndexOf('@') + 1
)}`
)
) {
if (versionIsAlias(key, version)) {
matchedKeys.push([key, snapshot]);
}
}
return matchedKeys;
}
// check if version has a form of npm:packageName@version and
// key starts with /packageName/version
function versionIsAlias(key: string, versionExpr: string): boolean {
const PREFIX = 'npm:';
if (!versionExpr.startsWith(PREFIX)) return false;
const indexOfVersionSeparator = versionExpr.indexOf('@', PREFIX.length + 1);
const packageName = versionExpr.slice(PREFIX.length, indexOfVersionSeparator);
const version = versionExpr.slice(indexOfVersionSeparator + 1);
return key.startsWith(`/${packageName}/${version}`);
}
function mapRootSnapshot(
packageJson: NormalizedPackageJson,
packages: PackageSnapshots,
@ -244,21 +257,22 @@ function mapRootSnapshot(
function findVersion(key: string, packageName: string): string {
if (key.startsWith(`/${packageName}/`)) {
return key.slice(key.lastIndexOf('/') + 1);
return getVersion(key, packageName);
}
// for alias packages prepend with "npm:"
if (key.startsWith('/')) {
const aliasName = key.slice(1, key.lastIndexOf('/'));
const version = key.slice(key.lastIndexOf('/') + 1);
const version = getVersion(key, aliasName);
return `npm:${aliasName}@${version}`;
}
// for tarball package the entire key is the version spec
return key;
}
function findPackageName(
key: string,
value: PackageSnapshot,
snapshot: PackageSnapshot,
data: Lockfile
): string {
const matchPropValue = (record: Record<string, string>): string => {
@ -272,18 +286,18 @@ function findPackageName(
};
const matchedDependencyName = (
snapshot: Partial<PackageSnapshot>
importer: Partial<PackageSnapshot>
): string => {
return (
matchPropValue(snapshot.dependencies) ||
matchPropValue(snapshot.optionalDependencies) ||
matchPropValue(snapshot.peerDependencies)
matchPropValue(importer.dependencies) ||
matchPropValue(importer.optionalDependencies) ||
matchPropValue(importer.peerDependencies)
);
};
// snapshot already has a name
if (value.name) {
return value.name;
if (snapshot.name) {
return snapshot.name;
}
// it'a a root dependency
const rootDependencyName =
@ -296,12 +310,31 @@ function findPackageName(
// find a snapshot that has a dependency that points to this snapshot
const snapshots = Object.values(data.packages);
for (let i = 0; i < snapshots.length; i++) {
const snapshot = snapshots[i];
const dependencyName = matchedDependencyName(snapshot);
const dependencyName = matchedDependencyName(snapshots[i]);
if (dependencyName) {
return dependencyName;
}
}
// otherwise, it's a standard package
return key.startsWith('/') ? key.slice(1, key.lastIndexOf('/')) : key;
return extractNameFromKey(key);
}
function getVersion(key: string, packageName: string): string {
const KEY_NAME_SEPARATOR_LENGTH = 2; // leading and trailing slash
return key.slice(packageName.length + KEY_NAME_SEPARATOR_LENGTH);
}
function extractNameFromKey(key: string): string {
// if package name contains org e.g. "/@babel/runtime/7.12.5"
// we want slice until the third slash
if (key.startsWith('/@')) {
// find the position of the '/' after org name
const startFrom = key.indexOf('/', 1);
return key.slice(1, key.indexOf('/', startFrom + 1));
}
if (key.startsWith('/')) {
// if package has just a name e.g. "/react/7.12.5..."
return key.slice(1, key.indexOf('/', 1));
}
return key;
}

View File

@ -6,29 +6,16 @@
import type {
Lockfile,
ProjectSnapshot,
ProjectSnapshotV6,
ResolvedDependencies,
} from '@pnpm/lockfile-types';
import { dump, load } from '@zkochan/js-yaml';
import { existsSync, readFileSync } from 'fs';
import { workspaceRoot } from '../../../../utils/workspace-root';
import { valid } from 'semver';
const LOCKFILE_YAML_FORMAT = {
blankLines: true,
lineWidth: 1000,
noCompatMode: true,
noRefs: true,
sortKeys: false,
};
export function stringifyToPnpmYaml(lockfile: Lockfile): string {
return dump(lockfile, LOCKFILE_YAML_FORMAT);
}
export function parseAndNormalizePnpmLockfile(content: string): Lockfile {
const lockFileData = load(content);
return revertFromInlineSpecifiersFormatIfNecessary(
convertFromLockfileFileMutable(lockFileData)
);
export function isV6Lockfile(data: InlineSpecifiersLockfile | Lockfile) {
return data.lockfileVersion.toString().startsWith('6.');
}
export function loadPnpmHoistedDepsDefinition() {
@ -42,44 +29,32 @@ export function loadPnpmHoistedDepsDefinition() {
}
}
/**
* THE FOLLOWING CODE IS COPIED FROM @pnpm/lockfile-file for convenience
*/
/*************************************************************************
* THE FOLLOWING CODE IS COPIED & simplified FROM @pnpm/lockfile-file for convenience
*************************************************************************/
function isMutableLockfile(
lockfileFile:
| (Omit<Lockfile, 'importers'> &
Partial<ProjectSnapshot> &
Partial<Pick<Lockfile, 'importers'>>)
| InlineSpecifiersLockfile
| Lockfile
): lockfileFile is Omit<Lockfile, 'importers'> &
Partial<ProjectSnapshot> &
Partial<Pick<Lockfile, 'importers'>> {
return typeof lockfileFile['importers'] === 'undefined';
/**
* Parsing and mapping logic from pnpm lockfile `read` function
* https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/read.ts#L91
*/
export function parseAndNormalizePnpmLockfile(content: string): Lockfile {
const lockFileData = load(content);
return revertFromInlineSpecifiersFormatIfNecessary(
convertFromLockfileFileMutable(lockFileData)
);
}
/**
* Reverts changes from the "forceSharedFormat" write option if necessary.
* https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/read.ts#L234
*/
function convertFromLockfileFileMutable(
lockfileFile:
| (Omit<Lockfile, 'importers'> &
Partial<ProjectSnapshot> &
Partial<Pick<Lockfile, 'importers'>>)
| InlineSpecifiersLockfile
| Lockfile
): InlineSpecifiersLockfile | Lockfile {
if (isMutableLockfile(lockfileFile)) {
function convertFromLockfileFileMutable(lockfileFile: LockfileFile): Lockfile {
if (typeof lockfileFile?.['importers'] === 'undefined') {
lockfileFile.importers = {
'.': {
specifiers: lockfileFile['specifiers'] ?? {},
...(lockfileFile['dependenciesMeta'] && {
dependenciesMeta: lockfileFile['dependenciesMeta'],
}),
...(lockfileFile['publishDirectory'] && {
publishDirectory: lockfileFile['publishDirectory'],
}),
dependenciesMeta: lockfileFile['dependenciesMeta'],
publishDirectory: lockfileFile['publishDirectory'],
},
};
delete lockfileFile.specifiers;
@ -89,12 +64,227 @@ function convertFromLockfileFileMutable(
delete lockfileFile[depType];
}
}
return lockfileFile as Lockfile;
} else {
return lockfileFile;
}
return lockfileFile as Lockfile;
}
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/write.ts#L27
const LOCKFILE_YAML_FORMAT = {
blankLines: true,
lineWidth: 1000,
noCompatMode: true,
noRefs: true,
sortKeys: false,
};
/**
* Mapping and writing logic from pnpm lockfile `write` function
* https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/write.ts#L77
*/
export function stringifyToPnpmYaml(lockfile: Lockfile): string {
const isLockfileV6 = isV6Lockfile(lockfile);
const adaptedLockfile = isLockfileV6
? convertToInlineSpecifiersFormat(lockfile)
: lockfile;
return dump(
sortLockfileKeys(
normalizeLockfile(adaptedLockfile as Lockfile, isLockfileV6)
),
LOCKFILE_YAML_FORMAT
);
}
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/write.ts#L99
type LockfileFile = Omit<Lockfile, 'importers'> &
Partial<ProjectSnapshot> &
Partial<Pick<Lockfile, 'importers'>>;
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/write.ts#L106
function normalizeLockfile(lockfile: Lockfile, isLockfileV6: boolean) {
let lockfileToSave!: LockfileFile;
if (Object.keys(lockfile.importers).length === 1 && lockfile.importers['.']) {
lockfileToSave = {
...lockfile,
...lockfile.importers['.'],
};
delete lockfileToSave.importers;
for (const depType of DEPENDENCIES_FIELDS) {
if (isEmpty(lockfileToSave[depType])) {
delete lockfileToSave[depType];
}
}
if (isEmpty(lockfileToSave.packages) || lockfileToSave.packages == null) {
delete lockfileToSave.packages;
}
} else {
lockfileToSave = {
...lockfile,
importers: mapValues(lockfile.importers, (importer: ProjectSnapshot) => {
const normalizedImporter: Partial<ProjectSnapshot> = {};
if (!isEmpty(importer.specifiers ?? {}) || !isLockfileV6) {
normalizedImporter['specifiers'] = importer.specifiers ?? {};
}
if (
importer.dependenciesMeta != null &&
!isEmpty(importer.dependenciesMeta)
) {
normalizedImporter['dependenciesMeta'] = importer.dependenciesMeta;
}
for (const depType of DEPENDENCIES_FIELDS) {
if (!isEmpty(importer[depType] ?? {})) {
normalizedImporter[depType] = importer[depType];
}
}
if (importer.publishDirectory) {
normalizedImporter.publishDirectory = importer.publishDirectory;
}
return normalizedImporter as ProjectSnapshot;
}),
};
if (isEmpty(lockfileToSave.packages) || lockfileToSave.packages == null) {
delete lockfileToSave.packages;
}
}
if (lockfileToSave.time) {
lockfileToSave.time = (isLockfileV6 ? pruneTimeInLockfileV6 : pruneTime)(
lockfileToSave.time,
lockfile.importers
);
}
if (lockfileToSave.overrides != null && isEmpty(lockfileToSave.overrides)) {
delete lockfileToSave.overrides;
}
if (
lockfileToSave.patchedDependencies != null &&
isEmpty(lockfileToSave.patchedDependencies)
) {
delete lockfileToSave.patchedDependencies;
}
if (lockfileToSave.neverBuiltDependencies != null) {
if (isEmpty(lockfileToSave.neverBuiltDependencies)) {
delete lockfileToSave.neverBuiltDependencies;
} else {
lockfileToSave.neverBuiltDependencies =
lockfileToSave.neverBuiltDependencies.sort();
}
}
if (lockfileToSave.onlyBuiltDependencies != null) {
lockfileToSave.onlyBuiltDependencies =
lockfileToSave.onlyBuiltDependencies.sort();
}
if (!lockfileToSave.packageExtensionsChecksum) {
delete lockfileToSave.packageExtensionsChecksum;
}
return lockfileToSave;
}
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/write.ts#L173
function pruneTimeInLockfileV6(
time: Record<string, string>,
importers: Record<string, ProjectSnapshot>
): Record<string, string> {
const rootDepPaths = new Set<string>();
for (const importer of Object.values(importers)) {
for (const depType of DEPENDENCIES_FIELDS) {
for (let [depName, ref] of Object.entries(importer[depType] ?? {})) {
let version: string;
if (ref['version']) {
version = ref['version'];
} else {
version = ref as string;
}
const suffixStart = version.indexOf('(');
const refWithoutPeerSuffix =
suffixStart === -1 ? version : version.slice(0, suffixStart);
const depPath = refToRelative(refWithoutPeerSuffix, depName);
if (!depPath) continue;
rootDepPaths.add(depPath);
}
}
}
return pickBy((prop) => rootDepPaths.has(prop), time);
}
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/write.ts#L191
function refToRelative(reference: string, pkgName: string): string | null {
if (reference.startsWith('link:')) {
return null;
}
if (reference.startsWith('file:')) {
return reference;
}
if (
!reference.includes('/') ||
!reference.replace(/(\([^)]+\))+$/, '').includes('/')
) {
return `/${pkgName}@${reference}`;
}
return reference;
}
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/write.ts#L207
function pruneTime(
time: Record<string, string>,
importers: Record<string, ProjectSnapshot | ProjectSnapshotV6>
): Record<string, string> {
const rootDepPaths = new Set<string>();
for (const importer of Object.values(importers)) {
for (const depType of DEPENDENCIES_FIELDS) {
for (let [depName, ref] of Object.entries(importer[depType] ?? {})) {
let version: string;
if (ref['version']) {
version = ref['version'];
} else {
version = ref as string;
}
const suffixStart = version.indexOf('_');
const refWithoutPeerSuffix =
suffixStart === -1 ? version : version.slice(0, suffixStart);
const depPath = dpRefToRelative(refWithoutPeerSuffix, depName);
if (!depPath) continue;
rootDepPaths.add(depPath);
}
}
}
return pickBy((depPath) => rootDepPaths.has(depPath), time);
}
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/sortLockfileKeys.ts#L34
const ROOT_KEYS_ORDER = {
lockfileVersion: 1,
// only and never are conflict options.
neverBuiltDependencies: 2,
onlyBuiltDependencies: 2,
overrides: 3,
packageExtensionsChecksum: 4,
patchedDependencies: 5,
specifiers: 10,
dependencies: 11,
optionalDependencies: 12,
devDependencies: 13,
dependenciesMeta: 14,
importers: 15,
packages: 16,
};
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/sortLockfileKeys.ts#L60
function sortLockfileKeys(lockfile: LockfileFile): LockfileFile {
let sortedLockfile = {} as Lockfile;
const sortedKeys = Object.keys(lockfile).sort(
(a, b) => ROOT_KEYS_ORDER[a] - ROOT_KEYS_ORDER[b]
);
for (const key of sortedKeys) {
sortedLockfile[key] = lockfile[key];
}
return sortedLockfile;
}
/**
* Types from https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/InlineSpecifiersLockfile.ts
*/
const INLINE_SPECIFIERS_FORMAT_LOCKFILE_VERSION_SUFFIX = '-inlineSpecifiers';
interface InlineSpecifiersLockfile
extends Omit<Lockfile, 'lockfileVersion' | 'importers'> {
lockfileVersion: string;
@ -117,50 +307,273 @@ interface SpecifierAndResolution {
version: string;
}
const INLINE_SPECIFIERS_FORMAT_LOCKFILE_VERSION_SUFFIX = '-inlineSpecifiers';
function isInlineSpecifierLockfile(
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L10
function isExperimentalInlineSpecifiersFormat(
lockfile: InlineSpecifiersLockfile | Lockfile
): lockfile is InlineSpecifiersLockfile {
const { lockfileVersion } = lockfile;
return (
typeof lockfile.lockfileVersion === 'string' &&
lockfile.lockfileVersion.endsWith(
INLINE_SPECIFIERS_FORMAT_LOCKFILE_VERSION_SUFFIX
)
lockfileVersion.toString().startsWith('6.') ||
(typeof lockfileVersion === 'string' &&
lockfileVersion.endsWith(
INLINE_SPECIFIERS_FORMAT_LOCKFILE_VERSION_SUFFIX
))
);
}
function revertFromInlineSpecifiersFormatIfNecessary(
lockFile: InlineSpecifiersLockfile | Lockfile
): Lockfile {
if (isInlineSpecifierLockfile(lockFile)) {
const { lockfileVersion, importers, ...rest } = lockFile;
const originalVersionStr = lockfileVersion.replace(
INLINE_SPECIFIERS_FORMAT_LOCKFILE_VERSION_SUFFIX,
''
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L17
function convertToInlineSpecifiersFormat(
lockfile: Lockfile
): InlineSpecifiersLockfile {
let importers = lockfile.importers;
let packages = lockfile.packages;
if (isV6Lockfile(lockfile)) {
importers = Object.fromEntries(
Object.entries(lockfile.importers ?? {}).map(
([importerId, pkgSnapshot]: [string, ProjectSnapshot]) => {
const newSnapshot = { ...pkgSnapshot };
if (newSnapshot.dependencies != null) {
newSnapshot.dependencies = mapValues(
newSnapshot.dependencies,
convertOldRefToNewRef
);
}
if (newSnapshot.optionalDependencies != null) {
newSnapshot.optionalDependencies = mapValues(
newSnapshot.optionalDependencies,
convertOldRefToNewRef
);
}
if (newSnapshot.devDependencies != null) {
newSnapshot.devDependencies = mapValues(
newSnapshot.devDependencies,
convertOldRefToNewRef
);
}
return [importerId, newSnapshot];
}
)
);
packages = Object.fromEntries(
Object.entries(lockfile.packages ?? {}).map(([depPath, pkgSnapshot]) => {
const newSnapshot = { ...pkgSnapshot };
if (newSnapshot.dependencies != null) {
newSnapshot.dependencies = mapValues(
newSnapshot.dependencies,
convertOldRefToNewRef
);
}
if (newSnapshot.optionalDependencies != null) {
newSnapshot.optionalDependencies = mapValues(
newSnapshot.optionalDependencies,
convertOldRefToNewRef
);
}
return [convertOldDepPathToNewDepPath(depPath), newSnapshot];
})
);
const originalVersion = Number(originalVersionStr);
if (isNaN(originalVersion)) {
throw new Error(
`Unable to revert lockfile from inline specifiers format. Invalid version parsed: ${originalVersionStr}`
);
}
const mappedImporters: Record<string, ProjectSnapshot> = {};
Object.entries(importers).forEach(([key, value]) => {
mappedImporters[key] = revertProjectSnapshot(value);
});
return {
...rest,
lockfileVersion: originalVersion,
importers: mappedImporters,
};
}
return lockFile;
const newLockfile = {
...lockfile,
packages,
lockfileVersion: isV6Lockfile(lockfile)
? lockfile.lockfileVersion.toString()
: lockfile.lockfileVersion
.toString()
.endsWith(INLINE_SPECIFIERS_FORMAT_LOCKFILE_VERSION_SUFFIX)
? lockfile.lockfileVersion.toString()
: `${lockfile.lockfileVersion}${INLINE_SPECIFIERS_FORMAT_LOCKFILE_VERSION_SUFFIX}`,
importers: mapValues(
importers,
convertProjectSnapshotToInlineSpecifiersFormat
),
};
if (isV6Lockfile(lockfile) && newLockfile.time) {
newLockfile.time = Object.fromEntries(
Object.entries(newLockfile.time).map(([depPath, time]) => [
convertOldDepPathToNewDepPath(depPath),
time,
])
);
}
return newLockfile;
}
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L72
function convertOldDepPathToNewDepPath(oldDepPath: string) {
const parsedDepPath = dpParse(oldDepPath);
if (!parsedDepPath.name || !parsedDepPath.version) return oldDepPath;
let newDepPath = `/${parsedDepPath.name}@${parsedDepPath.version}`;
if (parsedDepPath.peersSuffix) {
if (parsedDepPath.peersSuffix.startsWith('(')) {
newDepPath += parsedDepPath.peersSuffix;
} else {
newDepPath += `_${parsedDepPath.peersSuffix}`;
}
}
if (parsedDepPath.host) {
newDepPath = `${parsedDepPath.host}${newDepPath}`;
}
return newDepPath;
}
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L89
function convertOldRefToNewRef(oldRef: string) {
if (oldRef.startsWith('link:') || oldRef.startsWith('file:')) {
return oldRef;
}
if (oldRef.includes('/')) {
return convertOldDepPathToNewDepPath(oldRef);
}
return oldRef;
}
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L99
function revertFromInlineSpecifiersFormatIfNecessary(
lockfile: Lockfile | InlineSpecifiersLockfile
): Lockfile {
return isExperimentalInlineSpecifiersFormat(lockfile)
? revertFromInlineSpecifiersFormat(lockfile)
: lockfile;
}
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L105
function revertFromInlineSpecifiersFormat(
lockfile: InlineSpecifiersLockfile
): Lockfile {
const { lockfileVersion, importers, ...rest } = lockfile;
const originalVersionStr = lockfileVersion.replace(
INLINE_SPECIFIERS_FORMAT_LOCKFILE_VERSION_SUFFIX,
''
);
const originalVersion = Number(originalVersionStr);
if (isNaN(originalVersion)) {
throw new Error(
`Unable to revert lockfile from inline specifiers format. Invalid version parsed: ${originalVersionStr}`
);
}
let revertedImporters = mapValues(importers, revertProjectSnapshot);
let packages = lockfile.packages;
if (originalVersion === 6) {
revertedImporters = Object.fromEntries(
Object.entries(revertedImporters ?? {}).map(
([importerId, pkgSnapshot]: [string, ProjectSnapshot]) => {
const newSnapshot = { ...pkgSnapshot };
if (newSnapshot.dependencies != null) {
newSnapshot.dependencies = mapValues(
newSnapshot.dependencies,
convertNewRefToOldRef
);
}
if (newSnapshot.optionalDependencies != null) {
newSnapshot.optionalDependencies = mapValues(
newSnapshot.optionalDependencies,
convertNewRefToOldRef
);
}
if (newSnapshot.devDependencies != null) {
newSnapshot.devDependencies = mapValues(
newSnapshot.devDependencies,
convertNewRefToOldRef
);
}
return [importerId, newSnapshot];
}
)
);
packages = Object.fromEntries(
Object.entries(lockfile.packages ?? {}).map(([depPath, pkgSnapshot]) => {
const newSnapshot = { ...pkgSnapshot };
if (newSnapshot.dependencies != null) {
newSnapshot.dependencies = mapValues(
newSnapshot.dependencies,
convertNewRefToOldRef
);
}
if (newSnapshot.optionalDependencies != null) {
newSnapshot.optionalDependencies = mapValues(
newSnapshot.optionalDependencies,
convertNewRefToOldRef
);
}
return [convertNewDepPathToOldDepPath(depPath), newSnapshot];
})
);
}
const newLockfile = {
...rest,
lockfileVersion: lockfileVersion.endsWith(
INLINE_SPECIFIERS_FORMAT_LOCKFILE_VERSION_SUFFIX
)
? originalVersion
: lockfileVersion,
packages,
importers: revertedImporters,
};
if (originalVersion === 6 && newLockfile.time) {
newLockfile.time = Object.fromEntries(
Object.entries(newLockfile.time).map(([depPath, time]) => [
convertNewDepPathToOldDepPath(depPath),
time,
])
);
}
return newLockfile;
}
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L162
function convertNewDepPathToOldDepPath(oldDepPath: string) {
if (!oldDepPath.includes('@', 2)) return oldDepPath;
const index = oldDepPath.indexOf('@', oldDepPath.indexOf('/@') + 2);
if (oldDepPath.includes('(') && index > oldDepPath.indexOf('('))
return oldDepPath;
return `${oldDepPath.substring(0, index)}/${oldDepPath.substring(index + 1)}`;
}
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L169
function convertNewRefToOldRef(oldRef: string) {
if (oldRef.startsWith('link:') || oldRef.startsWith('file:')) {
return oldRef;
}
if (oldRef.includes('@')) {
return convertNewDepPathToOldDepPath(oldRef);
}
return oldRef;
}
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L179
function convertProjectSnapshotToInlineSpecifiersFormat(
projectSnapshot: ProjectSnapshot
): InlineSpecifiersProjectSnapshot {
const { specifiers, ...rest } = projectSnapshot;
const convertBlock = (block?: ResolvedDependencies) =>
block != null
? convertResolvedDependenciesToInlineSpecifiersFormat(block, {
specifiers,
})
: block;
return {
...rest,
dependencies: convertBlock(projectSnapshot.dependencies),
optionalDependencies: convertBlock(projectSnapshot.optionalDependencies),
devDependencies: convertBlock(projectSnapshot.devDependencies),
} as InlineSpecifiersProjectSnapshot;
}
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L195
function convertResolvedDependenciesToInlineSpecifiersFormat(
resolvedDependencies: ResolvedDependencies,
{ specifiers }: { specifiers: ResolvedDependencies }
): InlineSpecifiersResolvedDependencies {
return mapValues(resolvedDependencies, (version, depName) => ({
specifier: specifiers[depName],
version,
}));
}
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L205
function revertProjectSnapshot(
from: InlineSpecifiersProjectSnapshot
): ProjectSnapshot {
@ -203,8 +616,132 @@ function revertProjectSnapshot(
};
}
export const DEPENDENCIES_FIELDS = [
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/experiments/inlineSpecifiersLockfileConverters.ts#L241
function mapValues<T, U>(
obj: Record<string, T>,
mapper: (val: T, key: string) => U
): Record<string, U> {
const result: Record<string, U> = {};
for (const [key, value] of Object.entries(obj)) {
result[key] = mapper(value, key);
}
return result;
}
/*************************************************************************
* THE FOLLOWING CODE IS COPIED FROM @pnpm/types for convenience
*************************************************************************/
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/packages/types/src/misc.ts#L6
const DEPENDENCIES_FIELDS = [
'optionalDependencies',
'dependencies',
'devDependencies',
];
/*************************************************************************
* THE FOLLOWING CODE IS COPIED FROM @pnpm/dependency-path for convenience
*************************************************************************/
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/packages/dependency-path/src/index.ts#L6
function isAbsolute(dependencyPath) {
return dependencyPath[0] !== '/';
}
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/packages/dependency-path/src/index.ts#L80
function dpRefToRelative(reference, pkgName) {
if (reference.startsWith('link:')) {
return null;
}
if (reference.startsWith('file:')) {
return reference;
}
if (
!reference.includes('/') ||
(reference.includes('(') &&
reference.lastIndexOf('/', reference.indexOf('(')) === -1)
) {
return `/${pkgName}/${reference}`;
}
return reference;
}
// https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/packages/dependency-path/src/index.ts#L96
function dpParse(dependencyPath) {
// eslint-disable-next-line: strict-type-predicates
if (typeof dependencyPath !== 'string') {
throw new TypeError(
`Expected \`dependencyPath\` to be of type \`string\`, got \`${
// eslint-disable-next-line: strict-type-predicates
dependencyPath === null ? 'null' : typeof dependencyPath
}\``
);
}
const _isAbsolute = isAbsolute(dependencyPath);
const parts = dependencyPath.split('/');
if (!_isAbsolute) parts.shift();
const host = _isAbsolute ? parts.shift() : undefined;
if (parts.length === 0)
return {
host,
isAbsolute: _isAbsolute,
};
const name = parts[0].startsWith('@')
? `${parts.shift()}/${parts.shift()}` // eslint-disable-line @typescript-eslint/restrict-template-expressions
: parts.shift();
let version = parts.join('/');
if (version) {
let peerSepIndex;
let peersSuffix;
if (version.includes('(') && version.endsWith(')')) {
peerSepIndex = version.indexOf('(');
if (peerSepIndex !== -1) {
peersSuffix = version.substring(peerSepIndex);
version = version.substring(0, peerSepIndex);
}
} else {
peerSepIndex = version.indexOf('_');
if (peerSepIndex !== -1) {
peersSuffix = version.substring(peerSepIndex + 1);
version = version.substring(0, peerSepIndex);
}
}
if (valid(version)) {
return {
host,
isAbsolute: _isAbsolute,
name,
peersSuffix,
version,
};
}
}
if (!_isAbsolute)
throw new Error(`${dependencyPath} is an invalid relative dependency path`);
return {
host,
isAbsolute: _isAbsolute,
};
}
/********************************************************************************
* THE FOLLOWING CODE IS COPIED AND SIMPLIFIED FROM @pnpm/ramda for convenience
*******************************************************************************/
// https://github.com/pnpm/ramda/blob/50c6b57110b2f3631ed8633141f12012b7768d85/source/pickBy.js#L24
function pickBy(test: (prop: string) => boolean, obj: Record<string, string>) {
let result = {};
for (const prop in obj) {
if (test(obj[prop])) {
result[prop] = obj[prop];
}
}
return result;
}
// https://github.com/pnpm/ramda/blob/50c6b57110b2f3631ed8633141f12012b7768d85/source/isEmpty.js#L28
function isEmpty(obj: object) {
return obj != null && Object.keys(obj).length === 0;
}

View File

@ -167,7 +167,7 @@ describe('yarn LockFile utility', () => {
});
it('should parse root lock file', async () => {
expect(Object.keys(graph.externalNodes).length).toEqual(1244); // 1104
expect(Object.keys(graph.externalNodes).length).toEqual(1244);
});
it('should prune lock file', async () => {
@ -231,7 +231,7 @@ describe('yarn LockFile utility', () => {
const builder = new ProjectGraphBuilder();
parseYarnLockfile(classicLockFile, builder);
const graph = builder.getUpdatedProjectGraph();
expect(Object.keys(graph.externalNodes).length).toEqual(127); // 124 hoisted
expect(Object.keys(graph.externalNodes).length).toEqual(127);
expect(graph.externalNodes['npm:minimatch']).toMatchInlineSnapshot(`
Object {
@ -369,7 +369,7 @@ describe('yarn LockFile utility', () => {
const builder = new ProjectGraphBuilder();
parseYarnLockfile(berryLockFile, builder);
const graph = builder.getUpdatedProjectGraph();
expect(Object.keys(graph.externalNodes).length).toEqual(129); //124 hoisted
expect(Object.keys(graph.externalNodes).length).toEqual(129);
expect(graph.externalNodes['npm:minimatch']).toMatchInlineSnapshot(`
Object {
@ -506,7 +506,7 @@ describe('yarn LockFile utility', () => {
const builder = new ProjectGraphBuilder();
parseYarnLockfile(classicLockFile, builder);
const graph = builder.getUpdatedProjectGraph();
expect(Object.keys(graph.externalNodes).length).toEqual(371); //337 hoisted
expect(Object.keys(graph.externalNodes).length).toEqual(371);
});
});