refactor(text): move lexCompare and nerfDart into the monorepo (#13535)

Both utilities lived in the pnpm/components Bit workspace, where their
component names collide with same-named components elsewhere in the Bit
registry. Move the code here and publish it under new names:

  `@pnpm/util.lex-comparator` -> `@pnpm/text.ordinal-comparator`
  `@pnpm/config.nerf-dart`    -> `@pnpm/config.registry-auth-key`

The new names describe what the utilities do: the comparator is ordinal
rather than locale-aware, and the mapped URL is the key that registry
settings are stored under in `.npmrc`. The exported functions keep their
names, so consumers only change their import specifiers.

Implementations and tests are carried over unchanged. The rationale from
the components' docs pages moves into doc comments: why `localeCompare`
cannot be used for values compared across machines, and where `nerfDart`
originates.

No pacquet counterpart is needed. The Rust stack has its own
implementations of both and no user-visible behavior changes.
This commit is contained in:
Zoltan Kochan authored and GitHub committed 2026-07-31 23:00:10 +02:00
1 parent c2b7cfb930
commit d3556f6ba9
98 files changed
+611 -251

No files matched your search

@@ -0,0 +1,7 @@
---
"@pnpm/text.ordinal-comparator": patch
"@pnpm/config.registry-auth-key": patch
"pnpm": patch
---
`lexCompare` and `nerfDart` are now published as `@pnpm/text.ordinal-comparator` and `@pnpm/config.registry-auth-key`. Use these instead of `@pnpm/util.lex-comparator` and `@pnpm/config.nerf-dart`.
+223 -191
View File
@@ -168,9 +168,6 @@ catalogs:
'@pnpm/config.env-replace':
specifier: ^4.1.0
version: 4.1.0
'@pnpm/config.nerf-dart':
specifier: ^2.0.1
version: 2.0.1
'@pnpm/exec':
specifier: ^4.0.0
version: 4.0.0
@@ -207,9 +204,6 @@ catalogs:
'@pnpm/tgz-fixtures':
specifier: 0.0.0
version: 0.0.0
'@pnpm/util.lex-comparator':
specifier: ^4.0.1
version: 4.0.1
'@reflink/reflink':
specifier: 0.1.19
version: 0.1.19
@@ -1395,7 +1389,7 @@ importers:
dependencies:
'@inquirer/prompts':
specifier: 'catalog:'
version: 8.5.2(@types/node@26.1.2)
version: 8.5.2(@types/node@22.20.1)
'@pnpm/cli.utils':
specifier: workspace:*
version: link:../../cli/utils
@@ -1688,7 +1682,7 @@ importers:
dependencies:
'@inquirer/prompts':
specifier: 'catalog:'
version: 8.5.2(@types/node@26.1.2)
version: 8.5.2(@types/node@22.20.1)
'@pnpm/building.after-install':
specifier: workspace:*
version: link:../after-install
@@ -1728,12 +1722,12 @@ importers:
'@pnpm/store.connection-manager':
specifier: workspace:*
version: link:../../store/connection-manager
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../text/ordinal-comparator
'@pnpm/types':
specifier: workspace:*
version: link:../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
'@pnpm/workspace.projects-sorter':
specifier: workspace:*
version: link:../../workspace/projects-sorter
@@ -2137,12 +2131,12 @@ importers:
'@pnpm/installing.dedupe.types':
specifier: workspace:*
version: link:../../installing/dedupe/types
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../text/ordinal-comparator
'@pnpm/types':
specifier: workspace:*
version: link:../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
ansi-diff:
specifier: 'catalog:'
version: 1.2.0
@@ -2483,9 +2477,9 @@ importers:
'@pnpm/config.matcher':
specifier: workspace:*
version: link:../matcher
'@pnpm/config.nerf-dart':
specifier: 'catalog:'
version: 2.0.1
'@pnpm/config.registry-auth-key':
specifier: workspace:*
version: link:../registry-auth-key
'@pnpm/constants':
specifier: workspace:*
version: link:../../core/constants
@@ -2593,6 +2587,15 @@ importers:
specifier: 'catalog:'
version: 6.0.0
pnpm11/config/registry-auth-key:
devDependencies:
'@jest/globals':
specifier: 'catalog:'
version: 30.4.1(supports-color@10.2.2)
'@pnpm/config.registry-auth-key':
specifier: workspace:*
version: 'link:'
pnpm11/config/version-policy:
dependencies:
'@pnpm/config.matcher':
@@ -2761,14 +2764,14 @@ importers:
version: link:../../fetching/types
openpgp:
specifier: 'catalog:'
version: 6.3.1(@openpgp/web-stream-tools@0.3.1(@types/node@26.1.2)(typescript@6.0.3))
version: 6.3.1(@openpgp/web-stream-tools@0.3.1(@types/node@22.20.1)(typescript@6.0.3))
devDependencies:
'@jest/globals':
specifier: 'catalog:'
version: 30.4.1(supports-color@10.2.2)
'@openpgp/web-stream-tools':
specifier: 'catalog:'
version: 0.3.1(@types/node@26.1.2)(typescript@6.0.3)
version: 0.3.1(@types/node@22.20.1)(typescript@6.0.3)
'@pnpm/crypto.shasums-file':
specifier: workspace:*
version: 'link:'
@@ -2835,7 +2838,7 @@ importers:
dependencies:
'@inquirer/prompts':
specifier: 'catalog:'
version: 8.5.2(@types/node@26.1.2)
version: 8.5.2(@types/node@22.20.1)
'@pnpm/cli.command':
specifier: workspace:*
version: link:../../../cli/command
@@ -3431,15 +3434,15 @@ importers:
'@pnpm/pkg-manifest.reader':
specifier: workspace:*
version: link:../../../pkg-manifest/reader
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../../text/ordinal-comparator
'@pnpm/text.tree-renderer':
specifier: workspace:*
version: link:../../../text/tree-renderer
'@pnpm/types':
specifier: workspace:*
version: link:../../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
'@pnpm/workspace.project-manifest-reader':
specifier: workspace:*
version: link:../../../workspace/project-manifest-reader
@@ -3639,12 +3642,12 @@ importers:
'@pnpm/store.index':
specifier: workspace:*
version: link:../../../store/index
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../../text/ordinal-comparator
'@pnpm/types':
specifier: workspace:*
version: link:../../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
load-json-file:
specifier: 'catalog:'
version: 7.0.1
@@ -3826,7 +3829,7 @@ importers:
dependencies:
'@inquirer/prompts':
specifier: 'catalog:'
version: 8.5.2(@types/node@26.1.2)
version: 8.5.2(@types/node@22.20.1)
'@pnpm/bins.linker':
specifier: workspace:*
version: link:../../../bins/linker
@@ -3981,12 +3984,12 @@ importers:
'@pnpm/resolving.resolver-base':
specifier: workspace:*
version: link:../../../resolving/resolver-base
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../../text/ordinal-comparator
'@pnpm/types':
specifier: workspace:*
version: link:../../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
'@pnpm/worker':
specifier: workspace:^
version: link:../../../worker
@@ -4064,12 +4067,12 @@ importers:
'@pnpm/resolving.resolver-base':
specifier: workspace:*
version: link:../../../resolving/resolver-base
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../../text/ordinal-comparator
'@pnpm/types':
specifier: workspace:*
version: link:../../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
'@pnpm/worker':
specifier: workspace:^
version: link:../../../worker
@@ -4150,7 +4153,7 @@ importers:
dependencies:
'@inquirer/prompts':
specifier: 'catalog:'
version: 8.5.2(@types/node@26.1.2)
version: 8.5.2(@types/node@22.20.1)
'@pnpm/bins.resolver':
specifier: workspace:*
version: link:../../bins/resolver
@@ -4217,12 +4220,12 @@ importers:
'@pnpm/store.path':
specifier: workspace:*
version: link:../../store/path
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../text/ordinal-comparator
'@pnpm/types':
specifier: workspace:*
version: link:../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
'@pnpm/workspace.injected-deps-syncer':
specifier: workspace:*
version: link:../../workspace/injected-deps-syncer
@@ -4517,9 +4520,9 @@ importers:
'@pnpm/test-fixtures':
specifier: workspace:*
version: link:../../__utils__/test-fixtures
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../text/ordinal-comparator
'@zkochan/rimraf':
specifier: 'catalog:'
version: 4.0.0
@@ -4588,12 +4591,12 @@ importers:
'@pnpm/store.create-cafs-store':
specifier: workspace:*
version: link:../../store/create-cafs-store
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../text/ordinal-comparator
'@pnpm/types':
specifier: workspace:*
version: link:../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
tempy:
specifier: 'catalog:'
version: 3.0.0
@@ -4710,9 +4713,9 @@ importers:
'@pnpm/test-fixtures':
specifier: workspace:*
version: link:../../__utils__/test-fixtures
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../text/ordinal-comparator
'@types/lodash.throttle':
specifier: 'catalog:'
version: 4.1.9
@@ -4948,12 +4951,12 @@ importers:
'@pnpm/store.connection-manager':
specifier: workspace:*
version: link:../../store/connection-manager
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../text/ordinal-comparator
'@pnpm/types':
specifier: workspace:*
version: link:../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
is-subdir:
specifier: 'catalog:'
version: 2.0.0
@@ -4979,12 +4982,12 @@ importers:
'@pnpm/pkg-manifest.reader':
specifier: workspace:*
version: link:../../pkg-manifest/reader
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../text/ordinal-comparator
'@pnpm/types':
specifier: workspace:*
version: link:../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
devDependencies:
'@pnpm/global.packages':
specifier: workspace:*
@@ -5181,7 +5184,7 @@ importers:
dependencies:
'@inquirer/prompts':
specifier: 'catalog:'
version: 8.5.2(@types/node@26.1.2)
version: 8.5.2(@types/node@22.20.1)
'@pnpm/building.after-install':
specifier: workspace:*
version: link:../../building/after-install
@@ -5311,12 +5314,12 @@ importers:
'@pnpm/store.controller':
specifier: workspace:*
version: link:../../store/controller
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../text/ordinal-comparator
'@pnpm/types':
specifier: workspace:*
version: link:../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
'@pnpm/workspace.project-manifest-reader':
specifier: workspace:*
version: link:../../workspace/project-manifest-reader
@@ -5587,7 +5590,7 @@ importers:
dependencies:
'@inquirer/prompts':
specifier: 'catalog:'
version: 8.5.2(@types/node@26.1.2)
version: 8.5.2(@types/node@22.20.1)
'@pnpm/bins.linker':
specifier: workspace:*
version: link:../../bins/linker
@@ -5744,12 +5747,12 @@ importers:
'@pnpm/store.index':
specifier: workspace:*
version: link:../../store/index
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../text/ordinal-comparator
'@pnpm/types':
specifier: workspace:*
version: link:../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
'@pnpm/worker':
specifier: workspace:^
version: link:../../worker
@@ -5967,12 +5970,12 @@ importers:
'@pnpm/store.controller-types':
specifier: workspace:*
version: link:../../store/controller-types
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../text/ordinal-comparator
'@pnpm/types':
specifier: workspace:*
version: link:../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
'@pnpm/workspace.spec-parser':
specifier: workspace:*
version: link:../../workspace/spec-parser
@@ -6367,12 +6370,12 @@ importers:
'@pnpm/core-loggers':
specifier: workspace:*
version: link:../../../core/core-loggers
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../../text/ordinal-comparator
'@pnpm/types':
specifier: workspace:*
version: link:../../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
is-subdir:
specifier: 'catalog:'
version: 2.0.0
@@ -7252,9 +7255,9 @@ importers:
pnpm11/network/auth-header:
dependencies:
'@pnpm/config.nerf-dart':
specifier: 'catalog:'
version: 2.0.1
'@pnpm/config.registry-auth-key':
specifier: workspace:*
version: link:../../config/registry-auth-key
'@pnpm/error':
specifier: workspace:*
version: link:../../core/error
@@ -7274,9 +7277,9 @@ importers:
pnpm11/network/fetch:
dependencies:
'@pnpm/config.nerf-dart':
specifier: 'catalog:'
version: 2.0.1
'@pnpm/config.registry-auth-key':
specifier: workspace:*
version: link:../../config/registry-auth-key
'@pnpm/core-loggers':
specifier: workspace:*
version: link:../../core/core-loggers
@@ -7355,9 +7358,9 @@ importers:
pnpm11/object/key-sorting:
dependencies:
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../text/ordinal-comparator
sort-keys:
specifier: 'catalog:'
version: 6.0.1
@@ -7411,7 +7414,7 @@ importers:
dependencies:
'@inquirer/prompts':
specifier: 'catalog:'
version: 8.5.2(@types/node@26.1.2)
version: 8.5.2(@types/node@22.20.1)
'@pnpm/cli.utils':
specifier: workspace:*
version: link:../../cli/utils
@@ -7844,12 +7847,12 @@ importers:
'@pnpm/testing.registry-mock':
specifier: workspace:*
version: link:../testing/registry-mock
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../text/ordinal-comparator
'@pnpm/types':
specifier: workspace:*
version: link:../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
'@pnpm/worker':
specifier: workspace:*
version: link:../worker
@@ -8138,7 +8141,7 @@ importers:
dependencies:
'@inquirer/prompts':
specifier: 'catalog:'
version: 8.5.2(@types/node@26.1.2)
version: 8.5.2(@types/node@22.20.1)
'@pnpm/cli.utils':
specifier: workspace:*
version: link:../../cli/utils
@@ -8223,7 +8226,7 @@ importers:
dependencies:
'@inquirer/prompts':
specifier: 'catalog:'
version: 8.5.2(@types/node@26.1.2)
version: 8.5.2(@types/node@22.20.1)
'@pnpm/bins.resolver':
specifier: workspace:*
version: link:../../bins/resolver
@@ -9118,12 +9121,12 @@ importers:
'@pnpm/store.path':
specifier: workspace:*
version: link:../path
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../text/ordinal-comparator
'@pnpm/types':
specifier: workspace:*
version: link:../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
archy:
specifier: 'catalog:'
version: 1.0.0
@@ -9552,6 +9555,15 @@ importers:
specifier: workspace:*
version: 'link:'
pnpm11/text/ordinal-comparator:
devDependencies:
'@jest/globals':
specifier: 'catalog:'
version: 30.4.1(supports-color@10.2.2)
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: 'link:'
pnpm11/text/tree-renderer:
devDependencies:
'@jest/globals':
@@ -9595,7 +9607,7 @@ importers:
version: link:../store/index
'@rushstack/worker-pool':
specifier: 'catalog:'
version: 0.7.22(@types/node@26.1.2)
version: 0.7.22(@types/node@22.20.1)
is-windows:
specifier: 'catalog:'
version: 1.0.2
@@ -9694,12 +9706,12 @@ importers:
'@pnpm/pkg-manifest.reader':
specifier: workspace:*
version: link:../../pkg-manifest/reader
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../text/ordinal-comparator
'@pnpm/types':
specifier: workspace:*
version: link:../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
'@pnpm/workspace.projects-reader':
specifier: workspace:*
version: link:../projects-reader
@@ -9927,12 +9939,12 @@ importers:
'@pnpm/constants':
specifier: workspace:*
version: link:../../core/constants
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../text/ordinal-comparator
'@pnpm/types':
specifier: workspace:*
version: link:../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
'@pnpm/workspace.project-manifest-reader':
specifier: workspace:*
version: link:../project-manifest-reader
@@ -10089,12 +10101,12 @@ importers:
'@pnpm/lockfile.types':
specifier: workspace:*
version: link:../../lockfile/types
'@pnpm/text.ordinal-comparator':
specifier: workspace:*
version: link:../../text/ordinal-comparator
'@pnpm/types':
specifier: workspace:*
version: link:../../core/types
'@pnpm/util.lex-comparator':
specifier: 'catalog:'
version: 4.0.1
'@pnpm/workspace.workspace-manifest-reader':
specifier: workspace:*
version: link:../workspace-manifest-reader
@@ -11397,10 +11409,6 @@ packages:
resolution: {integrity: sha512-03d2l21gAyzGVr9SR6rS5pvCTnZ4HaNdi8jB2Y/UGvszzrNbA+AJVObVw6SulNQ1Eah3SHB9wCezJwtP+jYIcA==}
engines: {node: '>=18.12'}
'@pnpm/config.nerf-dart@2.0.1':
resolution: {integrity: sha512-4jAXyUB1PyY6eETXojxYrXL2NWtcZVxQx8nHTkJjyy0aEx1quMxlIqwnlh8YZRaXcfiqM6VCIEc+BLZWwQq6yg==}
engines: {node: '>=22.13'}
'@pnpm/config@1004.11.0':
resolution: {integrity: sha512-NuiUOC00Vjfy7oAbj2xBKwlTJysXVLjuT0FoCYtrvhf1z62xKZOWY+uSHUtvjdx7G73JDoShEAYd0tDLxvg1WQ==}
engines: {node: '>=18.12'}
@@ -11905,10 +11913,6 @@ packages:
resolution: {integrity: sha512-blFO4Ws97tWv/SNE6N39ZdGmZBrocXnBOfVp0ln4kELmns4pGPZizqyRtR8EjfOLMLstbmNCTReBoDvLz1isVg==}
engines: {node: '>=18.12'}
'@pnpm/util.lex-comparator@4.0.1':
resolution: {integrity: sha512-EZ3aWU7ThppE3Xgq7/ftxq8J/nit6z8I2/wZbC/acea2Zw7KJ1k/fLkGBgyyVAE37CULFsOSmPl3EjYM18cB2Q==}
engines: {node: '>=22.13'}
'@pnpm/which@3.0.1':
resolution: {integrity: sha512-4ivtS12Oni9axgGefaq+gTPD+7N0VPCFdxFH8izCaWfnxLQblX3iVxba+25ZoagStlzUs8sQg8OMKlCVhyGWTw==}
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
@@ -17884,48 +17888,48 @@ snapshots:
'@inquirer/ansi@2.0.7': {}
'@inquirer/checkbox@5.2.1(@types/node@26.1.2)':
'@inquirer/checkbox@5.2.1(@types/node@22.20.1)':
dependencies:
'@inquirer/ansi': 2.0.7
'@inquirer/core': 11.2.1(@types/node@26.1.2)
'@inquirer/core': 11.2.1(@types/node@22.20.1)
'@inquirer/figures': 2.0.7
'@inquirer/type': 4.0.7(@types/node@26.1.2)
'@inquirer/type': 4.0.7(@types/node@22.20.1)
optionalDependencies:
'@types/node': 26.1.2
'@types/node': 22.20.1
'@inquirer/confirm@6.1.1(@types/node@26.1.2)':
'@inquirer/confirm@6.1.1(@types/node@22.20.1)':
dependencies:
'@inquirer/core': 11.2.1(@types/node@26.1.2)
'@inquirer/type': 4.0.7(@types/node@26.1.2)
'@inquirer/core': 11.2.1(@types/node@22.20.1)
'@inquirer/type': 4.0.7(@types/node@22.20.1)
optionalDependencies:
'@types/node': 26.1.2
'@types/node': 22.20.1
'@inquirer/core@11.2.1(@types/node@26.1.2)':
'@inquirer/core@11.2.1(@types/node@22.20.1)':
dependencies:
'@inquirer/ansi': 2.0.7
'@inquirer/figures': 2.0.7
'@inquirer/type': 4.0.7(@types/node@26.1.2)
'@inquirer/type': 4.0.7(@types/node@22.20.1)
cli-width: 4.1.0
fast-wrap-ansi: 0.2.2
mute-stream: 3.0.0
signal-exit: 4.1.0
optionalDependencies:
'@types/node': 26.1.2
'@types/node': 22.20.1
'@inquirer/editor@5.2.2(@types/node@26.1.2)':
'@inquirer/editor@5.2.2(@types/node@22.20.1)':
dependencies:
'@inquirer/core': 11.2.1(@types/node@26.1.2)
'@inquirer/external-editor': 3.0.3(@types/node@26.1.2)
'@inquirer/type': 4.0.7(@types/node@26.1.2)
'@inquirer/core': 11.2.1(@types/node@22.20.1)
'@inquirer/external-editor': 3.0.3(@types/node@22.20.1)
'@inquirer/type': 4.0.7(@types/node@22.20.1)
optionalDependencies:
'@types/node': 26.1.2
'@types/node': 22.20.1
'@inquirer/expand@5.1.1(@types/node@26.1.2)':
'@inquirer/expand@5.1.1(@types/node@22.20.1)':
dependencies:
'@inquirer/core': 11.2.1(@types/node@26.1.2)
'@inquirer/type': 4.0.7(@types/node@26.1.2)
'@inquirer/core': 11.2.1(@types/node@22.20.1)
'@inquirer/type': 4.0.7(@types/node@22.20.1)
optionalDependencies:
'@types/node': 26.1.2
'@types/node': 22.20.1
'@inquirer/external-editor@1.0.3(@types/node@22.20.1)':
dependencies:
@@ -17934,81 +17938,81 @@ snapshots:
optionalDependencies:
'@types/node': 22.20.1
'@inquirer/external-editor@3.0.3(@types/node@26.1.2)':
'@inquirer/external-editor@3.0.3(@types/node@22.20.1)':
dependencies:
chardet: 2.2.0
iconv-lite: 0.7.3
optionalDependencies:
'@types/node': 26.1.2
'@types/node': 22.20.1
'@inquirer/figures@1.0.15': {}
'@inquirer/figures@2.0.7': {}
'@inquirer/input@5.1.2(@types/node@26.1.2)':
'@inquirer/input@5.1.2(@types/node@22.20.1)':
dependencies:
'@inquirer/core': 11.2.1(@types/node@26.1.2)
'@inquirer/type': 4.0.7(@types/node@26.1.2)
'@inquirer/core': 11.2.1(@types/node@22.20.1)
'@inquirer/type': 4.0.7(@types/node@22.20.1)
optionalDependencies:
'@types/node': 26.1.2
'@types/node': 22.20.1
'@inquirer/number@4.1.1(@types/node@26.1.2)':
'@inquirer/number@4.1.1(@types/node@22.20.1)':
dependencies:
'@inquirer/core': 11.2.1(@types/node@26.1.2)
'@inquirer/type': 4.0.7(@types/node@26.1.2)
'@inquirer/core': 11.2.1(@types/node@22.20.1)
'@inquirer/type': 4.0.7(@types/node@22.20.1)
optionalDependencies:
'@types/node': 26.1.2
'@types/node': 22.20.1
'@inquirer/password@5.1.1(@types/node@26.1.2)':
'@inquirer/password@5.1.1(@types/node@22.20.1)':
dependencies:
'@inquirer/ansi': 2.0.7
'@inquirer/core': 11.2.1(@types/node@26.1.2)
'@inquirer/type': 4.0.7(@types/node@26.1.2)
'@inquirer/core': 11.2.1(@types/node@22.20.1)
'@inquirer/type': 4.0.7(@types/node@22.20.1)
optionalDependencies:
'@types/node': 26.1.2
'@types/node': 22.20.1
'@inquirer/prompts@8.5.2(@types/node@26.1.2)':
'@inquirer/prompts@8.5.2(@types/node@22.20.1)':
dependencies:
'@inquirer/checkbox': 5.2.1(@types/node@26.1.2)
'@inquirer/confirm': 6.1.1(@types/node@26.1.2)
'@inquirer/editor': 5.2.2(@types/node@26.1.2)
'@inquirer/expand': 5.1.1(@types/node@26.1.2)
'@inquirer/input': 5.1.2(@types/node@26.1.2)
'@inquirer/number': 4.1.1(@types/node@26.1.2)
'@inquirer/password': 5.1.1(@types/node@26.1.2)
'@inquirer/rawlist': 5.3.1(@types/node@26.1.2)
'@inquirer/search': 4.2.1(@types/node@26.1.2)
'@inquirer/select': 5.2.1(@types/node@26.1.2)
'@inquirer/checkbox': 5.2.1(@types/node@22.20.1)
'@inquirer/confirm': 6.1.1(@types/node@22.20.1)
'@inquirer/editor': 5.2.2(@types/node@22.20.1)
'@inquirer/expand': 5.1.1(@types/node@22.20.1)
'@inquirer/input': 5.1.2(@types/node@22.20.1)
'@inquirer/number': 4.1.1(@types/node@22.20.1)
'@inquirer/password': 5.1.1(@types/node@22.20.1)
'@inquirer/rawlist': 5.3.1(@types/node@22.20.1)
'@inquirer/search': 4.2.1(@types/node@22.20.1)
'@inquirer/select': 5.2.1(@types/node@22.20.1)
optionalDependencies:
'@types/node': 26.1.2
'@types/node': 22.20.1
'@inquirer/rawlist@5.3.1(@types/node@26.1.2)':
'@inquirer/rawlist@5.3.1(@types/node@22.20.1)':
dependencies:
'@inquirer/core': 11.2.1(@types/node@26.1.2)
'@inquirer/type': 4.0.7(@types/node@26.1.2)
'@inquirer/core': 11.2.1(@types/node@22.20.1)
'@inquirer/type': 4.0.7(@types/node@22.20.1)
optionalDependencies:
'@types/node': 26.1.2
'@types/node': 22.20.1
'@inquirer/search@4.2.1(@types/node@26.1.2)':
'@inquirer/search@4.2.1(@types/node@22.20.1)':
dependencies:
'@inquirer/core': 11.2.1(@types/node@26.1.2)
'@inquirer/core': 11.2.1(@types/node@22.20.1)
'@inquirer/figures': 2.0.7
'@inquirer/type': 4.0.7(@types/node@26.1.2)
'@inquirer/type': 4.0.7(@types/node@22.20.1)
optionalDependencies:
'@types/node': 26.1.2
'@types/node': 22.20.1
'@inquirer/select@5.2.1(@types/node@26.1.2)':
'@inquirer/select@5.2.1(@types/node@22.20.1)':
dependencies:
'@inquirer/ansi': 2.0.7
'@inquirer/core': 11.2.1(@types/node@26.1.2)
'@inquirer/core': 11.2.1(@types/node@22.20.1)
'@inquirer/figures': 2.0.7
'@inquirer/type': 4.0.7(@types/node@26.1.2)
'@inquirer/type': 4.0.7(@types/node@22.20.1)
optionalDependencies:
'@types/node': 26.1.2
'@types/node': 22.20.1
'@inquirer/type@4.0.7(@types/node@26.1.2)':
'@inquirer/type@4.0.7(@types/node@22.20.1)':
optionalDependencies:
'@types/node': 26.1.2
'@types/node': 22.20.1
'@isaacs/cliui@9.0.0': {}
@@ -18029,7 +18033,7 @@ snapshots:
'@jest/console@30.4.1':
dependencies:
'@jest/types': 30.4.1
'@types/node': 22.20.1
'@types/node': 26.1.2
chalk: 4.1.2
jest-message-util: 30.4.1
jest-util: 30.4.1
@@ -18043,7 +18047,7 @@ snapshots:
'@jest/test-result': 30.4.1
'@jest/transform': 30.4.1(@babel/types@7.29.7)(supports-color@10.2.2)
'@jest/types': 30.4.1
'@types/node': 22.20.1
'@types/node': 26.1.2
ansi-escapes: 4.3.2
chalk: 4.1.2
ci-info: 4.4.0
@@ -18051,7 +18055,7 @@ snapshots:
fast-json-stable-stringify: 2.1.0
graceful-fs: 4.2.11(patch_hash=68ebc232025360cb3dcd3081f4067f4e9fc022ab6b6f71a3230e86c7a5b337d1)
jest-changed-files: 30.4.1
jest-config: 30.4.2(@babel/types@7.29.7)(@types/node@22.20.1)(supports-color@10.2.2)
jest-config: 30.4.2(@babel/types@7.29.7)(@types/node@26.1.2)(supports-color@10.2.2)
jest-haste-map: 30.4.1
jest-message-util: 30.4.1
jest-regex-util: 30.4.0
@@ -18078,7 +18082,7 @@ snapshots:
dependencies:
'@jest/fake-timers': 30.4.1
'@jest/types': 30.4.1
'@types/node': 22.20.1
'@types/node': 26.1.2
jest-mock: 30.4.1
'@jest/expect-utils@30.4.1':
@@ -18096,7 +18100,7 @@ snapshots:
dependencies:
'@jest/types': 30.4.1
'@sinonjs/fake-timers': 15.4.0
'@types/node': 22.20.1
'@types/node': 26.1.2
jest-message-util: 30.4.1
jest-mock: 30.4.1
jest-util: 30.4.1
@@ -18114,7 +18118,7 @@ snapshots:
'@jest/pattern@30.4.0':
dependencies:
'@types/node': 22.20.1
'@types/node': 26.1.2
jest-regex-util: 30.4.0
'@jest/reporters@30.4.1(@babel/types@7.29.7)(supports-color@10.2.2)':
@@ -18125,7 +18129,7 @@ snapshots:
'@jest/transform': 30.4.1(@babel/types@7.29.7)(supports-color@10.2.2)
'@jest/types': 30.4.1
'@jridgewell/trace-mapping': 0.3.31
'@types/node': 22.20.1
'@types/node': 26.1.2
chalk: 4.1.2
collect-v8-coverage: 1.0.3
exit-x: 0.2.2
@@ -18216,7 +18220,7 @@ snapshots:
'@jest/schemas': 30.4.1
'@types/istanbul-lib-coverage': 2.0.6
'@types/istanbul-reports': 3.0.4
'@types/node': 22.20.1
'@types/node': 26.1.2
'@types/yargs': 17.0.35
chalk: 4.1.2
@@ -18345,9 +18349,9 @@ snapshots:
'@npmcli/redact@4.0.0': {}
'@openpgp/web-stream-tools@0.3.1(@types/node@26.1.2)(typescript@6.0.3)':
'@openpgp/web-stream-tools@0.3.1(@types/node@22.20.1)(typescript@6.0.3)':
optionalDependencies:
'@types/node': 26.1.2
'@types/node': 22.20.1
typescript: 6.0.3
'@pkgr/core@0.3.6': {}
@@ -18454,8 +18458,6 @@ snapshots:
'@pnpm/config.nerf-dart@1.0.1': {}
'@pnpm/config.nerf-dart@2.0.1': {}
'@pnpm/config@1004.11.0(@pnpm/logger@1001.0.1)':
dependencies:
'@pnpm/catalogs.config': 1000.0.6
@@ -19431,8 +19433,6 @@ snapshots:
'@pnpm/util.lex-comparator@3.0.2': {}
'@pnpm/util.lex-comparator@4.0.1': {}
'@pnpm/which@3.0.1':
dependencies:
isexe: 2.0.0
@@ -19527,9 +19527,9 @@ snapshots:
optionalDependencies:
'@types/node': 22.20.1
'@rushstack/worker-pool@0.7.22(@types/node@26.1.2)':
'@rushstack/worker-pool@0.7.22(@types/node@22.20.1)':
optionalDependencies:
'@types/node': 26.1.2
'@types/node': 22.20.1
'@sec-ant/readable-stream@0.4.1': {}
@@ -19694,7 +19694,7 @@ snapshots:
'@types/isexe@2.0.4':
dependencies:
'@types/node': 22.20.1
'@types/node': 26.1.2
'@types/istanbul-lib-coverage@2.0.6': {}
@@ -19828,7 +19828,7 @@ snapshots:
'@types/touch@3.1.5':
dependencies:
'@types/node': 22.20.1
'@types/node': 26.1.2
'@types/treeify@1.0.3': {}
@@ -22365,7 +22365,7 @@ snapshots:
'@jest/expect': 30.4.1(supports-color@10.2.2)
'@jest/test-result': 30.4.1
'@jest/types': 30.4.1
'@types/node': 22.20.1
'@types/node': 26.1.2
chalk: 4.1.2
co: 4.6.0
dedent: 1.7.2
@@ -22438,6 +22438,38 @@ snapshots:
- babel-plugin-macros
- supports-color
jest-config@30.4.2(@babel/types@7.29.7)(@types/node@26.1.2)(supports-color@10.2.2):
dependencies:
'@babel/core': 7.29.7(supports-color@10.2.2)
'@jest/get-type': 30.1.0
'@jest/pattern': 30.4.0
'@jest/test-sequencer': 30.4.1
'@jest/types': 30.4.1
babel-jest: 30.4.1(@babel/core@7.29.7(supports-color@10.2.2))(@babel/types@7.29.7)(supports-color@10.2.2)
chalk: 4.1.2
ci-info: 4.4.0
deepmerge: 4.3.1
glob: 11.1.0
graceful-fs: 4.2.11(patch_hash=68ebc232025360cb3dcd3081f4067f4e9fc022ab6b6f71a3230e86c7a5b337d1)
jest-circus: 30.4.2(@babel/types@7.29.7)(supports-color@10.2.2)
jest-docblock: 30.4.0
jest-environment-node: 30.4.1
jest-regex-util: 30.4.0
jest-resolve: 30.4.1
jest-runner: 30.4.2(@babel/types@7.29.7)(supports-color@10.2.2)
jest-util: 30.4.1
jest-validate: 30.4.1
parse-json: 5.2.0
pretty-format: 30.4.1
slash: 3.0.0
strip-json-comments: 3.1.1
optionalDependencies:
'@types/node': 26.1.2
transitivePeerDependencies:
- '@babel/types'
- babel-plugin-macros
- supports-color
jest-diff@30.4.1:
dependencies:
'@jest/diff-sequences': 30.4.0
@@ -22462,7 +22494,7 @@ snapshots:
'@jest/environment': 30.4.1
'@jest/fake-timers': 30.4.1
'@jest/types': 30.4.1
'@types/node': 22.20.1
'@types/node': 26.1.2
jest-mock: 30.4.1
jest-util: 30.4.1
jest-validate: 30.4.1
@@ -22488,7 +22520,7 @@ snapshots:
jest-haste-map@30.4.1:
dependencies:
'@jest/types': 30.4.1
'@types/node': 22.20.1
'@types/node': 26.1.2
anymatch: 3.1.3
fb-watchman: 2.0.2
graceful-fs: 4.2.11(patch_hash=68ebc232025360cb3dcd3081f4067f4e9fc022ab6b6f71a3230e86c7a5b337d1)
@@ -22528,7 +22560,7 @@ snapshots:
jest-mock@30.4.1:
dependencies:
'@jest/types': 30.4.1
'@types/node': 22.20.1
'@types/node': 26.1.2
jest-util: 30.4.1
jest-pnp-resolver@1.2.3(jest-resolve@29.7.0):
@@ -22580,7 +22612,7 @@ snapshots:
'@jest/test-result': 30.4.1
'@jest/transform': 30.4.1(@babel/types@7.29.7)(supports-color@10.2.2)
'@jest/types': 30.4.1
'@types/node': 22.20.1
'@types/node': 26.1.2
chalk: 4.1.2
emittery: 0.13.1
exit-x: 0.2.2
@@ -22610,7 +22642,7 @@ snapshots:
'@jest/test-result': 30.4.1
'@jest/transform': 30.4.1(@babel/types@7.29.7)(supports-color@10.2.2)
'@jest/types': 30.4.1
'@types/node': 22.20.1
'@types/node': 26.1.2
chalk: 4.1.2
cjs-module-lexer: 2.2.0
collect-v8-coverage: 1.0.3
@@ -22667,7 +22699,7 @@ snapshots:
jest-util@30.4.1:
dependencies:
'@jest/types': 30.4.1
'@types/node': 22.20.1
'@types/node': 26.1.2
chalk: 4.1.2
ci-info: 4.4.0
graceful-fs: 4.2.11(patch_hash=68ebc232025360cb3dcd3081f4067f4e9fc022ab6b6f71a3230e86c7a5b337d1)
@@ -22695,7 +22727,7 @@ snapshots:
dependencies:
'@jest/test-result': 30.4.1
'@jest/types': 30.4.1
'@types/node': 22.20.1
'@types/node': 26.1.2
ansi-escapes: 4.3.2
chalk: 4.1.2
emittery: 0.13.1
@@ -22711,7 +22743,7 @@ snapshots:
jest-worker@30.4.1:
dependencies:
'@types/node': 22.20.1
'@types/node': 26.1.2
'@ungap/structured-clone': 1.3.3
jest-util: 30.4.1
merge-stream: 2.0.0
@@ -23541,9 +23573,9 @@ snapshots:
is-docker: 2.2.1
is-wsl: 2.2.0
openpgp@6.3.1(@openpgp/web-stream-tools@0.3.1(@types/node@26.1.2)(typescript@6.0.3)):
openpgp@6.3.1(@openpgp/web-stream-tools@0.3.1(@types/node@22.20.1)(typescript@6.0.3)):
optionalDependencies:
'@openpgp/web-stream-tools': 0.3.1(@types/node@26.1.2)(typescript@6.0.3)
'@openpgp/web-stream-tools': 0.3.1(@types/node@22.20.1)(typescript@6.0.3)
opt-cli@1.5.1:
dependencies:
-2
View File
@@ -118,7 +118,6 @@ catalog:
'@pnpm/byline': ^1.0.0
'@pnpm/colorize-semver-diff': ^2.0.0
'@pnpm/config.env-replace': ^4.1.0
'@pnpm/config.nerf-dart': ^2.0.1
'@pnpm/exec': ^4.0.0
'@pnpm/log.group': 4.0.1
'@pnpm/logger': '^1100.0.0'
@@ -131,7 +130,6 @@ catalog:
'@pnpm/semver-diff': ^2.0.0
'@pnpm/tabtab': ^0.5.4
'@pnpm/tgz-fixtures': 0.0.0
'@pnpm/util.lex-comparator': ^4.0.1
'@reflink/reflink': 0.1.19
'@rushstack/worker-pool': 0.7.22
'@stylistic/eslint-plugin': ^5.10.0
+1 -1
View File
@@ -46,8 +46,8 @@
"@pnpm/installing.modules-yaml": "workspace:*",
"@pnpm/prepare-temp-dir": "workspace:*",
"@pnpm/store.connection-manager": "workspace:*",
"@pnpm/text.ordinal-comparator": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"@pnpm/workspace.projects-sorter": "workspace:*",
"chalk": "catalog:",
"p-limit": "catalog:",
@@ -7,7 +7,7 @@ import { PnpmError } from '@pnpm/error'
import { install } from '@pnpm/installing.commands'
import { type StrictModules, writeModulesManifest } from '@pnpm/installing.modules-yaml'
import { globalInfo } from '@pnpm/logger'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import chalk from 'chalk'
import { renderHelp } from 'render-help'
+3
View File
@@ -78,6 +78,9 @@
{
"path": "../../testing/registry-mock"
},
{
"path": "../../text/ordinal-comparator"
},
{
"path": "../../workspace/projects-filter"
},
+1 -1
View File
@@ -43,8 +43,8 @@
"@pnpm/error": "workspace:*",
"@pnpm/installing.dedupe.issues-renderer": "workspace:*",
"@pnpm/installing.dedupe.types": "workspace:*",
"@pnpm/text.ordinal-comparator": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"ansi-diff": "catalog:",
"boxen": "catalog:",
"chalk": "catalog:",
@@ -1,5 +1,5 @@
import type { IgnoredScriptsLog } from '@pnpm/core-loggers'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import boxen from 'boxen'
import * as Rx from 'rxjs'
import { map } from 'rxjs/operators'
@@ -31,6 +31,9 @@
{
"path": "../../installing/dedupe/types"
},
{
"path": "../../text/ordinal-comparator"
},
{
"path": "../meta"
}
+1 -1
View File
@@ -37,7 +37,7 @@
"@pnpm/catalogs.types": "workspace:*",
"@pnpm/config.env-replace": "catalog:",
"@pnpm/config.matcher": "workspace:*",
"@pnpm/config.nerf-dart": "catalog:",
"@pnpm/config.registry-auth-key": "workspace:*",
"@pnpm/constants": "workspace:*",
"@pnpm/error": "workspace:*",
"@pnpm/hooks.pnpmfile": "workspace:*",
+1 -1
View File
@@ -3,7 +3,7 @@ import os from 'node:os'
import path from 'node:path'
import { envReplaceLossy } from '@pnpm/config.env-replace'
import { nerfDart } from '@pnpm/config.nerf-dart'
import { nerfDart } from '@pnpm/config.registry-auth-key'
import { PnpmError } from '@pnpm/error'
import normalizeRegistryUrl from 'normalize-registry-url'
import { readIniFileSync } from 'read-ini-file'
+3
View File
@@ -50,6 +50,9 @@
},
{
"path": "../matcher"
},
{
"path": "../registry-auth-key"
}
]
}
@@ -0,0 +1,3 @@
# @pnpm/config.registry-auth-key
> Maps a registry URL to the key that its settings are stored under in .npmrc
@@ -0,0 +1,44 @@
{
"name": "@pnpm/config.registry-auth-key",
"version": "1100.0.0",
"description": "Maps a registry URL to the key that its settings are stored under in .npmrc",
"keywords": [
"pnpm",
"pnpm11",
"npmrc"
],
"license": "MIT",
"funding": "https://opencollective.com/pnpm",
"repository": "https://github.com/pnpm/pnpm/tree/main/pnpm11/config/registry-auth-key",
"homepage": "https://github.com/pnpm/pnpm/tree/main/pnpm11/config/registry-auth-key#readme",
"bugs": {
"url": "https://github.com/pnpm/pnpm/issues"
},
"type": "module",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"exports": {
".": "./lib/index.js"
},
"files": [
"lib",
"!*.map"
],
"scripts": {
"lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
"test": "pn compile && pn .test",
"prepublishOnly": "tsgo --build",
"compile": "tsgo --build && pn lint --fix",
".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/config.registry-auth-key": "workspace:*"
},
"engines": {
"node": ">=22.13"
},
"jest": {
"preset": "@pnpm/jest-config"
}
}
@@ -0,0 +1,14 @@
/**
* Maps a registry URL to the key that its settings (`_authToken`, `certfile`,
* and so on) are stored under in `.npmrc`. For instance,
* `https://registry.npmjs.org/some-pkg` maps to `//registry.npmjs.org/`.
*
* npm calls this key a "nerf dart" and derives it the same way:
* https://github.com/npm/cli/blob/latest/workspaces/config/lib/nerf-dart.js
*/
export function nerfDart (url: string): string {
const parsed = new URL(url)
const from = `${parsed.protocol}//${parsed.host}${parsed.pathname}`
const rel = new URL('.', from)
return `//${rel.host}${rel.pathname}`
}
@@ -0,0 +1,42 @@
import { expect, test } from '@jest/globals'
import { nerfDart } from '@pnpm/config.registry-auth-key'
test.each([
['//registry.npmjs.org/', [
'https://registry.npmjs.org',
'https://registry.npmjs.org/package-name',
'https://registry.npmjs.org/package-name?write=true',
'https://registry.npmjs.org/@scope%2fpackage-name',
'https://registry.npmjs.org/@scope%2fpackage-name?write=true',
'https://username:password@registry.npmjs.org/package-name?write=true',
'https://registry.npmjs.org/#hash',
'https://registry.npmjs.org/?write=true#hash',
'https://registry.npmjs.org/package-name?write=true#hash',
'https://registry.npmjs.org/package-name#hash',
'https://registry.npmjs.org/@scope%2fpackage-name?write=true#hash',
'https://registry.npmjs.org/@scope%2fpackage-name#hash',
]],
['//my-couch:5984/registry/_design/app/rewrite/', [
'https://my-couch:5984/registry/_design/app/rewrite/',
'https://my-couch:5984/registry/_design/app/rewrite/package-name',
'https://my-couch:5984/registry/_design/app/rewrite/package-name?write=true',
'https://my-couch:5984/registry/_design/app/rewrite/@scope%2fpackage-name',
'https://my-couch:5984/registry/_design/app/rewrite/@scope%2fpackage-name?write=true',
'https://username:password@my-couch:5984/registry/_design/app/rewrite/package-name?write=true',
'https://my-couch:5984/registry/_design/app/rewrite/#hash',
'https://my-couch:5984/registry/_design/app/rewrite/?write=true#hash',
'https://my-couch:5984/registry/_design/app/rewrite/package-name?write=true#hash',
'https://my-couch:5984/registry/_design/app/rewrite/package-name#hash',
'https://my-couch:5984/registry/_design/app/rewrite/@scope%2fpackage-name?write=true#hash',
'https://my-couch:5984/registry/_design/app/rewrite/@scope%2fpackage-name#hash',
]],
])('nerfDart() returns %s', (key, urls) => {
expect.assertions(urls.length)
for (const url of urls) {
expect(nerfDart(url)).toBe(key)
}
})
test('nerfDart() throws on an invalid URL', () => {
expect(() => nerfDart('not a valid url')).toThrow()
})
@@ -0,0 +1,18 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"noEmit": false,
"outDir": "../node_modules/.test.lib",
"rootDir": "..",
"isolatedModules": true
},
"include": [
"**/*.ts",
"../../../__typings__/**/*.d.ts"
],
"references": [
{
"path": ".."
}
]
}
@@ -0,0 +1,12 @@
{
"extends": "@pnpm/tsconfig",
"compilerOptions": {
"outDir": "lib",
"rootDir": "src"
},
"include": [
"src/**/*.ts",
"../../__typings__/**/*.d.ts"
],
"references": []
}
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../__typings__/**/*.d.ts"
]
}
+1 -1
View File
@@ -39,9 +39,9 @@
"@pnpm/deps.inspection.tree-builder": "workspace:*",
"@pnpm/lockfile.fs": "workspace:*",
"@pnpm/pkg-manifest.reader": "workspace:*",
"@pnpm/text.ordinal-comparator": "workspace:*",
"@pnpm/text.tree-renderer": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"@pnpm/workspace.project-manifest-reader": "workspace:*",
"chalk": "catalog:",
"p-limit": "catalog:",
@@ -1,9 +1,9 @@
import path from 'node:path'
import type { DependencyNode } from '@pnpm/deps.inspection.tree-builder'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import { renderTree as renderArchyTree, type TreeNode, type TreeNodeGroup } from '@pnpm/text.tree-renderer'
import { DEPENDENCIES_FIELDS, type DependenciesField } from '@pnpm/types'
import { lexCompare } from '@pnpm/util.lex-comparator'
import chalk from 'chalk'
import { getPkgInfo } from './getPkgInfo.js'
@@ -21,6 +21,9 @@
{
"path": "../../../pkg-manifest/reader"
},
{
"path": "../../../text/ordinal-comparator"
},
{
"path": "../../../text/tree-renderer"
},
@@ -46,8 +46,8 @@
"@pnpm/pkg-manifest.reader": "workspace:*",
"@pnpm/store.cafs": "workspace:*",
"@pnpm/store.index": "workspace:*",
"@pnpm/text.ordinal-comparator": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"load-json-file": "catalog:",
"normalize-path": "catalog:",
"p-limit": "catalog:",
@@ -10,8 +10,8 @@ import {
} from '@pnpm/lockfile.fs'
import { nameVerFromPkgSnapshot } from '@pnpm/lockfile.utils'
import { StoreIndex } from '@pnpm/store.index'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import type { DependenciesField, DependencyManifest, Finder, Registries } from '@pnpm/types'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { realpathMissing } from 'realpath-missing'
import semver from 'semver'
@@ -3,8 +3,8 @@ import path from 'node:path'
import type { DepTypes } from '@pnpm/lockfile.detect-dep-types'
import type { PackageSnapshots, ProjectSnapshot } from '@pnpm/lockfile.fs'
import type { StoreIndex } from '@pnpm/store.index'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import type { Finder, Registries } from '@pnpm/types'
import { lexCompare } from '@pnpm/util.lex-comparator'
import type { DependencyGraph } from './buildDependencyGraph.js'
import type { DependencyNode } from './DependencyNode.js'
@@ -48,6 +48,9 @@
{
"path": "../../../store/index"
},
{
"path": "../../../text/ordinal-comparator"
},
{
"path": "../../path"
}
@@ -39,8 +39,8 @@
"@pnpm/fetching.types": "workspace:*",
"@pnpm/resolving.npm-resolver": "workspace:*",
"@pnpm/resolving.resolver-base": "workspace:*",
"@pnpm/text.ordinal-comparator": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"semver": "catalog:"
},
"peerDependencies": {
@@ -13,8 +13,8 @@ import type {
VariationsResolution,
WantedDependency,
} from '@pnpm/resolving.resolver-base'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import type { PkgResolutionId } from '@pnpm/types'
import { lexCompare } from '@pnpm/util.lex-comparator'
export interface BunRuntimeResolveResult extends ResolveResult {
resolution: VariationsResolution
@@ -33,6 +33,9 @@
{
"path": "../../../resolving/resolver-base"
},
{
"path": "../../../text/ordinal-comparator"
},
{
"path": "../../../worker"
}
@@ -39,8 +39,8 @@
"@pnpm/fetching.types": "workspace:*",
"@pnpm/resolving.npm-resolver": "workspace:*",
"@pnpm/resolving.resolver-base": "workspace:*",
"@pnpm/text.ordinal-comparator": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"semver": "catalog:"
},
"peerDependencies": {
@@ -12,8 +12,8 @@ import type {
VariationsResolution,
WantedDependency,
} from '@pnpm/resolving.resolver-base'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import type { PkgResolutionId } from '@pnpm/types'
import { lexCompare } from '@pnpm/util.lex-comparator'
const ASSET_REGEX = /^deno-(?<cpu>aarch64|x86_64)-(?<os>apple-darwin|unknown-linux-gnu|pc-windows-msvc)\.zip\.sha256sum$/
const OS_MAP = {
@@ -33,6 +33,9 @@
{
"path": "../../../resolving/resolver-base"
},
{
"path": "../../../text/ordinal-comparator"
},
{
"path": "../../../worker"
}
+1 -1
View File
@@ -56,8 +56,8 @@
"@pnpm/resolving.parse-wanted-dependency": "workspace:*",
"@pnpm/shell.path": "workspace:*",
"@pnpm/store.path": "workspace:*",
"@pnpm/text.ordinal-comparator": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"@pnpm/workspace.injected-deps-syncer": "workspace:*",
"@pnpm/workspace.project-manifest-reader": "workspace:*",
"@pnpm/workspace.projects-sorter": "workspace:*",
+1 -1
View File
@@ -20,8 +20,8 @@ import { add } from '@pnpm/installing.commands'
import { logger } from '@pnpm/logger'
import { readPackageJsonFromDir } from '@pnpm/pkg-manifest.reader'
import { parseWantedDependency } from '@pnpm/resolving.parse-wanted-dependency'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import type { PackageManifest, PnpmSettings, SupportedArchitectures } from '@pnpm/types'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { pick } from 'ramda'
import { renderHelp } from 'render-help'
import { symlinkDir } from 'symlink-dir'
+3
View File
@@ -84,6 +84,9 @@
{
"path": "../../testing/command-defaults"
},
{
"path": "../../text/ordinal-comparator"
},
{
"path": "../../workspace/injected-deps-syncer"
},
@@ -48,7 +48,7 @@
"@pnpm/fetching.directory-fetcher": "workspace:*",
"@pnpm/logger": "workspace:*",
"@pnpm/test-fixtures": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"@pnpm/text.ordinal-comparator": "workspace:*",
"@zkochan/rimraf": "catalog:"
},
"engines": {
@@ -4,7 +4,7 @@ import path from 'node:path'
import { beforeAll, describe, expect, jest, test } from '@jest/globals'
import { fixtures } from '@pnpm/test-fixtures'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import { rimrafSync } from '@zkochan/rimraf'
const debug = jest.fn()
@@ -30,6 +30,9 @@
{
"path": "../../store/cafs-types"
},
{
"path": "../../text/ordinal-comparator"
},
{
"path": "../../workspace/project-manifest-reader"
},
+1 -1
View File
@@ -51,8 +51,8 @@
"@pnpm/logger": "workspace:*",
"@pnpm/store.cafs": "workspace:*",
"@pnpm/store.create-cafs-store": "workspace:*",
"@pnpm/text.ordinal-comparator": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"tempy": "catalog:"
},
"engines": {
+1 -1
View File
@@ -4,7 +4,7 @@ import path from 'node:path'
import { afterAll, beforeEach, expect, jest, test } from '@jest/globals'
import { createCafsStore } from '@pnpm/store.create-cafs-store'
import { StoreIndex } from '@pnpm/store.index'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import { temporaryDirectory } from 'tempy'
{
@@ -36,6 +36,9 @@
{
"path": "../../store/index"
},
{
"path": "../../text/ordinal-comparator"
},
{
"path": "../../worker"
},
+1 -1
View File
@@ -59,8 +59,8 @@
"@pnpm/store.cafs-types": "workspace:*",
"@pnpm/store.create-cafs-store": "workspace:*",
"@pnpm/test-fixtures": "workspace:*",
"@pnpm/text.ordinal-comparator": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"@types/lodash.throttle": "catalog:",
"@types/ramda": "catalog:",
"@types/retry": "catalog:",
@@ -8,7 +8,7 @@ import { createFetchFromRegistry } from '@pnpm/network.fetch'
import { createCafsStore } from '@pnpm/store.create-cafs-store'
import { StoreIndex } from '@pnpm/store.index'
import { fixtures } from '@pnpm/test-fixtures'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import ssri from 'ssri'
import { temporaryDirectory } from 'tempy'
import { type Dispatcher, getGlobalDispatcher, MockAgent, setGlobalDispatcher } from 'undici'
@@ -45,6 +45,9 @@
{
"path": "../../store/index"
},
{
"path": "../../text/ordinal-comparator"
},
{
"path": "../../worker"
},
+1 -1
View File
@@ -47,8 +47,8 @@
"@pnpm/pkg-manifest.reader": "workspace:*",
"@pnpm/pkg-manifest.utils": "workspace:*",
"@pnpm/store.connection-manager": "workspace:*",
"@pnpm/text.ordinal-comparator": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"is-subdir": "catalog:",
"symlink-dir": "catalog:"
},
@@ -6,7 +6,7 @@ import {
getGlobalPackageDetails,
scanGlobalPackages,
} from '@pnpm/global.packages'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
export function findGlobalInstallDirs (globalPkgDir: string, params: string[]): string[] {
const packages = scanGlobalPackages(globalPkgDir)
+3
View File
@@ -54,6 +54,9 @@
{
"path": "../../store/connection-manager"
},
{
"path": "../../text/ordinal-comparator"
},
{
"path": "../packages"
}
+2 -2
View File
@@ -34,8 +34,8 @@
"@pnpm/bins.resolver": "workspace:*",
"@pnpm/crypto.hash": "workspace:*",
"@pnpm/pkg-manifest.reader": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:"
"@pnpm/text.ordinal-comparator": "workspace:*",
"@pnpm/types": "workspace:*"
},
"devDependencies": {
"@pnpm/global.packages": "workspace:*"
+1 -1
View File
@@ -1,5 +1,5 @@
import { createHexHash } from '@pnpm/crypto.hash'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
export function createGlobalCacheKey (opts: {
aliases: string[]
+3
View File
@@ -20,6 +20,9 @@
},
{
"path": "../../pkg-manifest/reader"
},
{
"path": "../../text/ordinal-comparator"
}
]
}
+1 -1
View File
@@ -76,8 +76,8 @@
"@pnpm/semver-diff": "catalog:",
"@pnpm/store.connection-manager": "workspace:*",
"@pnpm/store.controller": "workspace:*",
"@pnpm/text.ordinal-comparator": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"@pnpm/workspace.project-manifest-reader": "workspace:*",
"@pnpm/workspace.project-manifest-writer": "workspace:*",
"@pnpm/workspace.projects-filter": "workspace:*",
@@ -3,8 +3,8 @@ import { writeSettings } from '@pnpm/config.writer'
import {
IgnoredBuildsError,
} from '@pnpm/installing.deps-installer'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import type { IgnoredBuilds } from '@pnpm/types'
import { lexCompare } from '@pnpm/util.lex-comparator'
export interface HandleIgnoredBuildsOpts {
allowBuilds?: Record<string, boolean | string>
@@ -9,8 +9,8 @@ import type { Catalogs } from '@pnpm/catalogs.types'
import { createMatcher } from '@pnpm/config.matcher'
import { PnpmError } from '@pnpm/error'
import { globalInfo, globalWarn } from '@pnpm/logger'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import type { Project, ProjectManifest, ProjectRootDir } from '@pnpm/types'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { safeReadProjectManifestOnly } from '@pnpm/workspace.project-manifest-reader'
import { findWorkspaceProjects } from '@pnpm/workspace.projects-reader'
import { readWorkspaceManifest } from '@pnpm/workspace.workspace-manifest-reader'
+3
View File
@@ -147,6 +147,9 @@
{
"path": "../../testing/registry-mock"
},
{
"path": "../../text/ordinal-comparator"
},
{
"path": "../../worker"
},
@@ -111,8 +111,8 @@
"@pnpm/resolving.resolver-base": "workspace:*",
"@pnpm/store.controller-types": "workspace:*",
"@pnpm/store.index": "workspace:*",
"@pnpm/text.ordinal-comparator": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"@pnpm/workspace.project-manifest-reader": "workspace:*",
"@zkochan/rimraf": "catalog:",
"is-inner-link": "catalog:",
@@ -77,6 +77,7 @@ import type {
PreferredVersions,
ResolutionPolicyViolation,
} from '@pnpm/resolving.resolver-base'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import type {
AllowBuild,
DependenciesField,
@@ -89,7 +90,6 @@ import type {
ProjectRootDir,
ReadPackageHook,
} from '@pnpm/types'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { safeReadProjectManifestOnly } from '@pnpm/workspace.project-manifest-reader'
import { isSubdir } from 'is-subdir'
import pLimit from 'p-limit'
@@ -186,6 +186,9 @@
{
"path": "../../testing/temp-store"
},
{
"path": "../../text/ordinal-comparator"
},
{
"path": "../../worker"
},
+1 -1
View File
@@ -55,8 +55,8 @@
"@pnpm/resolving.npm-resolver": "workspace:*",
"@pnpm/resolving.resolver-base": "workspace:*",
"@pnpm/store.controller-types": "workspace:*",
"@pnpm/text.ordinal-comparator": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"@pnpm/workspace.spec-parser": "workspace:*",
"@yarnpkg/core": "catalog:",
"graph-cycles": "catalog:",
@@ -1,6 +1,6 @@
import { getPeerVersionRange } from '@pnpm/deps.peer-range'
import type { PreferredVersions } from '@pnpm/resolving.resolver-base'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import semver from 'semver'
/** One workspace-root dependency that a missing peer can be satisfied with. */
@@ -40,6 +40,7 @@ import type {
PkgRequestFetchResult,
StoreController,
} from '@pnpm/store.controller-types'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import type {
AllowBuild,
AllowedDeprecatedVersions,
@@ -53,7 +54,6 @@ import type {
SupportedArchitectures,
TrustPolicy,
} from '@pnpm/types'
import { lexCompare } from '@pnpm/util.lex-comparator'
import normalizePath from 'normalize-path'
import pDefer from 'p-defer'
import { pathExists } from 'path-exists'
@@ -84,6 +84,9 @@
{
"path": "../../store/controller-types"
},
{
"path": "../../text/ordinal-comparator"
},
{
"path": "../../workspace/spec-parser"
}
+1 -1
View File
@@ -38,8 +38,8 @@
"@pnpm/config.matcher": "workspace:*",
"@pnpm/constants": "workspace:*",
"@pnpm/core-loggers": "workspace:*",
"@pnpm/text.ordinal-comparator": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"is-subdir": "catalog:",
"ramda": "catalog:",
"resolve-link-target": "catalog:",
+1 -1
View File
@@ -6,8 +6,8 @@ import { createMatcher } from '@pnpm/config.matcher'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import { linkLogger } from '@pnpm/core-loggers'
import { logger } from '@pnpm/logger'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import type { DependenciesField, DepPath, HoistedDependencies, ProjectId } from '@pnpm/types'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { isSubdir } from 'is-subdir'
import { resolveLinkTarget } from 'resolve-link-target'
import { symlinkDir } from 'symlink-dir'
@@ -26,6 +26,9 @@
},
{
"path": "../../../core/types"
},
{
"path": "../../../text/ordinal-comparator"
}
]
}
+1 -1
View File
@@ -32,7 +32,7 @@
".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
},
"dependencies": {
"@pnpm/config.nerf-dart": "catalog:",
"@pnpm/config.registry-auth-key": "workspace:*",
"@pnpm/error": "workspace:*",
"@pnpm/types": "workspace:*"
},
+1 -1
View File
@@ -1,4 +1,4 @@
import { nerfDart } from '@pnpm/config.nerf-dart'
import { nerfDart } from '@pnpm/config.registry-auth-key'
import type { RegistryConfig } from '@pnpm/types'
import { type AuthHeaders, type AuthHeadersByScope, getAuthHeadersByScope, getAuthHeadersFromCreds } from './getAuthHeadersFromConfig.js'
+3
View File
@@ -9,6 +9,9 @@
"../../__typings__/**/*.d.ts"
],
"references": [
{
"path": "../../config/registry-auth-key"
},
{
"path": "../../core/error"
},
+1 -1
View File
@@ -33,7 +33,7 @@
".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
},
"dependencies": {
"@pnpm/config.nerf-dart": "catalog:",
"@pnpm/config.registry-auth-key": "workspace:*",
"@pnpm/core-loggers": "workspace:*",
"@pnpm/error": "workspace:*",
"@pnpm/fetching.types": "workspace:*",
+1 -1
View File
@@ -2,7 +2,7 @@ import net from 'node:net'
import tls from 'node:tls'
import { URL } from 'node:url'
import { nerfDart } from '@pnpm/config.nerf-dart'
import { nerfDart } from '@pnpm/config.registry-auth-key'
import { PnpmError } from '@pnpm/error'
import type { TlsConfig } from '@pnpm/types'
import { LRUCache } from 'lru-cache'
+3
View File
@@ -9,6 +9,9 @@
"../../__typings__/**/*.d.ts"
],
"references": [
{
"path": "../../config/registry-auth-key"
},
{
"path": "../../core/core-loggers"
},
+1 -1
View File
@@ -32,7 +32,7 @@
".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
},
"dependencies": {
"@pnpm/util.lex-comparator": "catalog:",
"@pnpm/text.ordinal-comparator": "workspace:*",
"sort-keys": "catalog:"
},
"devDependencies": {
+1 -1
View File
@@ -1,4 +1,4 @@
import { lexCompare } from '@pnpm/util.lex-comparator'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import _sortKeys from 'sort-keys'
// eslint-disable-next-line @typescript-eslint/no-explicit-any
+5 -1
View File
@@ -8,5 +8,9 @@
"src/**/*.ts",
"../../__typings__/**/*.d.ts"
],
"references": []
"references": [
{
"path": "../../text/ordinal-comparator"
}
]
}
+1 -1
View File
@@ -132,7 +132,7 @@
"@pnpm/test-ipc-server": "workspace:*",
"@pnpm/testing.registry-mock": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"@pnpm/text.ordinal-comparator": "workspace:*",
"@pnpm/worker": "workspace:*",
"@pnpm/workspace.commands": "workspace:*",
"@pnpm/workspace.project-manifest-reader": "workspace:*",
+1 -1
View File
@@ -9,8 +9,8 @@ import { requireHooks } from '@pnpm/hooks.pnpmfile'
import { resolveAndInstallConfigDeps } from '@pnpm/installing.env-installer'
import { logger } from '@pnpm/logger'
import { createStoreController } from '@pnpm/store.connection-manager'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import type { ConfigDependencies } from '@pnpm/types'
import { lexCompare } from '@pnpm/util.lex-comparator'
export async function getConfig (
cliOptions: CliOptions,
+1 -1
View File
@@ -10,7 +10,7 @@ import type { PackageFilesIndex } from '@pnpm/store.cafs'
import { StoreIndex, storeIndexKey } from '@pnpm/store.index'
import { fixtures } from '@pnpm/test-fixtures'
import { getIntegrity } from '@pnpm/testing.registry-mock'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import { readProjectManifest } from '@pnpm/workspace.project-manifest-reader'
import { writeProjectManifest } from '@pnpm/workspace.project-manifest-writer'
import { rimrafSync } from '@zkochan/rimraf'
+3
View File
@@ -164,6 +164,9 @@
{
"path": "../testing/registry-mock"
},
{
"path": "../text/ordinal-comparator"
},
{
"path": "../worker"
},
+1 -1
View File
@@ -51,8 +51,8 @@
"@pnpm/store.controller-types": "workspace:*",
"@pnpm/store.index": "workspace:*",
"@pnpm/store.path": "workspace:*",
"@pnpm/text.ordinal-comparator": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"archy": "catalog:",
"chalk": "catalog:",
"dint": "catalog:",
@@ -9,7 +9,7 @@ import { parseWantedDependency } from '@pnpm/resolving.parse-wanted-dependency'
import type { PackageFilesIndex } from '@pnpm/store.cafs'
import { StoreIndex, storeIndexKey } from '@pnpm/store.index'
import { getStorePath } from '@pnpm/store.path'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import { renderHelp } from 'render-help'
export const skipPackageManagerCheck = true
+3
View File
@@ -75,6 +75,9 @@
{
"path": "../../testing/registry-mock"
},
{
"path": "../../text/ordinal-comparator"
},
{
"path": "../cafs"
},
+3
View File
@@ -0,0 +1,3 @@
# @pnpm/text.ordinal-comparator
> A string comparator that sorts in lexicographical order
@@ -0,0 +1,44 @@
{
"name": "@pnpm/text.ordinal-comparator",
"version": "1100.0.0",
"description": "A string comparator that sorts in lexicographical order",
"keywords": [
"pnpm",
"pnpm11",
"comparator"
],
"license": "MIT",
"funding": "https://opencollective.com/pnpm",
"repository": "https://github.com/pnpm/pnpm/tree/main/pnpm11/text/ordinal-comparator",
"homepage": "https://github.com/pnpm/pnpm/tree/main/pnpm11/text/ordinal-comparator#readme",
"bugs": {
"url": "https://github.com/pnpm/pnpm/issues"
},
"type": "module",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"exports": {
".": "./lib/index.js"
},
"files": [
"lib",
"!*.map"
],
"scripts": {
"lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
"test": "pn compile && pn .test",
"prepublishOnly": "tsgo --build",
"compile": "tsgo --build && pn lint --fix",
".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/text.ordinal-comparator": "workspace:*"
},
"engines": {
"node": ">=22.13"
},
"jest": {
"preset": "@pnpm/jest-config"
}
}
@@ -0,0 +1,9 @@
/**
* Compares two strings by code unit, so that the sort order is the same on
* every machine. `String.prototype.localeCompare` must not be used for
* anything that ends up in a lockfile or any other file we compare across
* machines, as its result depends on the current locale.
*/
export function lexCompare (a: string, b: string): number {
return a > b ? 1 : a < b ? -1 : 0
}
@@ -0,0 +1,12 @@
import { expect, test } from '@jest/globals'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
test('lexCompare', () => {
expect(lexCompare('a', 'b')).toBe(-1)
expect(lexCompare('a', 'a')).toBe(0)
expect(lexCompare('b', 'a')).toBe(1)
})
test('lexCompare sorts uppercase letters before lowercase ones', () => {
expect(['b', 'A', 'a', 'B'].sort(lexCompare)).toStrictEqual(['A', 'B', 'a', 'b'])
})
@@ -0,0 +1,18 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"noEmit": false,
"outDir": "../node_modules/.test.lib",
"rootDir": "..",
"isolatedModules": true
},
"include": [
"**/*.ts",
"../../../__typings__/**/*.d.ts"
],
"references": [
{
"path": ".."
}
]
}
@@ -0,0 +1,12 @@
{
"extends": "@pnpm/tsconfig",
"compilerOptions": {
"outDir": "lib",
"rootDir": "src"
},
"include": [
"src/**/*.ts",
"../../__typings__/**/*.d.ts"
],
"references": []
}
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../__typings__/**/*.d.ts"
]
}
@@ -36,8 +36,8 @@
"@pnpm/fetching.directory-fetcher": "workspace:*",
"@pnpm/installing.modules-yaml": "workspace:*",
"@pnpm/pkg-manifest.reader": "workspace:*",
"@pnpm/text.ordinal-comparator": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"@pnpm/workspace.projects-reader": "workspace:*",
"@types/normalize-path": "catalog:",
"normalize-path": "catalog:"
@@ -4,7 +4,7 @@ import path from 'node:path'
import { afterEach, expect, jest, test } from '@jest/globals'
import { fetchFromDir } from '@pnpm/fetching.directory-fetcher'
import { prepareEmpty } from '@pnpm/prepare'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import { DirPatcher } from '../src/DirPatcher.js'
@@ -4,7 +4,7 @@ import path from 'node:path'
import { afterEach, expect, jest, test } from '@jest/globals'
import { fetchFromDir } from '@pnpm/fetching.directory-fetcher'
import { prepareEmpty } from '@pnpm/prepare'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import { applyPatch, DIR, type DirDiff } from '../src/DirPatcher.js'
@@ -33,6 +33,9 @@
{
"path": "../../pkg-manifest/reader"
},
{
"path": "../../text/ordinal-comparator"
},
{
"path": "../projects-reader"
}
@@ -33,8 +33,8 @@
"dependencies": {
"@pnpm/cli.utils": "workspace:*",
"@pnpm/constants": "workspace:*",
"@pnpm/text.ordinal-comparator": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"@pnpm/workspace.project-manifest-reader": "workspace:*",
"p-filter": "catalog:",
"tinyglobby": "catalog:"
@@ -2,8 +2,8 @@ import { promises as fs } from 'node:fs'
import path from 'node:path'
import util from 'node:util'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import type { Project, ProjectRootDir, ProjectRootDirRealPath } from '@pnpm/types'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { readExactProjectManifest } from '@pnpm/workspace.project-manifest-reader'
import pFilter from 'p-filter'
import { glob } from 'tinyglobby'
@@ -1,7 +1,7 @@
import { packageIsInstallable } from '@pnpm/cli.utils'
import { logger } from '@pnpm/logger'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import type { Project, ProjectManifest, SupportedArchitectures } from '@pnpm/types'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { findPackages } from './findPackages.js'
@@ -21,6 +21,9 @@
{
"path": "../../core/types"
},
{
"path": "../../text/ordinal-comparator"
},
{
"path": "../project-manifest-reader"
},
@@ -36,8 +36,8 @@
"@pnpm/config.version-policy": "workspace:*",
"@pnpm/constants": "workspace:*",
"@pnpm/lockfile.types": "workspace:*",
"@pnpm/text.ordinal-comparator": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/util.lex-comparator": "catalog:",
"@pnpm/workspace.workspace-manifest-reader": "workspace:*",
"@pnpm/yaml.document-sync": "workspace:*",
"ramda": "catalog:",
@@ -7,10 +7,10 @@ import { parsePkgAndParentSelector } from '@pnpm/config.parse-overrides'
import { mergePackageVersionSpecs } from '@pnpm/config.version-policy'
import { type GLOBAL_CONFIG_YAML_FILENAME, WORKSPACE_MANIFEST_FILENAME } from '@pnpm/constants'
import type { ResolvedCatalogEntry } from '@pnpm/lockfile.types'
import { lexCompare } from '@pnpm/text.ordinal-comparator'
import type {
Project,
} from '@pnpm/types'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { validateWorkspaceManifest, type WorkspaceManifest } from '@pnpm/workspace.workspace-manifest-reader'
import { patchDocument } from '@pnpm/yaml.document-sync'
import { equals } from 'ramda'
@@ -33,6 +33,9 @@
{
"path": "../../lockfile/types"
},
{
"path": "../../text/ordinal-comparator"
},
{
"path": "../../yaml/document-sync"
},