diff --git a/.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx b/.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx index 52fc0bfe1a7d..7c435e73b950 100755 --- a/.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx +++ b/.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx @@ -10,8 +10,9 @@ packages/angular_devkit/architect_cli/package.json=1551210941 packages/angular_devkit/build_webpack/package.json=373950017 packages/angular_devkit/core/package.json=339935828 packages/angular_devkit/schematics/package.json=673943597 +packages/angular_devkit/schematics_cli/package.json=-1663529211 packages/ngtools/webpack/package.json=597254444 packages/schematics/angular/package.json=251715148 -pnpm-lock.yaml=-690479437 -pnpm-workspace.yaml=634423855 +pnpm-lock.yaml=-2058271568 +pnpm-workspace.yaml=1732591250 yarn.lock=-1257671515 diff --git a/WORKSPACE b/WORKSPACE index e35608cdce83..591d37d629e4 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -193,6 +193,7 @@ npm_translate_lock( "//packages/angular_devkit/build_webpack:package.json", "//packages/angular_devkit/core:package.json", "//packages/angular_devkit/schematics:package.json", + "//packages/angular_devkit/schematics_cli:package.json", "//packages/ngtools/webpack:package.json", "//packages/schematics/angular:package.json", ], diff --git a/packages/angular_devkit/architect/node/BUILD.bazel b/packages/angular_devkit/architect/node/BUILD.bazel index e263c3ec3d7e..4d7909e6755e 100644 --- a/packages/angular_devkit/architect/node/BUILD.bazel +++ b/packages/angular_devkit/architect/node/BUILD.bazel @@ -3,8 +3,7 @@ # Use of this source code is governed by an MIT-style license that can be # found in the LICENSE file at https://angular.dev/license -load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test") -load("//tools:interop.bzl", "ts_project") +load("//tools:defaults2.bzl", "jasmine_test", "ts_project") licenses(["notice"]) @@ -21,8 +20,7 @@ ts_project( "//:node_modules/@types/node", "//:node_modules/rxjs", "//packages/angular_devkit/architect:architect_rjs", - "//packages/angular_devkit/core:core_rjs", - "//packages/angular_devkit/core/node:node_rjs", + "//packages/angular_devkit/architect:node_modules/@angular-devkit/core", ], ) @@ -39,11 +37,11 @@ ts_project( "//:node_modules/@types/jasmine", "//:node_modules/rxjs", "//packages/angular_devkit/architect:architect_rjs", - "//tests/angular_devkit/architect/node/jobs:jobs_test_lib_rjs", + "//packages/angular_devkit/architect/node/test:test_lib_rjs", ], ) -jasmine_node_test( +jasmine_test( name = "node_test", - srcs = [":node_test_lib"], + data = [":node_test_lib_rjs"], ) diff --git a/packages/angular_devkit/architect/node/jobs/job-registry.ts b/packages/angular_devkit/architect/node/jobs/job-registry.ts index 4ee9773ba4bf..9237a7238c96 100644 --- a/packages/angular_devkit/architect/node/jobs/job-registry.ts +++ b/packages/angular_devkit/architect/node/jobs/job-registry.ts @@ -6,9 +6,9 @@ * found in the LICENSE file at https://angular.dev/license */ -import { jobs } from '@angular-devkit/architect'; import { JsonValue, schema } from '@angular-devkit/core'; import { Observable, of } from 'rxjs'; +import { jobs } from '../../src'; export class NodeModuleJobRegistry< MinimumArgumentValueT extends JsonValue = JsonValue, diff --git a/packages/angular_devkit/architect/node/jobs/job-registry_spec.ts b/packages/angular_devkit/architect/node/jobs/job-registry_spec.ts index 6b386f36758f..74e03eaf3c3c 100644 --- a/packages/angular_devkit/architect/node/jobs/job-registry_spec.ts +++ b/packages/angular_devkit/architect/node/jobs/job-registry_spec.ts @@ -6,12 +6,12 @@ * found in the LICENSE file at https://angular.dev/license */ -import { jobs } from '@angular-devkit/architect'; import * as path from 'path'; import { lastValueFrom } from 'rxjs'; +import { jobs } from '../../src'; import { NodeModuleJobRegistry } from './job-registry'; -const root = path.join(__dirname, '../../../../../tests/angular_devkit/architect/node/jobs'); +const root = path.join(__dirname, '../test/jobs'); describe('NodeModuleJobScheduler', () => { it('works', async () => { diff --git a/packages/angular_devkit/architect/node/test/BUILD.bazel b/packages/angular_devkit/architect/node/test/BUILD.bazel new file mode 100644 index 000000000000..03cf4fd0d68e --- /dev/null +++ b/packages/angular_devkit/architect/node/test/BUILD.bazel @@ -0,0 +1,11 @@ +load("//tools:interop.bzl", "ts_project") + +ts_project( + name = "test_lib", + srcs = glob(["**/*.ts"]), + visibility = ["//packages/angular_devkit/architect/node:__pkg__"], + deps = [ + "//:node_modules/@types/node", + "//packages/angular_devkit/architect:architect_rjs", + ], +) diff --git a/tests/angular_devkit/architect/node/jobs/add.ts b/packages/angular_devkit/architect/node/test/jobs/add.ts similarity index 90% rename from tests/angular_devkit/architect/node/jobs/add.ts rename to packages/angular_devkit/architect/node/test/jobs/add.ts index bcf6b781b190..9760f04c6a01 100644 --- a/tests/angular_devkit/architect/node/jobs/add.ts +++ b/packages/angular_devkit/architect/node/test/jobs/add.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.dev/license */ -import { jobs } from '@angular-devkit/architect'; +import { jobs } from '../../../index'; // Export the job using a createJob. We use our own spec file here to do the job. export default jobs.createJobHandler( diff --git a/packages/angular_devkit/core/node/BUILD.bazel b/packages/angular_devkit/core/node/BUILD.bazel index fab7df5cdff5..a71aa8a2856f 100644 --- a/packages/angular_devkit/core/node/BUILD.bazel +++ b/packages/angular_devkit/core/node/BUILD.bazel @@ -3,8 +3,7 @@ # Use of this source code is governed by an MIT-style license that can be # found in the LICENSE file at https://angular.dev/license -load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test") -load("//tools:interop.bzl", "ts_project") +load("//tools:defaults2.bzl", "jasmine_test", "ts_project") licenses(["notice"]) @@ -28,8 +27,6 @@ ts_project( ], ) -# @external_begin - ts_project( name = "node_test_lib", testonly = True, @@ -49,11 +46,7 @@ ts_project( ], ) -jasmine_node_test( +jasmine_test( name = "node_test", - srcs = [":node_test_lib"], - deps = [ - "@npm//chokidar", - ], + data = [":node_test_lib_rjs"], ) -# @external_end diff --git a/packages/angular_devkit/schematics/tools/BUILD.bazel b/packages/angular_devkit/schematics/tools/BUILD.bazel index eda1d2a56215..8e901d9fe01f 100644 --- a/packages/angular_devkit/schematics/tools/BUILD.bazel +++ b/packages/angular_devkit/schematics/tools/BUILD.bazel @@ -1,5 +1,4 @@ -load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test") -load("//tools:interop.bzl", "ts_project") +load("//tools:defaults2.bzl", "jasmine_test", "ts_project") # Copyright Google Inc. All Rights Reserved. # @@ -24,8 +23,7 @@ ts_project( "//:node_modules/@types/node", "//:node_modules/jsonc-parser", "//:node_modules/rxjs", - "//packages/angular_devkit/core:core_rjs", - "//packages/angular_devkit/core/node:node_rjs", + "//packages/angular_devkit/schematics:node_modules/@angular-devkit/core", "//packages/angular_devkit/schematics:schematics_rjs", "//packages/angular_devkit/schematics/tasks:tasks_rjs", "//packages/angular_devkit/schematics/tasks/node:node_rjs", @@ -45,8 +43,7 @@ ts_project( ":tools_rjs", "//:node_modules/@types/jasmine", "//:node_modules/rxjs", - "//packages/angular_devkit/core:core_rjs", - "//packages/angular_devkit/core/node:node_rjs", + "//packages/angular_devkit/schematics:node_modules/@angular-devkit/core", "//packages/angular_devkit/schematics:schematics_rjs", "//packages/angular_devkit/schematics/tasks:tasks_rjs", "//packages/angular_devkit/schematics/testing:testing_rjs", @@ -54,7 +51,7 @@ ts_project( ], ) -jasmine_node_test( +jasmine_test( name = "tools_test", - deps = [":tools_test_lib"], + data = [":tools_test_lib_rjs"], ) diff --git a/packages/angular_devkit/schematics/tools/file-system-engine-host_spec.ts b/packages/angular_devkit/schematics/tools/file-system-engine-host_spec.ts index 73cb6f6738eb..0d8a9aae41e6 100644 --- a/packages/angular_devkit/schematics/tools/file-system-engine-host_spec.ts +++ b/packages/angular_devkit/schematics/tools/file-system-engine-host_spec.ts @@ -8,10 +8,10 @@ /* eslint-disable @typescript-eslint/no-explicit-any, import/no-extraneous-dependencies */ import { normalize, virtualFs } from '@angular-devkit/core'; -import { HostSink, HostTree, SchematicEngine } from '@angular-devkit/schematics'; -import { FileSystemEngineHost } from '@angular-devkit/schematics/tools'; import * as path from 'path'; import { from, lastValueFrom, of as observableOf } from 'rxjs'; +import { HostSink, HostTree, SchematicEngine } from '../index'; +import { FileSystemEngineHost } from './file-system-engine-host'; describe('FileSystemEngineHost', () => { // We need to resolve a file that actually exists, and not just a folder. diff --git a/packages/angular_devkit/schematics/tools/node-module-engine-host_spec.ts b/packages/angular_devkit/schematics/tools/node-module-engine-host_spec.ts index fdfb54e053f9..5ce3699daef6 100644 --- a/packages/angular_devkit/schematics/tools/node-module-engine-host_spec.ts +++ b/packages/angular_devkit/schematics/tools/node-module-engine-host_spec.ts @@ -6,28 +6,23 @@ * found in the LICENSE file at https://angular.dev/license */ -import { SchematicEngine } from '@angular-devkit/schematics'; import * as fs from 'fs'; import * as os from 'os'; import * as path from 'path'; +import { SchematicEngine } from '../index'; import { NodeModulesEngineHost } from './node-module-engine-host'; const TMP_DIR = process.env['TEST_TMPDIR'] || os.tmpdir(); describe('NodeModulesEngineHost', () => { let tmpDir!: string; - let previousDir!: string; beforeEach(() => { tmpDir = fs.mkdtempSync( path.join(TMP_DIR, 'angular-devkit-schematics-tools-node-module-engine-host'), ); - previousDir = process.cwd(); - process.chdir(tmpDir); }); - afterEach(() => process.chdir(previousDir)); - /** Creates a fake NPM module that can be used to test the node module engine host. */ function createFakeNpmModule() { fs.mkdirSync(path.join(tmpDir, 'node_modules')); @@ -47,19 +42,11 @@ describe('NodeModulesEngineHost', () => { it('should properly create collections with explicit collection path', () => { createFakeNpmModule(); - const engineHost = new NodeModulesEngineHost(); + const engineHost = new NodeModulesEngineHost([tmpDir]); const engine = new SchematicEngine(engineHost); - // Under Bazel 'require.resolve' is patched to use Bazel resolutions from the MANIFEST FILES. - // Adding a temporary file won't be enough to make Bazel aware of this file. - // We provide the full path here just to verify that the underlying logic works - let prefix = ''; - if (process.env['BAZEL_TARGET']) { - prefix = path.join(process.cwd(), 'node_modules'); - } - expect(() => { - engine.createCollection(path.join(prefix, '@angular/core', './schematics/migrations.json')); + engine.createCollection(path.join('@angular/core', './schematics/migrations.json')); }).not.toThrow(); }); }); diff --git a/packages/angular_devkit/schematics/tools/workflow/node-workflow_spec.ts b/packages/angular_devkit/schematics/tools/workflow/node-workflow_spec.ts index f01ff0653465..d2c2c72f4824 100644 --- a/packages/angular_devkit/schematics/tools/workflow/node-workflow_spec.ts +++ b/packages/angular_devkit/schematics/tools/workflow/node-workflow_spec.ts @@ -8,8 +8,8 @@ /* eslint-disable import/no-extraneous-dependencies */ import { NodeJsSyncHost } from '@angular-devkit/core/node'; -import { NodeWorkflow } from '@angular-devkit/schematics/tools'; import * as path from 'path'; +import { NodeWorkflow } from './node-workflow'; describe('NodeWorkflow', () => { // TODO: this test seems to either not work on windows or on linux. diff --git a/packages/angular_devkit/schematics_cli/BUILD.bazel b/packages/angular_devkit/schematics_cli/BUILD.bazel index 04d2962c8f0b..56a69a1124e7 100644 --- a/packages/angular_devkit/schematics_cli/BUILD.bazel +++ b/packages/angular_devkit/schematics_cli/BUILD.bazel @@ -1,4 +1,4 @@ -load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test") +load("@npm2//:defs.bzl", "npm_link_all_packages") load("//tools:defaults2.bzl", "npm_package", "ts_project") load("//tools:ts_json_schema.bzl", "ts_json_schema") @@ -10,6 +10,8 @@ licenses(["notice"]) package(default_visibility = ["//visibility:public"]) +npm_link_all_packages() + RUNTIME_ASSETS = [ "blank/schema.json", "collection.json", @@ -44,39 +46,14 @@ ts_project( data = RUNTIME_ASSETS, module_name = "@angular-devkit/schematics-cli", deps = [ + ":node_modules/@angular-devkit/core", + ":node_modules/@angular-devkit/schematics", "//:node_modules/@inquirer/prompts", "//:node_modules/@types/node", "//:node_modules/@types/yargs-parser", "//:node_modules/ansi-colors", "//:node_modules/symbol-observable", "//:node_modules/yargs-parser", - "//packages/angular_devkit/core:core_rjs", - "//packages/angular_devkit/core/node:node_rjs", - "//packages/angular_devkit/schematics:schematics_rjs", - "//packages/angular_devkit/schematics/tasks:tasks_rjs", - "//packages/angular_devkit/schematics/tools:tools_rjs", - ], -) - -ts_project( - name = "schematics_cli_test_lib", - testonly = True, - srcs = glob( - include = [ - "bin/**/*_spec.ts", - ], - ), - deps = [ - ":schematics_cli_rjs", - ], -) - -jasmine_node_test( - name = "schematics_cli_test", - srcs = [":schematics_cli_test_lib"], - data = [ - # The package is loaded at runtime within the tests - ":schematics_cli", ], ) diff --git a/packages/angular_devkit/schematics_cli/package.json b/packages/angular_devkit/schematics_cli/package.json index 8045860c0202..f87fa21f4d5f 100644 --- a/packages/angular_devkit/schematics_cli/package.json +++ b/packages/angular_devkit/schematics_cli/package.json @@ -16,8 +16,8 @@ ], "schematics": "./collection.json", "dependencies": { - "@angular-devkit/core": "0.0.0-PLACEHOLDER", - "@angular-devkit/schematics": "0.0.0-PLACEHOLDER", + "@angular-devkit/core": "workspace:0.0.0-PLACEHOLDER", + "@angular-devkit/schematics": "workspace:0.0.0-PLACEHOLDER", "@inquirer/prompts": "7.2.3", "ansi-colors": "4.1.3", "symbol-observable": "4.0.0", diff --git a/packages/angular_devkit/schematics_cli/test/BUILD.bazel b/packages/angular_devkit/schematics_cli/test/BUILD.bazel new file mode 100644 index 000000000000..55965b2ecf02 --- /dev/null +++ b/packages/angular_devkit/schematics_cli/test/BUILD.bazel @@ -0,0 +1,31 @@ +load("@aspect_rules_js//npm:defs.bzl", "npm_link_package") +load("//tools:defaults2.bzl", "jasmine_test", "ts_project") + +ts_project( + name = "schematics_cli_test_lib", + testonly = True, + srcs = glob(["**/*"]), + deps = [ + "//packages/angular_devkit/schematics_cli:schematics_cli_rjs", + ], +) + +# Note: Link the schematics CLI package into node modules for testing. Notably, tests +# of a package typically don't use the npm package, to e.g. allow for relative +# imports, but here this is an exception as the package needs to be resolvable at runtime. +npm_link_package( + name = "node_modules/@angular-devkit/schematics-cli", + src = "//packages/angular_devkit/schematics_cli:pkg", + package = "@angular-devkit/schematics-cli", + root_package = package_name(), +) + +jasmine_test( + name = "schematics_cli_test", + data = [ + ":schematics_cli_test_lib_rjs", + # The npm package itself is needed for the test at runtime, so we + # link it into this folder as `node_modules/@angular-devkit/schematics-cli`. + ":node_modules/@angular-devkit/schematics-cli", + ], +) diff --git a/packages/angular_devkit/schematics_cli/bin/schematics_spec.ts b/packages/angular_devkit/schematics_cli/test/schematics.spec.ts similarity index 98% rename from packages/angular_devkit/schematics_cli/bin/schematics_spec.ts rename to packages/angular_devkit/schematics_cli/test/schematics.spec.ts index 462b0afdf405..5dcf2fc962f0 100644 --- a/packages/angular_devkit/schematics_cli/bin/schematics_spec.ts +++ b/packages/angular_devkit/schematics_cli/test/schematics.spec.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.dev/license */ -import { main } from './schematics'; +import { main } from '../bin/schematics'; // We only care about the write method in these mocks of NodeJS.WriteStream. class MockWriteStream { diff --git a/packages/ngtools/webpack/BUILD.bazel b/packages/ngtools/webpack/BUILD.bazel index f5b14dddd433..36d3096f6f03 100644 --- a/packages/ngtools/webpack/BUILD.bazel +++ b/packages/ngtools/webpack/BUILD.bazel @@ -4,13 +4,15 @@ # found in the LICENSE file at https://angular.dev/license load("@npm//@angular/build-tooling/bazel/api-golden:index.bzl", "api_golden_test_npm_package") -load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test") -load("//tools:defaults2.bzl", "npm_package", "ts_project") +load("@npm2//:defs.bzl", "npm_link_all_packages") +load("//tools:defaults2.bzl", "jasmine_test", "npm_package", "ts_project") licenses(["notice"]) package(default_visibility = ["//visibility:public"]) +npm_link_all_packages() + ts_project( name = "webpack", srcs = glob( @@ -46,17 +48,21 @@ ts_project( ], ), deps = [ + ":node_modules/@angular-devkit/core", ":webpack_rjs", "//:node_modules/@angular/compiler", "//:node_modules/@types/jasmine", "//:node_modules/typescript", - "//packages/angular_devkit/core:core_rjs", ], ) -jasmine_node_test( +jasmine_test( name = "webpack_test", - srcs = [":webpack_test_lib"], + data = [ + ":webpack_test_lib_rjs", + # Needed at runtime for runtime TS compilations performed by tests. + "//:node_modules/tslib", + ], ) genrule( diff --git a/packages/schematics/angular/BUILD.bazel b/packages/schematics/angular/BUILD.bazel index b57ab3b33e10..8b3f6bf0b728 100644 --- a/packages/schematics/angular/BUILD.bazel +++ b/packages/schematics/angular/BUILD.bazel @@ -3,14 +3,16 @@ # Use of this source code is governed by an MIT-style license that can be # found in the LICENSE file at https://angular.dev/license -load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test") -load("//tools:defaults2.bzl", "npm_package", "ts_project") +load("@npm2//:defs.bzl", "npm_link_all_packages") +load("//tools:defaults2.bzl", "jasmine_test", "npm_package", "ts_project") load("//tools:ts_json_schema.bzl", "ts_json_schema") licenses(["notice"]) package(default_visibility = ["//visibility:public"]) +npm_link_all_packages() + # Create a list of Tuple("path/file.json", "path_file") to be used as rules ALL_SCHEMA_TARGETS = [ ( @@ -81,22 +83,21 @@ ts_project( data = RUNTIME_ASSETS, module_name = "@schematics/angular", deps = [ + ":node_modules/@angular-devkit/core", + ":node_modules/@angular-devkit/schematics", "//:node_modules/@inquirer/prompts", "//:node_modules/@types/node", "//:node_modules/browserslist", "//:node_modules/jsonc-parser", - "//packages/angular_devkit/core:core_rjs", - "//packages/angular_devkit/schematics:schematics_rjs", - "//packages/angular_devkit/schematics/tasks:tasks_rjs", "//packages/schematics/angular/third_party/github.com/Microsoft/TypeScript:TypeScript_rjs", ], ) -jasmine_node_test( +jasmine_test( name = "no_typescript_runtime_dep_test", - srcs = ["no_typescript_runtime_dep_spec.js"], - deps = [ - ":angular", + data = [ + "no_typescript_runtime_dep_spec.js", + ":angular_rjs", "//:node_modules/@types/jasmine", ], ) @@ -116,20 +117,17 @@ ts_project( ), deps = [ ":angular_rjs", + ":node_modules/@angular-devkit/core", + ":node_modules/@angular-devkit/schematics", "//:node_modules/@types/jasmine", "//:node_modules/jsonc-parser", - "//packages/angular_devkit/core:core_rjs", - "//packages/angular_devkit/core/node/testing:testing_rjs", - "//packages/angular_devkit/schematics:schematics_rjs", - "//packages/angular_devkit/schematics/tasks:tasks_rjs", - "//packages/angular_devkit/schematics/testing:testing_rjs", "//packages/schematics/angular/third_party/github.com/Microsoft/TypeScript:TypeScript_rjs", ], ) -jasmine_node_test( +jasmine_test( name = "angular_test", - srcs = [":angular_test_lib"], + data = [":angular_test_lib_rjs"], ) genrule( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bf859d564e30..bb57b6f622dd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -693,6 +693,27 @@ importers: specifier: 7.8.1 version: 7.8.1 + packages/angular_devkit/schematics_cli: + dependencies: + '@angular-devkit/core': + specifier: workspace:0.0.0-PLACEHOLDER + version: link:../core + '@angular-devkit/schematics': + specifier: workspace:0.0.0-PLACEHOLDER + version: link:../schematics + '@inquirer/prompts': + specifier: 7.2.3 + version: 7.2.3(@types/node@22.10.7) + ansi-colors: + specifier: 4.1.3 + version: 4.1.3 + symbol-observable: + specifier: 4.0.0 + version: 4.0.0 + yargs-parser: + specifier: 21.1.1 + version: 21.1.1 + packages/ngtools/webpack: devDependencies: '@angular-devkit/core': diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 1b11c447500e..5a367b30c940 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -5,6 +5,7 @@ packages: - packages/angular_devkit/core - packages/angular_devkit/build_webpack - packages/angular_devkit/schematics + - packages/angular_devkit/schematics_cli - packages/angular/cli - packages/angular/pwa - packages/schematics/angular diff --git a/tests/angular_devkit/architect/node/jobs/BUILD.bazel b/tests/angular_devkit/architect/node/jobs/BUILD.bazel deleted file mode 100644 index 92b3422ccc5d..000000000000 --- a/tests/angular_devkit/architect/node/jobs/BUILD.bazel +++ /dev/null @@ -1,22 +0,0 @@ -load("//tools:interop.bzl", "ts_project") - -# Copyright Google Inc. All Rights Reserved. -# -# Use of this source code is governed by an MIT-style license that can be -# found in the LICENSE file at https://angular.dev/license -package(default_visibility = ["//visibility:public"]) - -licenses(["notice"]) - -ts_project( - name = "jobs_test_lib", - srcs = glob( - include = [ - "**/*.ts", - ], - ), - deps = [ - "//:node_modules/@types/node", - "//packages/angular_devkit/architect:architect_rjs", - ], -) diff --git a/tools/interop.bzl b/tools/interop.bzl index 4b981129bcd8..056e7244e5e9 100644 --- a/tools/interop.bzl +++ b/tools/interop.bzl @@ -97,7 +97,14 @@ ts_project_module = rule( }, ) -def ts_project(name, module_name = None, deps = [], tsconfig = None, testonly = False, **kwargs): +def ts_project( + name, + module_name = None, + deps = [], + tsconfig = None, + testonly = False, + visibility = None, + **kwargs): interop_deps = [] # Pull in the `rules_nodejs` variants of dependencies we know are "hybrid". This @@ -118,6 +125,7 @@ def ts_project(name, module_name = None, deps = [], tsconfig = None, testonly = ts_deps_interop( name = "%s_interop_deps" % name, deps = [] + interop_deps + rjs_modules_to_rnjs, + visibility = visibility, testonly = testonly, ) @@ -126,6 +134,7 @@ def ts_project(name, module_name = None, deps = [], tsconfig = None, testonly = testonly = testonly, declaration = True, tsconfig = tsconfig, + visibility = visibility, # Use the worker from our own Angular rules, as the default worker # from `rules_ts` is incompatible with TS5+ and abandoned. We need # worker for efficient, fast DX and avoiding Windows no-sandbox issues. @@ -138,6 +147,7 @@ def ts_project(name, module_name = None, deps = [], tsconfig = None, testonly = ts_project_module( name = name, testonly = testonly, + visibility = visibility, dep = "%s_rjs" % name, # Forwarded dependencies for linker module mapping aspect. # RJS deps can also transitively pull in module mappings from their `interop_deps`. diff --git a/tsconfig.json b/tsconfig.json index 259b92b6e5dc..4df52a94fea7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -34,6 +34,8 @@ "**/node_modules/**/*", "**/third_party/**/*", "packages/angular_devkit/schematics_cli/schematic/files/**/*", - "packages/angular_devkit/*/test/**/*" + "modules/testing/builder/projects/**/*", + "packages/angular_devkit/build_angular/test/**/*", + "packages/angular_devkit/build_webpack/test/**/*" ] }