Skip to content
Closed
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
5 changes: 3 additions & 2 deletions .ng-dev/release.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ export const release: ReleaseConfig = {
npmPackages: [
{name: '@angular/animations'},
{name: '@angular/common'},
{name: '@angular/compiler'},
{name: '@angular/compiler-cli'},
{name: '@angular/compiler'},
{name: '@angular/core'},
{name: '@angular/elements'},
{name: '@angular/forms'},
{name: '@angular/language-server'},
{name: '@angular/language-service'},
{name: '@angular/localize'},
{name: '@angular/platform-browser'},
{name: '@angular/platform-browser-dynamic'},
{name: '@angular/platform-browser'},
{name: '@angular/platform-server'},
{name: '@angular/router'},
{name: '@angular/service-worker'},
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"runtimeExecutable": "${execPath}",
"args": [
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceFolder}/dist/bin/vscode-ng-language-service/npm/vscode-ng-language-service/vsix_sandbox"
"--extensionDevelopmentPath=${workspaceFolder}/dist/bin/vscode-ng-language-service/development_package"
],
"preLaunchTask": "VSCE: package"
},
Expand Down
1 change: 0 additions & 1 deletion integration/legacy-animations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"@angular-devkit/build-angular": "21.0.0-next.7",
"@angular/cli": "21.0.0-next.7",
"@angular/compiler-cli": "link:./in-existing-linked-by-bazel",
"@angular/language-service": "link:./in-existing-linked-by-bazel",
"@types/jasmine": "^5.0.0",
"@types/jasminewd2": "^2.0.8",
"@types/node": "^20.14.8",
Expand Down
3 changes: 0 additions & 3 deletions integration/legacy-animations/pnpm-lock.yaml

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

