Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jsconfig.json

# VSCode
# https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore
.vscode/
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
Expand Down
49 changes: 49 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// A launch configuration that compiles the extension and then opens it inside a new window
{
"version": "0.2.0",
"configurations": [
{
"name": "DEBUG: Attach to bazel test",
"type": "node",
"request": "attach",
"port": 9229,
"restart": true,
"timeout": 600000,
"sourceMaps": true,
"skipFiles": ["<node_internals>/**"],
"sourceMapPathOverrides": {
"?:*@0.0.0/node_modules/@angular-devkit/build-angular/*": "${workspaceFolder}/packages/angular_devkit/build_angular/*",
"?:*@0.0.0/node_modules/@angular-devkit/build-webpack/*": "${workspaceFolder}/packages/angular_devkit/build_webpack/*",
"?:*@0.0.0/node_modules/@angular-devkit/*": "${workspaceFolder}/packages/angular_devkit/*",
"?:*@0.0.0/node_modules/@angular/*": "${workspaceFolder}/packages/angular/*",
"?:*/bin/*": "${workspaceFolder}/*"
},
"resolveSourceMapLocations": ["*/**", "!**/rxjs**"]
},
{
"name": "DEBUG: Run bazel test (Custom Target)",
"type": "node",
"request": "launch",
"restart": true,
"timeout": 600000,
"runtimeExecutable": "pnpm",
"runtimeArgs": ["bazel", "test", "${input:bazelTarget}", "--config=debug"],
"console": "integratedTerminal",
"cwd": "${workspaceFolder}"
}
],
"compounds": [
{
"name": "DEBUG: Run bazel test (Custom Target) + Attach",
"configurations": ["DEBUG: Attach to bazel test", "DEBUG: Run bazel test (Custom Target)"]
}
],
"inputs": [
{
"id": "bazelTarget",
"type": "promptString",
"description": "Enter the Bazel test target (e.g., //path/to/my:unit_test)",
"default": "//packages/..."
}
]
}
26 changes: 26 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"[javascript]": {
"editor.formatOnSave": true
},
"[typescript]": {
"editor.formatOnSave": true
},
// Exclude third party modules and build artifacts from the editor watchers/searches.
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/**": true,
"**/bazel-out/**": true,
"**/dist/**": true,
"**/dist-schema/**": true
},
"search.exclude": {
"**/node_modules": true,
"**/bazel-out": true,
"**/dist": true,
"**/dist-schema": true,
".history": true
},
"git.ignoreLimitWarning": true,
"gitlens.advanced.blame.customArguments": ["--ignore-revs-file .git-blame-ignore-revs"]
}
1 change: 0 additions & 1 deletion packages/schematics/angular/workspace/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ describe('Workspace Schematic', () => {

it('should create all files of a workspace', async () => {
const options = { ...defaultOptions };

const tree = await schematicRunner.runSchematic('workspace', options);
const files = tree.files;
expect(files).toEqual(
Expand Down
14 changes: 5 additions & 9 deletions tools/defaults.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", _copy_to_bin = "copy_to_bin")
load("@aspect_rules_jasmine//jasmine:defs.bzl", _jasmine_test = "jasmine_test")
load("@aspect_rules_js//js:defs.bzl", _js_binary = "js_binary")
load("@devinfra//bazel/jasmine:jasmine.bzl", _jasmine_test = "jasmine_test")
load("@devinfra//bazel/ts_project:index.bzl", "strict_deps_test")
load("@rules_angular//src/ng_package:index.bzl", _ng_package = "ng_package")
load("@rules_angular//src/ts_project:index.bzl", _ts_project = "ts_project")
Expand All @@ -12,6 +12,7 @@ def ts_project(
deps = [],
tsconfig = None,
testonly = False,
source_map = True,
visibility = None,
**kwargs):
if tsconfig == None:
Expand All @@ -21,6 +22,7 @@ def ts_project(
name = name,
testonly = testonly,
declaration = True,
source_map = source_map,
tsconfig = tsconfig,
visibility = visibility,
deps = deps,
Expand Down Expand Up @@ -54,21 +56,15 @@ def ng_package(deps = [], **kwargs):
**kwargs
)

def jasmine_test(data = [], args = [], **kwargs):
# Create relative path to root, from current package dir. Necessary as
# we change the `chdir` below to the package directory.
relative_to_root = "/".join([".."] * len(native.package_name().split("/")))

def jasmine_test(args = [], tsconfig = "//:test-tsconfig", **kwargs):
_jasmine_test(
node_modules = "//:node_modules",
tsconfig = tsconfig,
chdir = native.package_name(),
args = [
"--require=%s/node_modules/source-map-support/register.js" % relative_to_root,
# Escape so that the `js_binary` launcher triggers Bash expansion.
"'**/*+(.|_)spec.js'",
"'**/*+(.|_)spec.mjs'",
"'**/*+(.|_)spec.cjs'",
] + args,
data = data + ["//:node_modules/source-map-support"],
**kwargs
)
3 changes: 0 additions & 3 deletions tsconfig-test-esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
{
"extends": "./tsconfig-build-esm.json",
"compilerOptions": {
"sourceMap": false,
"inlineSourceMap": true,
"inlineSources": true,
"types": ["node", "jasmine"]
}
}
6 changes: 0 additions & 6 deletions tsconfig-test.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"inlineSourceMap": true,
"sourceRoot": ".",
// Inline sources are necessary for our tests to show the proper sources, since we are using
// Istanbul (not Constantinople) as well, and applying both source maps to get the original
// source in devtools.
"inlineSources": true,
"types": ["node", "jasmine"]
}
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"noImplicitOverride": true,
"isolatedModules": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"target": "es2023",
"lib": ["es2023"],
Expand Down