diff --git a/.bazelrc b/.bazelrc index 00ce0e3bcb..3fba9c4323 100644 --- a/.bazelrc +++ b/.bazelrc @@ -5,8 +5,8 @@ import %workspace%/common.bazelrc # This lets us glob() up all the files inside the examples to make them inputs to tests # To update these lines, just run `yarn bazel:update-deleted-packages` # (Note, we cannot use common --deleted_packages because the bazel version command doesn't support it) -build --deleted_packages=examples/angular,examples/angular/e2e,examples/angular/src/app/home,examples/angular/src/app/hello-world,examples/angular/src/app,examples/angular/src/app/todos,examples/angular/src/app/todos/reducers,examples/angular/src/shared/material,examples/angular/src/lib/shorten,examples/angular/src,examples/angular/src/assets,examples/angular/tools,examples/angular_bazel_architect,examples/angular_bazel_architect/projects/frontend-lib,examples/angular_view_engine,examples/angular_view_engine/e2e,examples/angular_view_engine/src/app/home,examples/angular_view_engine/src/app/hello-world,examples/angular_view_engine/src/app,examples/angular_view_engine/src/app/todos,examples/angular_view_engine/src/app/todos/reducers,examples/angular_view_engine/src/shared/material,examples/angular_view_engine/src/lib/typography,examples/angular_view_engine/src/lib/shorten,examples/angular_view_engine/src,examples/angular_view_engine/src/assets,examples/app,examples/app/styles,examples/app/test,examples/closure,examples/create-react-app,examples/cypress,examples/esbuild,examples/esbuild/src,examples/from_source,examples/jest,examples/jest/ts/test,examples/jest/ts,examples/jest/ts/src,examples/kotlin,examples/nestjs,examples/nestjs/src,examples/parcel,examples/protobufjs,examples/protocol_buffers,examples/react_webpack,examples/user_managed_deps,examples/vendored_node,examples/vendored_node_and_yarn,examples/vue,examples/vue/src,examples/web_testing,examples/webapp,examples/worker,e2e/bazel_managed_deps,e2e/concatjs_devserver,e2e/concatjs_devserver/genrule,e2e/concatjs_devserver/subpackage,e2e/coverage,e2e/fine_grained_symlinks,e2e/jasmine,e2e/node_loader_no_preserve_symlinks,e2e/node_loader_preserve_symlinks,e2e/nodejs_image,e2e/nodejs_image/foolib,e2e/packages,e2e/symlinked_node_modules_npm,e2e/symlinked_node_modules_yarn,e2e/typescript,e2e/webapp -query --deleted_packages=examples/angular,examples/angular/e2e,examples/angular/src/app/home,examples/angular/src/app/hello-world,examples/angular/src/app,examples/angular/src/app/todos,examples/angular/src/app/todos/reducers,examples/angular/src/shared/material,examples/angular/src/lib/shorten,examples/angular/src,examples/angular/src/assets,examples/angular/tools,examples/angular_bazel_architect,examples/angular_bazel_architect/projects/frontend-lib,examples/angular_view_engine,examples/angular_view_engine/e2e,examples/angular_view_engine/src/app/home,examples/angular_view_engine/src/app/hello-world,examples/angular_view_engine/src/app,examples/angular_view_engine/src/app/todos,examples/angular_view_engine/src/app/todos/reducers,examples/angular_view_engine/src/shared/material,examples/angular_view_engine/src/lib/typography,examples/angular_view_engine/src/lib/shorten,examples/angular_view_engine/src,examples/angular_view_engine/src/assets,examples/app,examples/app/styles,examples/app/test,examples/closure,examples/create-react-app,examples/cypress,examples/esbuild,examples/esbuild/src,examples/from_source,examples/jest,examples/jest/ts/test,examples/jest/ts,examples/jest/ts/src,examples/kotlin,examples/nestjs,examples/nestjs/src,examples/parcel,examples/protobufjs,examples/protocol_buffers,examples/react_webpack,examples/user_managed_deps,examples/vendored_node,examples/vendored_node_and_yarn,examples/vue,examples/vue/src,examples/web_testing,examples/webapp,examples/worker,e2e/bazel_managed_deps,e2e/concatjs_devserver,e2e/concatjs_devserver/genrule,e2e/concatjs_devserver/subpackage,e2e/coverage,e2e/fine_grained_symlinks,e2e/jasmine,e2e/node_loader_no_preserve_symlinks,e2e/node_loader_preserve_symlinks,e2e/nodejs_image,e2e/nodejs_image/foolib,e2e/packages,e2e/symlinked_node_modules_npm,e2e/symlinked_node_modules_yarn,e2e/typescript,e2e/webapp +build --deleted_packages=examples/angular,examples/angular/e2e,examples/angular/src/app/home,examples/angular/src/app/hello-world,examples/angular/src/app,examples/angular/src/app/todos,examples/angular/src/app/todos/reducers,examples/angular/src/shared/material,examples/angular/src/lib/shorten,examples/angular/src,examples/angular/src/assets,examples/angular/tools,examples/angular_bazel_architect,examples/angular_bazel_architect/projects/frontend-lib,examples/angular_view_engine,examples/angular_view_engine/e2e,examples/angular_view_engine/src/app/home,examples/angular_view_engine/src/app/hello-world,examples/angular_view_engine/src/app,examples/angular_view_engine/src/app/todos,examples/angular_view_engine/src/app/todos/reducers,examples/angular_view_engine/src/shared/material,examples/angular_view_engine/src/lib/typography,examples/angular_view_engine/src/lib/shorten,examples/angular_view_engine/src,examples/angular_view_engine/src/assets,examples/app,examples/app/styles,examples/app/test,examples/closure,examples/create-react-app,examples/cypress,examples/esbuild,examples/esbuild/src,examples/from_source,examples/jest,examples/jest/ts/test,examples/jest/ts,examples/jest/ts/src,examples/kotlin,examples/kotlin/node_modules/@bazel/rollup,examples/kotlin/node_modules/@bazel/terser,examples/nestjs,examples/nestjs/src,examples/parcel,examples/protobufjs,examples/protocol_buffers,examples/react_webpack,examples/user_managed_deps,examples/vendored_node,examples/vendored_node_and_yarn,examples/vue,examples/vue/src,examples/web_testing,examples/webapp,examples/worker,e2e/bazel_managed_deps,e2e/concatjs_devserver,e2e/concatjs_devserver/genrule,e2e/concatjs_devserver/subpackage,e2e/coverage,e2e/fine_grained_symlinks,e2e/jasmine,e2e/node_loader_no_preserve_symlinks,e2e/node_loader_preserve_symlinks,e2e/nodejs_image,e2e/nodejs_image/foolib,e2e/nodejs_repository,e2e/packages,e2e/symlinked_node_modules_npm,e2e/symlinked_node_modules_yarn,e2e/typescript,e2e/webapp +query --deleted_packages=examples/angular,examples/angular/e2e,examples/angular/src/app/home,examples/angular/src/app/hello-world,examples/angular/src/app,examples/angular/src/app/todos,examples/angular/src/app/todos/reducers,examples/angular/src/shared/material,examples/angular/src/lib/shorten,examples/angular/src,examples/angular/src/assets,examples/angular/tools,examples/angular_bazel_architect,examples/angular_bazel_architect/projects/frontend-lib,examples/angular_view_engine,examples/angular_view_engine/e2e,examples/angular_view_engine/src/app/home,examples/angular_view_engine/src/app/hello-world,examples/angular_view_engine/src/app,examples/angular_view_engine/src/app/todos,examples/angular_view_engine/src/app/todos/reducers,examples/angular_view_engine/src/shared/material,examples/angular_view_engine/src/lib/typography,examples/angular_view_engine/src/lib/shorten,examples/angular_view_engine/src,examples/angular_view_engine/src/assets,examples/app,examples/app/styles,examples/app/test,examples/closure,examples/create-react-app,examples/cypress,examples/esbuild,examples/esbuild/src,examples/from_source,examples/jest,examples/jest/ts/test,examples/jest/ts,examples/jest/ts/src,examples/kotlin,examples/kotlin/node_modules/@bazel/rollup,examples/kotlin/node_modules/@bazel/terser,examples/nestjs,examples/nestjs/src,examples/parcel,examples/protobufjs,examples/protocol_buffers,examples/react_webpack,examples/user_managed_deps,examples/vendored_node,examples/vendored_node_and_yarn,examples/vue,examples/vue/src,examples/web_testing,examples/webapp,examples/worker,e2e/bazel_managed_deps,e2e/concatjs_devserver,e2e/concatjs_devserver/genrule,e2e/concatjs_devserver/subpackage,e2e/coverage,e2e/fine_grained_symlinks,e2e/jasmine,e2e/node_loader_no_preserve_symlinks,e2e/node_loader_preserve_symlinks,e2e/nodejs_image,e2e/nodejs_image/foolib,e2e/nodejs_repository,e2e/packages,e2e/symlinked_node_modules_npm,e2e/symlinked_node_modules_yarn,e2e/typescript,e2e/webapp # Mock versioning command to test the --stamp behavior build --workspace_status_command="echo BUILD_SCM_VERSION 1.2.3" diff --git a/e2e/BUILD.bazel b/e2e/BUILD.bazel index 0fb5a0b531..ba64f0205d 100644 --- a/e2e/BUILD.bazel +++ b/e2e/BUILD.bazel @@ -75,6 +75,10 @@ e2e_integration_test( ], ) +e2e_integration_test( + name = "e2e_nodejs_repository", +) + e2e_integration_test( name = "e2e_packages", # TODO(alex): figure out why this is broken by turning on linker diff --git a/e2e/nodejs_repository/.bazelignore b/e2e/nodejs_repository/.bazelignore new file mode 100644 index 0000000000..b512c09d47 --- /dev/null +++ b/e2e/nodejs_repository/.bazelignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/e2e/nodejs_repository/.bazelrc b/e2e/nodejs_repository/.bazelrc new file mode 100644 index 0000000000..3431057af6 --- /dev/null +++ b/e2e/nodejs_repository/.bazelrc @@ -0,0 +1 @@ +import %workspace%/../../common.bazelrc diff --git a/e2e/nodejs_repository/BUILD.bazel b/e2e/nodejs_repository/BUILD.bazel new file mode 100644 index 0000000000..cb42cd13f1 --- /dev/null +++ b/e2e/nodejs_repository/BUILD.bazel @@ -0,0 +1,24 @@ +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test") + +# Dummy test target that imports various targets from the +# "@nodejs" repository. If a target of the repository is +# misconfigured, Bazel will complain about missing input files. +nodejs_test( + name = "test", + data = [ + "index.spec.js", + "@nodejs//:node", + "@nodejs//:node_bin", + "@nodejs//:node_files", + "@nodejs//:npm", + "@nodejs//:npm_bin", + "@nodejs//:npm_files", + "@nodejs//:npm_node_repositories", + "@nodejs//:npx_bin", + "@nodejs//:yarn", + "@nodejs//:yarn_bin", + "@nodejs//:yarn_files", + "@nodejs//:yarn_node_repositories", + ], + entry_point = ":index.spec.js", +) diff --git a/e2e/nodejs_repository/WORKSPACE b/e2e/nodejs_repository/WORKSPACE new file mode 100644 index 0000000000..7828782223 --- /dev/null +++ b/e2e/nodejs_repository/WORKSPACE @@ -0,0 +1,20 @@ +workspace( + name = "nodejs_repository", + managed_directories = {"@npm": ["node_modules"]}, +) + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +http_archive( + name = "build_bazel_rules_nodejs", + sha256 = "10f534e1c80f795cffe1f2822becd4897754d18564612510c59b3c73544ae7c6", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.5.0/rules_nodejs-3.5.0.tar.gz"], +) + +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") + +yarn_install( + name = "npm", + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", +) diff --git a/e2e/nodejs_repository/index.spec.js b/e2e/nodejs_repository/index.spec.js new file mode 100644 index 0000000000..c6786e2740 --- /dev/null +++ b/e2e/nodejs_repository/index.spec.js @@ -0,0 +1,2 @@ +// Empty test file. The test target primarily exists to ensure +// that Bazel targets are not misconfigured. See BUILD.bazel. \ No newline at end of file diff --git a/e2e/nodejs_repository/package.json b/e2e/nodejs_repository/package.json new file mode 100644 index 0000000000..c349b7a415 --- /dev/null +++ b/e2e/nodejs_repository/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": {}, + "scripts": { + "test": "bazel test ..." + } +} diff --git a/e2e/nodejs_repository/yarn.lock b/e2e/nodejs_repository/yarn.lock new file mode 100644 index 0000000000..fb57ccd13a --- /dev/null +++ b/e2e/nodejs_repository/yarn.lock @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + +