Skip to content

Commit

Permalink
test: npm: dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedard committed Jun 27, 2024
1 parent b1dc67f commit 60c60e8
Show file tree
Hide file tree
Showing 24 changed files with 366 additions and 226 deletions.
15 changes: 12 additions & 3 deletions e2e/pnpm_lockfiles/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,21 @@ npm = use_extension(
use_repo(
npm,
"lock-%s" % version,

# Dep with bin entries etc
"lock-%s__rollup__3.2.5" % version,
"lock-%s__rollup__3.2.5__links" % version,

# TODO: inconsistent across versions
# "lock-%s__at_aspect-test_d__2.0.0__at_aspect-test_c_2.0.2" % version,
# "lock-%s__at_aspect-test_d__2.0.0__at_aspect-test_c_2.0.2__links" % version,
# Dep only referenced via npm: should have the real package name in the repo name
"lock-%s__at_types_sizzle__2.3.8" % version,
"lock-%s__at_types_sizzle__2.3.8__links" % version,

# Dep with peers
"lock-%s__at_aspect-test_d__2.0.0__at_aspect-test_c_2.0.2" % version,
"lock-%s__at_aspect-test_d__2.0.0__at_aspect-test_c_2.0.2__links" % version,

# Dep with patch
"lock-%s__meaning-of-life__1.0.0__o3deharooos255qt5xdujc3cuq" % version,
)
for version in PNPM_LOCK_VERSIONS
]
Expand Down
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 @@ -25,3 +25,6 @@ if (

// `@isaacs/cliui` has transitive `npm:*` deps
require('@isaacs/cliui')

// `alias-only-sizzle` aliases a package not declared elsewhere
require('alias-only-sizzle/package.json')
1 change: 1 addition & 0 deletions e2e/pnpm_lockfiles/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@aspect-test/b": "5.0.2",
"@types/node": "16.18.11",
"@types/archiver": "5.3.1",
"alias-only-sizzle": "npm:@types/sizzle@~2.3.8",
"alias-types-node": "npm:@types/node@~16.18.11"
},
"optionalDependencies": {
Expand Down
12 changes: 8 additions & 4 deletions e2e/pnpm_lockfiles/lockfile-test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ BZL_FILES = {
# hasBin, optional deps, deps
"rollup_links_defs.bzl": "@REPO_NAME__rollup__3.2.5__links//:defs.bzl",
"rollup_package_json.bzl": "@REPO_NAME__rollup__3.2.5//VERSION:package_json.bzl",

# TODO: inconsistent across versions
# peers
# "aspect_test_d_defs.bzl": "@REPO_NAME__@aspect-test+d__2.0.0_@aspect-test+c__2.0.2//:defs.bzl",
}

def lockfile_test(name = None):
Expand Down Expand Up @@ -61,6 +57,7 @@ def lockfile_test(name = None):
":node_modules/@aspect-test/a",
":node_modules/@aspect-test/a2",
":node_modules/@types/node",
":node_modules/alias-only-sizzle",
":node_modules/alias-types-node",
":node_modules/is-odd",
":node_modules/is-odd-alt-version",
Expand Down Expand Up @@ -118,6 +115,11 @@ def lockfile_test(name = None):
":node_modules/is-odd-alt-version",
":.aspect_rules_js/node_modules/is-odd@2.0.0",

# npm: alias to package not listed elsewhere
":node_modules/alias-only-sizzle",
":.aspect_rules_js/node_modules/@types+sizzle@2.3.8",
"@%s__at_types_sizzle__2.3.8//:pkg" % lock_repo,

# Targets within the virtual store...
# Direct dep targets
":.aspect_rules_js/node_modules/@aspect-test+a@5.0.2",
Expand All @@ -137,12 +139,14 @@ def lockfile_test(name = None):

# Patched dependencies
":.aspect_rules_js/node_modules/meaning-of-life@1.0.0_o3deharooos255qt5xdujc3cuq",
"@%s__meaning-of-life__1.0.0__o3deharooos255qt5xdujc3cuq//:pkg" % lock_repo,

# Direct deps from custom registry
":.aspect_rules_js/node_modules/@types+node@16.18.11",

# Direct deps with peers
":.aspect_rules_js/node_modules/@aspect-test+d@2.0.0_at_aspect-test_c_2.0.2",
"@%s__at_aspect-test_d__2.0.0__at_aspect-test_c_2.0.2//:pkg" % lock_repo,
],
)

Expand Down
8 changes: 8 additions & 0 deletions e2e/pnpm_lockfiles/v54/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

113 changes: 59 additions & 54 deletions e2e/pnpm_lockfiles/v54/snapshots/defs.bzl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions e2e/pnpm_lockfiles/v60/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 60c60e8

Please sign in to comment.