Skip to content

Commit

Permalink
fix(npm): expost package_json.bzl and resolved.json for each package …
Browse files Browse the repository at this point in the history
…alias
  • Loading branch information
jbedard committed Jul 20, 2024
1 parent c938130 commit cce48d7
Show file tree
Hide file tree
Showing 20 changed files with 538 additions and 144 deletions.
4 changes: 3 additions & 1 deletion e2e/pnpm_lockfiles/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ npm = use_extension(
# Dep with bin entries etc
"lock-%s__rollup__2.14.0" % version,
"lock-%s__rollup__2.14.0__links" % version,
"lock-%s__rollup__3.29.4" % version,
"lock-%s__rollup__3.29.4__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,
Expand All @@ -79,7 +81,7 @@ npm = use_extension(
# Deep with many peers
"lock-%s__at_rollup_plugin-typescript__8.2.1__%s" % (
version,
"ommloj5qql5ba6x5wuiluawhoi" if version == "v54" else "1662662592",
"ommloj5qql5ba6x5wuiluawhoi" if version == "v54" else "1662662592" if version == "v90" else "1813138439",
),

# Dep with patch
Expand Down
1 change: 1 addition & 0 deletions e2e/pnpm_lockfiles/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"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",
"rollup": "2.14.0",
"rollup3": "npm:rollup@3.29.4",
"rollup-plugin-with-peers": "npm:@rollup/plugin-typescript@8.2.1",
"tslib": "^2.6.3",
"typescript": "^5.4.5",
Expand Down
6 changes: 4 additions & 2 deletions e2e/pnpm_lockfiles/lockfile-test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ BZL_FILES = {

# resolved.json reference
"is-odd_resolved.json": "@REPO_NAME//VERSION:is-odd/resolved.json",
"is-odd-v0_resolved.json": "@REPO_NAME//VERSION:is-odd-v0/resolved.json",

# hasBin, optional deps, deps
# hasBin, optional deps, deps and across versions
"rollup_links_defs.bzl": "@REPO_NAME__rollup__2.14.0__links//:defs.bzl",
"rollup_package_json.bzl": "@REPO_NAME__rollup__2.14.0//VERSION:package_json.bzl",
"rollup3_package_json.bzl": "@REPO_NAME__rollup__3.29.4//VERSION:package_json.bzl",
}

def lockfile_test(name = None):
Expand Down Expand Up @@ -95,7 +97,7 @@ def lockfile_test(name = None):
# npm: alias to a package that has many peers
":node_modules/rollup-plugin-with-peers",
# underlying repo for the many-peers package
"@%s__at_rollup_plugin-typescript__8.2.1__%s//:pkg" % (lock_repo, "ommloj5qql5ba6x5wuiluawhoi" if lock_version == "v54" else "1662662592"),
"@%s__at_rollup_plugin-typescript__8.2.1__%s//:pkg" % (lock_repo, "ommloj5qql5ba6x5wuiluawhoi" if lock_version == "v54" else "1662662592" if lock_version == "v90" else "1813138439"),

# uuv 'hasBin'
":node_modules/uvu",
Expand Down
10 changes: 10 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.

49 changes: 27 additions & 22 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.

1 change: 1 addition & 0 deletions e2e/pnpm_lockfiles/v54/snapshots/is-odd-v0_resolved.json

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

76 changes: 76 additions & 0 deletions e2e/pnpm_lockfiles/v54/snapshots/rollup3_package_json.bzl

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

23 changes: 17 additions & 6 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 cce48d7

Please sign in to comment.