1 change: 0 additions & 1 deletion integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"@angular/core": "workspace:*",
"@angular/elements": "workspace:*",
"@angular/forms": "workspace:*",
"@angular/language-service": "workspace: *",
"@angular/localize": "workspace: *",
"@angular/platform-browser-dynamic": "workspace:*",
"@angular/platform-browser": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ UNPUBLISHED_PACKAGES = [
ALL_PACKAGES = PUBLISHED_PACKAGES + UNPUBLISHED_PACKAGES

# Packages used by integration tests
INTEGRATION_PACKAGES = _exclude_pkgs(PUBLISHED_PACKAGES, "zone.js", "angular-in-memory-web-api")
INTEGRATION_PACKAGES = _exclude_pkgs(PUBLISHED_PACKAGES, "@angular/language-service", "zone.js", "angular-in-memory-web-api")

# Package names under //packages that have `files_for_docgen` targets
DOCS_ENTRYPOINTS = [
Expand Down
5 changes: 1 addition & 4 deletions packages/language-service/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,5 @@ npm_package(
],
# Do not add more to this list.
# Dependencies on the full npm_package cause long re-builds.
visibility = [
"//integration:__subpackages__",
"//modules/ssr-benchmarks:__subpackages__",
],
visibility = [],
)
38 changes: 13 additions & 25 deletions pnpm-lock.yaml

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

15 changes: 12 additions & 3 deletions scripts/build/package-builder.mts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const releaseTargetTag = 'release-with-framework';
/** Command that queries Bazel for all release package targets. */
const queryPackagesCmd =
`${bazelCmd} query --output=label "filter(':npm_package$', ` +
`attr('tags', '\\[.*${releaseTargetTag}.*\\]', //packages/...))"`;
`attr('tags', '\\[.*${releaseTargetTag}.*\\]', //packages/... + //vscode-ng-language-service/...))"`;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the whole package should have gone into packages/misc 😄

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk, maybe @josephperrott / @atscott can pitch in on that?

I can certainly do a follow-up to move it

@devversion devversion Oct 9, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for sure something we can follow-up on (if we even want to do something)


/** Path for the default distribution output directory. */
const defaultDistPath = join(projectDir, 'dist/packages-dist');
Expand Down Expand Up @@ -59,8 +59,12 @@ function buildReleasePackages(
const targets = exec(queryPackagesCmd, true).split(/\r?\n/).concat(additionalTargets);
const packageNames = getPackageNamesOfTargets(targets);
const bazelBinPath = exec(`${bazelCmd} info bazel-bin`, true);
const getBazelOutputPath = (pkgName: string) =>
join(bazelBinPath, 'packages', pkgName, 'npm_package');
const getBazelOutputPath = (pkgName: string) => {
return pkgName === 'language-server'
? join(bazelBinPath, 'vscode-ng-language-service/server/npm_package')
: join(bazelBinPath, 'packages', pkgName, 'npm_package');
};

const getDistPath = (pkgName: string) => join(distPath, pkgName);

// Build with "--config=release" or `--config=snapshot-build` so that Bazel
Expand Down Expand Up @@ -109,13 +113,18 @@ function buildReleasePackages(
*/
function getPackageNamesOfTargets(targets: string[]): string[] {
return targets.map((targetName) => {
if (targetName === '//vscode-ng-language-service/server:npm_package') {
return 'language-server';
}

const matches = targetName.match(/\/\/packages\/(.*):npm_package/);
if (matches === null) {
throw Error(
`Found Bazel target with "${releaseTargetTag}" tag, but could not ` +
`determine release output name: ${targetName}`,
);
}

return matches[1];
});
}
Expand Down
3 changes: 3 additions & 0 deletions tools/defaults.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ def _determine_tsconfig(testonly):
if native.package_name().startswith("tools"):
return "//tools:tsconfig_test" if testonly else "//tools:tsconfig_build"

if native.package_name().startswith("vscode-ng-language-service"):
return "//vscode-ng-language-service:tsconfig_test" if testonly else "//vscode-ng-language-service:tsconfig_build"

fail("Failing... a tsconfig value must be provided.")

def ts_project(
Expand Down
32 changes: 20 additions & 12 deletions vscode-ng-language-service/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,28 @@ js_library(
)

ts_config(
name = "tsconfig",
name = "tsconfig_build",
src = "tsconfig.json",
visibility = ["//visibility:public"],
)

ts_config(
name = "tsconfig_test",
src = "tsconfig-test.json",
visibility = ["//visibility:public"],
deps = [
":tsconfig_build",
],
)

expand_template_rule(
name = "package_json_expanded",
out = "package_expanded.json",
stamp_substitutions = {
"0.0.0-PLACEHOLDER": "{{BUILD_SCM_VERSION}}",
"workspace:*": "{{STABLE_PROJECT_VERSION}}",
},
substitutions = {
"workspace:*": "0.0.0",
"../dist/bin/vscode-ng-language-service/client/src/extension.js": "./index",
},
template = "package.json",
Expand All @@ -34,12 +44,12 @@ expand_template_rule(
npm_package(
name = "vsix_sandbox",
srcs = [
"package_expanded.json",
"angular.png",
"CHANGELOG.md",
"README.md",
"angular.png",
"package_expanded.json",
"//vscode-ng-language-service/client:index.js",
"//vscode-ng-language-service/server:npm_files",
"//vscode-ng-language-service/server:npm_package",
"//vscode-ng-language-service/syntaxes:npm_files",
# Transitive closure of npm deps that are marked as "external" in esbuild needed for vsce;
# this set was determined manually by running `bazel build //:vsix` and burning down missing packages.
Expand All @@ -56,7 +66,7 @@ npm_package(
],
replace_prefixes = {
"package_expanded.json": "package.json",
"server/package_expanded.json": "server/package.json",
"server/npm_package/": "server/",
"client/": "",
"syntaxes/src/": "syntaxes/",
},
Expand All @@ -82,16 +92,14 @@ vsce_bin.vsce(
)

npm_package(
name = "npm",
name = "development_package",
srcs = [
":vsix",
":vsix_sandbox",
],
data = [
"//vscode-ng-language-service:node_modules/@angular/language-service",
],
root_paths = [
"vsix_sandbox",
"vscode-ng-language-service/vsix_sandbox",
"vscode-ng-language-service",
],
visibility = ["//vscode-ng-language-service/integration:__subpackages__"],
visibility = ["//vscode-ng-language-service/integration/e2e:__subpackages__"],
)
11 changes: 0 additions & 11 deletions vscode-ng-language-service/client/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
load("@aspect_rules_esbuild//esbuild:defs.bzl", "esbuild")
load("@aspect_rules_ts//ts:defs.bzl", "ts_config")

ts_config(
name = "tsconfig",
src = "tsconfig.json",
visibility = ["//vscode-ng-language-service/client:__subpackages__"],
deps = [
"//vscode-ng-language-service:tsconfig",
"//vscode-ng-language-service/common:tsconfig",
],
)

esbuild(
name = "index",
Expand Down
5 changes: 1 addition & 4 deletions vscode-ng-language-service/client/src/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
load("@aspect_rules_ts//ts:defs.bzl", "ts_project")
load("//tools:defaults.bzl", "ts_project")

ts_project(
name = "src",
srcs = glob(["*.ts"]),
declaration = True,
source_map = True,
tsconfig = "//vscode-ng-language-service/client:tsconfig",
visibility = [
"//vscode-ng-language-service/client:__subpackages__",
],
Expand Down
17 changes: 3 additions & 14 deletions vscode-ng-language-service/client/src/tests/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
load("@aspect_rules_jasmine//jasmine:defs.bzl", "jasmine_test")
load("@aspect_rules_ts//ts:defs.bzl", "ts_config", "ts_project")

ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//vscode-ng-language-service:tsconfig",
"//vscode-ng-language-service/client:tsconfig",
],
)
load("@devinfra//bazel/jasmine:jasmine.bzl", "jasmine_test")
load("//tools:defaults.bzl", "ts_project")

ts_project(
name = "tests",
testonly = True,
srcs = glob(["*.ts"]),
declaration = True,
source_map = True,
tsconfig = ":tsconfig",
deps = [
"//vscode-ng-language-service:node_modules/@types/jasmine",
"//vscode-ng-language-service:node_modules/@types/vscode",
Expand Down
Loading