Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pnpm): pnpm9 transitive npm: dependenies #1775

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions e2e/pnpm_lockfiles/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ PNPM_LOCK_VERSIONS = [
PNPM_LOCK_TEST_CASES = [
"tarball-no-url-v54.yaml",
"override-with-alias-url-v9.yaml",
"isaacs-cliui-v90.yaml",
]

bazel_dep(name = "aspect_bazel_lib", version = "2.7.7")
Expand Down
6 changes: 5 additions & 1 deletion e2e/pnpm_lockfiles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

See notes in lockfile-test.bzl for test cases of each package.

## pnpm lockfile edge cases
## pnpm lockfile edge cases (./cases/\*)

Unique test cases hard to cover with normal pnpm workspaces + package.json. Each
test case is a pnpm-lock.yaml with a unique filename, see cases/BUILD for how the test
cases run on each of those lockfiles.

- `isaacs-cliui-v*`: a transitive `npm:` dependency as an alias to use multiple versions of a single package, this is different then a direct `npm:` dependency
- `override-with-alias-url-v9` - a package overridden with a different package
- `tarball-no-url-v54` - a package with a tarball but not a full URL
4 changes: 4 additions & 0 deletions e2e/pnpm_lockfiles/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ PNPM_LOCK_VERSIONS = [
PNPM_LOCK_TEST_CASES = [
"tarball-no-url-v54.yaml",
"override-with-alias-url-v9.yaml",
"isaacs-cliui-v90.yaml",
]

load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
Expand Down Expand Up @@ -62,9 +63,12 @@ npm_repositories_v90()
for lockfile in PNPM_LOCK_TEST_CASES
]

load("@isaacs-cliui-v90//:repositories.bzl", npm_repositories_isaacs_cliui_v90 = "npm_repositories")
load("@override-with-alias-url-v9//:repositories.bzl", npm_repositories_override_with_alias_v90 = "npm_repositories")
load("@tarball-no-url-v54//:repositories.bzl", npm_repositories_tarball_no_url_v54 = "npm_repositories")

npm_repositories_tarball_no_url_v54()

npm_repositories_override_with_alias_v90()

npm_repositories_isaacs_cliui_v90()
3 changes: 3 additions & 0 deletions e2e/pnpm_lockfiles/base/aliases-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ if (
) {
throw new Error('aliased `is-odd` as `is-odd-alt-version` are the same')
}

// `@isaacs/cliui` has transitive `npm:*` deps
require('@isaacs/cliui')
1 change: 1 addition & 0 deletions e2e/pnpm_lockfiles/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"dependencies": {
"@aspect-test/a": "^5.0.2",
"@aspect-test/a2": "npm:@aspect-test/a",
"@isaacs/cliui": "8.0.2",
"debug": "ngokevin/debug#9742c5f383a6f8046241920156236ade8ec30d53",
"hello": "https://gitpkg.vercel.app/EqualMa/gitpkg-hello/packages/hello",
"jsonify": "https://github.com/aspect-build/test-packages/releases/download/0.0.0/@foo-jsonify-0.0.0.tgz",
Expand Down
11 changes: 11 additions & 0 deletions e2e/pnpm_lockfiles/cases/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@isaacs-cliui-v90//:defs.bzl", isaacs_cliui_v90_link_all = "npm_link_all_packages")
load("@override-with-alias-url-v9//:defs.bzl", override_with_alias_link_all = "npm_link_all_packages")
load("@tarball-no-url-v54//:defs.bzl", tarball_no_url_link_all = "npm_link_all_packages")

Expand All @@ -23,3 +24,13 @@ build_test(
":override-with-alias-url-v9_modules/lodash.pick",
],
)

isaacs_cliui_v90_link_all(name = "isaacs_cliui_v90-modules")

build_test(
name = "isaacs_cliui",
targets = [
":isaacs_cliui_v90-modules",
":isaacs_cliui_v90-modules/@isaacs/cliui",
],
)
194 changes: 194 additions & 0 deletions e2e/pnpm_lockfiles/cases/isaacs-cliui-v90.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
lockfileVersion: '9.0'

settings:
autoInstallPeers: true
excludeLinksFromLockfile: false

importers:
.:
dependencies:
'@isaacs/cliui':
specifier: 8.0.2
version: 8.0.2

packages:
'@isaacs/cliui@8.0.2':
resolution:
{
integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==,
}
engines: { node: '>=12' }

ansi-regex@5.0.1:
resolution:
{
integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==,
}
engines: { node: '>=8' }

ansi-regex@6.0.1:
resolution:
{
integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==,
}
engines: { node: '>=12' }

ansi-styles@4.3.0:
resolution:
{
integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==,
}
engines: { node: '>=8' }

ansi-styles@6.2.1:
resolution:
{
integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==,
}
engines: { node: '>=12' }

color-convert@2.0.1:
resolution:
{
integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==,
}
engines: { node: '>=7.0.0' }

color-name@1.1.4:
resolution:
{
integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==,
}

eastasianwidth@0.2.0:
resolution:
{
integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==,
}

emoji-regex@8.0.0:
resolution:
{
integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==,
}

emoji-regex@9.2.2:
resolution:
{
integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==,
}

is-fullwidth-code-point@3.0.0:
resolution:
{
integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==,
}
engines: { node: '>=8' }

string-width@4.2.3:
resolution:
{
integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==,
}
engines: { node: '>=8' }

string-width@5.1.2:
resolution:
{
integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==,
}
engines: { node: '>=12' }

strip-ansi@6.0.1:
resolution:
{
integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==,
}
engines: { node: '>=8' }

strip-ansi@7.1.0:
resolution:
{
integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==,
}
engines: { node: '>=12' }

wrap-ansi@7.0.0:
resolution:
{
integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==,
}
engines: { node: '>=10' }

wrap-ansi@8.1.0:
resolution:
{
integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==,
}
engines: { node: '>=12' }

snapshots:
'@isaacs/cliui@8.0.2':
dependencies:
string-width: 5.1.2
string-width-cjs: string-width@4.2.3
strip-ansi: 7.1.0
strip-ansi-cjs: strip-ansi@6.0.1
wrap-ansi: 8.1.0
wrap-ansi-cjs: wrap-ansi@7.0.0

ansi-regex@5.0.1: {}

ansi-regex@6.0.1: {}

ansi-styles@4.3.0:
dependencies:
color-convert: 2.0.1

ansi-styles@6.2.1: {}

color-convert@2.0.1:
dependencies:
color-name: 1.1.4

color-name@1.1.4: {}

eastasianwidth@0.2.0: {}

emoji-regex@8.0.0: {}

emoji-regex@9.2.2: {}

is-fullwidth-code-point@3.0.0: {}

string-width@4.2.3:
dependencies:
emoji-regex: 8.0.0
is-fullwidth-code-point: 3.0.0
strip-ansi: 6.0.1

string-width@5.1.2:
dependencies:
eastasianwidth: 0.2.0
emoji-regex: 9.2.2
strip-ansi: 7.1.0

strip-ansi@6.0.1:
dependencies:
ansi-regex: 5.0.1

strip-ansi@7.1.0:
dependencies:
ansi-regex: 6.0.1

wrap-ansi@7.0.0:
dependencies:
ansi-styles: 4.3.0
string-width: 4.2.3
strip-ansi: 6.0.1

wrap-ansi@8.1.0:
dependencies:
ansi-styles: 6.2.1
string-width: 5.1.2
strip-ansi: 7.1.0
4 changes: 4 additions & 0 deletions e2e/pnpm_lockfiles/lockfile-test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def lockfile_test(name = None):
":node_modules/alias-types-node",
":node_modules/is-odd",
":node_modules/is-odd-alt-version",
":node_modules/@isaacs/cliui",
],
entry_point = "aliases-test.js",
)
Expand All @@ -90,6 +91,9 @@ def lockfile_test(name = None):
# uuv 'hasBin'
":node_modules/uvu",

# a package with various `npm:` cases
":node_modules/@isaacs/cliui",

# link:, workspace:, file:, ./rel/path
":node_modules/@scoped/a",
":node_modules/@scoped/b",
Expand Down
Loading