From bee69fd38cef4a993a043520d683c3464c240159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20G=C5=82owala?= Date: Wed, 16 Aug 2023 11:52:22 +0200 Subject: [PATCH] refactor!: improve library (#75) --- package.json | 11 +- pnpm-lock.yaml | 1171 +++++--- src/_utils.ts | 127 + src/api.ts | 195 +- src/detect.ts | 105 - src/index.ts | 2 +- src/package-manager.ts | 109 + src/spawn.ts | 34 - src/types.ts | 12 +- test/fixtures/default/package.json | 5 - test/fixtures/npm/package-lock.json | 36 +- test/fixtures/npm/package.json | 6 +- .../npm/packages/workspace-a/package.json | 7 +- test/fixtures/pnpm/package.json | 6 +- .../pnpm/packages/workspace-a/package.json | 9 +- test/fixtures/pnpm/pnpm-lock.yaml | 23 +- test/fixtures/yarn-berry/.pnp.loader.mjs | 2562 +++++++++++++++++ test/fixtures/yarn-berry/package.json | 10 +- .../packages/workspace-a/package.json | 8 +- test/fixtures/yarn-berry/yarn.lock | 21 +- test/fixtures/yarn-classic/package.json | 11 +- .../packages/workspace-a/package.json | 10 + test/fixtures/yarn-classic/yarn.lock | 13 +- test/index.test.ts | 222 +- 24 files changed, 3933 insertions(+), 782 deletions(-) create mode 100644 src/_utils.ts delete mode 100644 src/detect.ts create mode 100644 src/package-manager.ts delete mode 100644 src/spawn.ts delete mode 100644 test/fixtures/default/package.json create mode 100644 test/fixtures/yarn-berry/.pnp.loader.mjs create mode 100644 test/fixtures/yarn-classic/packages/workspace-a/package.json diff --git a/package.json b/package.json index 89ab927..423040e 100644 --- a/package.json +++ b/package.json @@ -29,18 +29,19 @@ "test": "pnpm lint && vitest run --coverage" }, "dependencies": { - "execa": "^7.2.0" + "execa": "^7.2.0", + "ufo": "^1.2.0" }, "devDependencies": { - "@types/node": "^20.4.6", + "@types/node": "^20.5.0", "@vitest/coverage-v8": "^0.34.1", "changelogen": "^0.5.4", "corepack": "^0.19.0", - "eslint": "^8.46.0", + "eslint": "^8.47.0", "eslint-config-unjs": "^0.2.1", "jiti": "^1.19.1", "pathe": "^1.1.1", - "prettier": "^2.8.8", + "prettier": "^3.0.2", "typescript": "^5.1.6", "unbuild": "^1.2.1", "vitest": "^0.34.1" @@ -49,4 +50,4 @@ "engines": { "node": "^14.16.0 || >=16.10.0" } -} \ No newline at end of file +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ef5d08f..3f5fd78 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,11 +8,14 @@ dependencies: execa: specifier: ^7.2.0 version: 7.2.0 + ufo: + specifier: ^1.2.0 + version: 1.2.0 devDependencies: '@types/node': - specifier: ^20.4.6 - version: 20.4.6 + specifier: ^20.5.0 + version: 20.5.0 '@vitest/coverage-v8': specifier: ^0.34.1 version: 0.34.1(vitest@0.34.1) @@ -23,11 +26,11 @@ devDependencies: specifier: ^0.19.0 version: 0.19.0 eslint: - specifier: ^8.46.0 - version: 8.46.0 + specifier: ^8.47.0 + version: 8.47.0 eslint-config-unjs: specifier: ^0.2.1 - version: 0.2.1(eslint@8.46.0)(typescript@5.1.6) + version: 0.2.1(eslint@8.47.0)(typescript@5.1.6) jiti: specifier: ^1.19.1 version: 1.19.1 @@ -35,8 +38,8 @@ devDependencies: specifier: ^1.1.1 version: 1.1.1 prettier: - specifier: ^2.8.8 - version: 2.8.8 + specifier: ^3.0.2 + version: 3.0.2 typescript: specifier: ^5.1.6 version: 5.1.6 @@ -59,66 +62,64 @@ packages: engines: {node: '>=6.0.0'} dependencies: '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.18 + '@jridgewell/trace-mapping': 0.3.19 dev: true - /@babel/code-frame@7.22.5: - resolution: {integrity: sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==} + /@babel/code-frame@7.22.10: + resolution: {integrity: sha512-/KKIMG4UEL35WmI9OlvMhurwtytjvXoFcGNrOvyG9zIzA8YmPjVtIZUf7b05+TPO7G7/GEmLHDaoCgACHl9hhA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/highlight': 7.22.5 + '@babel/highlight': 7.22.10 + chalk: 2.4.2 dev: true - /@babel/compat-data@7.22.5: - resolution: {integrity: sha512-4Jc/YuIaYqKnDDz892kPIledykKg12Aw1PYX5i/TY28anJtacvM1Rrr8wbieB9GfEJwlzqT0hUEao0CxEebiDA==} + /@babel/compat-data@7.22.9: + resolution: {integrity: sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==} engines: {node: '>=6.9.0'} dev: true - /@babel/core@7.22.5: - resolution: {integrity: sha512-SBuTAjg91A3eKOvD+bPEz3LlhHZRNu1nFOVts9lzDJTXshHTjII0BAtDS3Y2DAkdZdDKWVZGVwkDfc4Clxn1dg==} + /@babel/core@7.22.10: + resolution: {integrity: sha512-fTmqbbUBAwCcre6zPzNngvsI0aNrPZe77AeqvDxWM9Nm+04RrJ3CAmGHA9f7lJQY6ZMhRztNemy4uslDxTX4Qw==} engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.2.1 - '@babel/code-frame': 7.22.5 - '@babel/generator': 7.22.5 - '@babel/helper-compilation-targets': 7.22.5(@babel/core@7.22.5) - '@babel/helper-module-transforms': 7.22.5 - '@babel/helpers': 7.22.5 - '@babel/parser': 7.22.5 + '@babel/code-frame': 7.22.10 + '@babel/generator': 7.22.10 + '@babel/helper-compilation-targets': 7.22.10 + '@babel/helper-module-transforms': 7.22.9(@babel/core@7.22.10) + '@babel/helpers': 7.22.10 + '@babel/parser': 7.22.10 '@babel/template': 7.22.5 - '@babel/traverse': 7.22.5 - '@babel/types': 7.22.5 + '@babel/traverse': 7.22.10 + '@babel/types': 7.22.10 convert-source-map: 1.9.0 debug: 4.3.4 gensync: 1.0.0-beta.2 json5: 2.2.3 - semver: 6.3.0 + semver: 6.3.1 transitivePeerDependencies: - supports-color dev: true - /@babel/generator@7.22.5: - resolution: {integrity: sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==} + /@babel/generator@7.22.10: + resolution: {integrity: sha512-79KIf7YiWjjdZ81JnLujDRApWtl7BxTqWD88+FFdQEIOG8LJ0etDOM7CXuIgGJa55sGOwZVwuEsaLEm0PJ5/+A==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.5 + '@babel/types': 7.22.10 '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.18 + '@jridgewell/trace-mapping': 0.3.19 jsesc: 2.5.2 dev: true - /@babel/helper-compilation-targets@7.22.5(@babel/core@7.22.5): - resolution: {integrity: sha512-Ji+ywpHeuqxB8WDxraCiqR0xfhYjiDE/e6k7FuIaANnoOFxAHskHChz4vA1mJC9Lbm01s1PVAGhQY4FUKSkGZw==} + /@babel/helper-compilation-targets@7.22.10: + resolution: {integrity: sha512-JMSwHD4J7SLod0idLq5PKgI+6g/hLD/iuWBq08ZX49xE14VpVEojJ5rHWptpirV2j020MvypRLAXAO50igCJ5Q==} engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 dependencies: - '@babel/compat-data': 7.22.5 - '@babel/core': 7.22.5 + '@babel/compat-data': 7.22.9 '@babel/helper-validator-option': 7.22.5 - browserslist: 4.21.9 + browserslist: 4.21.10 lru-cache: 5.1.1 - semver: 6.3.0 + semver: 6.3.1 dev: true /@babel/helper-environment-visitor@7.22.5: @@ -131,51 +132,49 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.22.5 - '@babel/types': 7.22.5 + '@babel/types': 7.22.10 dev: true /@babel/helper-hoist-variables@7.22.5: resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.5 + '@babel/types': 7.22.10 dev: true /@babel/helper-module-imports@7.22.5: resolution: {integrity: sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.5 + '@babel/types': 7.22.10 dev: true - /@babel/helper-module-transforms@7.22.5: - resolution: {integrity: sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw==} + /@babel/helper-module-transforms@7.22.9(@babel/core@7.22.10): + resolution: {integrity: sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ==} engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 dependencies: + '@babel/core': 7.22.10 '@babel/helper-environment-visitor': 7.22.5 '@babel/helper-module-imports': 7.22.5 '@babel/helper-simple-access': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 '@babel/helper-validator-identifier': 7.22.5 - '@babel/template': 7.22.5 - '@babel/traverse': 7.22.5 - '@babel/types': 7.22.5 - transitivePeerDependencies: - - supports-color dev: true /@babel/helper-simple-access@7.22.5: resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.5 + '@babel/types': 7.22.10 dev: true - /@babel/helper-split-export-declaration@7.22.5: - resolution: {integrity: sha512-thqK5QFghPKWLhAV321lxF95yCg2K3Ob5yw+M3VHWfdia0IkPXUtoLH8x/6Fh486QUvzhb8YOWHChTVen2/PoQ==} + /@babel/helper-split-export-declaration@7.22.6: + resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.5 + '@babel/types': 7.22.10 dev: true /@babel/helper-string-parser@7.22.5: @@ -193,19 +192,19 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helpers@7.22.5: - resolution: {integrity: sha512-pSXRmfE1vzcUIDFQcSGA5Mr+GxBV9oiRKDuDxXvWQQBCh8HoIjs/2DlDB7H8smac1IVrB9/xdXj2N3Wol9Cr+Q==} + /@babel/helpers@7.22.10: + resolution: {integrity: sha512-a41J4NW8HyZa1I1vAndrraTlPZ/eZoga2ZgS7fEr0tZJGVU4xqdE80CEm0CcNjha5EZ8fTBYLKHF0kqDUuAwQw==} engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.22.5 - '@babel/traverse': 7.22.5 - '@babel/types': 7.22.5 + '@babel/traverse': 7.22.10 + '@babel/types': 7.22.10 transitivePeerDependencies: - supports-color dev: true - /@babel/highlight@7.22.5: - resolution: {integrity: sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==} + /@babel/highlight@7.22.10: + resolution: {integrity: sha512-78aUtVcT7MUscr0K5mIEnkwxPE0MaxkR5RxRwuHaQ+JuU5AmTPhY+do2mdzVTnIJJpyBglql2pehuBIWHug+WQ==} engines: {node: '>=6.9.0'} requiresBuild: true dependencies: @@ -214,16 +213,16 @@ packages: js-tokens: 4.0.0 dev: true - /@babel/parser@7.22.5: - resolution: {integrity: sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q==} + /@babel/parser@7.22.10: + resolution: {integrity: sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ==} engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.22.5 + '@babel/types': 7.22.10 dev: true - /@babel/standalone@7.22.5: - resolution: {integrity: sha512-6Lwhzral4YDEbIM3dBC8/w0BMDvOosGBGaJWSORLkerx8byawkmwwzXKUB0jGlI1Zp90+cK2uyTl62UPtLbUjQ==} + /@babel/standalone@7.22.10: + resolution: {integrity: sha512-VmK2sWxUTfDDh9mPfCtFJPIehZToteqK+Zpwq8oJUjJ+WeeKIFTTQIrDzH7jEdom+cAaaguU7FI/FBsBWFkIeQ==} engines: {node: '>=6.9.0'} dev: true @@ -231,31 +230,31 @@ packages: resolution: {integrity: sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.22.5 - '@babel/parser': 7.22.5 - '@babel/types': 7.22.5 + '@babel/code-frame': 7.22.10 + '@babel/parser': 7.22.10 + '@babel/types': 7.22.10 dev: true - /@babel/traverse@7.22.5: - resolution: {integrity: sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==} + /@babel/traverse@7.22.10: + resolution: {integrity: sha512-Q/urqV4pRByiNNpb/f5OSv28ZlGJiFiiTh+GAHktbIrkPhPbl90+uW6SmpoLyZqutrg9AEaEf3Q/ZBRHBXgxig==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.22.5 - '@babel/generator': 7.22.5 + '@babel/code-frame': 7.22.10 + '@babel/generator': 7.22.10 '@babel/helper-environment-visitor': 7.22.5 '@babel/helper-function-name': 7.22.5 '@babel/helper-hoist-variables': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.5 - '@babel/parser': 7.22.5 - '@babel/types': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/parser': 7.22.10 + '@babel/types': 7.22.10 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color dev: true - /@babel/types@7.22.5: - resolution: {integrity: sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==} + /@babel/types@7.22.10: + resolution: {integrity: sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-string-parser': 7.22.5 @@ -276,6 +275,15 @@ packages: dev: true optional: true + /@esbuild/android-arm64@0.18.20: + resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + /@esbuild/android-arm@0.17.19: resolution: {integrity: sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==} engines: {node: '>=12'} @@ -285,6 +293,15 @@ packages: dev: true optional: true + /@esbuild/android-arm@0.18.20: + resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + /@esbuild/android-x64@0.17.19: resolution: {integrity: sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==} engines: {node: '>=12'} @@ -294,6 +311,15 @@ packages: dev: true optional: true + /@esbuild/android-x64@0.18.20: + resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + /@esbuild/darwin-arm64@0.17.19: resolution: {integrity: sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==} engines: {node: '>=12'} @@ -303,6 +329,15 @@ packages: dev: true optional: true + /@esbuild/darwin-arm64@0.18.20: + resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@esbuild/darwin-x64@0.17.19: resolution: {integrity: sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==} engines: {node: '>=12'} @@ -312,6 +347,15 @@ packages: dev: true optional: true + /@esbuild/darwin-x64@0.18.20: + resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@esbuild/freebsd-arm64@0.17.19: resolution: {integrity: sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==} engines: {node: '>=12'} @@ -321,6 +365,15 @@ packages: dev: true optional: true + /@esbuild/freebsd-arm64@0.18.20: + resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + /@esbuild/freebsd-x64@0.17.19: resolution: {integrity: sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==} engines: {node: '>=12'} @@ -330,6 +383,15 @@ packages: dev: true optional: true + /@esbuild/freebsd-x64@0.18.20: + resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-arm64@0.17.19: resolution: {integrity: sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==} engines: {node: '>=12'} @@ -339,6 +401,15 @@ packages: dev: true optional: true + /@esbuild/linux-arm64@0.18.20: + resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-arm@0.17.19: resolution: {integrity: sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==} engines: {node: '>=12'} @@ -348,6 +419,15 @@ packages: dev: true optional: true + /@esbuild/linux-arm@0.18.20: + resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-ia32@0.17.19: resolution: {integrity: sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==} engines: {node: '>=12'} @@ -357,6 +437,15 @@ packages: dev: true optional: true + /@esbuild/linux-ia32@0.18.20: + resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-loong64@0.17.19: resolution: {integrity: sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==} engines: {node: '>=12'} @@ -366,6 +455,15 @@ packages: dev: true optional: true + /@esbuild/linux-loong64@0.18.20: + resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-mips64el@0.17.19: resolution: {integrity: sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==} engines: {node: '>=12'} @@ -375,6 +473,15 @@ packages: dev: true optional: true + /@esbuild/linux-mips64el@0.18.20: + resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-ppc64@0.17.19: resolution: {integrity: sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==} engines: {node: '>=12'} @@ -384,6 +491,15 @@ packages: dev: true optional: true + /@esbuild/linux-ppc64@0.18.20: + resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-riscv64@0.17.19: resolution: {integrity: sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==} engines: {node: '>=12'} @@ -393,6 +509,15 @@ packages: dev: true optional: true + /@esbuild/linux-riscv64@0.18.20: + resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-s390x@0.17.19: resolution: {integrity: sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==} engines: {node: '>=12'} @@ -402,6 +527,15 @@ packages: dev: true optional: true + /@esbuild/linux-s390x@0.18.20: + resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-x64@0.17.19: resolution: {integrity: sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==} engines: {node: '>=12'} @@ -411,6 +545,15 @@ packages: dev: true optional: true + /@esbuild/linux-x64@0.18.20: + resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/netbsd-x64@0.17.19: resolution: {integrity: sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==} engines: {node: '>=12'} @@ -420,6 +563,15 @@ packages: dev: true optional: true + /@esbuild/netbsd-x64@0.18.20: + resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + /@esbuild/openbsd-x64@0.17.19: resolution: {integrity: sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==} engines: {node: '>=12'} @@ -429,6 +581,15 @@ packages: dev: true optional: true + /@esbuild/openbsd-x64@0.18.20: + resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + /@esbuild/sunos-x64@0.17.19: resolution: {integrity: sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==} engines: {node: '>=12'} @@ -438,6 +599,15 @@ packages: dev: true optional: true + /@esbuild/sunos-x64@0.18.20: + resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + /@esbuild/win32-arm64@0.17.19: resolution: {integrity: sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==} engines: {node: '>=12'} @@ -447,6 +617,15 @@ packages: dev: true optional: true + /@esbuild/win32-arm64@0.18.20: + resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@esbuild/win32-ia32@0.17.19: resolution: {integrity: sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==} engines: {node: '>=12'} @@ -456,6 +635,15 @@ packages: dev: true optional: true + /@esbuild/win32-ia32@0.18.20: + resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@esbuild/win32-x64@0.17.19: resolution: {integrity: sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==} engines: {node: '>=12'} @@ -465,19 +653,23 @@ packages: dev: true optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.46.0): + /@esbuild/win32-x64@0.18.20: + resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@eslint-community/eslint-utils@4.4.0(eslint@8.47.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: - eslint: 8.46.0 - eslint-visitor-keys: 3.4.2 - dev: true - - /@eslint-community/regexpp@4.5.1: - resolution: {integrity: sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==} - engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + eslint: 8.47.0 + eslint-visitor-keys: 3.4.3 dev: true /@eslint-community/regexpp@4.6.2: @@ -485,14 +677,14 @@ packages: engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dev: true - /@eslint/eslintrc@2.1.1: - resolution: {integrity: sha512-9t7ZA7NGGK8ckelF0PQCfcxIUzs1Md5rrO6U/c+FIQNanea5UZC0wqKXH4vHBccmu4ZJgZ2idtPeW7+Q2npOEA==} + /@eslint/eslintrc@2.1.2: + resolution: {integrity: sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 debug: 4.3.4 espree: 9.6.1 - globals: 13.20.0 + globals: 13.21.0 ignore: 5.2.4 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -502,8 +694,8 @@ packages: - supports-color dev: true - /@eslint/js@8.46.0: - resolution: {integrity: sha512-a8TLtmPi8xzPkCbp/OGFUo5yhRkHM2Ko9kOWP4znJr0WAhWyThaw3PnwX4vOTWOAMsV2uRt32PPDcEz63esSaA==} + /@eslint/js@8.47.0: + resolution: {integrity: sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true @@ -545,11 +737,11 @@ packages: dependencies: '@jridgewell/set-array': 1.1.2 '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.18 + '@jridgewell/trace-mapping': 0.3.19 dev: true - /@jridgewell/resolve-uri@3.1.0: - resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} + /@jridgewell/resolve-uri@3.1.1: + resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==} engines: {node: '>=6.0.0'} dev: true @@ -558,19 +750,15 @@ packages: engines: {node: '>=6.0.0'} dev: true - /@jridgewell/sourcemap-codec@1.4.14: - resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} - dev: true - /@jridgewell/sourcemap-codec@1.4.15: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} dev: true - /@jridgewell/trace-mapping@0.3.18: - resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==} + /@jridgewell/trace-mapping@0.3.19: + resolution: {integrity: sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==} dependencies: - '@jridgewell/resolve-uri': 3.1.0 - '@jridgewell/sourcemap-codec': 1.4.14 + '@jridgewell/resolve-uri': 3.1.1 + '@jridgewell/sourcemap-codec': 1.4.15 dev: true /@nodelib/fs.scandir@2.1.5: @@ -594,19 +782,7 @@ packages: fastq: 1.15.0 dev: true - /@pkgr/utils@2.4.1: - resolution: {integrity: sha512-JOqwkgFEyi+OROIyq7l4Jy28h/WwhDnG/cPkXG2Z1iFbubB6jsHW1NDvmyOzTBxHr3yg68YGirmh1JUgMqa+9w==} - engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - dependencies: - cross-spawn: 7.0.3 - fast-glob: 3.2.12 - is-glob: 4.0.3 - open: 9.1.0 - picocolors: 1.0.0 - tslib: 2.5.3 - dev: true - - /@rollup/plugin-alias@5.0.0(rollup@3.25.1): + /@rollup/plugin-alias@5.0.0(rollup@3.28.0): resolution: {integrity: sha512-l9hY5chSCjuFRPsnRm16twWBiSApl2uYFLsepQYwtBuAxNMQ/1dJqADld40P0Jkqm65GRTLy/AC6hnpVebtLsA==} engines: {node: '>=14.0.0'} peerDependencies: @@ -615,11 +791,11 @@ packages: rollup: optional: true dependencies: - rollup: 3.25.1 + rollup: 3.28.0 slash: 4.0.0 dev: true - /@rollup/plugin-commonjs@24.1.0(rollup@3.25.1): + /@rollup/plugin-commonjs@24.1.0(rollup@3.28.0): resolution: {integrity: sha512-eSL45hjhCWI0jCCXcNtLVqM5N1JlBGvlFfY0m6oOYnLCJ6N0qEXoZql4sY2MOUArzhH4SA/qBpTxvvZp2Sc+DQ==} engines: {node: '>=14.0.0'} peerDependencies: @@ -628,16 +804,16 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.25.1) + '@rollup/pluginutils': 5.0.3(rollup@3.28.0) commondir: 1.0.1 estree-walker: 2.0.2 glob: 8.1.0 is-reference: 1.2.1 magic-string: 0.27.0 - rollup: 3.25.1 + rollup: 3.28.0 dev: true - /@rollup/plugin-json@6.0.0(rollup@3.25.1): + /@rollup/plugin-json@6.0.0(rollup@3.28.0): resolution: {integrity: sha512-i/4C5Jrdr1XUarRhVu27EEwjt4GObltD7c+MkCIpO2QIbojw8MUs+CCTqOphQi3Qtg1FLmYt+l+6YeoIf51J7w==} engines: {node: '>=14.0.0'} peerDependencies: @@ -646,11 +822,11 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.25.1) - rollup: 3.25.1 + '@rollup/pluginutils': 5.0.3(rollup@3.28.0) + rollup: 3.28.0 dev: true - /@rollup/plugin-node-resolve@15.1.0(rollup@3.25.1): + /@rollup/plugin-node-resolve@15.1.0(rollup@3.28.0): resolution: {integrity: sha512-xeZHCgsiZ9pzYVgAo9580eCGqwh/XCEUM9q6iQfGNocjgkufHAqC3exA+45URvhiYV8sBF9RlBai650eNs7AsA==} engines: {node: '>=14.0.0'} peerDependencies: @@ -659,16 +835,16 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.25.1) + '@rollup/pluginutils': 5.0.3(rollup@3.28.0) '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-builtin-module: 3.2.1 is-module: 1.0.0 - resolve: 1.22.2 - rollup: 3.25.1 + resolve: 1.22.4 + rollup: 3.28.0 dev: true - /@rollup/plugin-replace@5.0.2(rollup@3.25.1): + /@rollup/plugin-replace@5.0.2(rollup@3.28.0): resolution: {integrity: sha512-M9YXNekv/C/iHHK+cvORzfRYfPbq0RDD8r0G+bMiTXjNGKulPnCT9O3Ss46WfhI6ZOCgApOP7xAdmCQJ+U2LAA==} engines: {node: '>=14.0.0'} peerDependencies: @@ -677,13 +853,13 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.25.1) + '@rollup/pluginutils': 5.0.3(rollup@3.28.0) magic-string: 0.27.0 - rollup: 3.25.1 + rollup: 3.28.0 dev: true - /@rollup/pluginutils@5.0.2(rollup@3.25.1): - resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==} + /@rollup/pluginutils@5.0.3(rollup@3.28.0): + resolution: {integrity: sha512-hfllNN4a80rwNQ9QCxhxuHCGHMAvabXqxNdaChUSSadMre7t4iEUI6fFAhBOn/eIYTgYVhBv7vCLsAJ4u3lf3g==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^1.20.0||^2.0.0||^3.0.0 @@ -694,7 +870,7 @@ packages: '@types/estree': 1.0.1 estree-walker: 2.0.2 picomatch: 2.3.1 - rollup: 3.25.1 + rollup: 3.28.0 dev: true /@sinclair/typebox@0.27.8: @@ -727,8 +903,8 @@ packages: resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} dev: true - /@types/node@20.4.6: - resolution: {integrity: sha512-q0RkvNgMweWWIvSMDiXhflGUKMdIxBo2M2tYM/0kEGDueQByFzK4KZAgu5YHGFNxziTlppNpTIBcqHQAxlfHdA==} + /@types/node@20.5.0: + resolution: {integrity: sha512-Mgq7eCtoTjT89FqNoTzzXg2XvCi5VMhRV6+I2aYanc6kQCBImeNaAYRs/DyoVqk1YEUJK5gN9VO7HRIdz4Wo3Q==} dev: true /@types/normalize-package-data@2.4.1: @@ -743,8 +919,8 @@ packages: resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} dev: true - /@typescript-eslint/eslint-plugin@5.59.11(@typescript-eslint/parser@5.59.11)(eslint@8.46.0)(typescript@5.1.6): - resolution: {integrity: sha512-XxuOfTkCUiOSyBWIvHlUraLw/JT/6Io1365RO6ZuI88STKMavJZPNMU0lFcUTeQXEhHiv64CbxYxBNoDVSmghg==} + /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.47.0)(typescript@5.1.6): + resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: '@typescript-eslint/parser': ^5.0.0 @@ -754,25 +930,25 @@ packages: typescript: optional: true dependencies: - '@eslint-community/regexpp': 4.5.1 - '@typescript-eslint/parser': 5.59.11(eslint@8.46.0)(typescript@5.1.6) - '@typescript-eslint/scope-manager': 5.59.11 - '@typescript-eslint/type-utils': 5.59.11(eslint@8.46.0)(typescript@5.1.6) - '@typescript-eslint/utils': 5.59.11(eslint@8.46.0)(typescript@5.1.6) + '@eslint-community/regexpp': 4.6.2 + '@typescript-eslint/parser': 5.62.0(eslint@8.47.0)(typescript@5.1.6) + '@typescript-eslint/scope-manager': 5.62.0 + '@typescript-eslint/type-utils': 5.62.0(eslint@8.47.0)(typescript@5.1.6) + '@typescript-eslint/utils': 5.62.0(eslint@8.47.0)(typescript@5.1.6) debug: 4.3.4 - eslint: 8.46.0 - grapheme-splitter: 1.0.4 + eslint: 8.47.0 + graphemer: 1.4.0 ignore: 5.2.4 natural-compare-lite: 1.4.0 - semver: 7.5.3 + semver: 7.5.4 tsutils: 3.21.0(typescript@5.1.6) typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@5.59.11(eslint@8.46.0)(typescript@5.1.6): - resolution: {integrity: sha512-s9ZF3M+Nym6CAZEkJJeO2TFHHDsKAM3ecNkLuH4i4s8/RCPnF5JRip2GyviYkeEAcwGMJxkqG9h2dAsnA1nZpA==} + /@typescript-eslint/parser@5.62.0(eslint@8.47.0)(typescript@5.1.6): + resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -781,26 +957,26 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.59.11 - '@typescript-eslint/types': 5.59.11 - '@typescript-eslint/typescript-estree': 5.59.11(typescript@5.1.6) + '@typescript-eslint/scope-manager': 5.62.0 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.1.6) debug: 4.3.4 - eslint: 8.46.0 + eslint: 8.47.0 typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/scope-manager@5.59.11: - resolution: {integrity: sha512-dHFOsxoLFtrIcSj5h0QoBT/89hxQONwmn3FOQ0GOQcLOOXm+MIrS8zEAhs4tWl5MraxCY3ZJpaXQQdFMc2Tu+Q==} + /@typescript-eslint/scope-manager@5.62.0: + resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.59.11 - '@typescript-eslint/visitor-keys': 5.59.11 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/visitor-keys': 5.62.0 dev: true - /@typescript-eslint/type-utils@5.59.11(eslint@8.46.0)(typescript@5.1.6): - resolution: {integrity: sha512-LZqVY8hMiVRF2a7/swmkStMYSoXMFlzL6sXV6U/2gL5cwnLWQgLEG8tjWPpaE4rMIdZ6VKWwcffPlo1jPfk43g==} + /@typescript-eslint/type-utils@5.62.0(eslint@8.47.0)(typescript@5.1.6): + resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -809,23 +985,23 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.59.11(typescript@5.1.6) - '@typescript-eslint/utils': 5.59.11(eslint@8.46.0)(typescript@5.1.6) + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.1.6) + '@typescript-eslint/utils': 5.62.0(eslint@8.47.0)(typescript@5.1.6) debug: 4.3.4 - eslint: 8.46.0 + eslint: 8.47.0 tsutils: 3.21.0(typescript@5.1.6) typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/types@5.59.11: - resolution: {integrity: sha512-epoN6R6tkvBYSc+cllrz+c2sOFWkbisJZWkOE+y3xHtvYaOE6Wk6B8e114McRJwFRjGvYdJwLXQH5c9osME/AA==} + /@typescript-eslint/types@5.62.0: + resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree@5.59.11(typescript@5.1.6): - resolution: {integrity: sha512-YupOpot5hJO0maupJXixi6l5ETdrITxeo5eBOeuV7RSKgYdU3G5cxO49/9WRnJq9EMrB7AuTSLH/bqOsXi7wPA==} + /@typescript-eslint/typescript-estree@5.62.0(typescript@5.1.6): + resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: typescript: '*' @@ -833,44 +1009,44 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.59.11 - '@typescript-eslint/visitor-keys': 5.59.11 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/visitor-keys': 5.62.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.5.3 + semver: 7.5.4 tsutils: 3.21.0(typescript@5.1.6) typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@5.59.11(eslint@8.46.0)(typescript@5.1.6): - resolution: {integrity: sha512-didu2rHSOMUdJThLk4aZ1Or8IcO3HzCw/ZvEjTTIfjIrcdd5cvSIwwDy2AOlE7htSNp7QIZ10fLMyRCveesMLg==} + /@typescript-eslint/utils@5.62.0(eslint@8.47.0)(typescript@5.1.6): + resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.46.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.47.0) '@types/json-schema': 7.0.12 '@types/semver': 7.5.0 - '@typescript-eslint/scope-manager': 5.59.11 - '@typescript-eslint/types': 5.59.11 - '@typescript-eslint/typescript-estree': 5.59.11(typescript@5.1.6) - eslint: 8.46.0 + '@typescript-eslint/scope-manager': 5.62.0 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.1.6) + eslint: 8.47.0 eslint-scope: 5.1.1 - semver: 7.5.3 + semver: 7.5.4 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/visitor-keys@5.59.11: - resolution: {integrity: sha512-KGYniTGG3AMTuKF9QBD7EIrvufkB6O6uX3knP73xbKLMpH+QRPcgnCxjWXSHjMRuOxFLovljqQgQpR0c7GvjoA==} + /@typescript-eslint/visitor-keys@5.62.0: + resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.59.11 - eslint-visitor-keys: 3.4.1 + '@typescript-eslint/types': 5.62.0 + eslint-visitor-keys: 3.4.3 dev: true /@vitest/coverage-v8@0.34.1(vitest@0.34.1): @@ -883,7 +1059,7 @@ packages: istanbul-lib-coverage: 3.2.0 istanbul-lib-report: 3.0.1 istanbul-lib-source-maps: 4.0.1 - istanbul-reports: 3.1.5 + istanbul-reports: 3.1.6 magic-string: 0.30.2 picocolors: 1.0.0 std-env: 3.3.3 @@ -915,7 +1091,7 @@ packages: dependencies: magic-string: 0.30.2 pathe: 1.1.1 - pretty-format: 29.6.0 + pretty-format: 29.6.2 dev: true /@vitest/spy@0.34.1: @@ -929,15 +1105,15 @@ packages: dependencies: diff-sequences: 29.4.3 loupe: 2.3.6 - pretty-format: 29.6.0 + pretty-format: 29.6.2 dev: true - /acorn-jsx@5.3.2(acorn@8.9.0): + /acorn-jsx@5.3.2(acorn@8.10.0): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.9.0 + acorn: 8.10.0 dev: true /acorn-walk@8.2.0: @@ -945,8 +1121,8 @@ packages: engines: {node: '>=0.4.0'} dev: true - /acorn@8.9.0: - resolution: {integrity: sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==} + /acorn@8.10.0: + resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==} engines: {node: '>=0.4.0'} hasBin: true dev: true @@ -1019,7 +1195,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.22.1 get-intrinsic: 1.2.1 is-string: 1.0.7 dev: true @@ -1029,13 +1205,24 @@ packages: engines: {node: '>=8'} dev: true + /array.prototype.findlastindex@1.2.2: + resolution: {integrity: sha512-tb5thFFlUcp7NdNF6/MpDk/1r/4awWG1FIz3YqDf+/zJSTezBb+/5WViH41obXULHVpDzoiCLpJ/ZO9YbJMsdw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + es-abstract: 1.22.1 + es-shim-unscopables: 1.0.0 + get-intrinsic: 1.2.1 + dev: true + /array.prototype.flat@1.3.1: resolution: {integrity: sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.22.1 es-shim-unscopables: 1.0.0 dev: true @@ -1045,10 +1232,22 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.22.1 es-shim-unscopables: 1.0.0 dev: true + /arraybuffer.prototype.slice@1.0.1: + resolution: {integrity: sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==} + engines: {node: '>= 0.4'} + dependencies: + array-buffer-byte-length: 1.0.0 + call-bind: 1.0.2 + define-properties: 1.2.0 + get-intrinsic: 1.2.1 + is-array-buffer: 3.0.2 + is-shared-array-buffer: 1.0.2 + dev: true + /assertion-error@1.1.0: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} dev: true @@ -1099,15 +1298,15 @@ packages: fill-range: 7.0.1 dev: true - /browserslist@4.21.9: - resolution: {integrity: sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==} + /browserslist@4.21.10: + resolution: {integrity: sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001504 - electron-to-chromium: 1.4.433 - node-releases: 2.0.12 - update-browserslist-db: 1.0.11(browserslist@4.21.9) + caniuse-lite: 1.0.30001521 + electron-to-chromium: 1.4.492 + node-releases: 2.0.13 + update-browserslist-db: 1.0.11(browserslist@4.21.10) dev: true /builtin-modules@3.3.0: @@ -1118,7 +1317,7 @@ packages: /builtins@5.0.1: resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==} dependencies: - semver: 7.5.3 + semver: 7.5.4 dev: true /bundle-name@3.0.0: @@ -1137,7 +1336,7 @@ packages: giget: 1.1.2 jiti: 1.19.1 mlly: 1.4.0 - ohash: 1.1.2 + ohash: 1.1.3 pathe: 1.1.1 perfect-debounce: 1.0.0 pkg-types: 1.0.3 @@ -1163,8 +1362,8 @@ packages: engines: {node: '>=6'} dev: true - /caniuse-lite@1.0.30001504: - resolution: {integrity: sha512-5uo7eoOp2mKbWyfMXnGO9rJWOGU8duvzEiYITW+wivukL7yHH4gX9yuRaobu6El4jPxo6jKZfG+N6fB621GD/Q==} + /caniuse-lite@1.0.30001521: + resolution: {integrity: sha512-fnx1grfpEOvDGH+V17eccmNjucGUnCbP6KL+l5KqBIerp26WK/+RQ7CIDE37KGJjaPyqWXXlFUyKiWmvdNNKmQ==} dev: true /chai@4.3.7: @@ -1198,8 +1397,8 @@ packages: supports-color: 7.2.0 dev: true - /chalk@5.2.0: - resolution: {integrity: sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==} + /chalk@5.3.0: + resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} dev: true @@ -1209,7 +1408,7 @@ packages: dependencies: c12: 1.4.2 colorette: 2.0.20 - consola: 3.2.2 + consola: 3.2.3 convert-gitmoji: 0.1.3 execa: 7.2.0 mri: 1.2.0 @@ -1219,7 +1418,7 @@ packages: pathe: 1.1.1 pkg-types: 1.0.3 scule: 1.0.0 - semver: 7.5.3 + semver: 7.5.4 std-env: 3.3.3 yaml: 2.3.1 transitivePeerDependencies: @@ -1255,6 +1454,12 @@ packages: engines: {node: '>=8'} dev: true + /citty@0.1.2: + resolution: {integrity: sha512-Me9nf0/BEmMOnuQzMOVXgpzkMUNbd0Am8lTl/13p0aRGAoLGk5T5sdet/42CrIGmWdG67BgHUhcKK1my1ujUEg==} + dependencies: + consola: 3.2.3 + dev: true + /clean-regexp@1.0.0: resolution: {integrity: sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==} engines: {node: '>=4'} @@ -1297,12 +1502,8 @@ packages: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} dev: true - /consola@3.1.0: - resolution: {integrity: sha512-rrrJE6rP0qzl/Srg+C9x/AE5Kxfux7reVm1Wh0wCjuXvih6DqZgqDZe8auTD28fzJ9TF0mHlSDrPpWlujQRo1Q==} - dev: true - - /consola@3.2.2: - resolution: {integrity: sha512-r921u0vbF4lQsoIqYvSSER+yZLPQGijOHrYcWoCNVNBZmn/bRR+xT/DgerTze/nLD9TTGzdDa378TVhx7RDOYg==} + /consola@3.2.3: + resolution: {integrity: sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==} engines: {node: ^14.18.0 || >=16.10.0} dev: true @@ -1402,8 +1603,8 @@ packages: resolution: {integrity: sha512-+uO4+qr7msjNNWKYPHqN/3+Dx3NFkmIzayk2L1MyZQlvgZb/J1A0fo410dpKrN2SnqFjt8n4JL8fDJE0wIgjFQ==} dev: true - /destr@2.0.0: - resolution: {integrity: sha512-FJ9RDpf3GicEBvzI3jxc2XhHzbqD8p4ANw/1kPsFBfTvP1b7Gn/Lg1vO7R9J4IVgoMbyUmFrFGZafJ1hPZpvlg==} + /destr@2.0.1: + resolution: {integrity: sha512-M1Ob1zPSIvlARiJUkKqvAZ3VAqQY6Jcuth/pBKQ2b1dX/Qx0OnJ8Vux6J2H5PTMQeRzWrrbTu70VxBfv/OPDJA==} dev: true /diff-sequences@29.4.3: @@ -1437,8 +1638,8 @@ packages: engines: {node: '>=12'} dev: true - /electron-to-chromium@1.4.433: - resolution: {integrity: sha512-MGO1k0w1RgrfdbLVwmXcDhHHuxCn2qRgR7dYsJvWFKDttvYPx6FNzCGG0c/fBBvzK2LDh3UV7Tt9awnHnvAAUQ==} + /electron-to-chromium@1.4.492: + resolution: {integrity: sha512-36K9b/6skMVwAIEsC7GiQ8I8N3soCALVSHqWHzNDtGemAcI9Xu8hP02cywWM0A794rTHm0b0zHPeLJHtgFVamQ==} dev: true /enhanced-resolve@5.15.0: @@ -1455,11 +1656,12 @@ packages: is-arrayish: 0.2.1 dev: true - /es-abstract@1.21.2: - resolution: {integrity: sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==} + /es-abstract@1.22.1: + resolution: {integrity: sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==} engines: {node: '>= 0.4'} dependencies: array-buffer-byte-length: 1.0.0 + arraybuffer.prototype.slice: 1.0.1 available-typed-arrays: 1.0.5 call-bind: 1.0.2 es-set-tostringtag: 2.0.1 @@ -1480,19 +1682,23 @@ packages: is-regex: 1.1.4 is-shared-array-buffer: 1.0.2 is-string: 1.0.7 - is-typed-array: 1.1.10 + is-typed-array: 1.1.12 is-weakref: 1.0.2 object-inspect: 1.12.3 object-keys: 1.1.1 object.assign: 4.1.4 regexp.prototype.flags: 1.5.0 + safe-array-concat: 1.0.0 safe-regex-test: 1.0.0 string.prototype.trim: 1.2.7 string.prototype.trimend: 1.0.6 string.prototype.trimstart: 1.0.6 + typed-array-buffer: 1.0.0 + typed-array-byte-length: 1.0.0 + typed-array-byte-offset: 1.0.0 typed-array-length: 1.0.4 unbox-primitive: 1.0.2 - which-typed-array: 1.1.9 + which-typed-array: 1.1.11 dev: true /es-set-tostringtag@2.0.1: @@ -1549,6 +1755,36 @@ packages: '@esbuild/win32-x64': 0.17.19 dev: true + /esbuild@0.18.20: + resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/android-arm': 0.18.20 + '@esbuild/android-arm64': 0.18.20 + '@esbuild/android-x64': 0.18.20 + '@esbuild/darwin-arm64': 0.18.20 + '@esbuild/darwin-x64': 0.18.20 + '@esbuild/freebsd-arm64': 0.18.20 + '@esbuild/freebsd-x64': 0.18.20 + '@esbuild/linux-arm': 0.18.20 + '@esbuild/linux-arm64': 0.18.20 + '@esbuild/linux-ia32': 0.18.20 + '@esbuild/linux-loong64': 0.18.20 + '@esbuild/linux-mips64el': 0.18.20 + '@esbuild/linux-ppc64': 0.18.20 + '@esbuild/linux-riscv64': 0.18.20 + '@esbuild/linux-s390x': 0.18.20 + '@esbuild/linux-x64': 0.18.20 + '@esbuild/netbsd-x64': 0.18.20 + '@esbuild/openbsd-x64': 0.18.20 + '@esbuild/sunos-x64': 0.18.20 + '@esbuild/win32-arm64': 0.18.20 + '@esbuild/win32-ia32': 0.18.20 + '@esbuild/win32-x64': 0.18.20 + dev: true + /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} @@ -1564,16 +1800,16 @@ packages: engines: {node: '>=10'} dev: true - /eslint-config-prettier@8.8.0(eslint@8.46.0): - resolution: {integrity: sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==} + /eslint-config-prettier@8.10.0(eslint@8.47.0): + resolution: {integrity: sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.46.0 + eslint: 8.47.0 dev: true - /eslint-config-standard@17.1.0(eslint-plugin-import@2.27.5)(eslint-plugin-n@16.0.0)(eslint-plugin-promise@6.1.1)(eslint@8.46.0): + /eslint-config-standard@17.1.0(eslint-plugin-import@2.28.0)(eslint-plugin-n@16.0.1)(eslint-plugin-promise@6.1.1)(eslint@8.47.0): resolution: {integrity: sha512-IwHwmaBNtDK4zDHQukFDW5u/aTb8+meQWZvNFWkiGmbWjD6bqyuSSBxxXKkCftCUzc1zwCH2m/baCNDLGmuO5Q==} engines: {node: '>=12.0.0'} peerDependencies: @@ -1582,29 +1818,29 @@ packages: eslint-plugin-n: '^15.0.0 || ^16.0.0 ' eslint-plugin-promise: ^6.0.0 dependencies: - eslint: 8.46.0 - eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.59.11)(eslint-import-resolver-typescript@3.5.5)(eslint@8.46.0) - eslint-plugin-n: 16.0.0(eslint@8.46.0) - eslint-plugin-promise: 6.1.1(eslint@8.46.0) + eslint: 8.47.0 + eslint-plugin-import: 2.28.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-typescript@3.6.0)(eslint@8.47.0) + eslint-plugin-n: 16.0.1(eslint@8.47.0) + eslint-plugin-promise: 6.1.1(eslint@8.47.0) dev: true - /eslint-config-unjs@0.2.1(eslint@8.46.0)(typescript@5.1.6): + /eslint-config-unjs@0.2.1(eslint@8.47.0)(typescript@5.1.6): resolution: {integrity: sha512-h17q+WR86glq8yLFuHfEnAFfbEYqXpJAppXc0e0fQz0gsotJQ14BZVrlvIThE2a+stWyh0VT73gbBPfosl2rVA==} peerDependencies: eslint: '*' typescript: '*' dependencies: - '@typescript-eslint/eslint-plugin': 5.59.11(@typescript-eslint/parser@5.59.11)(eslint@8.46.0)(typescript@5.1.6) - '@typescript-eslint/parser': 5.59.11(eslint@8.46.0)(typescript@5.1.6) - eslint: 8.46.0 - eslint-config-prettier: 8.8.0(eslint@8.46.0) - eslint-config-standard: 17.1.0(eslint-plugin-import@2.27.5)(eslint-plugin-n@16.0.0)(eslint-plugin-promise@6.1.1)(eslint@8.46.0) - eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/parser@5.59.11)(eslint-plugin-import@2.27.5)(eslint@8.46.0) - eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.59.11)(eslint-import-resolver-typescript@3.5.5)(eslint@8.46.0) - eslint-plugin-n: 16.0.0(eslint@8.46.0) - eslint-plugin-node: 11.1.0(eslint@8.46.0) - eslint-plugin-promise: 6.1.1(eslint@8.46.0) - eslint-plugin-unicorn: 47.0.0(eslint@8.46.0) + '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.47.0)(typescript@5.1.6) + '@typescript-eslint/parser': 5.62.0(eslint@8.47.0)(typescript@5.1.6) + eslint: 8.47.0 + eslint-config-prettier: 8.10.0(eslint@8.47.0) + eslint-config-standard: 17.1.0(eslint-plugin-import@2.28.0)(eslint-plugin-n@16.0.1)(eslint-plugin-promise@6.1.1)(eslint@8.47.0) + eslint-import-resolver-typescript: 3.6.0(@typescript-eslint/parser@5.62.0)(eslint-plugin-import@2.28.0)(eslint@8.47.0) + eslint-plugin-import: 2.28.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-typescript@3.6.0)(eslint@8.47.0) + eslint-plugin-n: 16.0.1(eslint@8.47.0) + eslint-plugin-node: 11.1.0(eslint@8.47.0) + eslint-plugin-promise: 6.1.1(eslint@8.47.0) + eslint-plugin-unicorn: 47.0.0(eslint@8.47.0) typescript: 5.1.6 transitivePeerDependencies: - eslint-import-resolver-node @@ -1612,18 +1848,18 @@ packages: - supports-color dev: true - /eslint-import-resolver-node@0.3.7: - resolution: {integrity: sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==} + /eslint-import-resolver-node@0.3.9: + resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} dependencies: debug: 3.2.7 - is-core-module: 2.12.1 - resolve: 1.22.2 + is-core-module: 2.13.0 + resolve: 1.22.4 transitivePeerDependencies: - supports-color dev: true - /eslint-import-resolver-typescript@3.5.5(@typescript-eslint/parser@5.59.11)(eslint-plugin-import@2.27.5)(eslint@8.46.0): - resolution: {integrity: sha512-TdJqPHs2lW5J9Zpe17DZNQuDnox4xo2o+0tE7Pggain9Rbc19ik8kFtXdxZ250FVx2kF4vlt2RSf4qlUpG7bhw==} + /eslint-import-resolver-typescript@3.6.0(@typescript-eslint/parser@5.62.0)(eslint-plugin-import@2.28.0)(eslint@8.47.0): + resolution: {integrity: sha512-QTHR9ddNnn35RTxlaEnx2gCxqFlF2SEN0SE2d17SqwyM7YOSI2GHWRYp5BiRkObTUNYPupC/3Fq2a0PpT+EKpg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -1631,14 +1867,13 @@ packages: dependencies: debug: 4.3.4 enhanced-resolve: 5.15.0 - eslint: 8.46.0 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.59.11)(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.5)(eslint@8.46.0) - eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.59.11)(eslint-import-resolver-typescript@3.5.5)(eslint@8.46.0) - get-tsconfig: 4.6.0 - globby: 13.1.4 - is-core-module: 2.12.1 + eslint: 8.47.0 + eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.0)(eslint@8.47.0) + eslint-plugin-import: 2.28.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-typescript@3.6.0)(eslint@8.47.0) + fast-glob: 3.3.1 + get-tsconfig: 4.7.0 + is-core-module: 2.13.0 is-glob: 4.0.3 - synckit: 0.8.5 transitivePeerDependencies: - '@typescript-eslint/parser' - eslint-import-resolver-node @@ -1646,7 +1881,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.0(@typescript-eslint/parser@5.59.11)(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.5)(eslint@8.46.0): + /eslint-module-utils@2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.0)(eslint@8.47.0): resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: @@ -1667,39 +1902,39 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.59.11(eslint@8.46.0)(typescript@5.1.6) + '@typescript-eslint/parser': 5.62.0(eslint@8.47.0)(typescript@5.1.6) debug: 3.2.7 - eslint: 8.46.0 - eslint-import-resolver-node: 0.3.7 - eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/parser@5.59.11)(eslint-plugin-import@2.27.5)(eslint@8.46.0) + eslint: 8.47.0 + eslint-import-resolver-node: 0.3.9 + eslint-import-resolver-typescript: 3.6.0(@typescript-eslint/parser@5.62.0)(eslint-plugin-import@2.28.0)(eslint@8.47.0) transitivePeerDependencies: - supports-color dev: true - /eslint-plugin-es-x@6.2.1(eslint@8.46.0): - resolution: {integrity: sha512-uR34zUhZ9EBoiSD2DdV5kHLpydVEvwWqjteUr9sXRgJknwbKZJZhdJ7uFnaTtd+Nr/2G3ceJHnHXrFhJ67n3Tw==} + /eslint-plugin-es-x@7.2.0(eslint@8.47.0): + resolution: {integrity: sha512-9dvv5CcvNjSJPqnS5uZkqb3xmbeqRLnvXKK7iI5+oK/yTusyc46zbBZKENGsOfojm/mKfszyZb+wNqNPAPeGXA==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: eslint: '>=8' dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.46.0) - '@eslint-community/regexpp': 4.5.1 - eslint: 8.46.0 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.47.0) + '@eslint-community/regexpp': 4.6.2 + eslint: 8.47.0 dev: true - /eslint-plugin-es@3.0.1(eslint@8.46.0): + /eslint-plugin-es@3.0.1(eslint@8.47.0): resolution: {integrity: sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==} engines: {node: '>=8.10.0'} peerDependencies: eslint: '>=4.19.1' dependencies: - eslint: 8.46.0 + eslint: 8.47.0 eslint-utils: 2.1.0 regexpp: 3.2.0 dev: true - /eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.59.11)(eslint-import-resolver-typescript@3.5.5)(eslint@8.46.0): - resolution: {integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==} + /eslint-plugin-import@2.28.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-typescript@3.6.0)(eslint@8.47.0): + resolution: {integrity: sha512-B8s/n+ZluN7sxj9eUf7/pRFERX0r5bnFA2dCaLHy2ZeaQEAz0k+ZZkFWRFHJAqxfxQDx6KLv9LeIki7cFdwW+Q==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' @@ -1708,22 +1943,25 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.59.11(eslint@8.46.0)(typescript@5.1.6) + '@typescript-eslint/parser': 5.62.0(eslint@8.47.0)(typescript@5.1.6) array-includes: 3.1.6 + array.prototype.findlastindex: 1.2.2 array.prototype.flat: 1.3.1 array.prototype.flatmap: 1.3.1 debug: 3.2.7 doctrine: 2.1.0 - eslint: 8.46.0 - eslint-import-resolver-node: 0.3.7 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.59.11)(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.5)(eslint@8.46.0) + eslint: 8.47.0 + eslint-import-resolver-node: 0.3.9 + eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.0)(eslint@8.47.0) has: 1.0.3 - is-core-module: 2.12.1 + is-core-module: 2.13.0 is-glob: 4.0.3 minimatch: 3.1.2 + object.fromentries: 2.0.6 + object.groupby: 1.0.0 object.values: 1.1.6 - resolve: 1.22.2 - semver: 6.3.0 + resolve: 1.22.4 + semver: 6.3.1 tsconfig-paths: 3.14.2 transitivePeerDependencies: - eslint-import-resolver-typescript @@ -1731,58 +1969,58 @@ packages: - supports-color dev: true - /eslint-plugin-n@16.0.0(eslint@8.46.0): - resolution: {integrity: sha512-akkZTE3hsHBrq6CwmGuYCzQREbVUrA855kzcHqe6i0FLBkeY7Y/6tThCVkjUnjhvRBAlc+8lILcSe5QvvDpeZQ==} + /eslint-plugin-n@16.0.1(eslint@8.47.0): + resolution: {integrity: sha512-CDmHegJN0OF3L5cz5tATH84RPQm9kG+Yx39wIqIwPR2C0uhBGMWfbbOtetR83PQjjidA5aXMu+LEFw1jaSwvTA==} engines: {node: '>=16.0.0'} peerDependencies: eslint: '>=7.0.0' dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.46.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.47.0) builtins: 5.0.1 - eslint: 8.46.0 - eslint-plugin-es-x: 6.2.1(eslint@8.46.0) + eslint: 8.47.0 + eslint-plugin-es-x: 7.2.0(eslint@8.47.0) ignore: 5.2.4 - is-core-module: 2.12.1 + is-core-module: 2.13.0 minimatch: 3.1.2 - resolve: 1.22.2 - semver: 7.5.3 + resolve: 1.22.4 + semver: 7.5.4 dev: true - /eslint-plugin-node@11.1.0(eslint@8.46.0): + /eslint-plugin-node@11.1.0(eslint@8.47.0): resolution: {integrity: sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==} engines: {node: '>=8.10.0'} peerDependencies: eslint: '>=5.16.0' dependencies: - eslint: 8.46.0 - eslint-plugin-es: 3.0.1(eslint@8.46.0) + eslint: 8.47.0 + eslint-plugin-es: 3.0.1(eslint@8.47.0) eslint-utils: 2.1.0 ignore: 5.2.4 minimatch: 3.1.2 - resolve: 1.22.2 - semver: 6.3.0 + resolve: 1.22.4 + semver: 6.3.1 dev: true - /eslint-plugin-promise@6.1.1(eslint@8.46.0): + /eslint-plugin-promise@6.1.1(eslint@8.47.0): resolution: {integrity: sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 dependencies: - eslint: 8.46.0 + eslint: 8.47.0 dev: true - /eslint-plugin-unicorn@47.0.0(eslint@8.46.0): + /eslint-plugin-unicorn@47.0.0(eslint@8.47.0): resolution: {integrity: sha512-ivB3bKk7fDIeWOUmmMm9o3Ax9zbMz1Bsza/R2qm46ufw4T6VBFBaJIR1uN3pCKSmSXm8/9Nri8V+iUut1NhQGA==} engines: {node: '>=16'} peerDependencies: eslint: '>=8.38.0' dependencies: '@babel/helper-validator-identifier': 7.22.5 - '@eslint-community/eslint-utils': 4.4.0(eslint@8.46.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.47.0) ci-info: 3.8.0 clean-regexp: 1.0.0 - eslint: 8.46.0 + eslint: 8.47.0 esquery: 1.5.0 indent-string: 4.0.0 is-builtin-module: 3.2.1 @@ -1793,7 +2031,7 @@ packages: regexp-tree: 0.1.27 regjsparser: 0.10.0 safe-regex: 2.1.1 - semver: 7.5.3 + semver: 7.5.4 strip-indent: 3.0.0 dev: true @@ -1825,25 +2063,20 @@ packages: engines: {node: '>=4'} dev: true - /eslint-visitor-keys@3.4.1: - resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true - - /eslint-visitor-keys@3.4.2: - resolution: {integrity: sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw==} + /eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint@8.46.0: - resolution: {integrity: sha512-cIO74PvbW0qU8e0mIvk5IV3ToWdCq5FYG6gWPHHkx6gNdjlbAYvtfHmlCMXxjcoVaIdwy/IAt3+mDkZkfvb2Dg==} + /eslint@8.47.0: + resolution: {integrity: sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.46.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.47.0) '@eslint-community/regexpp': 4.6.2 - '@eslint/eslintrc': 2.1.1 - '@eslint/js': 8.46.0 + '@eslint/eslintrc': 2.1.2 + '@eslint/js': 8.47.0 '@humanwhocodes/config-array': 0.11.10 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 @@ -1854,7 +2087,7 @@ packages: doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.2 + eslint-visitor-keys: 3.4.3 espree: 9.6.1 esquery: 1.5.0 esutils: 2.0.3 @@ -1862,7 +2095,7 @@ packages: file-entry-cache: 6.0.1 find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.20.0 + globals: 13.21.0 graphemer: 1.4.0 ignore: 5.2.4 imurmurhash: 0.1.4 @@ -1885,9 +2118,9 @@ packages: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - acorn: 8.9.0 - acorn-jsx: 5.3.2(acorn@8.9.0) - eslint-visitor-keys: 3.4.2 + acorn: 8.10.0 + acorn-jsx: 5.3.2(acorn@8.10.0) + eslint-visitor-keys: 3.4.3 dev: true /esquery@1.5.0: @@ -1956,8 +2189,8 @@ packages: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true - /fast-glob@3.2.12: - resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} + /fast-glob@3.3.1: + resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==} engines: {node: '>=8.6.0'} dependencies: '@nodelib/fs.stat': 2.0.5 @@ -2072,7 +2305,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.22.1 functions-have-names: 1.2.3 dev: true @@ -2110,8 +2343,8 @@ packages: get-intrinsic: 1.2.1 dev: true - /get-tsconfig@4.6.0: - resolution: {integrity: sha512-lgbo68hHTQnFddybKbbs/RDRJnJT5YyGy2kQzVwbq+g67X73i+5MVTval34QxGkOe9X5Ujf1UYpCaphLyltjEg==} + /get-tsconfig@4.7.0: + resolution: {integrity: sha512-pmjiZ7xtB8URYm74PlGJozDNyhvsVLUcpBa8DZBG3bWHwaHa9bPiRpiSfovw+fjhwONSCWKRyk+JQHEGZmMrzw==} dependencies: resolve-pkg-maps: 1.0.0 dev: true @@ -2172,8 +2405,8 @@ packages: engines: {node: '>=4'} dev: true - /globals@13.20.0: - resolution: {integrity: sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==} + /globals@13.21.0: + resolution: {integrity: sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==} engines: {node: '>=8'} dependencies: type-fest: 0.20.2 @@ -2192,18 +2425,18 @@ packages: dependencies: array-union: 2.1.0 dir-glob: 3.0.1 - fast-glob: 3.2.12 + fast-glob: 3.3.1 ignore: 5.2.4 merge2: 1.4.1 slash: 3.0.0 dev: true - /globby@13.1.4: - resolution: {integrity: sha512-iui/IiiW+QrJ1X1hKH5qwlMQyv34wJAYwH1vrf8b9kBA4sNiif3gKsMHa+BrdnOpEudWjpotfa7LrTzB1ERS/g==} + /globby@13.2.2: + resolution: {integrity: sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: dir-glob: 3.0.1 - fast-glob: 3.2.12 + fast-glob: 3.3.1 ignore: 5.2.4 merge2: 1.4.1 slash: 4.0.0 @@ -2219,10 +2452,6 @@ packages: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} dev: true - /grapheme-splitter@1.0.4: - resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} - dev: true - /graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} dev: true @@ -2351,7 +2580,7 @@ packages: dependencies: call-bind: 1.0.2 get-intrinsic: 1.2.1 - is-typed-array: 1.1.10 + is-typed-array: 1.1.12 dev: true /is-arrayish@0.2.1: @@ -2391,8 +2620,8 @@ packages: engines: {node: '>= 0.4'} dev: true - /is-core-module@2.12.1: - resolution: {integrity: sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==} + /is-core-module@2.13.0: + resolution: {integrity: sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==} dependencies: has: 1.0.3 dev: true @@ -2505,15 +2734,11 @@ packages: has-symbols: 1.0.3 dev: true - /is-typed-array@1.1.10: - resolution: {integrity: sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==} + /is-typed-array@1.1.12: + resolution: {integrity: sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==} engines: {node: '>= 0.4'} dependencies: - available-typed-arrays: 1.0.5 - call-bind: 1.0.2 - for-each: 0.3.3 - gopd: 1.0.1 - has-tostringtag: 1.0.0 + which-typed-array: 1.1.11 dev: true /is-weakref@1.0.2: @@ -2529,6 +2754,10 @@ packages: is-docker: 2.2.1 dev: true + /isarray@2.0.5: + resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + dev: true + /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -2557,8 +2786,8 @@ packages: - supports-color dev: true - /istanbul-reports@3.1.5: - resolution: {integrity: sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==} + /istanbul-reports@3.1.6: + resolution: {integrity: sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==} engines: {node: '>=8'} dependencies: html-escaper: 2.0.2 @@ -2701,13 +2930,6 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: true - /magic-string@0.30.0: - resolution: {integrity: sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==} - engines: {node: '>=12'} - dependencies: - '@jridgewell/sourcemap-codec': 1.4.15 - dev: true - /magic-string@0.30.2: resolution: {integrity: sha512-lNZdu7pewtq/ZvWUp9Wpf/x7WzMTsR26TWV03BRZrXFsv+BI6dy8RAiKgm1uM/kyR0rCfUcqvOlXKG66KhIGug==} engines: {node: '>=12'} @@ -2719,7 +2941,7 @@ packages: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} dependencies: - semver: 7.5.3 + semver: 7.5.4 dev: true /merge-stream@2.0.0: @@ -2795,22 +3017,23 @@ packages: hasBin: true dev: true - /mkdist@1.2.0(typescript@5.1.6): - resolution: {integrity: sha512-UTqu/bXmIk/+VKNVgufAeMyjUcNy1dn9Bl7wL1zZlCKVrpDgj/VllmZBeh3ZCC/2HWqUrt6frNFTKt9TRZbNvQ==} + /mkdist@1.3.0(typescript@5.1.6): + resolution: {integrity: sha512-ZQrUvcL7LkRdzMREpDyg9AT18N9Tl5jc2qeKAUeEw0KGsgykbHbuRvysGAzTuGtwuSg0WQyNit5jh/k+Er3JEg==} hasBin: true peerDependencies: - sass: ^1.60.0 - typescript: '>=4.9.5' + sass: ^1.63.6 + typescript: '>=5.1.6' peerDependenciesMeta: sass: optional: true typescript: optional: true dependencies: + citty: 0.1.2 defu: 6.1.2 - esbuild: 0.17.19 + esbuild: 0.18.20 fs-extra: 11.1.1 - globby: 13.1.4 + globby: 13.2.2 jiti: 1.19.1 mlly: 1.4.0 mri: 1.2.0 @@ -2818,22 +3041,13 @@ packages: typescript: 5.1.6 dev: true - /mlly@1.3.0: - resolution: {integrity: sha512-HT5mcgIQKkOrZecOjOX3DJorTikWXwsBfpcr/MGBkhfWcjiqvnaL/9ppxvIUXfjT6xt4DVIAsN9fMUz1ev4bIw==} - dependencies: - acorn: 8.9.0 - pathe: 1.1.1 - pkg-types: 1.0.3 - ufo: 1.1.2 - dev: true - /mlly@1.4.0: resolution: {integrity: sha512-ua8PAThnTwpprIaU47EPeZ/bPUVp2QYBbWMphUQpVdBI3Lgqzm5KZQ45Agm3YJedHXaIHl6pBGabaLSUPPSptg==} dependencies: - acorn: 8.9.0 + acorn: 8.10.0 pathe: 1.1.1 pkg-types: 1.0.3 - ufo: 1.1.2 + ufo: 1.2.0 dev: true /mri@1.2.0: @@ -2867,16 +3081,16 @@ packages: resolution: {integrity: sha512-5IAMBTl9p6PaAjYCnMv5FmqIF6GcZnawAVnzaCG0rX2aYZJ4CxEkZNtVPuTRug7fL7wyM5BQYTlAzcyMPi6oTQ==} dev: true - /node-releases@2.0.12: - resolution: {integrity: sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==} + /node-releases@2.0.13: + resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} dev: true /normalize-package-data@2.5.0: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: hosted-git-info: 2.8.9 - resolve: 1.22.2 - semver: 5.7.1 + resolve: 1.22.4 + semver: 5.7.2 validate-npm-package-license: 3.0.4 dev: true @@ -2917,25 +3131,43 @@ packages: object-keys: 1.1.1 dev: true + /object.fromentries@2.0.6: + resolution: {integrity: sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + es-abstract: 1.22.1 + dev: true + + /object.groupby@1.0.0: + resolution: {integrity: sha512-70MWG6NfRH9GnbZOikuhPPYzpUpof9iW2J9E4dW7FXTqPNb6rllE6u39SKwwiNh8lCwX3DDb5OgcKGiEBrTTyw==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + es-abstract: 1.22.1 + get-intrinsic: 1.2.1 + dev: true + /object.values@1.1.6: resolution: {integrity: sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.22.1 dev: true /ofetch@1.1.1: resolution: {integrity: sha512-SSMoktrp9SNLi20BWfB/BnnKcL0RDigXThD/mZBeQxkIRv1xrd9183MtLdsqRYLYSqW0eTr5t8w8MqjNhvoOQQ==} dependencies: - destr: 2.0.0 + destr: 2.0.1 node-fetch-native: 1.2.0 - ufo: 1.1.2 + ufo: 1.2.0 dev: true - /ohash@1.1.2: - resolution: {integrity: sha512-9CIOSq5945rI045GFtcO3uudyOkYVY1nyfFxVQp+9BRgslr8jPNiSSrsFGg/BNTUFOLqx0P5tng6G32brIPw0w==} + /ohash@1.1.3: + resolution: {integrity: sha512-zuHHiGTYTA1sYJ/wZN+t5HKZaH23i4yI1HMwbuXm24Nid7Dv0KcuRlKoNKS9UNfAVSBlnGLcuQrnOKWOZoEGaw==} dev: true /once@1.4.0: @@ -3030,7 +3262,7 @@ packages: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} dependencies: - '@babel/code-frame': 7.22.5 + '@babel/code-frame': 7.22.10 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -3097,8 +3329,8 @@ packages: engines: {node: '>=4'} dev: true - /postcss@8.4.24: - resolution: {integrity: sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==} + /postcss@8.4.28: + resolution: {integrity: sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw==} engines: {node: ^10 || ^12 || >=14} dependencies: nanoid: 3.3.6 @@ -3111,19 +3343,19 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} + /prettier@3.0.2: + resolution: {integrity: sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ==} + engines: {node: '>=14'} hasBin: true dev: true - /pretty-bytes@6.1.0: - resolution: {integrity: sha512-Rk753HI8f4uivXi4ZCIYdhmG1V+WKzvRMg/X+M42a6t7D07RcmopXJMDNk6N++7Bl75URRGsb40ruvg7Hcp2wQ==} + /pretty-bytes@6.1.1: + resolution: {integrity: sha512-mQUvGU6aUFQ+rNvTIAcZuWGRT9a6f6Yrg9bHs4ImKF+HZCEK+plBvnAZYSIQztknZF2qnzNtr6F8s0+IuptdlQ==} engines: {node: ^14.13.1 || >=16.0.0} dev: true - /pretty-format@29.6.0: - resolution: {integrity: sha512-XH+D4n7Ey0iSR6PdAnBs99cWMZdGsdKrR33iUHQNr79w1szKTCIZDVdXuccAsHVwDBp0XeWPfNEoaxP9EZgRmQ==} + /pretty-format@29.6.2: + resolution: {integrity: sha512-1q0oC8eRveTg5nnBEWMXAU2qpv65Gnuf2eCQzSjxpWFkPaPARwqZZDGuNE0zPAZfTCHzIk3A8dIjwlQKKLphyg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/schemas': 29.6.0 @@ -3144,7 +3376,7 @@ packages: resolution: {integrity: sha512-lNeOl38Ws0eNxpO3+wD1I9rkHGQyj1NU1jlzv4go2CtEnEQEUfqnIvZG7W+bC/aXdJ27n5x/yUjb6RoT9tko+Q==} dependencies: defu: 6.1.2 - destr: 2.0.0 + destr: 2.0.1 flat: 5.0.2 dev: true @@ -3213,11 +3445,11 @@ packages: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} dev: true - /resolve@1.22.2: - resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} + /resolve@1.22.4: + resolution: {integrity: sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==} hasBin: true dependencies: - is-core-module: 2.12.1 + is-core-module: 2.13.0 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 dev: true @@ -3234,22 +3466,22 @@ packages: glob: 7.2.3 dev: true - /rollup-plugin-dts@5.3.0(rollup@3.25.1)(typescript@5.1.6): - resolution: {integrity: sha512-8FXp0ZkyZj1iU5klkIJYLjIq/YZSwBoERu33QBDxm/1yw5UU4txrEtcmMkrq+ZiKu3Q4qvPCNqc3ovX6rjqzbQ==} - engines: {node: '>=v14'} + /rollup-plugin-dts@5.3.1(rollup@3.28.0)(typescript@5.1.6): + resolution: {integrity: sha512-gusMi+Z4gY/JaEQeXnB0RUdU82h1kF0WYzCWgVmV4p3hWXqelaKuCvcJawfeg+EKn2T1Ie+YWF2OiN1/L8bTVg==} + engines: {node: '>=v14.21.3'} peerDependencies: - rollup: ^3.0.0 + rollup: ^3.0 typescript: ^4.1 || ^5.0 dependencies: - magic-string: 0.30.0 - rollup: 3.25.1 + magic-string: 0.30.2 + rollup: 3.28.0 typescript: 5.1.6 optionalDependencies: - '@babel/code-frame': 7.22.5 + '@babel/code-frame': 7.22.10 dev: true - /rollup@3.25.1: - resolution: {integrity: sha512-tywOR+rwIt5m2ZAWSe5AIJcTat8vGlnPFAv15ycCrw33t6iFsXZ6mzHVFh2psSjxQPmI+xgzMZZizUAukBI4aQ==} + /rollup@3.28.0: + resolution: {integrity: sha512-d7zhvo1OUY2SXSM6pfNjgD5+d0Nz87CUp4mt8l/GgVP3oBsPwzNvSzyu1me6BSG9JIgWNTVcafIXBIyM8yQ3yw==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: @@ -3269,6 +3501,16 @@ packages: queue-microtask: 1.2.3 dev: true + /safe-array-concat@1.0.0: + resolution: {integrity: sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==} + engines: {node: '>=0.4'} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.2.1 + has-symbols: 1.0.3 + isarray: 2.0.5 + dev: true + /safe-regex-test@1.0.0: resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} dependencies: @@ -3287,18 +3529,18 @@ packages: resolution: {integrity: sha512-4AsO/FrViE/iDNEPaAQlb77tf0csuq27EsVpy6ett584EcRTp6pTDLoGWVxCD77y5iU5FauOvhsI4o1APwPoSQ==} dev: true - /semver@5.7.1: - resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} + /semver@5.7.2: + resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} hasBin: true dev: true - /semver@6.3.0: - resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} + /semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true dev: true - /semver@7.5.3: - resolution: {integrity: sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==} + /semver@7.5.4: + resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} engines: {node: '>=10'} hasBin: true dependencies: @@ -3386,7 +3628,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.22.1 dev: true /string.prototype.trimend@1.0.6: @@ -3394,7 +3636,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.22.1 dev: true /string.prototype.trimstart@1.0.6: @@ -3402,7 +3644,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.22.1 dev: true /strip-ansi@6.0.1: @@ -3438,10 +3680,10 @@ packages: engines: {node: '>=8'} dev: true - /strip-literal@1.0.1: - resolution: {integrity: sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==} + /strip-literal@1.3.0: + resolution: {integrity: sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==} dependencies: - acorn: 8.9.0 + acorn: 8.10.0 dev: true /supports-color@5.5.0: @@ -3464,14 +3706,6 @@ packages: engines: {node: '>= 0.4'} dev: true - /synckit@0.8.5: - resolution: {integrity: sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==} - engines: {node: ^14.18.0 || >=16.0.0} - dependencies: - '@pkgr/utils': 2.4.1 - tslib: 2.5.3 - dev: true - /tapable@2.2.1: resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} engines: {node: '>=6'} @@ -3546,10 +3780,6 @@ packages: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true - /tslib@2.5.3: - resolution: {integrity: sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==} - dev: true - /tsutils@3.21.0(typescript@5.1.6): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} @@ -3587,12 +3817,42 @@ packages: engines: {node: '>=8'} dev: true + /typed-array-buffer@1.0.0: + resolution: {integrity: sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.2.1 + is-typed-array: 1.1.12 + dev: true + + /typed-array-byte-length@1.0.0: + resolution: {integrity: sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + for-each: 0.3.3 + has-proto: 1.0.1 + is-typed-array: 1.1.12 + dev: true + + /typed-array-byte-offset@1.0.0: + resolution: {integrity: sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.2 + for-each: 0.3.3 + has-proto: 1.0.1 + is-typed-array: 1.1.12 + dev: true + /typed-array-length@1.0.4: resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} dependencies: call-bind: 1.0.2 for-each: 0.3.3 - is-typed-array: 1.1.10 + is-typed-array: 1.1.12 dev: true /typescript@5.1.6: @@ -3601,9 +3861,8 @@ packages: hasBin: true dev: true - /ufo@1.1.2: - resolution: {integrity: sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==} - dev: true + /ufo@1.2.0: + resolution: {integrity: sha512-RsPyTbqORDNDxqAdQPQBpgqhWle1VcTSou/FraClYlHf6TZnQcGslpLcAphNR+sQW4q5lLWLbOsRlh9j24baQg==} /unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} @@ -3618,31 +3877,31 @@ packages: resolution: {integrity: sha512-J4efk69Aye43tWcBPCsLK7TIRppGrEN4pAlDzRKo3HSE6MgTSTBxSEuE3ccx7ixc62JvGQ/CoFXYqqF2AHozow==} hasBin: true dependencies: - '@rollup/plugin-alias': 5.0.0(rollup@3.25.1) - '@rollup/plugin-commonjs': 24.1.0(rollup@3.25.1) - '@rollup/plugin-json': 6.0.0(rollup@3.25.1) - '@rollup/plugin-node-resolve': 15.1.0(rollup@3.25.1) - '@rollup/plugin-replace': 5.0.2(rollup@3.25.1) - '@rollup/pluginutils': 5.0.2(rollup@3.25.1) - chalk: 5.2.0 - consola: 3.1.0 + '@rollup/plugin-alias': 5.0.0(rollup@3.28.0) + '@rollup/plugin-commonjs': 24.1.0(rollup@3.28.0) + '@rollup/plugin-json': 6.0.0(rollup@3.28.0) + '@rollup/plugin-node-resolve': 15.1.0(rollup@3.28.0) + '@rollup/plugin-replace': 5.0.2(rollup@3.28.0) + '@rollup/pluginutils': 5.0.3(rollup@3.28.0) + chalk: 5.3.0 + consola: 3.2.3 defu: 6.1.2 esbuild: 0.17.19 - globby: 13.1.4 + globby: 13.2.2 hookable: 5.5.3 jiti: 1.19.1 - magic-string: 0.30.0 - mkdist: 1.2.0(typescript@5.1.6) - mlly: 1.3.0 + magic-string: 0.30.2 + mkdist: 1.3.0(typescript@5.1.6) + mlly: 1.4.0 mri: 1.2.0 pathe: 1.1.1 pkg-types: 1.0.3 - pretty-bytes: 6.1.0 - rollup: 3.25.1 - rollup-plugin-dts: 5.3.0(rollup@3.25.1)(typescript@5.1.6) + pretty-bytes: 6.1.1 + rollup: 3.28.0 + rollup-plugin-dts: 5.3.1(rollup@3.28.0)(typescript@5.1.6) scule: 1.0.0 typescript: 5.1.6 - untyped: 1.3.2 + untyped: 1.4.0 transitivePeerDependencies: - sass - supports-color @@ -3658,13 +3917,13 @@ packages: engines: {node: '>=8'} dev: true - /untyped@1.3.2: - resolution: {integrity: sha512-z219Z65rOGD6jXIvIhpZFfwWdqQckB8sdZec2NO+TkcH1Bph7gL0hwLzRJs1KsOo4Jz4mF9guBXhsEnyEBGVfw==} + /untyped@1.4.0: + resolution: {integrity: sha512-Egkr/s4zcMTEuulcIb7dgURS6QpN7DyqQYdf+jBtiaJvQ+eRsrtWUoX84SbvQWuLkXsOjM+8sJC9u6KoMK/U7Q==} hasBin: true dependencies: - '@babel/core': 7.22.5 - '@babel/standalone': 7.22.5 - '@babel/types': 7.22.5 + '@babel/core': 7.22.10 + '@babel/standalone': 7.22.10 + '@babel/types': 7.22.10 defu: 6.1.2 jiti: 1.19.1 mri: 1.2.0 @@ -3673,13 +3932,13 @@ packages: - supports-color dev: true - /update-browserslist-db@1.0.11(browserslist@4.21.9): + /update-browserslist-db@1.0.11(browserslist@4.21.10): resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' dependencies: - browserslist: 4.21.9 + browserslist: 4.21.10 escalade: 3.1.1 picocolors: 1.0.0 dev: true @@ -3694,7 +3953,7 @@ packages: resolution: {integrity: sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==} engines: {node: '>=10.12.0'} dependencies: - '@jridgewell/trace-mapping': 0.3.18 + '@jridgewell/trace-mapping': 0.3.19 '@types/istanbul-lib-coverage': 2.0.4 convert-source-map: 1.9.0 dev: true @@ -3706,7 +3965,7 @@ packages: spdx-expression-parse: 3.0.1 dev: true - /vite-node@0.34.1(@types/node@20.4.6): + /vite-node@0.34.1(@types/node@20.5.0): resolution: {integrity: sha512-odAZAL9xFMuAg8aWd7nSPT+hU8u2r9gU3LRm9QKjxBEF2rRdWpMuqkrkjvyVQEdNFiBctqr2Gg4uJYizm5Le6w==} engines: {node: '>=v14.18.0'} hasBin: true @@ -3716,10 +3975,11 @@ packages: mlly: 1.4.0 pathe: 1.1.1 picocolors: 1.0.0 - vite: 4.3.9(@types/node@20.4.6) + vite: 4.4.9(@types/node@20.5.0) transitivePeerDependencies: - '@types/node' - less + - lightningcss - sass - stylus - sugarss @@ -3727,13 +3987,14 @@ packages: - terser dev: true - /vite@4.3.9(@types/node@20.4.6): - resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==} + /vite@4.4.9(@types/node@20.5.0): + resolution: {integrity: sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: '@types/node': '>= 14' less: '*' + lightningcss: ^1.21.0 sass: '*' stylus: '*' sugarss: '*' @@ -3743,6 +4004,8 @@ packages: optional: true less: optional: true + lightningcss: + optional: true sass: optional: true stylus: @@ -3752,10 +4015,10 @@ packages: terser: optional: true dependencies: - '@types/node': 20.4.6 - esbuild: 0.17.19 - postcss: 8.4.24 - rollup: 3.25.1 + '@types/node': 20.5.0 + esbuild: 0.18.20 + postcss: 8.4.28 + rollup: 3.28.0 optionalDependencies: fsevents: 2.3.2 dev: true @@ -3793,13 +4056,13 @@ packages: dependencies: '@types/chai': 4.3.5 '@types/chai-subset': 1.3.3 - '@types/node': 20.4.6 + '@types/node': 20.5.0 '@vitest/expect': 0.34.1 '@vitest/runner': 0.34.1 '@vitest/snapshot': 0.34.1 '@vitest/spy': 0.34.1 '@vitest/utils': 0.34.1 - acorn: 8.9.0 + acorn: 8.10.0 acorn-walk: 8.2.0 cac: 6.7.14 chai: 4.3.7 @@ -3809,14 +4072,15 @@ packages: pathe: 1.1.1 picocolors: 1.0.0 std-env: 3.3.3 - strip-literal: 1.0.1 + strip-literal: 1.3.0 tinybench: 2.5.0 tinypool: 0.7.0 - vite: 4.3.9(@types/node@20.4.6) - vite-node: 0.34.1(@types/node@20.4.6) + vite: 4.4.9(@types/node@20.5.0) + vite-node: 0.34.1(@types/node@20.5.0) why-is-node-running: 2.2.2 transitivePeerDependencies: - less + - lightningcss - sass - stylus - sugarss @@ -3834,8 +4098,8 @@ packages: is-symbol: 1.0.4 dev: true - /which-typed-array@1.1.9: - resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==} + /which-typed-array@1.1.11: + resolution: {integrity: sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==} engines: {node: '>= 0.4'} dependencies: available-typed-arrays: 1.0.5 @@ -3843,7 +4107,6 @@ packages: for-each: 0.3.3 gopd: 1.0.1 has-tostringtag: 1.0.0 - is-typed-array: 1.1.10 dev: true /which@2.0.2: diff --git a/src/_utils.ts b/src/_utils.ts new file mode 100644 index 0000000..49d1444 --- /dev/null +++ b/src/_utils.ts @@ -0,0 +1,127 @@ +import { createRequire } from "node:module"; +import { normalize } from "pathe"; +import { withTrailingSlash } from "ufo"; +import type { OperationOptions } from "./types"; +import type { DetectPackageManagerOptions } from "./package-manager"; +import { detectPackageManager } from "./package-manager"; + +export async function findup( + cwd: string, + match: (path: string) => T | Promise, + options: Pick = {}, +): Promise { + const segments = normalize(cwd).split("/"); + + while (segments.length > 0) { + const path = segments.join("/"); + const result = await match(path); + + if (result || !options.includeParentDirs) { + return result; + } + + segments.pop(); + } +} + +export async function executeCommand( + command: string, + args: string[], + options: Pick = {}, +): Promise { + const { execa } = await import("execa"); + const { resolve } = await import("pathe"); + + // work around issue with segmentation fault when using corepack with npm + // on ubuntu-latest + const execaArgs: [string, string[]] = + command === "npm" ? [command, args] : ["corepack", [command, ...args]]; + + await execa(execaArgs[0], execaArgs[1], { + cwd: resolve(options.cwd || process.cwd()), + stdio: options.silent ? "ignore" : "inherit", + }); +} + +type NonPartial = { [P in keyof T]-?: T[P] }; + +export const NO_PACKAGE_MANAGER_DETECTED_ERROR_MSG = + "No package manager auto-detected."; + +export async function resolveOperationOptions( + options: OperationOptions = {}, +): Promise< + NonPartial< + Pick + > & + Pick +> { + const cwd = options.cwd || process.cwd(); + + const packageManager = + options.packageManager || + (await detectPackageManager(options.cwd || process.cwd())); + + if (!packageManager) { + throw new Error(NO_PACKAGE_MANAGER_DETECTED_ERROR_MSG); + } + + return { + cwd, + silent: options.silent ?? false, + packageManager, + dev: options.dev ?? false, + workspace: options.workspace, + }; +} + +export function getWorkspaceArgs( + options: Awaited>, +): string[] { + if (!options.workspace) { + if (options.packageManager.name === "pnpm") { + return ["-w"]; + } + + if ( + options.packageManager.name === "yarn" && + options.packageManager.majorVersion === "1" + ) { + return ["-W"]; + } + + return []; + } + + switch (options.packageManager.name) { + case "npm": { + return ["-w", options.workspace]; + } + + case "pnpm": { + return ["-F", options.workspace]; + } + + case "yarn": { + return ["workspace", options.workspace]; + } + } +} + +export function doesDependencyExist( + name: string, + options: Pick< + Awaited>, + "cwd" | "workspace" + >, +) { + const require = createRequire(withTrailingSlash(options.cwd)); + + try { + const resolvedPath = require.resolve(name); + + return resolvedPath.startsWith(options.cwd); + } catch { + return false; + } +} diff --git a/src/api.ts b/src/api.ts index c032876..c826167 100644 --- a/src/api.ts +++ b/src/api.ts @@ -1,56 +1,27 @@ -import { detectPackageManager } from "./detect"; -import { runCorepack } from "./spawn"; -import { PackageManager } from "./types"; - -export type OperationOptions = { - /** - * The directory to run the command in. - * - * @default process.cwd() - */ - cwd?: string; - - /** - * Whether to run the command in silent mode. - * - * @default false - */ - silent?: boolean; - - /** - * The package manager info to use (auto-detected). - */ - packageManager?: PackageManager; - - /** - * Whether to add the dependency as dev dependency. - * - * @default false - */ - dev?: boolean; - - /** - * Whether to use the workspace package manager. - * Works only with yarn@2+, pnpm and npm. - * - * @default false - */ - workspace?: boolean; -}; +import { + executeCommand, + resolveOperationOptions, + getWorkspaceArgs, + doesDependencyExist, +} from "./_utils"; +import type { OperationOptions } from "./types"; /** * Installs project dependencies. * - * @param _options - Options to pass to the API call. + * @param options - Options to pass to the API call. + * @param options.cwd - The directory to run the command in. + * @param options.silent - Whether to run the command in silent mode. + * @param options.packageManager - The package manager info to use (auto-detected). */ export async function installDependencies( - _options: Omit = {} + options: Pick = {}, ) { - const options = await _resolveOptions(_options); + const resolvedOptions = await resolveOperationOptions(options); - return await runCorepack(options.packageManager.command, ["install"], { - cwd: options.cwd, - silent: options.silent, + await executeCommand(resolvedOptions.packageManager.command, ["install"], { + cwd: resolvedOptions.cwd, + silent: resolvedOptions.silent, }); } @@ -58,80 +29,120 @@ export async function installDependencies( * Adds dependency to the project. * * @param name - Name of the dependency to add. - * @param _options - Options to pass to the API call. + * @param options - Options to pass to the API call. + * @param options.cwd - The directory to run the command in. + * @param options.silent - Whether to run the command in silent mode. + * @param options.packageManager - The package manager info to use (auto-detected). + * @param options.dev - Whether to add the dependency as dev dependency. + * @param options.workspace - The name of the workspace to use. */ export async function addDependency( name: string, - _options: OperationOptions = {} + options: OperationOptions = {}, ) { - const options = await _resolveOptions(_options); - - const args = [ - options.packageManager.name === "npm" ? "install" : "add", - options.workspace - ? options.packageManager.name === "yarn" // eslint-disable-line unicorn/no-nested-ternary - ? "-W" - : "-w" - : "", - options.dev ? "-D" : "", - name, - ].filter(Boolean); - - await runCorepack(options.packageManager.command, args, { - cwd: options.cwd, - silent: options.silent, + const resolvedOptions = await resolveOperationOptions(options); + + const args = ( + resolvedOptions.packageManager.name === "yarn" + ? [ + ...getWorkspaceArgs(resolvedOptions), + "add", + resolvedOptions.dev ? "-D" : "", + name, + ] + : [ + resolvedOptions.packageManager.name === "npm" ? "install" : "add", + ...getWorkspaceArgs(resolvedOptions), + resolvedOptions.dev ? "-D" : "", + name, + ] + ).filter(Boolean); + + await executeCommand(resolvedOptions.packageManager.command, args, { + cwd: resolvedOptions.cwd, + silent: resolvedOptions.silent, }); - return {}; } /** * Adds dev dependency to the project. * - * @param name - Name of the dependency to add. - * @param _options - Options to pass to the API call. + * @param name - Name of the dev dependency to add. + * @param options - Options to pass to the API call. + * @param options.cwd - The directory to run the command in. + * @param options.silent - Whether to run the command in silent mode. + * @param options.packageManager - The package manager info to use (auto-detected). + * @param options.workspace - The name of the workspace to use. + * */ export async function addDevDependency( name: string, - _options: Omit = {} + options: Omit = {}, ) { - return await addDependency(name, { ..._options, dev: true }); + await addDependency(name, { ...options, dev: true }); } /** * Removes dependency from the project. * * @param name - Name of the dependency to remove. - * @param _options - Options to pass to the API call. + * @param options - Options to pass to the API call. + * @param options.cwd - The directory to run the command in. + * @param options.silent - Whether to run the command in silent mode. + * @param options.packageManager - The package manager info to use (auto-detected). + * @param options.dev - Whether to remove dev dependency. + * @param options.workspace - The name of the workspace to use. */ export async function removeDependency( name: string, - _options: Omit = {} + options: OperationOptions = {}, ) { - const options = await _resolveOptions(_options); - - const args = [ - options.packageManager.name === "npm" ? "uninstall" : "remove", - options.dev ? "-D" : "", - name, - ].filter(Boolean); - - await runCorepack(options.packageManager.command, args, { - cwd: options.cwd, - silent: options.silent, + const resolvedOptions = await resolveOperationOptions(options); + + const args = ( + resolvedOptions.packageManager.name === "yarn" + ? [ + ...getWorkspaceArgs(resolvedOptions), + "remove", + resolvedOptions.dev ? "-D" : "", + name, + ] + : [ + resolvedOptions.packageManager.name === "npm" + ? "uninstall" + : "remove", + ...getWorkspaceArgs(resolvedOptions), + resolvedOptions.dev ? "-D" : "", + name, + ] + ).filter(Boolean); + + await executeCommand(resolvedOptions.packageManager.command, args, { + cwd: resolvedOptions.cwd, + silent: resolvedOptions.silent, }); - return {}; } -type NonPartial = { [P in keyof T]-?: T[P] }; +/** + * Ensures dependency is installed. + * + * @param name - Name of the dependency. + * @param options - Options to pass to the API call. + * @param options.cwd - The directory to run the command in. + * @param options.dev - Whether to install as dev dependency (if not already installed). + * @param options.workspace - The name of the workspace to install dependency in (if not already installed). + */ +export async function ensureDependencyInstalled( + name: string, + options: Pick = {}, +) { + const resolvedOptions = await resolveOperationOptions(options); -async function _resolveOptions( - options: OperationOptions = {} -): Promise> { - options.cwd = options.cwd || process.cwd(); - options.silent = options.silent ?? process.env.NODE_ENV === "test"; - if (!options.packageManager) { - const detected = await detectPackageManager(options.cwd); - options.packageManager = detected; + const dependencyExists = doesDependencyExist(name, resolvedOptions); + + if (dependencyExists) { + return true; } - return options as NonPartial; + + await addDependency(name, resolvedOptions); } diff --git a/src/detect.ts b/src/detect.ts deleted file mode 100644 index a4db120..0000000 --- a/src/detect.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { existsSync } from "node:fs"; -import { readFile } from "node:fs/promises"; -import { resolve } from "node:path"; -import { join, normalize } from "pathe"; -import type { PackageManager } from "./types"; - -const packageManagers: PackageManager[] = [ - { name: "npm", command: "npm", lockFile: "package-lock.json" }, - { - name: "pnpm", - command: "pnpm", - lockFile: "pnpm-lock.yaml", - files: ["pnpm-workspace.yaml"], - }, - { - name: "yarn", - command: "yarn", - majorVersion: "1.0.0", - lockFile: "yarn.lock", - }, - { - name: "yarn", - command: "yarn", - majorVersion: "3.0.0", - lockFile: "yarn.lock", - files: [".yarnrc.yml"], - }, -]; - -export type DetectPackageManagerOptions = { - /** - * Whether to ignore the lock file - * - * @default false - */ - ignoreLockFile?: boolean; - - /** - * Whether to ignore the package.json file - * - * @default false - */ - ignorePackageJSON?: boolean; -}; - -export async function detectPackageManager( - cwd: string, - options: DetectPackageManagerOptions = {} -): Promise { - const detected = await findup(cwd, async (path) => { - // 1. Use `packageManager` field from package.json - if (!options.ignorePackageJSON) { - const packageJSONPath = join(path, "package.json"); - if (existsSync(packageJSONPath)) { - const packageJSON = JSON.parse(await readFile(packageJSONPath, "utf8")); - if (packageJSON?.packageManager) { - const [name, version = "0.0.0"] = - packageJSON.packageManager.split("@"); - const majorVersion = version.split(".")[0]; - const packageManager = - packageManagers.find( - (pm) => pm.name === name && pm.majorVersion === majorVersion - ) || packageManagers.find((pm) => pm.name === name); - return { - ...packageManager, - name, - command: name, - version, - majorVersion, - }; - } - } - } - // 2. Use implicit file detection - if (!options.ignoreLockFile) { - for (const packageManager of packageManagers) { - const detectionsFiles = [ - packageManager.lockFile, - ...(packageManager.files || []), - ].filter(Boolean) as string[]; - if (detectionsFiles.some((file) => existsSync(resolve(path, file)))) { - return { - ...packageManager, - }; - } - } - } - }); - return detected; -} - -async function findup( - cwd: string, - match: (path: string) => T | Promise -): Promise { - const segments = normalize(cwd).split("/"); - while (segments.length > 0) { - const path = segments.join("/"); - const result = await match(path); - if (result) { - return result; - } - segments.pop(); - } -} diff --git a/src/index.ts b/src/index.ts index cc6f160..dd9edcd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,3 @@ export * from "./types"; -export * from "./detect"; +export * from "./package-manager"; export * from "./api"; diff --git a/src/package-manager.ts b/src/package-manager.ts new file mode 100644 index 0000000..95bb01e --- /dev/null +++ b/src/package-manager.ts @@ -0,0 +1,109 @@ +import { existsSync } from "node:fs"; +import { readFile } from "node:fs/promises"; +import { join, resolve } from "pathe"; +import { findup } from "./_utils"; +import type { PackageManager } from "./types"; + +export type DetectPackageManagerOptions = { + /** + * Whether to ignore the lock file + * + * @default false + */ + ignoreLockFile?: boolean; + + /** + * Whether to ignore the package.json file + * + * @default false + */ + ignorePackageJSON?: boolean; + + /** + * Whether to include parent directories + * + * @default false + */ + includeParentDirs?: boolean; +}; + +const _packageManagers: PackageManager[] = [ + { name: "npm", command: "npm", lockFile: "package-lock.json" }, + { + name: "pnpm", + command: "pnpm", + lockFile: "pnpm-lock.yaml", + files: ["pnpm-workspace.yaml"], + }, + { + name: "yarn", + command: "yarn", + majorVersion: "1.0.0", + lockFile: "yarn.lock", + }, + { + name: "yarn", + command: "yarn", + majorVersion: "3.0.0", + lockFile: "yarn.lock", + files: [".yarnrc.yml"], + }, +]; + +export async function detectPackageManager( + cwd: string, + options: DetectPackageManagerOptions = {}, +): Promise { + const detected = await findup( + cwd, + async (path) => { + // 1. Use `packageManager` field from package.json + if (!options.ignorePackageJSON) { + const packageJSONPath = join(path, "package.json"); + if (existsSync(packageJSONPath)) { + const packageJSON = JSON.parse( + await readFile(packageJSONPath, "utf8"), + ); + if (packageJSON?.packageManager) { + const [name, version = "0.0.0"] = + packageJSON.packageManager.split("@"); + const majorVersion = version.split(".")[0]; + const packageManager = + _packageManagers.find( + (pm) => pm.name === name && pm.majorVersion === majorVersion, + ) || _packageManagers.find((pm) => pm.name === name); + return { + ...packageManager, + name, + command: name, + version, + majorVersion, + }; + } + } + } + + // 2. Use implicit file detection + if (!options.ignoreLockFile) { + for (const packageManager of _packageManagers) { + const detectionsFiles = [ + packageManager.lockFile, + ...(packageManager.files || []), + ].filter(Boolean) as string[]; + + if (detectionsFiles.some((file) => existsSync(resolve(path, file)))) { + console.log(path); + return { + ...packageManager, + }; + } + } + } + }, + { + includeParentDirs: options.includeParentDirs, + }, + ); + + return detected; +} diff --git a/src/spawn.ts b/src/spawn.ts deleted file mode 100644 index e5d588b..0000000 --- a/src/spawn.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { resolve } from "pathe"; - -export interface RunCommandOptions { - cwd?: string; - silent?: boolean; -} - -export function runCorepack( - pm: string, - argv: string[], - options: RunCommandOptions = {} -): Promise { - if (pm === "npm") { - return runCommand("npm", argv, options); - } - return runCommand("corepack", [pm, ...argv], options); -} - -async function runCommand( - command: string, - argv: string[], - options: RunCommandOptions = {} -): Promise { - const { execa } = await import("execa"); - try { - await execa(command, argv, { - cwd: resolve(options.cwd || process.cwd()), - stdio: options.silent ? "ignore" : "inherit", - }); - } catch { - return false; - } - return true; -} diff --git a/src/types.ts b/src/types.ts index 0981f92..3b19f2c 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,10 +1,18 @@ export type PackageManagerName = "npm" | "yarn" | "pnpm"; -export interface PackageManager { +export type PackageManager = { name: PackageManagerName; command: string; version?: string; majorVersion?: string; lockFile?: string; files?: string[]; -} +}; + +export type OperationOptions = { + cwd?: string; + silent?: boolean; + packageManager?: PackageManager; + dev?: boolean; + workspace?: string; +}; diff --git a/test/fixtures/default/package.json b/test/fixtures/default/package.json deleted file mode 100644 index 11c43d0..0000000 --- a/test/fixtures/default/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "fixture-default", - "private": true, - "version": "0.0.0" -} diff --git a/test/fixtures/npm/package-lock.json b/test/fixtures/npm/package-lock.json index 39f6fd8..dcaf01a 100644 --- a/test/fixtures/npm/package-lock.json +++ b/test/fixtures/npm/package-lock.json @@ -6,15 +6,25 @@ "packages": { "": { "name": "fixture-npm", - "version": "0.0.0", "workspaces": [ "packages/workspace-a" - ] + ], + "dependencies": { + "consola": "3.2.2" + } + }, + "node_modules/consola": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.2.2.tgz", + "integrity": "sha512-r921u0vbF4lQsoIqYvSSER+yZLPQGijOHrYcWoCNVNBZmn/bRR+xT/DgerTze/nLD9TTGzdDa378TVhx7RDOYg==", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } }, "node_modules/ufo": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.1.1.tgz", - "integrity": "sha512-MvlCc4GHrmZdAllBc0iUDowff36Q9Ndw/UzqmEKyrfSzokTd9ZCy1i+IIk5hrYKkjoYVQyNbrw7/F8XJ2rEwTg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.1.2.tgz", + "integrity": "sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==", "dev": true }, "node_modules/workspace-a": { @@ -22,23 +32,27 @@ "link": true }, "packages/workspace-a": { - "version": "0.0.0", "devDependencies": { - "ufo": "^1.1.1" + "ufo": "1.1.2" } } }, "dependencies": { + "consola": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.2.2.tgz", + "integrity": "sha512-r921u0vbF4lQsoIqYvSSER+yZLPQGijOHrYcWoCNVNBZmn/bRR+xT/DgerTze/nLD9TTGzdDa378TVhx7RDOYg==" + }, "ufo": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.1.1.tgz", - "integrity": "sha512-MvlCc4GHrmZdAllBc0iUDowff36Q9Ndw/UzqmEKyrfSzokTd9ZCy1i+IIk5hrYKkjoYVQyNbrw7/F8XJ2rEwTg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.1.2.tgz", + "integrity": "sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==", "dev": true }, "workspace-a": { "version": "file:packages/workspace-a", "requires": { - "ufo": "^1.1.1" + "ufo": "1.1.2" } } } diff --git a/test/fixtures/npm/package.json b/test/fixtures/npm/package.json index 86cc39f..2ac9b04 100644 --- a/test/fixtures/npm/package.json +++ b/test/fixtures/npm/package.json @@ -1,9 +1,11 @@ { "name": "fixture-npm", "private": true, - "version": "0.0.0", "workspaces": [ "packages/workspace-a" ], - "packageManager": "npm@9.1.3" + "packageManager": "npm@9.7.2", + "dependencies": { + "consola": "3.2.2" + } } diff --git a/test/fixtures/npm/packages/workspace-a/package.json b/test/fixtures/npm/packages/workspace-a/package.json index d155977..dc3945d 100644 --- a/test/fixtures/npm/packages/workspace-a/package.json +++ b/test/fixtures/npm/packages/workspace-a/package.json @@ -1,9 +1,8 @@ { "name": "workspace-a", "private": true, - "version": "0.0.0", + "packageManager": "npm@9.7.2", "devDependencies": { - "ufo": "^1.1.1" - }, - "packageManager": "npm@9.1.3" + "ufo": "1.1.2" + } } diff --git a/test/fixtures/pnpm/package.json b/test/fixtures/pnpm/package.json index fdc7b21..3ca1f0f 100644 --- a/test/fixtures/pnpm/package.json +++ b/test/fixtures/pnpm/package.json @@ -1,6 +1,8 @@ { "name": "fixture-pnpm", "private": true, - "version": "0.0.0", - "packageManager": "pnpm@8.1.1" + "packageManager": "pnpm@8.6.5", + "dependencies": { + "consola": "3.2.2" + } } diff --git a/test/fixtures/pnpm/packages/workspace-a/package.json b/test/fixtures/pnpm/packages/workspace-a/package.json index adb7b92..3ce34a3 100644 --- a/test/fixtures/pnpm/packages/workspace-a/package.json +++ b/test/fixtures/pnpm/packages/workspace-a/package.json @@ -1,9 +1,8 @@ { - "name": "fixture-pnpm/workspace-a", + "name": "workspace-a", "private": true, - "version": "0.0.0", + "packageManager": "pnpm@8.6.5", "devDependencies": { - "ufo": "^1.1.1" - }, - "packageManager": "pnpm@8.1.1" + "ufo": "1.1.2" + } } diff --git a/test/fixtures/pnpm/pnpm-lock.yaml b/test/fixtures/pnpm/pnpm-lock.yaml index ef44372..ec64e6b 100644 --- a/test/fixtures/pnpm/pnpm-lock.yaml +++ b/test/fixtures/pnpm/pnpm-lock.yaml @@ -1,17 +1,30 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + importers: - .: {} + .: + dependencies: + consola: + specifier: 3.2.2 + version: 3.2.2 packages/workspace-a: devDependencies: ufo: - specifier: ^1.1.1 - version: 1.1.1 + specifier: 1.1.2 + version: 1.1.2 packages: - /ufo@1.1.1: - resolution: {integrity: sha512-MvlCc4GHrmZdAllBc0iUDowff36Q9Ndw/UzqmEKyrfSzokTd9ZCy1i+IIk5hrYKkjoYVQyNbrw7/F8XJ2rEwTg==} + /consola@3.2.2: + resolution: {integrity: sha512-r921u0vbF4lQsoIqYvSSER+yZLPQGijOHrYcWoCNVNBZmn/bRR+xT/DgerTze/nLD9TTGzdDa378TVhx7RDOYg==} + engines: {node: ^14.18.0 || >=16.10.0} + dev: false + + /ufo@1.1.2: + resolution: {integrity: sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==} dev: true diff --git a/test/fixtures/yarn-berry/.pnp.loader.mjs b/test/fixtures/yarn-berry/.pnp.loader.mjs new file mode 100644 index 0000000..318d0e2 --- /dev/null +++ b/test/fixtures/yarn-berry/.pnp.loader.mjs @@ -0,0 +1,2562 @@ +import { URL as URL$1, fileURLToPath, pathToFileURL } from "url"; +import fs from "fs"; +import path from "path"; +import moduleExports, { Module } from "module"; +import { EOL } from "os"; +import assert from "assert"; + +const SAFE_TIME = 456789e3; + +const PortablePath = { + root: `/`, + dot: `.`, + parent: `..`, +}; +const npath = Object.create(path); +const ppath = Object.create(path.posix); +npath.cwd = () => process.cwd(); +ppath.cwd = () => toPortablePath(process.cwd()); +ppath.resolve = (...segments) => { + if (segments.length > 0 && ppath.isAbsolute(segments[0])) { + return path.posix.resolve(...segments); + } else { + return path.posix.resolve(ppath.cwd(), ...segments); + } +}; +const contains = function (pathUtils, from, to) { + from = pathUtils.normalize(from); + to = pathUtils.normalize(to); + if (from === to) return `.`; + if (!from.endsWith(pathUtils.sep)) from = from + pathUtils.sep; + if (to.startsWith(from)) { + return to.slice(from.length); + } else { + return null; + } +}; +npath.fromPortablePath = fromPortablePath; +npath.toPortablePath = toPortablePath; +npath.contains = (from, to) => contains(npath, from, to); +ppath.contains = (from, to) => contains(ppath, from, to); +const WINDOWS_PATH_REGEXP = /^([a-zA-Z]:.*)$/; +const UNC_WINDOWS_PATH_REGEXP = /^\/\/(\.\/)?(.*)$/; +const PORTABLE_PATH_REGEXP = /^\/([a-zA-Z]:.*)$/; +const UNC_PORTABLE_PATH_REGEXP = /^\/unc\/(\.dot\/)?(.*)$/; +function fromPortablePath(p) { + if (process.platform !== `win32`) return p; + let portablePathMatch, uncPortablePathMatch; + if ((portablePathMatch = p.match(PORTABLE_PATH_REGEXP))) + p = portablePathMatch[1]; + else if ((uncPortablePathMatch = p.match(UNC_PORTABLE_PATH_REGEXP))) + p = `\\\\${uncPortablePathMatch[1] ? `.\\` : ``}${uncPortablePathMatch[2]}`; + else return p; + return p.replace(/\//g, `\\`); +} +function toPortablePath(p) { + if (process.platform !== `win32`) return p; + p = p.replace(/\\/g, `/`); + let windowsPathMatch, uncWindowsPathMatch; + if ((windowsPathMatch = p.match(WINDOWS_PATH_REGEXP))) + p = `/${windowsPathMatch[1]}`; + else if ((uncWindowsPathMatch = p.match(UNC_WINDOWS_PATH_REGEXP))) + p = `/unc/${uncWindowsPathMatch[1] ? `.dot/` : ``}${ + uncWindowsPathMatch[2] + }`; + return p; +} +function convertPath(targetPathUtils, sourcePath) { + return targetPathUtils === npath + ? fromPortablePath(sourcePath) + : toPortablePath(sourcePath); +} + +const defaultTime = new Date(SAFE_TIME * 1e3); +async function copyPromise(destinationFs, destination, sourceFs, source, opts) { + const normalizedDestination = destinationFs.pathUtils.normalize(destination); + const normalizedSource = sourceFs.pathUtils.normalize(source); + const prelayout = []; + const postlayout = []; + const { atime, mtime } = opts.stableTime + ? { atime: defaultTime, mtime: defaultTime } + : await sourceFs.lstatPromise(normalizedSource); + await destinationFs.mkdirpPromise( + destinationFs.pathUtils.dirname(destination), + { utimes: [atime, mtime] }, + ); + const updateTime = + typeof destinationFs.lutimesPromise === `function` + ? destinationFs.lutimesPromise.bind(destinationFs) + : destinationFs.utimesPromise.bind(destinationFs); + await copyImpl( + prelayout, + postlayout, + updateTime, + destinationFs, + normalizedDestination, + sourceFs, + normalizedSource, + { ...opts, didParentExist: true }, + ); + for (const operation of prelayout) await operation(); + await Promise.all( + postlayout.map((operation) => { + return operation(); + }), + ); +} +async function copyImpl( + prelayout, + postlayout, + updateTime, + destinationFs, + destination, + sourceFs, + source, + opts, +) { + var _a, _b; + const destinationStat = opts.didParentExist + ? await maybeLStat(destinationFs, destination) + : null; + const sourceStat = await sourceFs.lstatPromise(source); + const { atime, mtime } = opts.stableTime + ? { atime: defaultTime, mtime: defaultTime } + : sourceStat; + let updated; + switch (true) { + case sourceStat.isDirectory(): + { + updated = await copyFolder( + prelayout, + postlayout, + updateTime, + destinationFs, + destination, + destinationStat, + sourceFs, + source, + sourceStat, + opts, + ); + } + break; + case sourceStat.isFile(): + { + updated = await copyFile( + prelayout, + postlayout, + updateTime, + destinationFs, + destination, + destinationStat, + sourceFs, + source, + sourceStat, + opts, + ); + } + break; + case sourceStat.isSymbolicLink(): + { + updated = await copySymlink( + prelayout, + postlayout, + updateTime, + destinationFs, + destination, + destinationStat, + sourceFs, + source, + sourceStat, + opts, + ); + } + break; + default: { + throw new Error(`Unsupported file type (${sourceStat.mode})`); + } + } + if ( + updated || + ((_a = destinationStat == null ? void 0 : destinationStat.mtime) == null + ? void 0 + : _a.getTime()) !== mtime.getTime() || + ((_b = destinationStat == null ? void 0 : destinationStat.atime) == null + ? void 0 + : _b.getTime()) !== atime.getTime() + ) { + postlayout.push(() => updateTime(destination, atime, mtime)); + updated = true; + } + if ( + destinationStat === null || + (destinationStat.mode & 511) !== (sourceStat.mode & 511) + ) { + postlayout.push(() => + destinationFs.chmodPromise(destination, sourceStat.mode & 511), + ); + updated = true; + } + return updated; +} +async function maybeLStat(baseFs, p) { + try { + return await baseFs.lstatPromise(p); + } catch (e) { + return null; + } +} +async function copyFolder( + prelayout, + postlayout, + updateTime, + destinationFs, + destination, + destinationStat, + sourceFs, + source, + sourceStat, + opts, +) { + if (destinationStat !== null && !destinationStat.isDirectory()) { + if (opts.overwrite) { + prelayout.push(async () => destinationFs.removePromise(destination)); + destinationStat = null; + } else { + return false; + } + } + let updated = false; + if (destinationStat === null) { + prelayout.push(async () => { + try { + await destinationFs.mkdirPromise(destination, { + mode: sourceStat.mode, + }); + } catch (err) { + if (err.code !== `EEXIST`) { + throw err; + } + } + }); + updated = true; + } + const entries = await sourceFs.readdirPromise(source); + const nextOpts = + opts.didParentExist && !destinationStat + ? { ...opts, didParentExist: false } + : opts; + if (opts.stableSort) { + for (const entry of entries.sort()) { + if ( + await copyImpl( + prelayout, + postlayout, + updateTime, + destinationFs, + destinationFs.pathUtils.join(destination, entry), + sourceFs, + sourceFs.pathUtils.join(source, entry), + nextOpts, + ) + ) { + updated = true; + } + } + } else { + const entriesUpdateStatus = await Promise.all( + entries.map(async (entry) => { + await copyImpl( + prelayout, + postlayout, + updateTime, + destinationFs, + destinationFs.pathUtils.join(destination, entry), + sourceFs, + sourceFs.pathUtils.join(source, entry), + nextOpts, + ); + }), + ); + if (entriesUpdateStatus.some((status) => status)) { + updated = true; + } + } + return updated; +} +const isCloneSupportedCache = /* @__PURE__ */ new WeakMap(); +function makeLinkOperation( + opFs, + destination, + source, + sourceStat, + linkStrategy, +) { + return async () => { + await opFs.linkPromise(source, destination); + if (linkStrategy === "readOnly" /* ReadOnly */) { + sourceStat.mode &= ~146; + await opFs.chmodPromise(destination, sourceStat.mode); + } + }; +} +function makeCloneLinkOperation( + opFs, + destination, + source, + sourceStat, + linkStrategy, +) { + const isCloneSupported = isCloneSupportedCache.get(opFs); + if (typeof isCloneSupported === `undefined`) { + return async () => { + try { + await opFs.copyFilePromise( + source, + destination, + fs.constants.COPYFILE_FICLONE_FORCE, + ); + isCloneSupportedCache.set(opFs, true); + } catch (err) { + if (err.code === `ENOSYS` || err.code === `ENOTSUP`) { + isCloneSupportedCache.set(opFs, false); + await makeLinkOperation( + opFs, + destination, + source, + sourceStat, + linkStrategy, + )(); + } else { + throw err; + } + } + }; + } else { + if (isCloneSupported) { + return async () => + opFs.copyFilePromise( + source, + destination, + fs.constants.COPYFILE_FICLONE_FORCE, + ); + } else { + return makeLinkOperation( + opFs, + destination, + source, + sourceStat, + linkStrategy, + ); + } + } +} +async function copyFile( + prelayout, + postlayout, + updateTime, + destinationFs, + destination, + destinationStat, + sourceFs, + source, + sourceStat, + opts, +) { + var _a; + if (destinationStat !== null) { + if (opts.overwrite) { + prelayout.push(async () => destinationFs.removePromise(destination)); + destinationStat = null; + } else { + return false; + } + } + const linkStrategy = (_a = opts.linkStrategy) != null ? _a : null; + const op = + destinationFs === sourceFs + ? linkStrategy !== null + ? makeCloneLinkOperation( + destinationFs, + destination, + source, + sourceStat, + linkStrategy, + ) + : async () => + destinationFs.copyFilePromise( + source, + destination, + fs.constants.COPYFILE_FICLONE, + ) + : linkStrategy !== null + ? makeLinkOperation( + destinationFs, + destination, + source, + sourceStat, + linkStrategy, + ) + : async () => + destinationFs.writeFilePromise( + destination, + await sourceFs.readFilePromise(source), + ); + prelayout.push(async () => op()); + return true; +} +async function copySymlink( + prelayout, + postlayout, + updateTime, + destinationFs, + destination, + destinationStat, + sourceFs, + source, + sourceStat, + opts, +) { + if (destinationStat !== null) { + if (opts.overwrite) { + prelayout.push(async () => destinationFs.removePromise(destination)); + destinationStat = null; + } else { + return false; + } + } + prelayout.push(async () => { + await destinationFs.symlinkPromise( + convertPath( + destinationFs.pathUtils, + await sourceFs.readlinkPromise(source), + ), + destination, + ); + }); + return true; +} + +function makeError(code, message) { + return Object.assign(new Error(`${code}: ${message}`), { code }); +} +function ENOSYS(message, reason) { + return makeError(`ENOSYS`, `${message}, ${reason}`); +} + +class FakeFS { + constructor(pathUtils) { + this.pathUtils = pathUtils; + } + async *genTraversePromise(init, { stableSort = false } = {}) { + const stack = [init]; + while (stack.length > 0) { + const p = stack.shift(); + const entry = await this.lstatPromise(p); + if (entry.isDirectory()) { + const entries = await this.readdirPromise(p); + if (stableSort) { + for (const entry2 of entries.sort()) { + stack.push(this.pathUtils.join(p, entry2)); + } + } else { + throw new Error(`Not supported`); + } + } else { + yield p; + } + } + } + async removePromise(p, { recursive = true, maxRetries = 5 } = {}) { + let stat; + try { + stat = await this.lstatPromise(p); + } catch (error) { + if (error.code === `ENOENT`) { + return; + } else { + throw error; + } + } + if (stat.isDirectory()) { + if (recursive) { + const entries = await this.readdirPromise(p); + await Promise.all( + entries.map((entry) => { + return this.removePromise(this.pathUtils.resolve(p, entry)); + }), + ); + } + for (let t = 0; t <= maxRetries; t++) { + try { + await this.rmdirPromise(p); + break; + } catch (error) { + if (error.code !== `EBUSY` && error.code !== `ENOTEMPTY`) { + throw error; + } else if (t < maxRetries) { + await new Promise((resolve) => setTimeout(resolve, t * 100)); + } + } + } + } else { + await this.unlinkPromise(p); + } + } + removeSync(p, { recursive = true } = {}) { + let stat; + try { + stat = this.lstatSync(p); + } catch (error) { + if (error.code === `ENOENT`) { + return; + } else { + throw error; + } + } + if (stat.isDirectory()) { + if (recursive) + for (const entry of this.readdirSync(p)) + this.removeSync(this.pathUtils.resolve(p, entry)); + this.rmdirSync(p); + } else { + this.unlinkSync(p); + } + } + async mkdirpPromise(p, { chmod, utimes } = {}) { + p = this.resolve(p); + if (p === this.pathUtils.dirname(p)) return void 0; + const parts = p.split(this.pathUtils.sep); + let createdDirectory; + for (let u = 2; u <= parts.length; ++u) { + const subPath = parts.slice(0, u).join(this.pathUtils.sep); + if (!this.existsSync(subPath)) { + try { + await this.mkdirPromise(subPath); + } catch (error) { + if (error.code === `EEXIST`) { + continue; + } else { + throw error; + } + } + createdDirectory != null + ? createdDirectory + : (createdDirectory = subPath); + if (chmod != null) await this.chmodPromise(subPath, chmod); + if (utimes != null) { + await this.utimesPromise(subPath, utimes[0], utimes[1]); + } else { + const parentStat = await this.statPromise( + this.pathUtils.dirname(subPath), + ); + await this.utimesPromise(subPath, parentStat.atime, parentStat.mtime); + } + } + } + return createdDirectory; + } + mkdirpSync(p, { chmod, utimes } = {}) { + p = this.resolve(p); + if (p === this.pathUtils.dirname(p)) return void 0; + const parts = p.split(this.pathUtils.sep); + let createdDirectory; + for (let u = 2; u <= parts.length; ++u) { + const subPath = parts.slice(0, u).join(this.pathUtils.sep); + if (!this.existsSync(subPath)) { + try { + this.mkdirSync(subPath); + } catch (error) { + if (error.code === `EEXIST`) { + continue; + } else { + throw error; + } + } + createdDirectory != null + ? createdDirectory + : (createdDirectory = subPath); + if (chmod != null) this.chmodSync(subPath, chmod); + if (utimes != null) { + this.utimesSync(subPath, utimes[0], utimes[1]); + } else { + const parentStat = this.statSync(this.pathUtils.dirname(subPath)); + this.utimesSync(subPath, parentStat.atime, parentStat.mtime); + } + } + } + return createdDirectory; + } + async copyPromise( + destination, + source, + { + baseFs = this, + overwrite = true, + stableSort = false, + stableTime = false, + linkStrategy = null, + } = {}, + ) { + return await copyPromise(this, destination, baseFs, source, { + overwrite, + stableSort, + stableTime, + linkStrategy, + }); + } + copySync(destination, source, { baseFs = this, overwrite = true } = {}) { + const stat = baseFs.lstatSync(source); + const exists = this.existsSync(destination); + if (stat.isDirectory()) { + this.mkdirpSync(destination); + const directoryListing = baseFs.readdirSync(source); + for (const entry of directoryListing) { + this.copySync( + this.pathUtils.join(destination, entry), + baseFs.pathUtils.join(source, entry), + { baseFs, overwrite }, + ); + } + } else if (stat.isFile()) { + if (!exists || overwrite) { + if (exists) this.removeSync(destination); + const content = baseFs.readFileSync(source); + this.writeFileSync(destination, content); + } + } else if (stat.isSymbolicLink()) { + if (!exists || overwrite) { + if (exists) this.removeSync(destination); + const target = baseFs.readlinkSync(source); + this.symlinkSync(convertPath(this.pathUtils, target), destination); + } + } else { + throw new Error( + `Unsupported file type (file: ${source}, mode: 0o${stat.mode + .toString(8) + .padStart(6, `0`)})`, + ); + } + const mode = stat.mode & 511; + this.chmodSync(destination, mode); + } + async changeFilePromise(p, content, opts = {}) { + if (Buffer.isBuffer(content)) { + return this.changeFileBufferPromise(p, content, opts); + } else { + return this.changeFileTextPromise(p, content, opts); + } + } + async changeFileBufferPromise(p, content, { mode } = {}) { + let current = Buffer.alloc(0); + try { + current = await this.readFilePromise(p); + } catch (error) {} + if (Buffer.compare(current, content) === 0) return; + await this.writeFilePromise(p, content, { mode }); + } + async changeFileTextPromise(p, content, { automaticNewlines, mode } = {}) { + let current = ``; + try { + current = await this.readFilePromise(p, `utf8`); + } catch (error) {} + const normalizedContent = automaticNewlines + ? normalizeLineEndings(current, content) + : content; + if (current === normalizedContent) return; + await this.writeFilePromise(p, normalizedContent, { mode }); + } + changeFileSync(p, content, opts = {}) { + if (Buffer.isBuffer(content)) { + return this.changeFileBufferSync(p, content, opts); + } else { + return this.changeFileTextSync(p, content, opts); + } + } + changeFileBufferSync(p, content, { mode } = {}) { + let current = Buffer.alloc(0); + try { + current = this.readFileSync(p); + } catch (error) {} + if (Buffer.compare(current, content) === 0) return; + this.writeFileSync(p, content, { mode }); + } + changeFileTextSync(p, content, { automaticNewlines = false, mode } = {}) { + let current = ``; + try { + current = this.readFileSync(p, `utf8`); + } catch (error) {} + const normalizedContent = automaticNewlines + ? normalizeLineEndings(current, content) + : content; + if (current === normalizedContent) return; + this.writeFileSync(p, normalizedContent, { mode }); + } + async movePromise(fromP, toP) { + try { + await this.renamePromise(fromP, toP); + } catch (error) { + if (error.code === `EXDEV`) { + await this.copyPromise(toP, fromP); + await this.removePromise(fromP); + } else { + throw error; + } + } + } + moveSync(fromP, toP) { + try { + this.renameSync(fromP, toP); + } catch (error) { + if (error.code === `EXDEV`) { + this.copySync(toP, fromP); + this.removeSync(fromP); + } else { + throw error; + } + } + } + async lockPromise(affectedPath, callback) { + const lockPath = `${affectedPath}.flock`; + const interval = 1e3 / 60; + const startTime = Date.now(); + let fd = null; + const isAlive = async () => { + let pid; + try { + [pid] = await this.readJsonPromise(lockPath); + } catch (error) { + return Date.now() - startTime < 500; + } + try { + process.kill(pid, 0); + return true; + } catch (error) { + return false; + } + }; + while (fd === null) { + try { + fd = await this.openPromise(lockPath, `wx`); + } catch (error) { + if (error.code === `EEXIST`) { + if (!(await isAlive())) { + try { + await this.unlinkPromise(lockPath); + continue; + } catch (error2) {} + } + if (Date.now() - startTime < 60 * 1e3) { + await new Promise((resolve) => setTimeout(resolve, interval)); + } else { + throw new Error( + `Couldn't acquire a lock in a reasonable time (via ${lockPath})`, + ); + } + } else { + throw error; + } + } + } + await this.writePromise(fd, JSON.stringify([process.pid])); + try { + return await callback(); + } finally { + try { + await this.closePromise(fd); + await this.unlinkPromise(lockPath); + } catch (error) {} + } + } + async readJsonPromise(p) { + const content = await this.readFilePromise(p, `utf8`); + try { + return JSON.parse(content); + } catch (error) { + error.message += ` (in ${p})`; + throw error; + } + } + readJsonSync(p) { + const content = this.readFileSync(p, `utf8`); + try { + return JSON.parse(content); + } catch (error) { + error.message += ` (in ${p})`; + throw error; + } + } + async writeJsonPromise(p, data) { + return await this.writeFilePromise( + p, + `${JSON.stringify(data, null, 2)} +`, + ); + } + writeJsonSync(p, data) { + return this.writeFileSync( + p, + `${JSON.stringify(data, null, 2)} +`, + ); + } + async preserveTimePromise(p, cb) { + const stat = await this.lstatPromise(p); + const result = await cb(); + if (typeof result !== `undefined`) p = result; + if (this.lutimesPromise) { + await this.lutimesPromise(p, stat.atime, stat.mtime); + } else if (!stat.isSymbolicLink()) { + await this.utimesPromise(p, stat.atime, stat.mtime); + } + } + async preserveTimeSync(p, cb) { + const stat = this.lstatSync(p); + const result = cb(); + if (typeof result !== `undefined`) p = result; + if (this.lutimesSync) { + this.lutimesSync(p, stat.atime, stat.mtime); + } else if (!stat.isSymbolicLink()) { + this.utimesSync(p, stat.atime, stat.mtime); + } + } +} +class BasePortableFakeFS extends FakeFS { + constructor() { + super(ppath); + } +} +function getEndOfLine(content) { + const matches = content.match(/\r?\n/g); + if (matches === null) return EOL; + const crlf = matches.filter( + (nl) => + nl === + `\r +`, + ).length; + const lf = matches.length - crlf; + return crlf > lf + ? `\r +` + : ` +`; +} +function normalizeLineEndings(originalContent, newContent) { + return newContent.replace(/\r?\n/g, getEndOfLine(originalContent)); +} + +class NodeFS extends BasePortableFakeFS { + constructor(realFs = fs) { + super(); + this.realFs = realFs; + if (typeof this.realFs.lutimes !== `undefined`) { + this.lutimesPromise = this.lutimesPromiseImpl; + this.lutimesSync = this.lutimesSyncImpl; + } + } + getExtractHint() { + return false; + } + getRealPath() { + return PortablePath.root; + } + resolve(p) { + return ppath.resolve(p); + } + async openPromise(p, flags, mode) { + return await new Promise((resolve, reject) => { + this.realFs.open( + npath.fromPortablePath(p), + flags, + mode, + this.makeCallback(resolve, reject), + ); + }); + } + openSync(p, flags, mode) { + return this.realFs.openSync(npath.fromPortablePath(p), flags, mode); + } + async opendirPromise(p, opts) { + return await new Promise((resolve, reject) => { + if (typeof opts !== `undefined`) { + this.realFs.opendir( + npath.fromPortablePath(p), + opts, + this.makeCallback(resolve, reject), + ); + } else { + this.realFs.opendir( + npath.fromPortablePath(p), + this.makeCallback(resolve, reject), + ); + } + }).then((dir) => { + return Object.defineProperty(dir, `path`, { + value: p, + configurable: true, + writable: true, + }); + }); + } + opendirSync(p, opts) { + const dir = + typeof opts !== `undefined` + ? this.realFs.opendirSync(npath.fromPortablePath(p), opts) + : this.realFs.opendirSync(npath.fromPortablePath(p)); + return Object.defineProperty(dir, `path`, { + value: p, + configurable: true, + writable: true, + }); + } + async readPromise(fd, buffer, offset = 0, length = 0, position = -1) { + return await new Promise((resolve, reject) => { + this.realFs.read( + fd, + buffer, + offset, + length, + position, + (error, bytesRead) => { + if (error) { + reject(error); + } else { + resolve(bytesRead); + } + }, + ); + }); + } + readSync(fd, buffer, offset, length, position) { + return this.realFs.readSync(fd, buffer, offset, length, position); + } + async writePromise(fd, buffer, offset, length, position) { + return await new Promise((resolve, reject) => { + if (typeof buffer === `string`) { + return this.realFs.write( + fd, + buffer, + offset, + this.makeCallback(resolve, reject), + ); + } else { + return this.realFs.write( + fd, + buffer, + offset, + length, + position, + this.makeCallback(resolve, reject), + ); + } + }); + } + writeSync(fd, buffer, offset, length, position) { + if (typeof buffer === `string`) { + return this.realFs.writeSync(fd, buffer, offset); + } else { + return this.realFs.writeSync(fd, buffer, offset, length, position); + } + } + async closePromise(fd) { + await new Promise((resolve, reject) => { + this.realFs.close(fd, this.makeCallback(resolve, reject)); + }); + } + closeSync(fd) { + this.realFs.closeSync(fd); + } + createReadStream(p, opts) { + const realPath = p !== null ? npath.fromPortablePath(p) : p; + return this.realFs.createReadStream(realPath, opts); + } + createWriteStream(p, opts) { + const realPath = p !== null ? npath.fromPortablePath(p) : p; + return this.realFs.createWriteStream(realPath, opts); + } + async realpathPromise(p) { + return await new Promise((resolve, reject) => { + this.realFs.realpath( + npath.fromPortablePath(p), + {}, + this.makeCallback(resolve, reject), + ); + }).then((path) => { + return npath.toPortablePath(path); + }); + } + realpathSync(p) { + return npath.toPortablePath( + this.realFs.realpathSync(npath.fromPortablePath(p), {}), + ); + } + async existsPromise(p) { + return await new Promise((resolve) => { + this.realFs.exists(npath.fromPortablePath(p), resolve); + }); + } + accessSync(p, mode) { + return this.realFs.accessSync(npath.fromPortablePath(p), mode); + } + async accessPromise(p, mode) { + return await new Promise((resolve, reject) => { + this.realFs.access( + npath.fromPortablePath(p), + mode, + this.makeCallback(resolve, reject), + ); + }); + } + existsSync(p) { + return this.realFs.existsSync(npath.fromPortablePath(p)); + } + async statPromise(p, opts) { + return await new Promise((resolve, reject) => { + if (opts) { + this.realFs.stat( + npath.fromPortablePath(p), + opts, + this.makeCallback(resolve, reject), + ); + } else { + this.realFs.stat( + npath.fromPortablePath(p), + this.makeCallback(resolve, reject), + ); + } + }); + } + statSync(p, opts) { + if (opts) { + return this.realFs.statSync(npath.fromPortablePath(p), opts); + } else { + return this.realFs.statSync(npath.fromPortablePath(p)); + } + } + async fstatPromise(fd, opts) { + return await new Promise((resolve, reject) => { + if (opts) { + this.realFs.fstat(fd, opts, this.makeCallback(resolve, reject)); + } else { + this.realFs.fstat(fd, this.makeCallback(resolve, reject)); + } + }); + } + fstatSync(fd, opts) { + if (opts) { + return this.realFs.fstatSync(fd, opts); + } else { + return this.realFs.fstatSync(fd); + } + } + async lstatPromise(p, opts) { + return await new Promise((resolve, reject) => { + if (opts) { + this.realFs.lstat( + npath.fromPortablePath(p), + opts, + this.makeCallback(resolve, reject), + ); + } else { + this.realFs.lstat( + npath.fromPortablePath(p), + this.makeCallback(resolve, reject), + ); + } + }); + } + lstatSync(p, opts) { + if (opts) { + return this.realFs.lstatSync(npath.fromPortablePath(p), opts); + } else { + return this.realFs.lstatSync(npath.fromPortablePath(p)); + } + } + async fchmodPromise(fd, mask) { + return await new Promise((resolve, reject) => { + this.realFs.fchmod(fd, mask, this.makeCallback(resolve, reject)); + }); + } + fchmodSync(fd, mask) { + return this.realFs.fchmodSync(fd, mask); + } + async chmodPromise(p, mask) { + return await new Promise((resolve, reject) => { + this.realFs.chmod( + npath.fromPortablePath(p), + mask, + this.makeCallback(resolve, reject), + ); + }); + } + chmodSync(p, mask) { + return this.realFs.chmodSync(npath.fromPortablePath(p), mask); + } + async fchownPromise(fd, uid, gid) { + return await new Promise((resolve, reject) => { + this.realFs.fchown(fd, uid, gid, this.makeCallback(resolve, reject)); + }); + } + fchownSync(fd, uid, gid) { + return this.realFs.fchownSync(fd, uid, gid); + } + async chownPromise(p, uid, gid) { + return await new Promise((resolve, reject) => { + this.realFs.chown( + npath.fromPortablePath(p), + uid, + gid, + this.makeCallback(resolve, reject), + ); + }); + } + chownSync(p, uid, gid) { + return this.realFs.chownSync(npath.fromPortablePath(p), uid, gid); + } + async renamePromise(oldP, newP) { + return await new Promise((resolve, reject) => { + this.realFs.rename( + npath.fromPortablePath(oldP), + npath.fromPortablePath(newP), + this.makeCallback(resolve, reject), + ); + }); + } + renameSync(oldP, newP) { + return this.realFs.renameSync( + npath.fromPortablePath(oldP), + npath.fromPortablePath(newP), + ); + } + async copyFilePromise(sourceP, destP, flags = 0) { + return await new Promise((resolve, reject) => { + this.realFs.copyFile( + npath.fromPortablePath(sourceP), + npath.fromPortablePath(destP), + flags, + this.makeCallback(resolve, reject), + ); + }); + } + copyFileSync(sourceP, destP, flags = 0) { + return this.realFs.copyFileSync( + npath.fromPortablePath(sourceP), + npath.fromPortablePath(destP), + flags, + ); + } + async appendFilePromise(p, content, opts) { + return await new Promise((resolve, reject) => { + const fsNativePath = + typeof p === `string` ? npath.fromPortablePath(p) : p; + if (opts) { + this.realFs.appendFile( + fsNativePath, + content, + opts, + this.makeCallback(resolve, reject), + ); + } else { + this.realFs.appendFile( + fsNativePath, + content, + this.makeCallback(resolve, reject), + ); + } + }); + } + appendFileSync(p, content, opts) { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + if (opts) { + this.realFs.appendFileSync(fsNativePath, content, opts); + } else { + this.realFs.appendFileSync(fsNativePath, content); + } + } + async writeFilePromise(p, content, opts) { + return await new Promise((resolve, reject) => { + const fsNativePath = + typeof p === `string` ? npath.fromPortablePath(p) : p; + if (opts) { + this.realFs.writeFile( + fsNativePath, + content, + opts, + this.makeCallback(resolve, reject), + ); + } else { + this.realFs.writeFile( + fsNativePath, + content, + this.makeCallback(resolve, reject), + ); + } + }); + } + writeFileSync(p, content, opts) { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + if (opts) { + this.realFs.writeFileSync(fsNativePath, content, opts); + } else { + this.realFs.writeFileSync(fsNativePath, content); + } + } + async unlinkPromise(p) { + return await new Promise((resolve, reject) => { + this.realFs.unlink( + npath.fromPortablePath(p), + this.makeCallback(resolve, reject), + ); + }); + } + unlinkSync(p) { + return this.realFs.unlinkSync(npath.fromPortablePath(p)); + } + async utimesPromise(p, atime, mtime) { + return await new Promise((resolve, reject) => { + this.realFs.utimes( + npath.fromPortablePath(p), + atime, + mtime, + this.makeCallback(resolve, reject), + ); + }); + } + utimesSync(p, atime, mtime) { + this.realFs.utimesSync(npath.fromPortablePath(p), atime, mtime); + } + async lutimesPromiseImpl(p, atime, mtime) { + const lutimes = this.realFs.lutimes; + if (typeof lutimes === `undefined`) + throw ENOSYS(`unavailable Node binding`, `lutimes '${p}'`); + return await new Promise((resolve, reject) => { + lutimes.call( + this.realFs, + npath.fromPortablePath(p), + atime, + mtime, + this.makeCallback(resolve, reject), + ); + }); + } + lutimesSyncImpl(p, atime, mtime) { + const lutimesSync = this.realFs.lutimesSync; + if (typeof lutimesSync === `undefined`) + throw ENOSYS(`unavailable Node binding`, `lutimes '${p}'`); + lutimesSync.call(this.realFs, npath.fromPortablePath(p), atime, mtime); + } + async mkdirPromise(p, opts) { + return await new Promise((resolve, reject) => { + this.realFs.mkdir( + npath.fromPortablePath(p), + opts, + this.makeCallback(resolve, reject), + ); + }); + } + mkdirSync(p, opts) { + return this.realFs.mkdirSync(npath.fromPortablePath(p), opts); + } + async rmdirPromise(p, opts) { + return await new Promise((resolve, reject) => { + if (opts) { + this.realFs.rmdir( + npath.fromPortablePath(p), + opts, + this.makeCallback(resolve, reject), + ); + } else { + this.realFs.rmdir( + npath.fromPortablePath(p), + this.makeCallback(resolve, reject), + ); + } + }); + } + rmdirSync(p, opts) { + return this.realFs.rmdirSync(npath.fromPortablePath(p), opts); + } + async linkPromise(existingP, newP) { + return await new Promise((resolve, reject) => { + this.realFs.link( + npath.fromPortablePath(existingP), + npath.fromPortablePath(newP), + this.makeCallback(resolve, reject), + ); + }); + } + linkSync(existingP, newP) { + return this.realFs.linkSync( + npath.fromPortablePath(existingP), + npath.fromPortablePath(newP), + ); + } + async symlinkPromise(target, p, type) { + return await new Promise((resolve, reject) => { + this.realFs.symlink( + npath.fromPortablePath(target.replace(/\/+$/, ``)), + npath.fromPortablePath(p), + type, + this.makeCallback(resolve, reject), + ); + }); + } + symlinkSync(target, p, type) { + return this.realFs.symlinkSync( + npath.fromPortablePath(target.replace(/\/+$/, ``)), + npath.fromPortablePath(p), + type, + ); + } + async readFilePromise(p, encoding) { + return await new Promise((resolve, reject) => { + const fsNativePath = + typeof p === `string` ? npath.fromPortablePath(p) : p; + this.realFs.readFile( + fsNativePath, + encoding, + this.makeCallback(resolve, reject), + ); + }); + } + readFileSync(p, encoding) { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + return this.realFs.readFileSync(fsNativePath, encoding); + } + async readdirPromise(p, opts) { + return await new Promise((resolve, reject) => { + if (opts == null ? void 0 : opts.withFileTypes) { + this.realFs.readdir( + npath.fromPortablePath(p), + { withFileTypes: true }, + this.makeCallback(resolve, reject), + ); + } else { + this.realFs.readdir( + npath.fromPortablePath(p), + this.makeCallback((value) => resolve(value), reject), + ); + } + }); + } + readdirSync(p, opts) { + if (opts == null ? void 0 : opts.withFileTypes) { + return this.realFs.readdirSync(npath.fromPortablePath(p), { + withFileTypes: true, + }); + } else { + return this.realFs.readdirSync(npath.fromPortablePath(p)); + } + } + async readlinkPromise(p) { + return await new Promise((resolve, reject) => { + this.realFs.readlink( + npath.fromPortablePath(p), + this.makeCallback(resolve, reject), + ); + }).then((path) => { + return npath.toPortablePath(path); + }); + } + readlinkSync(p) { + return npath.toPortablePath( + this.realFs.readlinkSync(npath.fromPortablePath(p)), + ); + } + async truncatePromise(p, len) { + return await new Promise((resolve, reject) => { + this.realFs.truncate( + npath.fromPortablePath(p), + len, + this.makeCallback(resolve, reject), + ); + }); + } + truncateSync(p, len) { + return this.realFs.truncateSync(npath.fromPortablePath(p), len); + } + async ftruncatePromise(fd, len) { + return await new Promise((resolve, reject) => { + this.realFs.ftruncate(fd, len, this.makeCallback(resolve, reject)); + }); + } + ftruncateSync(fd, len) { + return this.realFs.ftruncateSync(fd, len); + } + watch(p, a, b) { + return this.realFs.watch(npath.fromPortablePath(p), a, b); + } + watchFile(p, a, b) { + return this.realFs.watchFile(npath.fromPortablePath(p), a, b); + } + unwatchFile(p, cb) { + return this.realFs.unwatchFile(npath.fromPortablePath(p), cb); + } + makeCallback(resolve, reject) { + return (err, result) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }; + } +} + +class ProxiedFS extends FakeFS { + getExtractHint(hints) { + return this.baseFs.getExtractHint(hints); + } + resolve(path) { + return this.mapFromBase(this.baseFs.resolve(this.mapToBase(path))); + } + getRealPath() { + return this.mapFromBase(this.baseFs.getRealPath()); + } + async openPromise(p, flags, mode) { + return this.baseFs.openPromise(this.mapToBase(p), flags, mode); + } + openSync(p, flags, mode) { + return this.baseFs.openSync(this.mapToBase(p), flags, mode); + } + async opendirPromise(p, opts) { + return Object.assign( + await this.baseFs.opendirPromise(this.mapToBase(p), opts), + { path: p }, + ); + } + opendirSync(p, opts) { + return Object.assign(this.baseFs.opendirSync(this.mapToBase(p), opts), { + path: p, + }); + } + async readPromise(fd, buffer, offset, length, position) { + return await this.baseFs.readPromise(fd, buffer, offset, length, position); + } + readSync(fd, buffer, offset, length, position) { + return this.baseFs.readSync(fd, buffer, offset, length, position); + } + async writePromise(fd, buffer, offset, length, position) { + if (typeof buffer === `string`) { + return await this.baseFs.writePromise(fd, buffer, offset); + } else { + return await this.baseFs.writePromise( + fd, + buffer, + offset, + length, + position, + ); + } + } + writeSync(fd, buffer, offset, length, position) { + if (typeof buffer === `string`) { + return this.baseFs.writeSync(fd, buffer, offset); + } else { + return this.baseFs.writeSync(fd, buffer, offset, length, position); + } + } + async closePromise(fd) { + return this.baseFs.closePromise(fd); + } + closeSync(fd) { + this.baseFs.closeSync(fd); + } + createReadStream(p, opts) { + return this.baseFs.createReadStream( + p !== null ? this.mapToBase(p) : p, + opts, + ); + } + createWriteStream(p, opts) { + return this.baseFs.createWriteStream( + p !== null ? this.mapToBase(p) : p, + opts, + ); + } + async realpathPromise(p) { + return this.mapFromBase( + await this.baseFs.realpathPromise(this.mapToBase(p)), + ); + } + realpathSync(p) { + return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(p))); + } + async existsPromise(p) { + return this.baseFs.existsPromise(this.mapToBase(p)); + } + existsSync(p) { + return this.baseFs.existsSync(this.mapToBase(p)); + } + accessSync(p, mode) { + return this.baseFs.accessSync(this.mapToBase(p), mode); + } + async accessPromise(p, mode) { + return this.baseFs.accessPromise(this.mapToBase(p), mode); + } + async statPromise(p, opts) { + return this.baseFs.statPromise(this.mapToBase(p), opts); + } + statSync(p, opts) { + return this.baseFs.statSync(this.mapToBase(p), opts); + } + async fstatPromise(fd, opts) { + return this.baseFs.fstatPromise(fd, opts); + } + fstatSync(fd, opts) { + return this.baseFs.fstatSync(fd, opts); + } + lstatPromise(p, opts) { + return this.baseFs.lstatPromise(this.mapToBase(p), opts); + } + lstatSync(p, opts) { + return this.baseFs.lstatSync(this.mapToBase(p), opts); + } + async fchmodPromise(fd, mask) { + return this.baseFs.fchmodPromise(fd, mask); + } + fchmodSync(fd, mask) { + return this.baseFs.fchmodSync(fd, mask); + } + async chmodPromise(p, mask) { + return this.baseFs.chmodPromise(this.mapToBase(p), mask); + } + chmodSync(p, mask) { + return this.baseFs.chmodSync(this.mapToBase(p), mask); + } + async fchownPromise(fd, uid, gid) { + return this.baseFs.fchownPromise(fd, uid, gid); + } + fchownSync(fd, uid, gid) { + return this.baseFs.fchownSync(fd, uid, gid); + } + async chownPromise(p, uid, gid) { + return this.baseFs.chownPromise(this.mapToBase(p), uid, gid); + } + chownSync(p, uid, gid) { + return this.baseFs.chownSync(this.mapToBase(p), uid, gid); + } + async renamePromise(oldP, newP) { + return this.baseFs.renamePromise( + this.mapToBase(oldP), + this.mapToBase(newP), + ); + } + renameSync(oldP, newP) { + return this.baseFs.renameSync(this.mapToBase(oldP), this.mapToBase(newP)); + } + async copyFilePromise(sourceP, destP, flags = 0) { + return this.baseFs.copyFilePromise( + this.mapToBase(sourceP), + this.mapToBase(destP), + flags, + ); + } + copyFileSync(sourceP, destP, flags = 0) { + return this.baseFs.copyFileSync( + this.mapToBase(sourceP), + this.mapToBase(destP), + flags, + ); + } + async appendFilePromise(p, content, opts) { + return this.baseFs.appendFilePromise(this.fsMapToBase(p), content, opts); + } + appendFileSync(p, content, opts) { + return this.baseFs.appendFileSync(this.fsMapToBase(p), content, opts); + } + async writeFilePromise(p, content, opts) { + return this.baseFs.writeFilePromise(this.fsMapToBase(p), content, opts); + } + writeFileSync(p, content, opts) { + return this.baseFs.writeFileSync(this.fsMapToBase(p), content, opts); + } + async unlinkPromise(p) { + return this.baseFs.unlinkPromise(this.mapToBase(p)); + } + unlinkSync(p) { + return this.baseFs.unlinkSync(this.mapToBase(p)); + } + async utimesPromise(p, atime, mtime) { + return this.baseFs.utimesPromise(this.mapToBase(p), atime, mtime); + } + utimesSync(p, atime, mtime) { + return this.baseFs.utimesSync(this.mapToBase(p), atime, mtime); + } + async mkdirPromise(p, opts) { + return this.baseFs.mkdirPromise(this.mapToBase(p), opts); + } + mkdirSync(p, opts) { + return this.baseFs.mkdirSync(this.mapToBase(p), opts); + } + async rmdirPromise(p, opts) { + return this.baseFs.rmdirPromise(this.mapToBase(p), opts); + } + rmdirSync(p, opts) { + return this.baseFs.rmdirSync(this.mapToBase(p), opts); + } + async linkPromise(existingP, newP) { + return this.baseFs.linkPromise( + this.mapToBase(existingP), + this.mapToBase(newP), + ); + } + linkSync(existingP, newP) { + return this.baseFs.linkSync( + this.mapToBase(existingP), + this.mapToBase(newP), + ); + } + async symlinkPromise(target, p, type) { + const mappedP = this.mapToBase(p); + if (this.pathUtils.isAbsolute(target)) + return this.baseFs.symlinkPromise(this.mapToBase(target), mappedP, type); + const mappedAbsoluteTarget = this.mapToBase( + this.pathUtils.join(this.pathUtils.dirname(p), target), + ); + const mappedTarget = this.baseFs.pathUtils.relative( + this.baseFs.pathUtils.dirname(mappedP), + mappedAbsoluteTarget, + ); + return this.baseFs.symlinkPromise(mappedTarget, mappedP, type); + } + symlinkSync(target, p, type) { + const mappedP = this.mapToBase(p); + if (this.pathUtils.isAbsolute(target)) + return this.baseFs.symlinkSync(this.mapToBase(target), mappedP, type); + const mappedAbsoluteTarget = this.mapToBase( + this.pathUtils.join(this.pathUtils.dirname(p), target), + ); + const mappedTarget = this.baseFs.pathUtils.relative( + this.baseFs.pathUtils.dirname(mappedP), + mappedAbsoluteTarget, + ); + return this.baseFs.symlinkSync(mappedTarget, mappedP, type); + } + async readFilePromise(p, encoding) { + if (encoding === `utf8`) { + return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding); + } else { + return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding); + } + } + readFileSync(p, encoding) { + if (encoding === `utf8`) { + return this.baseFs.readFileSync(this.fsMapToBase(p), encoding); + } else { + return this.baseFs.readFileSync(this.fsMapToBase(p), encoding); + } + } + async readdirPromise(p, opts) { + return this.baseFs.readdirPromise(this.mapToBase(p), opts); + } + readdirSync(p, opts) { + return this.baseFs.readdirSync(this.mapToBase(p), opts); + } + async readlinkPromise(p) { + return this.mapFromBase( + await this.baseFs.readlinkPromise(this.mapToBase(p)), + ); + } + readlinkSync(p) { + return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(p))); + } + async truncatePromise(p, len) { + return this.baseFs.truncatePromise(this.mapToBase(p), len); + } + truncateSync(p, len) { + return this.baseFs.truncateSync(this.mapToBase(p), len); + } + async ftruncatePromise(fd, len) { + return this.baseFs.ftruncatePromise(fd, len); + } + ftruncateSync(fd, len) { + return this.baseFs.ftruncateSync(fd, len); + } + watch(p, a, b) { + return this.baseFs.watch(this.mapToBase(p), a, b); + } + watchFile(p, a, b) { + return this.baseFs.watchFile(this.mapToBase(p), a, b); + } + unwatchFile(p, cb) { + return this.baseFs.unwatchFile(this.mapToBase(p), cb); + } + fsMapToBase(p) { + if (typeof p === `number`) { + return p; + } else { + return this.mapToBase(p); + } + } +} + +const NUMBER_REGEXP = /^[0-9]+$/; +const VIRTUAL_REGEXP = + /^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/; +const VALID_COMPONENT = /^([^/]+-)?[a-f0-9]+$/; +class VirtualFS extends ProxiedFS { + constructor({ baseFs = new NodeFS() } = {}) { + super(ppath); + this.baseFs = baseFs; + } + static makeVirtualPath(base, component, to) { + if (ppath.basename(base) !== `__virtual__`) + throw new Error( + `Assertion failed: Virtual folders must be named "__virtual__"`, + ); + if (!ppath.basename(component).match(VALID_COMPONENT)) + throw new Error( + `Assertion failed: Virtual components must be ended by an hexadecimal hash`, + ); + const target = ppath.relative(ppath.dirname(base), to); + const segments = target.split(`/`); + let depth = 0; + while (depth < segments.length && segments[depth] === `..`) depth += 1; + const finalSegments = segments.slice(depth); + const fullVirtualPath = ppath.join( + base, + component, + String(depth), + ...finalSegments, + ); + return fullVirtualPath; + } + static resolveVirtual(p) { + const match = p.match(VIRTUAL_REGEXP); + if (!match || (!match[3] && match[5])) return p; + const target = ppath.dirname(match[1]); + if (!match[3] || !match[4]) return target; + const isnum = NUMBER_REGEXP.test(match[4]); + if (!isnum) return p; + const depth = Number(match[4]); + const backstep = `../`.repeat(depth); + const subpath = match[5] || `.`; + return VirtualFS.resolveVirtual(ppath.join(target, backstep, subpath)); + } + getExtractHint(hints) { + return this.baseFs.getExtractHint(hints); + } + getRealPath() { + return this.baseFs.getRealPath(); + } + realpathSync(p) { + const match = p.match(VIRTUAL_REGEXP); + if (!match) return this.baseFs.realpathSync(p); + if (!match[5]) return p; + const realpath = this.baseFs.realpathSync(this.mapToBase(p)); + return VirtualFS.makeVirtualPath(match[1], match[3], realpath); + } + async realpathPromise(p) { + const match = p.match(VIRTUAL_REGEXP); + if (!match) return await this.baseFs.realpathPromise(p); + if (!match[5]) return p; + const realpath = await this.baseFs.realpathPromise(this.mapToBase(p)); + return VirtualFS.makeVirtualPath(match[1], match[3], realpath); + } + mapToBase(p) { + if (p === ``) return p; + if (this.pathUtils.isAbsolute(p)) return VirtualFS.resolveVirtual(p); + const resolvedRoot = VirtualFS.resolveVirtual( + this.baseFs.resolve(PortablePath.dot), + ); + const resolvedP = VirtualFS.resolveVirtual(this.baseFs.resolve(p)); + return ppath.relative(resolvedRoot, resolvedP) || PortablePath.dot; + } + mapFromBase(p) { + return p; + } +} + +const [major, minor] = process.versions.node + .split(`.`) + .map((value) => parseInt(value, 10)); +const HAS_CONSOLIDATED_HOOKS = major > 16 || (major === 16 && minor >= 12); +const HAS_UNFLAGGED_JSON_MODULES = + major > 17 || (major === 17 && minor >= 5) || (major === 16 && minor >= 15); +const HAS_JSON_IMPORT_ASSERTION_REQUIREMENT = + major > 17 || (major === 17 && minor >= 1) || (major === 16 && minor > 14); +const WATCH_MODE_MESSAGE_USES_ARRAYS = + major > 19 || (major === 19 && minor >= 2) || (major === 18 && minor >= 13); + +const builtinModules = new Set( + Module.builtinModules || Object.keys(process.binding(`natives`)), +); +const isBuiltinModule = (request) => + request.startsWith(`node:`) || builtinModules.has(request); +function readPackageScope(checkPath) { + const rootSeparatorIndex = checkPath.indexOf(npath.sep); + let separatorIndex; + do { + separatorIndex = checkPath.lastIndexOf(npath.sep); + checkPath = checkPath.slice(0, separatorIndex); + if (checkPath.endsWith(`${npath.sep}node_modules`)) return false; + const pjson = readPackage(checkPath + npath.sep); + if (pjson) { + return { + data: pjson, + path: checkPath, + }; + } + } while (separatorIndex > rootSeparatorIndex); + return false; +} +function readPackage(requestPath) { + const jsonPath = npath.resolve(requestPath, `package.json`); + if (!fs.existsSync(jsonPath)) return null; + return JSON.parse(fs.readFileSync(jsonPath, `utf8`)); +} + +async function tryReadFile$1(path2) { + try { + return await fs.promises.readFile(path2, `utf8`); + } catch (error) { + if (error.code === `ENOENT`) return null; + throw error; + } +} +function tryParseURL(str, base) { + try { + return new URL$1(str, base); + } catch { + return null; + } +} +let entrypointPath = null; +function setEntrypointPath(file) { + entrypointPath = file; +} +function getFileFormat(filepath) { + var _a, _b; + const ext = path.extname(filepath); + switch (ext) { + case `.mjs`: { + return `module`; + } + case `.cjs`: { + return `commonjs`; + } + case `.wasm`: { + throw new Error(`Unknown file extension ".wasm" for ${filepath}`); + } + case `.json`: { + if (HAS_UNFLAGGED_JSON_MODULES) return `json`; + throw new Error(`Unknown file extension ".json" for ${filepath}`); + } + case `.js`: { + const pkg = readPackageScope(filepath); + if (!pkg) return `commonjs`; + return (_a = pkg.data.type) != null ? _a : `commonjs`; + } + default: { + if (entrypointPath !== filepath) return null; + const pkg = readPackageScope(filepath); + if (!pkg) return `commonjs`; + if (pkg.data.type === `module`) return null; + return (_b = pkg.data.type) != null ? _b : `commonjs`; + } + } +} + +async function getFormat$1(resolved, context, defaultGetFormat) { + const url = tryParseURL(resolved); + if ((url == null ? void 0 : url.protocol) !== `file:`) + return defaultGetFormat(resolved, context, defaultGetFormat); + const format = getFileFormat(fileURLToPath(url)); + if (format) { + return { + format, + }; + } + return defaultGetFormat(resolved, context, defaultGetFormat); +} + +async function getSource$1(urlString, context, defaultGetSource) { + const url = tryParseURL(urlString); + if ((url == null ? void 0 : url.protocol) !== `file:`) + return defaultGetSource(urlString, context, defaultGetSource); + return { + source: await fs.promises.readFile(fileURLToPath(url), `utf8`), + }; +} + +async function load$1(urlString, context, nextLoad) { + var _a; + const url = tryParseURL(urlString); + if ((url == null ? void 0 : url.protocol) !== `file:`) + return nextLoad(urlString, context, nextLoad); + const filePath = fileURLToPath(url); + const format = getFileFormat(filePath); + if (!format) return nextLoad(urlString, context, nextLoad); + if ( + HAS_JSON_IMPORT_ASSERTION_REQUIREMENT && + format === `json` && + ((_a = context.importAssertions) == null ? void 0 : _a.type) !== `json` + ) { + const err = new TypeError( + `[ERR_IMPORT_ASSERTION_TYPE_MISSING]: Module "${urlString}" needs an import assertion of type "json"`, + ); + err.code = `ERR_IMPORT_ASSERTION_TYPE_MISSING`; + throw err; + } + if (process.env.WATCH_REPORT_DEPENDENCIES && process.send) { + const pathToSend = pathToFileURL( + npath.fromPortablePath( + VirtualFS.resolveVirtual(npath.toPortablePath(filePath)), + ), + ).href; + process.send({ + "watch:import": WATCH_MODE_MESSAGE_USES_ARRAYS + ? [pathToSend] + : pathToSend, + }); + } + return { + format, + source: await fs.promises.readFile(filePath, `utf8`), + shortCircuit: true, + }; +} + +const ArrayIsArray = Array.isArray; +const JSONStringify = JSON.stringify; +const ObjectGetOwnPropertyNames = Object.getOwnPropertyNames; +const ObjectPrototypeHasOwnProperty = (obj, prop) => + Object.prototype.hasOwnProperty.call(obj, prop); +const RegExpPrototypeExec = (obj, string) => + RegExp.prototype.exec.call(obj, string); +const RegExpPrototypeSymbolReplace = (obj, ...rest) => + RegExp.prototype[Symbol.replace].apply(obj, rest); +const StringPrototypeEndsWith = (str, ...rest) => + String.prototype.endsWith.apply(str, rest); +const StringPrototypeIncludes = (str, ...rest) => + String.prototype.includes.apply(str, rest); +const StringPrototypeLastIndexOf = (str, ...rest) => + String.prototype.lastIndexOf.apply(str, rest); +const StringPrototypeIndexOf = (str, ...rest) => + String.prototype.indexOf.apply(str, rest); +const StringPrototypeReplace = (str, ...rest) => + String.prototype.replace.apply(str, rest); +const StringPrototypeSlice = (str, ...rest) => + String.prototype.slice.apply(str, rest); +const StringPrototypeStartsWith = (str, ...rest) => + String.prototype.startsWith.apply(str, rest); +const SafeMap = Map; +const JSONParse = JSON.parse; + +function createErrorType(code, messageCreator, errorType) { + return class extends errorType { + constructor(...args) { + super(messageCreator(...args)); + this.code = code; + this.name = `${errorType.name} [${code}]`; + } + }; +} +const ERR_PACKAGE_IMPORT_NOT_DEFINED = createErrorType( + `ERR_PACKAGE_IMPORT_NOT_DEFINED`, + (specifier, packagePath, base) => { + return `Package import specifier "${specifier}" is not defined${ + packagePath ? ` in package ${packagePath}package.json` : `` + } imported from ${base}`; + }, + TypeError, +); +const ERR_INVALID_MODULE_SPECIFIER = createErrorType( + `ERR_INVALID_MODULE_SPECIFIER`, + (request, reason, base = void 0) => { + return `Invalid module "${request}" ${reason}${ + base ? ` imported from ${base}` : `` + }`; + }, + TypeError, +); +const ERR_INVALID_PACKAGE_TARGET = createErrorType( + `ERR_INVALID_PACKAGE_TARGET`, + (pkgPath, key, target, isImport = false, base = void 0) => { + const relError = + typeof target === `string` && + !isImport && + target.length && + !StringPrototypeStartsWith(target, `./`); + if (key === `.`) { + assert(isImport === false); + return `Invalid "exports" main target ${JSONStringify( + target, + )} defined in the package config ${pkgPath}package.json${ + base ? ` imported from ${base}` : `` + }${relError ? `; targets must start with "./"` : ``}`; + } + return `Invalid "${ + isImport ? `imports` : `exports` + }" target ${JSONStringify( + target, + )} defined for '${key}' in the package config ${pkgPath}package.json${ + base ? ` imported from ${base}` : `` + }${relError ? `; targets must start with "./"` : ``}`; + }, + Error, +); +const ERR_INVALID_PACKAGE_CONFIG = createErrorType( + `ERR_INVALID_PACKAGE_CONFIG`, + (path, base, message) => { + return `Invalid package config ${path}${ + base ? ` while importing ${base}` : `` + }${message ? `. ${message}` : ``}`; + }, + Error, +); + +function filterOwnProperties(source, keys) { + const filtered = /* @__PURE__ */ Object.create(null); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + if (ObjectPrototypeHasOwnProperty(source, key)) { + filtered[key] = source[key]; + } + } + return filtered; +} + +const packageJSONCache = new SafeMap(); +function getPackageConfig(path, specifier, base, readFileSyncFn) { + const existing = packageJSONCache.get(path); + if (existing !== void 0) { + return existing; + } + const source = readFileSyncFn(path); + if (source === void 0) { + const packageConfig2 = { + pjsonPath: path, + exists: false, + main: void 0, + name: void 0, + type: "none", + exports: void 0, + imports: void 0, + }; + packageJSONCache.set(path, packageConfig2); + return packageConfig2; + } + let packageJSON; + try { + packageJSON = JSONParse(source); + } catch (error) { + throw new ERR_INVALID_PACKAGE_CONFIG( + path, + (base ? `"${specifier}" from ` : "") + fileURLToPath(base || specifier), + error.message, + ); + } + let { imports, main, name, type } = filterOwnProperties(packageJSON, [ + "imports", + "main", + "name", + "type", + ]); + const exports = ObjectPrototypeHasOwnProperty(packageJSON, "exports") + ? packageJSON.exports + : void 0; + if (typeof imports !== "object" || imports === null) { + imports = void 0; + } + if (typeof main !== "string") { + main = void 0; + } + if (typeof name !== "string") { + name = void 0; + } + if (type !== "module" && type !== "commonjs") { + type = "none"; + } + const packageConfig = { + pjsonPath: path, + exists: true, + main, + name, + type, + exports, + imports, + }; + packageJSONCache.set(path, packageConfig); + return packageConfig; +} +function getPackageScopeConfig(resolved, readFileSyncFn) { + let packageJSONUrl = new URL("./package.json", resolved); + while (true) { + const packageJSONPath2 = packageJSONUrl.pathname; + if ( + StringPrototypeEndsWith(packageJSONPath2, "node_modules/package.json") + ) { + break; + } + const packageConfig2 = getPackageConfig( + fileURLToPath(packageJSONUrl), + resolved, + void 0, + readFileSyncFn, + ); + if (packageConfig2.exists) { + return packageConfig2; + } + const lastPackageJSONUrl = packageJSONUrl; + packageJSONUrl = new URL("../package.json", packageJSONUrl); + if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { + break; + } + } + const packageJSONPath = fileURLToPath(packageJSONUrl); + const packageConfig = { + pjsonPath: packageJSONPath, + exists: false, + main: void 0, + name: void 0, + type: "none", + exports: void 0, + imports: void 0, + }; + packageJSONCache.set(packageJSONPath, packageConfig); + return packageConfig; +} + +/** + @license + Copyright Node.js contributors. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. +*/ +function throwImportNotDefined(specifier, packageJSONUrl, base) { + throw new ERR_PACKAGE_IMPORT_NOT_DEFINED( + specifier, + packageJSONUrl && fileURLToPath(new URL(".", packageJSONUrl)), + fileURLToPath(base), + ); +} +function throwInvalidSubpath(subpath, packageJSONUrl, internal, base) { + const reason = `request is not a valid subpath for the "${ + internal ? "imports" : "exports" + }" resolution of ${fileURLToPath(packageJSONUrl)}`; + throw new ERR_INVALID_MODULE_SPECIFIER( + subpath, + reason, + base && fileURLToPath(base), + ); +} +function throwInvalidPackageTarget( + subpath, + target, + packageJSONUrl, + internal, + base, +) { + if (typeof target === "object" && target !== null) { + target = JSONStringify(target, null, ""); + } else { + target = `${target}`; + } + throw new ERR_INVALID_PACKAGE_TARGET( + fileURLToPath(new URL(".", packageJSONUrl)), + subpath, + target, + internal, + base && fileURLToPath(base), + ); +} +const invalidSegmentRegEx = + /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i; +const patternRegEx = /\*/g; +function resolvePackageTargetString( + target, + subpath, + match, + packageJSONUrl, + base, + pattern, + internal, + conditions, +) { + if (subpath !== "" && !pattern && target[target.length - 1] !== "/") + throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); + if (!StringPrototypeStartsWith(target, "./")) { + if ( + internal && + !StringPrototypeStartsWith(target, "../") && + !StringPrototypeStartsWith(target, "/") + ) { + let isURL = false; + try { + new URL(target); + isURL = true; + } catch {} + if (!isURL) { + const exportTarget = pattern + ? RegExpPrototypeSymbolReplace(patternRegEx, target, () => subpath) + : target + subpath; + return exportTarget; + } + } + throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); + } + if ( + RegExpPrototypeExec( + invalidSegmentRegEx, + StringPrototypeSlice(target, 2), + ) !== null + ) + throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); + const resolved = new URL(target, packageJSONUrl); + const resolvedPath = resolved.pathname; + const packagePath = new URL(".", packageJSONUrl).pathname; + if (!StringPrototypeStartsWith(resolvedPath, packagePath)) + throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); + if (subpath === "") return resolved; + if (RegExpPrototypeExec(invalidSegmentRegEx, subpath) !== null) { + const request = pattern + ? StringPrototypeReplace(match, "*", () => subpath) + : match + subpath; + throwInvalidSubpath(request, packageJSONUrl, internal, base); + } + if (pattern) { + return new URL( + RegExpPrototypeSymbolReplace(patternRegEx, resolved.href, () => subpath), + ); + } + return new URL(subpath, resolved); +} +function isArrayIndex(key) { + const keyNum = +key; + if (`${keyNum}` !== key) return false; + return keyNum >= 0 && keyNum < 4294967295; +} +function resolvePackageTarget( + packageJSONUrl, + target, + subpath, + packageSubpath, + base, + pattern, + internal, + conditions, +) { + if (typeof target === "string") { + return resolvePackageTargetString( + target, + subpath, + packageSubpath, + packageJSONUrl, + base, + pattern, + internal, + ); + } else if (ArrayIsArray(target)) { + if (target.length === 0) { + return null; + } + let lastException; + for (let i = 0; i < target.length; i++) { + const targetItem = target[i]; + let resolveResult; + try { + resolveResult = resolvePackageTarget( + packageJSONUrl, + targetItem, + subpath, + packageSubpath, + base, + pattern, + internal, + conditions, + ); + } catch (e) { + lastException = e; + if (e.code === "ERR_INVALID_PACKAGE_TARGET") { + continue; + } + throw e; + } + if (resolveResult === void 0) { + continue; + } + if (resolveResult === null) { + lastException = null; + continue; + } + return resolveResult; + } + if (lastException === void 0 || lastException === null) + return lastException; + throw lastException; + } else if (typeof target === "object" && target !== null) { + const keys = ObjectGetOwnPropertyNames(target); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + if (isArrayIndex(key)) { + throw new ERR_INVALID_PACKAGE_CONFIG( + fileURLToPath(packageJSONUrl), + base, + '"exports" cannot contain numeric property keys.', + ); + } + } + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + if (key === "default" || conditions.has(key)) { + const conditionalTarget = target[key]; + const resolveResult = resolvePackageTarget( + packageJSONUrl, + conditionalTarget, + subpath, + packageSubpath, + base, + pattern, + internal, + conditions, + ); + if (resolveResult === void 0) continue; + return resolveResult; + } + } + return void 0; + } else if (target === null) { + return null; + } + throwInvalidPackageTarget( + packageSubpath, + target, + packageJSONUrl, + internal, + base, + ); +} +function patternKeyCompare(a, b) { + const aPatternIndex = StringPrototypeIndexOf(a, "*"); + const bPatternIndex = StringPrototypeIndexOf(b, "*"); + const baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; + const baseLenB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; + if (baseLenA > baseLenB) return -1; + if (baseLenB > baseLenA) return 1; + if (aPatternIndex === -1) return 1; + if (bPatternIndex === -1) return -1; + if (a.length > b.length) return -1; + if (b.length > a.length) return 1; + return 0; +} +function packageImportsResolve({ name, base, conditions, readFileSyncFn }) { + if ( + name === "#" || + StringPrototypeStartsWith(name, "#/") || + StringPrototypeEndsWith(name, "/") + ) { + const reason = "is not a valid internal imports specifier name"; + throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath(base)); + } + let packageJSONUrl; + const packageConfig = getPackageScopeConfig(base, readFileSyncFn); + if (packageConfig.exists) { + packageJSONUrl = pathToFileURL(packageConfig.pjsonPath); + const imports = packageConfig.imports; + if (imports) { + if ( + ObjectPrototypeHasOwnProperty(imports, name) && + !StringPrototypeIncludes(name, "*") + ) { + const resolveResult = resolvePackageTarget( + packageJSONUrl, + imports[name], + "", + name, + base, + false, + true, + conditions, + ); + if (resolveResult != null) { + return resolveResult; + } + } else { + let bestMatch = ""; + let bestMatchSubpath; + const keys = ObjectGetOwnPropertyNames(imports); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const patternIndex = StringPrototypeIndexOf(key, "*"); + if ( + patternIndex !== -1 && + StringPrototypeStartsWith( + name, + StringPrototypeSlice(key, 0, patternIndex), + ) + ) { + const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); + if ( + name.length >= key.length && + StringPrototypeEndsWith(name, patternTrailer) && + patternKeyCompare(bestMatch, key) === 1 && + StringPrototypeLastIndexOf(key, "*") === patternIndex + ) { + bestMatch = key; + bestMatchSubpath = StringPrototypeSlice( + name, + patternIndex, + name.length - patternTrailer.length, + ); + } + } + } + if (bestMatch) { + const target = imports[bestMatch]; + const resolveResult = resolvePackageTarget( + packageJSONUrl, + target, + bestMatchSubpath, + bestMatch, + base, + true, + true, + conditions, + ); + if (resolveResult != null) { + return resolveResult; + } + } + } + } + } + throwImportNotDefined(name, packageJSONUrl, base); +} + +const pathRegExp = + /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/; +const isRelativeRegexp = /^\.{0,2}\//; +function tryReadFile(filePath) { + try { + return fs.readFileSync(filePath, `utf8`); + } catch (err) { + if (err.code === `ENOENT`) return void 0; + throw err; + } +} +async function resolvePrivateRequest(specifier, issuer, context, nextResolve) { + const resolved = packageImportsResolve({ + name: specifier, + base: pathToFileURL(issuer), + conditions: new Set(context.conditions), + readFileSyncFn: tryReadFile, + }); + if (resolved instanceof URL$1) { + return { url: resolved.href, shortCircuit: true }; + } else { + if (resolved.startsWith(`#`)) + throw new Error( + `Mapping from one private import to another isn't allowed`, + ); + return resolve$1(resolved, context, nextResolve); + } +} +async function resolve$1(originalSpecifier, context, nextResolve) { + var _a; + const { findPnpApi } = moduleExports; + if (!findPnpApi || isBuiltinModule(originalSpecifier)) + return nextResolve(originalSpecifier, context, nextResolve); + let specifier = originalSpecifier; + const url = tryParseURL( + specifier, + isRelativeRegexp.test(specifier) ? context.parentURL : void 0, + ); + if (url) { + if (url.protocol !== `file:`) + return nextResolve(originalSpecifier, context, nextResolve); + specifier = fileURLToPath(url); + } + const { parentURL, conditions = [] } = context; + const issuer = parentURL ? fileURLToPath(parentURL) : process.cwd(); + const pnpapi = + (_a = findPnpApi(issuer)) != null ? _a : url ? findPnpApi(specifier) : null; + if (!pnpapi) return nextResolve(originalSpecifier, context, nextResolve); + if (specifier.startsWith(`#`)) + return resolvePrivateRequest(specifier, issuer, context, nextResolve); + const dependencyNameMatch = specifier.match(pathRegExp); + let allowLegacyResolve = false; + if (dependencyNameMatch) { + const [, dependencyName, subPath] = dependencyNameMatch; + if (subPath === `` && dependencyName !== `pnpapi`) { + const resolved = pnpapi.resolveToUnqualified( + `${dependencyName}/package.json`, + issuer, + ); + if (resolved) { + const content = await tryReadFile$1(resolved); + if (content) { + const pkg = JSON.parse(content); + allowLegacyResolve = pkg.exports == null; + } + } + } + } + const result = pnpapi.resolveRequest(specifier, issuer, { + conditions: new Set(conditions), + extensions: allowLegacyResolve ? void 0 : [], + }); + if (!result) + throw new Error(`Resolving '${specifier}' from '${issuer}' failed`); + const resultURL = pathToFileURL(result); + if (url) { + resultURL.search = url.search; + resultURL.hash = url.hash; + } + if (!parentURL) setEntrypointPath(fileURLToPath(resultURL)); + return { + url: resultURL.href, + shortCircuit: true, + }; +} + +const binding = process.binding(`fs`); +const originalfstat = binding.fstat; +const ZIP_MASK = 4278190080; +const ZIP_MAGIC = 704643072; +binding.fstat = function (...args) { + const [fd, useBigint, req] = args; + if ((fd & ZIP_MASK) === ZIP_MAGIC && useBigint === false && req === void 0) { + try { + const stats = fs.fstatSync(fd); + return new Float64Array([ + stats.dev, + stats.mode, + stats.nlink, + stats.uid, + stats.gid, + stats.rdev, + stats.blksize, + stats.ino, + stats.size, + stats.blocks, + ]); + } catch {} + } + return originalfstat.apply(this, args); +}; + +const resolve = resolve$1; +const getFormat = HAS_CONSOLIDATED_HOOKS ? void 0 : getFormat$1; +const getSource = HAS_CONSOLIDATED_HOOKS ? void 0 : getSource$1; +const load = HAS_CONSOLIDATED_HOOKS ? load$1 : void 0; + +export { getFormat, getSource, load, resolve }; diff --git a/test/fixtures/yarn-berry/package.json b/test/fixtures/yarn-berry/package.json index 3d91221..8ca0603 100644 --- a/test/fixtures/yarn-berry/package.json +++ b/test/fixtures/yarn-berry/package.json @@ -1,9 +1,11 @@ { - "name": "fixture-yarn", + "name": "fixture-yarn-berry", "private": true, - "version": "0.0.0", "workspaces": [ - "packages/*" + "packages/workspace-a" ], - "packageManager": "yarn@3.5.0" + "packageManager": "yarn@3.6.1", + "dependencies": { + "consola": "3.2.2" + } } diff --git a/test/fixtures/yarn-berry/packages/workspace-a/package.json b/test/fixtures/yarn-berry/packages/workspace-a/package.json index bc24ab0..38b6089 100644 --- a/test/fixtures/yarn-berry/packages/workspace-a/package.json +++ b/test/fixtures/yarn-berry/packages/workspace-a/package.json @@ -1,8 +1,8 @@ { + "name": "workspace-a", "private": true, - "version": "0.0.0", + "packageManager": "yarn@3.6.0", "devDependencies": { - "ufo": "^1.1.1" - }, - "packageManager": "yarn@3.5.0" + "ufo": "1.1.2" + } } diff --git a/test/fixtures/yarn-berry/yarn.lock b/test/fixtures/yarn-berry/yarn.lock index f0a119a..925cd30 100644 --- a/test/fixtures/yarn-berry/yarn.lock +++ b/test/fixtures/yarn-berry/yarn.lock @@ -5,23 +5,32 @@ __metadata: version: 6 cacheKey: 8 -"fixture-yarn@workspace:.": +"consola@npm:3.2.2": + version: 3.2.2 + resolution: "consola@npm:3.2.2" + checksum: 3c22102f74b4dc1519ab2a3096b1975a8b767f258027cef9888ca9d999ed79388e390b969474bce0b42aade73cd2689f62ca511e530a06bf842092f8ef1bf7a6 + languageName: node + linkType: hard + +"fixture-yarn-berry@workspace:.": version: 0.0.0-use.local - resolution: "fixture-yarn@workspace:." + resolution: "fixture-yarn-berry@workspace:." + dependencies: + consola: 3.2.2 languageName: unknown linkType: soft -"ufo@npm:^1.1.1": +"ufo@npm:1.1.2": version: 1.1.2 resolution: "ufo@npm:1.1.2" checksum: 83c940a6a23b6d4fc0cd116265bb5dcf88ab34a408ad9196e413270ca607a4781c09b547dc518f43caee128a096f20fe80b5a0e62b4bcc0a868619896106d048 languageName: node linkType: hard -"workspace-a-2ddc4d@workspace:packages/workspace-a": +"workspace-a@workspace:packages/workspace-a": version: 0.0.0-use.local - resolution: "workspace-a-2ddc4d@workspace:packages/workspace-a" + resolution: "workspace-a@workspace:packages/workspace-a" dependencies: - ufo: ^1.1.1 + ufo: 1.1.2 languageName: unknown linkType: soft diff --git a/test/fixtures/yarn-classic/package.json b/test/fixtures/yarn-classic/package.json index f145c07..95e1197 100644 --- a/test/fixtures/yarn-classic/package.json +++ b/test/fixtures/yarn-classic/package.json @@ -1,10 +1,11 @@ { - "name": "fixture-yarn", + "name": "fixture-yarn-classic", "private": true, - "version": "0.0.0", - "dependencies": {}, + "workspaces": [ + "packages/workspace-a" + ], "packageManager": "yarn@1.22.19", - "devDependencies": { - "ufo": "^1.1.1" + "dependencies": { + "consola": "3.2.2" } } diff --git a/test/fixtures/yarn-classic/packages/workspace-a/package.json b/test/fixtures/yarn-classic/packages/workspace-a/package.json new file mode 100644 index 0000000..6725fd7 --- /dev/null +++ b/test/fixtures/yarn-classic/packages/workspace-a/package.json @@ -0,0 +1,10 @@ +{ + "name": "workspace-a", + "private": true, + "version": "0.0.0", + "packageManager": "yarn@1.22.19", + "devDependencies": { + "ufo": "1.1.2" + }, + "dependencies": {} +} diff --git a/test/fixtures/yarn-classic/yarn.lock b/test/fixtures/yarn-classic/yarn.lock index 3bfc85c..8a419dc 100644 --- a/test/fixtures/yarn-classic/yarn.lock +++ b/test/fixtures/yarn-classic/yarn.lock @@ -2,7 +2,12 @@ # yarn lockfile v1 -ufo@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.1.1.tgz#e70265e7152f3aba425bd013d150b2cdf4056d7c" - integrity sha512-MvlCc4GHrmZdAllBc0iUDowff36Q9Ndw/UzqmEKyrfSzokTd9ZCy1i+IIk5hrYKkjoYVQyNbrw7/F8XJ2rEwTg== +consola@3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/consola/-/consola-3.2.2.tgz#be9b295e1e556355a09ac475b4394016144e0c32" + integrity sha512-r921u0vbF4lQsoIqYvSSER+yZLPQGijOHrYcWoCNVNBZmn/bRR+xT/DgerTze/nLD9TTGzdDa378TVhx7RDOYg== + +ufo@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.1.2.tgz#d0d9e0fa09dece0c31ffd57bd363f030a35cfe76" + integrity sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ== diff --git a/test/index.test.ts b/test/index.test.ts index 9c815d3..32f1677 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -1,56 +1,121 @@ import { fileURLToPath } from "node:url"; -import { expect, it, describe } from "vitest"; +import { expect, it, describe, vi } from "vitest"; import { - detectPackageManager, + installDependencies, addDependency, removeDependency, - installDependencies, + PackageManagerName, + ensureDependencyInstalled, + detectPackageManager, } from "../src"; +import { NO_PACKAGE_MANAGER_DETECTED_ERROR_MSG } from "../src/_utils"; const resolveFixtureDirectory = (name: string) => fileURLToPath(new URL(`fixtures/${name}`, import.meta.url)); +type Fixture = { + name: string; + packageManager?: PackageManagerName; + majorVersion?: string; +}; + const fixtures = [ + { + name: "empty", + packageManager: "pnpm", + }, { name: "npm", - pm: "npm", + packageManager: "npm", }, { name: "pnpm", - pm: "pnpm", + packageManager: "pnpm", }, { name: "yarn-classic", - pm: "yarn", + packageManager: "yarn", majorVersion: "1", }, { name: "yarn-berry", - pm: "yarn", + packageManager: "yarn", majorVersion: "3", }, -]; +] as const satisfies readonly Fixture[]; + +const DEFAULT_WORKSPACE = "workspace-a"; describe("detectPackageManager", () => { for (const fixture of fixtures) { describe(fixture.name, () => { const fixtureDirectory = resolveFixtureDirectory(fixture.name); - it("should detect with lock file", async () => { - const detected = await detectPackageManager(fixtureDirectory, { - ignorePackageJSON: true, + if (fixture.name === "empty") { + it("should detect in parent directory", async () => { + const detected = await detectPackageManager(fixtureDirectory, { + includeParentDirs: true, + }); + + expect(detected).toMatchObject({ name: fixture.packageManager }); }); - expect(detected).toMatchObject({ name: fixture.pm }); - }); + } it("should detect with package.json", async () => { const detected = await detectPackageManager(fixtureDirectory, { ignoreLockFile: true, }); - expect(detected).toMatchObject({ - name: fixture.pm, - majorVersion: fixture.majorVersion || expect.any(String), + + switch (fixture.name) { + case "empty": { + expect(detected).toBe(undefined); + + break; + } + + case "npm": + case "pnpm": { + expect(detected).toMatchObject({ + name: fixture.packageManager, + majorVersion: expect.any(String), + }); + + break; + } + + case "yarn-berry": + case "yarn-classic": { + expect(detected).toMatchObject({ + name: fixture.packageManager, + majorVersion: fixture.majorVersion, + }); + + break; + } + } + }); + + it("should detect with lock file", async () => { + const detected = await detectPackageManager(fixtureDirectory, { + ignorePackageJSON: true, }); + + switch (fixture.name) { + case "empty": { + expect(detected).toBe(undefined); + + break; + } + + case "npm": + case "pnpm": + case "yarn-berry": + case "yarn-classic": { + expect(detected).toMatchObject({ name: fixture.packageManager }); + + break; + } + } }); }); } @@ -61,32 +126,125 @@ describe("api", () => { describe(fixture.name, () => { const fixtureDirectory = resolveFixtureDirectory(fixture.name); - it("installDependencies", async () => { - expect( - await installDependencies({ + it("installs dependencies", async () => { + const installDependenciesSpy = vi.fn(installDependencies); + + const executeInstallDependenciesSpy = () => + installDependenciesSpy({ cwd: fixtureDirectory, silent: false, - }) - ).toBeTruthy(); + }); + + if (fixture.name === "empty") { + expect( + async () => await executeInstallDependenciesSpy(), + ).rejects.toThrowError(NO_PACKAGE_MANAGER_DETECTED_ERROR_MSG); + } else { + await executeInstallDependenciesSpy(); + + expect(installDependenciesSpy).toHaveReturned(); + } + }, 30_000); + + it("adds dependency", async () => { + const addDependencySpy = vi.fn(addDependency); + + const executeAddDependencySpy = () => + addDependencySpy("pathe", { + cwd: fixtureDirectory, + silent: false, + }); + + if (fixture.name === "empty") { + expect( + async () => await executeAddDependencySpy(), + ).rejects.toThrowError(NO_PACKAGE_MANAGER_DETECTED_ERROR_MSG); + } else { + await executeAddDependencySpy(); + + expect(addDependencySpy).toHaveReturned(); + } + }, 30_000); + + it("ensures dependency is installed", async () => { + const ensureDependencyInstalledSpy = vi.fn(ensureDependencyInstalled); + + const executeEnsureDependencyInstalledSpy = () => + ensureDependencyInstalledSpy("pathe", { + cwd: fixtureDirectory, + }); + + if (fixture.name === "empty") { + expect( + async () => await executeEnsureDependencyInstalledSpy(), + ).rejects.toThrowError(NO_PACKAGE_MANAGER_DETECTED_ERROR_MSG); + } else { + await executeEnsureDependencyInstalledSpy(); + + expect(ensureDependencyInstalledSpy).toHaveReturned(); + } + }); + + it("removes dependency", async () => { + const removeDependencySpy = vi.fn(removeDependency); + + const executeRemoveDependencySpy = () => + removeDependencySpy("pathe", { + cwd: fixtureDirectory, + silent: false, + }); + + if (fixture.name === "empty") { + expect( + async () => await executeRemoveDependencySpy(), + ).rejects.toThrowError(NO_PACKAGE_MANAGER_DETECTED_ERROR_MSG); + } else { + await executeRemoveDependencySpy(); + + expect(removeDependencySpy).toHaveReturned(); + } }, 30_000); - it("addDependency", async () => { - expect( - await addDependency("pathe", { + it("adds dependency to workspace", async () => { + const addDependencySpy = vi.fn(addDependency); + + const executeAddDependencySpy = () => + addDependencySpy("pathe", { cwd: fixtureDirectory, silent: false, - workspace: true, - }) - ).toBeTruthy(); + workspace: DEFAULT_WORKSPACE, + }); + + if (fixture.name === "empty") { + expect( + async () => await executeAddDependencySpy(), + ).rejects.toThrowError(NO_PACKAGE_MANAGER_DETECTED_ERROR_MSG); + } else { + await executeAddDependencySpy(); + + expect(addDependencySpy).toHaveReturned(); + } }, 30_000); - it("removeDependency", async () => { - expect( - await removeDependency("pathe", { + it("removes dependency from workspace", async () => { + const removeDependencySpy = vi.fn(removeDependency); + + const executeRemoveDependencySpy = () => + removeDependencySpy("pathe", { cwd: fixtureDirectory, silent: false, - }) - ).toBeTruthy(); + workspace: DEFAULT_WORKSPACE, + }); + + if (fixture.name === "empty") { + expect( + async () => await executeRemoveDependencySpy(), + ).rejects.toThrowError(NO_PACKAGE_MANAGER_DETECTED_ERROR_MSG); + } else { + await executeRemoveDependencySpy(); + + expect(removeDependencySpy).toHaveReturned(); + } }, 30_000); }); }