Skip to content

Commit

Permalink
test: add test cases for individual pnpm lockfile issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedard committed May 31, 2024
1 parent 1574619 commit b64335c
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 3 deletions.
1 change: 1 addition & 0 deletions e2e/pnpm_lockfiles/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ PNPM_LOCK_VERSIONS = [
# Lockfiles with unique test cases
PNPM_LOCK_TEST_CASES = [
"tarball-no-url-v54.yaml",
"override-with-alias-url-v9.yaml",
]

bazel_dep(name = "aspect_bazel_lib", version = "2.7.7")
Expand Down
1 change: 1 addition & 0 deletions e2e/pnpm_lockfiles/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ PNPM_LOCK_VERSIONS = [
# Lockfiles with unique test cases
PNPM_LOCK_TEST_CASES = [
"tarball-no-url-v54.yaml",
"override-with-alias-url-v9.yaml",
]

load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
Expand Down
13 changes: 12 additions & 1 deletion e2e/pnpm_lockfiles/cases/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
load("@bazel_skylib//rules:build_test.bzl", "build_test")
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")

exports_files(glob(["*.yaml"]))

tarball_no_url_link_all(name = "tarball-no-url-v54-modules")

build_test(
Expand All @@ -11,4 +14,12 @@ build_test(
],
)

exports_files(glob(["*.yaml"]))
override_with_alias_link_all(name = "override-with-alias-url-v9_modules")

build_test(
name = "override-with-alias-url-v9",
targets = [
":override-with-alias-url-v9_modules",
":override-with-alias-url-v9_modules/lodash.pick",
],
)
28 changes: 28 additions & 0 deletions e2e/pnpm_lockfiles/cases/override-with-alias-url-v9.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
lockfileVersion: '9.0'

settings:
autoInstallPeers: true
excludeLinksFromLockfile: false

overrides:
# recommended workaround: https://github.com/lodash/lodash/issues/5809#issuecomment-1910560681
lodash.pick: https://github.com/lodash/lodash/archive/refs/tags/4.17.21.tar.gz

importers:
.:
dependencies:
lodash.pick:
specifier: https://github.com/lodash/lodash/archive/refs/tags/4.17.21.tar.gz
version: lodash@https://github.com/lodash/lodash/archive/refs/tags/4.17.21.tar.gz

packages:
lodash@https://github.com/lodash/lodash/archive/refs/tags/4.17.21.tar.gz:
resolution:
{
tarball: https://github.com/lodash/lodash/archive/refs/tags/4.17.21.tar.gz,
}
version: 4.17.21
engines: { node: '>=4.0.0' }

snapshots:
lodash@https://github.com/lodash/lodash/archive/refs/tags/4.17.21.tar.gz: {}
6 changes: 5 additions & 1 deletion e2e/pnpm_lockfiles/cases/package.json
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
{}
{
"pnpm": {
"onlyBuiltDependencies": []
}
}
2 changes: 1 addition & 1 deletion e2e/pnpm_lockfiles/projects/d/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@scoped/c",
"name": "@scoped/d",
"private": true,
"dependencies": {
"@scoped/a": "workspace:*"
Expand Down

0 comments on commit b64335c

Please sign in to comment.