mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
build: update tools directory to use rules_js for building (#61656)
Use ts_project for building the tools directory targets PR Close #61656
This commit is contained in:
parent
9832e72fc3
commit
22381bfd2d
14 changed files with 58 additions and 50 deletions
|
|
@ -34,6 +34,9 @@ def _determine_tsconfig(testonly):
|
|||
if native.package_name().startswith("packages"):
|
||||
return "//packages:tsconfig_test" if testonly else "//packages:tsconfig_build"
|
||||
|
||||
if native.package_name().startswith("tools"):
|
||||
return "//tools:tsconfig_test" if testonly else "//tools:tsconfig_build"
|
||||
|
||||
fail("Failing... a tsconfig value must be provided.")
|
||||
|
||||
def ts_project(
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
load("//tools:defaults.bzl", "ts_library")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "saucelabs-daemon",
|
||||
srcs = [
|
||||
"browser.ts",
|
||||
|
|
|
|||
|
|
@ -1,17 +1,20 @@
|
|||
load("//tools:defaults.bzl", "nodejs_binary", "ts_library")
|
||||
load("//tools:defaults.bzl", "nodejs_binary")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "background-service_lib",
|
||||
srcs = glob(["*.ts"]),
|
||||
deps = [
|
||||
interop_deps = [
|
||||
"//:browser-providers",
|
||||
"//tools/saucelabs-daemon",
|
||||
"@npm//@types/node",
|
||||
"@npm//@types/selenium-webdriver4",
|
||||
"@npm//chalk",
|
||||
"@npm//selenium-webdriver4",
|
||||
],
|
||||
deps = [
|
||||
"//:node_modules/@types/node",
|
||||
"//:node_modules/@types/selenium-webdriver4",
|
||||
"//:node_modules/chalk",
|
||||
"//:node_modules/selenium-webdriver4",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
@ -21,7 +24,7 @@ nodejs_binary(
|
|||
":background-service_lib",
|
||||
"//:sauce_connect",
|
||||
],
|
||||
entry_point = ":cli.ts",
|
||||
entry_point = ":cli.js",
|
||||
templated_args = [
|
||||
"$(rootpath //:sauce_connect)",
|
||||
],
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import {Builder, WebDriver} from 'selenium-webdriver4';
|
|||
|
||||
import {Browser, getUniqueId} from '../browser';
|
||||
|
||||
import {IpcServer} from './ipc';
|
||||
import {openSauceConnectTunnel} from './sauce-connect-tunnel';
|
||||
|
||||
const defaultCapabilities = {
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
load("//tools:defaults.bzl", "esbuild", "ts_library")
|
||||
load("//tools:defaults.bzl", "esbuild")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "launcher",
|
||||
srcs = [
|
||||
"index.ts",
|
||||
"launcher.ts",
|
||||
],
|
||||
deps = [
|
||||
interop_deps = [
|
||||
"//tools/saucelabs-daemon",
|
||||
"@npm//@types/node",
|
||||
],
|
||||
|
|
|
|||
|
|
@ -1,22 +1,23 @@
|
|||
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
|
||||
load("//tools:defaults.bzl", "jasmine_node_test")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "zone_base_setup_lib",
|
||||
testonly = 1,
|
||||
srcs = ["zone_base_setup.ts"],
|
||||
deps = [
|
||||
srcs = ["zone_base_setup.mts"],
|
||||
interop_deps = [
|
||||
"//packages/zone.js/lib",
|
||||
"@npm//reflect-metadata",
|
||||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "browser",
|
||||
testonly = 1,
|
||||
srcs = ["browser_tests.init.ts"],
|
||||
deps = [
|
||||
srcs = ["browser_tests.init.mts"],
|
||||
interop_deps = [
|
||||
":zone_base_setup_lib",
|
||||
"//packages/compiler",
|
||||
"//packages/core/testing",
|
||||
|
|
@ -26,11 +27,11 @@ ts_library(
|
|||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "browser_zoneless",
|
||||
testonly = 1,
|
||||
srcs = ["browser_zoneless_tests.init.ts"],
|
||||
deps = [
|
||||
srcs = ["browser_zoneless_tests.init.mts"],
|
||||
interop_deps = [
|
||||
"//packages/compiler",
|
||||
"//packages/core",
|
||||
"//packages/core/testing",
|
||||
|
|
@ -40,11 +41,11 @@ ts_library(
|
|||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "node_zoneless",
|
||||
testonly = 1,
|
||||
srcs = ["node_zoneless_tests.init.ts"],
|
||||
deps = [
|
||||
srcs = ["node_zoneless_tests.init.mts"],
|
||||
interop_deps = [
|
||||
"//packages/compiler",
|
||||
"//packages/core",
|
||||
"//packages/core/testing",
|
||||
|
|
@ -55,11 +56,11 @@ ts_library(
|
|||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "node",
|
||||
testonly = 1,
|
||||
srcs = ["node_tests.init.ts"],
|
||||
deps = [
|
||||
srcs = ["node_tests.init.mts"],
|
||||
interop_deps = [
|
||||
":zone_base_setup_lib",
|
||||
"//packages/compiler",
|
||||
"//packages/core/testing",
|
||||
|
|
@ -71,11 +72,11 @@ ts_library(
|
|||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "node_no_angular",
|
||||
testonly = 1,
|
||||
srcs = ["node_no_angular_tests.init.ts"],
|
||||
deps = [
|
||||
srcs = ["node_no_angular_tests.init.mts"],
|
||||
interop_deps = [
|
||||
"//packages:types",
|
||||
],
|
||||
)
|
||||
|
|
@ -87,7 +88,7 @@ ts_library(
|
|||
# of a potential regression.
|
||||
jasmine_node_test(
|
||||
name = "fail_test",
|
||||
srcs = ["fail.spec.js"],
|
||||
srcs = ["fail.spec.mjs"],
|
||||
# While we force the termination of the process with an exitCode of 55 in fail.spec.js. Jasmine force it to 4.
|
||||
# see: https://github.com/jasmine/jasmine-npm/blob/eea8b26efe29176ecbb26ce3f1c4990f8bede685/lib/jasmine.js#L213
|
||||
expected_exit_code = 4,
|
||||
|
|
@ -101,7 +102,7 @@ jasmine_node_test(
|
|||
# of a potential regression.
|
||||
jasmine_node_test(
|
||||
name = "fail_bootstrap_test",
|
||||
srcs = ["fail.spec.js"],
|
||||
srcs = ["fail.spec.mjs"],
|
||||
bootstrap = ["//tools/testing:node"],
|
||||
data = ["//packages:package_json"],
|
||||
# While we force the termination of the process with an exitCode of 55 in fail.spec.js. Jasmine force it to 4.
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import 'zone.js/lib/browser/rollup-main';
|
||||
import './zone_base_setup';
|
||||
import './zone_base_setup.mjs';
|
||||
import '@angular/compiler'; // For JIT mode. Must be in front of any other @angular/* imports.
|
||||
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
import 'reflect-metadata';
|
||||
|
||||
import 'zone.js/lib/node/rollup-main';
|
||||
import './zone_base_setup';
|
||||
import './zone_base_setup.mjs';
|
||||
|
||||
(global as any).isNode = true;
|
||||
(global as any).isBrowser = false;
|
||||
|
|
@ -17,11 +17,8 @@ import './zone_base_setup';
|
|||
import '@angular/compiler'; // For JIT mode. Must be in front of any other @angular/* imports.
|
||||
// Init TestBed
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
import {
|
||||
ServerTestingModule,
|
||||
platformServerTesting,
|
||||
} from '@angular/platform-server/testing/src/server';
|
||||
import {DominoAdapter} from '@angular/platform-server/src/domino_adapter';
|
||||
import {ServerTestingModule, platformServerTesting} from '@angular/platform-server/testing';
|
||||
import {ɵDominoAdapter as DominoAdapter} from '@angular/platform-server';
|
||||
import domino from '../../packages/platform-server/src/bundled-domino';
|
||||
|
||||
TestBed.initTestEnvironment(ServerTestingModule, platformServerTesting());
|
||||
|
|
@ -14,11 +14,8 @@ import '@angular/compiler'; // For JIT mode. Must be in front of any other @angu
|
|||
// Init TestBed
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
import {NgModule, provideZonelessChangeDetection} from '@angular/core';
|
||||
import {
|
||||
ServerTestingModule,
|
||||
platformServerTesting,
|
||||
} from '@angular/platform-server/testing/src/server';
|
||||
import {DominoAdapter} from '@angular/platform-server/src/domino_adapter';
|
||||
import {ServerTestingModule, platformServerTesting} from '@angular/platform-server/testing';
|
||||
import {ɵDominoAdapter as DominoAdapter} from '@angular/platform-server';
|
||||
import domino from '../../packages/platform-server/src/bundled-domino';
|
||||
|
||||
@NgModule({
|
||||
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
import 'reflect-metadata';
|
||||
|
||||
import {} from 'zone.js';
|
||||
|
||||
import {patchLongStackTrace} from 'zone.js/lib/zone-spec/long-stack-trace';
|
||||
import {patchTaskTracking} from 'zone.js/lib/zone-spec/task-tracking';
|
||||
import {patchProxyZoneSpec} from 'zone.js/lib/zone-spec/proxy';
|
||||
|
|
@ -5,8 +5,13 @@
|
|||
"declaration": true,
|
||||
"esModuleInterop": true,
|
||||
"sourceMap": true,
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "nodenext",
|
||||
"types": ["node"]
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"types": ["node"],
|
||||
"paths": {
|
||||
"zone.js": ["../packages/zone.js/lib/zone"],
|
||||
"zone.js/*": ["../packages/zone.js/*"],
|
||||
"@angular/*": ["../packages/*/index"],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue