-
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(pnpm): various npm package aliases
- Loading branch information
Showing
15 changed files
with
341 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# gazelle:exclude **/snapshots/**/* | ||
|
||
exports_files(["base/patched-dependencies-test.js"]) | ||
exports_files([ | ||
"base/patched-dependencies-test.js", | ||
"base/aliases-test.js", | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// `@aspect-test/{a,a2}` should be importable and equal | ||
if (require('@aspect-test/a') !== require('@aspect-test/a2')) { | ||
throw new Error( | ||
'aliased `@aspect-test/a` as `@aspect-test/a2` are not the same' | ||
) | ||
} | ||
|
||
// `alias-types-node` and `@types/node` should be importable and equal | ||
if ( | ||
require('alias-types-node/package.json') !== | ||
require('@types/node/package.json') | ||
) { | ||
throw new Error( | ||
'aliased `@types/node` as `alias-types-node` is not the same' | ||
) | ||
} | ||
|
||
// `is-odd` and the aliased `is-odd-alt-version` should be different versions | ||
if ( | ||
require('is-odd/package.json').version === | ||
require('is-odd-alt-version/package.json').version | ||
) { | ||
throw new Error('aliased `is-odd` as `is-odd-alt-version` are the same') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,11 +39,13 @@ def lockfile_test(name = None): | |
lock_version = name if name else native.package_name() | ||
lock_repo = "lock-%s" % lock_version | ||
|
||
copy_file( | ||
name = "copy-tests", | ||
src = "//:base/patched-dependencies-test.js", | ||
out = "patched-dependencies-test.js", | ||
) | ||
# Copy each test to this lockfile dir | ||
for test in ["patched-dependencies-test.js", "aliases-test.js"]: | ||
copy_file( | ||
name = "copy-{}".format(test), | ||
src = "//:base/{}".format(test), | ||
out = test, | ||
) | ||
|
||
js_test( | ||
name = "patch-test", | ||
|
@@ -53,6 +55,19 @@ def lockfile_test(name = None): | |
entry_point = "patched-dependencies-test.js", | ||
) | ||
|
||
js_test( | ||
name = "aliases-test", | ||
data = [ | ||
":node_modules/@aspect-test/a", | ||
":node_modules/@aspect-test/a2", | ||
":node_modules/@types/node", | ||
":node_modules/alias-types-node", | ||
":node_modules/is-odd", | ||
":node_modules/is-odd-alt-version", | ||
], | ||
entry_point = "aliases-test.js", | ||
) | ||
|
||
build_test( | ||
name = "targets", | ||
targets = [ | ||
|
@@ -89,10 +104,15 @@ def lockfile_test(name = None): | |
# Odd git/http versions | ||
":node_modules/debug", | ||
":node_modules/hello", | ||
# ":node_modules/jsonify", TODO: v9 | ||
":node_modules/jsonify", | ||
|
||
# npm: | ||
# npm: alias | ||
":node_modules/@aspect-test/a2", | ||
# npm: alias to registry-scoped packages | ||
":node_modules/alias-types-node", | ||
# npm: alias to alternate versions | ||
":node_modules/is-odd-alt-version", | ||
":.aspect_rules_js/node_modules/[email protected]", | ||
|
||
# Targets within the virtual store... | ||
# Direct dep targets | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.