Skip to content

Feat ignore not compatible packages #2263

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
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
14 changes: 14 additions & 0 deletions e2e/npm_translate_lock_platform/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# No load needed - sh_test is a built-in rule
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@aspect_rules_js//js:defs.bzl", "js_test")

npm_link_all_packages(name = "node_modules")

# Simple functionality test - just verify esbuild can be required and works
js_test(
name = "test",
entry_point = "basic_require_test.js",
data = [":node_modules"],
)


20 changes: 20 additions & 0 deletions e2e/npm_translate_lock_platform/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal module for platform fetch e2e test
bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True)
bazel_dep(name = "platforms", version = "0.0.5")
local_path_override(
module_name = "aspect_rules_js",
path = "../..",
)

npm = use_extension(
"@aspect_rules_js//npm:extensions.bzl",
"npm",
dev_dependency = True,
)

npm.npm_translate_lock(
name = "npm",
pnpm_lock = "//:pnpm-lock.yaml",
)

use_repo(npm, "npm")
4 changes: 4 additions & 0 deletions e2e/npm_translate_lock_platform/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Platform fetch e2e test

This directory contains an end-to-end test that ensures `npm_translate_lock` only
fetches packages compatible with the current build platform.
1 change: 1 addition & 0 deletions e2e/npm_translate_lock_platform/WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

16 changes: 16 additions & 0 deletions e2e/npm_translate_lock_platform/basic_require_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Basic test to verify esbuild can be required and works
// More comprehensive testing is done in test.sh

console.log('Testing basic esbuild functionality...');

try {
const esbuild = require('esbuild');
console.log('✅ esbuild loaded successfully, version:', esbuild.version);

// Simple transform test
const result = esbuild.transformSync('const x = 1', { format: 'esm' });
console.log('✅ esbuild.transformSync works, result:', result.code);
} catch (error) {
console.error('❌ Basic require test failed:', error.message);
process.exit(1);
}
58 changes: 58 additions & 0 deletions e2e/npm_translate_lock_platform/build_output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Computing main repo mapping:
Loading:
Loading: 0 packages loaded
Analyzing: target //:node_modules (1 packages loaded, 0 targets configured)
Analyzing: target //:node_modules (1 packages loaded, 0 targets configured)

INFO: Analyzed target //:node_modules (99 packages loaded, 613 targets configured).
INFO: Found 1 target...
Target //:node_modules up-to-date:
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/android-arm
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/android-arm64
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/android-x64
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/darwin-arm64
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/darwin-x64
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/freebsd-arm64
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/freebsd-x64
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/linux-arm
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/linux-arm64
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/linux-ia32
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/linux-loong64
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/linux-mips64el
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/linux-ppc64
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/linux-riscv64
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/linux-s390x
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/linux-x64
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/netbsd-x64
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/openbsd-x64
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/sunos-x64
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/win32-arm64
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/win32-ia32
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/@esbuild/win32-x64
bazel-bin/node_modules/.aspect_rules_js/[email protected]/node_modules/esbuild
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/android-arm
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/android-arm64
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/android-x64
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/darwin-arm64
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/darwin-x64
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/freebsd-arm64
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/freebsd-x64
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/linux-arm
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/linux-arm64
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/linux-ia32
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/linux-loong64
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/linux-mips64el
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/linux-ppc64
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/linux-riscv64
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/linux-s390x
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/linux-x64
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/netbsd-x64
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/openbsd-x64
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/sunos-x64
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/win32-arm64
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/win32-ia32
bazel-bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/@esbuild/win32-x64
bazel-bin/node_modules/esbuild
INFO: Elapsed time: 0.537s, Critical Path: 0.10s
INFO: 47 processes: 24 internal, 23 processwrapper-sandbox.
INFO: Build completed successfully, 47 total actions
10 changes: 10 additions & 0 deletions e2e/npm_translate_lock_platform/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "npm-translate-lock-platform-test",
"version": "1.0.0",
"dependencies": {
"esbuild": "0.16.17"
},
"pnpm": {
"onlyBuiltDependencies": []
}
}
245 changes: 245 additions & 0 deletions e2e/npm_translate_lock_platform/pnpm-lock.yaml

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

2 changes: 2 additions & 0 deletions e2e/npm_translate_lock_platform/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages:
- '.'
Loading
Loading