Skip to content

Commit b18c39c

Browse files
authored
fix(build): Adjust pointers to bazel-built directory (#1793)
* fix(build): Adjust pointers to bazel-built directory Prior commits have migrated this project to have its outputs built by bazel. As a result the pointers to the dist folder need to be updated to bazel-bin. * fixup! fix(build): Adjust pointers to bazel-built directory
1 parent a5076f8 commit b18c39c

File tree

6 files changed

+24
-16
lines changed

6 files changed

+24
-16
lines changed

.vscode/launch.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"--extensionDevelopmentPath=${workspaceFolder}"
1313
],
1414
"outFiles": [
15-
"${workspaceFolder}/dist/client/src/*.js"
15+
"${workspaceFolder}/bazel-bin/client/src/*.js"
1616
],
1717
"preLaunchTask": {
1818
"type": "npm",
@@ -25,7 +25,7 @@
2525
"name": "Launch Prod Client",
2626
"runtimeExecutable": "${execPath}",
2727
"args": [
28-
"--extensionDevelopmentPath=${workspaceFolder}/dist/npm"
28+
"--extensionDevelopmentPath=${workspaceFolder}/bazel-bin/npm"
2929
],
3030
"sourceMaps": false,
3131
"preLaunchTask": "build vsix"
@@ -37,7 +37,7 @@
3737
"port": 6009,
3838
"restart": true,
3939
"outFiles": [
40-
"${workspaceFolder}/dist/server/src/*.js"
40+
"${workspaceFolder}/bazel-bin/server/src/*.js"
4141
]
4242
},
4343
{
@@ -47,7 +47,7 @@
4747
"port": 9229,
4848
"restart": true,
4949
"outFiles": [
50-
"${workspaceFolder}/dist/**/*.js"
50+
"${workspaceFolder}/bazel-bin/**/*.js"
5151
],
5252
},
5353
{
@@ -58,7 +58,7 @@
5858
"<node_internals>/**"
5959
],
6060
"outFiles": [
61-
"${workspaceFolder}/dist/integration/lsp/*.js"
61+
"${workspaceFolder}/bazel-bin/integration/lsp/*.js"
6262
],
6363
"type": "node"
6464
},
@@ -69,12 +69,12 @@
6969
"runtimeExecutable": "${execPath}",
7070
"args": [
7171
"--disable-extensions",
72-
"--extensionDevelopmentPath=${workspaceFolder}/dist/npm",
73-
"--extensionTestsPath=${workspaceFolder}/dist/integration/e2e/jasmine",
72+
"--extensionDevelopmentPath=${workspaceFolder}/bazel-bin/npm",
73+
"--extensionTestsPath=${workspaceFolder}/bazel-bin/integration/e2e/jasmine",
7474
"${workspaceFolder}/integration/project"
7575
],
7676
"outFiles": [
77-
"${workspaceFolder}/dist/integration/e2e/*.js"
77+
"${workspaceFolder}/bazel-bin/integration/e2e/*.js"
7878
],
7979
"preLaunchTask": {
8080
"type": "npm",

.vscode/tasks.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,14 @@
2525
"panel": "dedicated",
2626
"reveal": "never"
2727
},
28-
"problemMatcher": [
29-
"$tsc-watch"
30-
]
28+
"problemMatcher": {
29+
"base": "$tsc-watch",
30+
"background": {
31+
"activeOnStart": true,
32+
"beginsPattern": "^iBazel \\[\\d{1,2}:\\d{1,2}(?:AM|PM)\\]: Querying for files to watch.*",
33+
"endsPattern": "^INFO: Build completed successfully, \\d total action(s)?"
34+
}
35+
}
3136
},
3237
{
3338
"type": "shell",

BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ expand_template(
2626
"0.0.0-PLACEHOLDER": "{{BUILD_SCM_VERSION}}",
2727
},
2828
substitutions = {
29-
"./dist/client/src/extension": "./index",
29+
"./bazel-bin/client/src/extension": "./index",
3030
},
3131
template = "package.json",
3232
)

DEVELOPER.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Monorepo setup
22

3-
This repository is a monorepo. All build outputs are created in the `dist` directory.
3+
This repository is a monorepo. All build outputs are created in the `bazel-bin` directory.
44

55
The `dependencies` in root [`package.json`](package.json) must include all production dependencies
66
of the client **and** and the server.
@@ -97,6 +97,8 @@ attach the debugger in a single step. To do so,
9797

9898
1. Go to Run on the sidebar, select `Client + Server` from the task list
9999

100+
Note: Because we are building with bazel, any breakpoints need to be set on the files in `bazel-bin/...` or by adding a `debugger;` statement before compilation.
101+
100102
### Install Local `@angular/language-service`
101103

102104
If changes are made to the upstream language service package, they can also be

client/src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ function getServerOptions(ctx: vscode.ExtensionContext, debug: boolean): lsp.Nod
490490
// Node module for the language server
491491
const args = constructArgs(ctx, viewEngine, vscode.workspace.isTrusted);
492492
const prodBundle = ctx.asAbsolutePath('server');
493-
const devBundle = ctx.asAbsolutePath(path.join('dist', 'server', 'src', 'server.js'));
493+
const devBundle = ctx.asAbsolutePath(path.join('bazel-bin', 'server', 'src', 'server.js'));
494494
// VS Code Insider launches extensions in debug mode by default but users
495495
// install prod bundle so we have to check whether dev bundle exists.
496496
const latestServerModule = debug && fs.existsSync(devBundle) ? devBundle : prodBundle;

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,16 +198,17 @@
198198
"onLanguage:html",
199199
"onLanguage:typescript"
200200
],
201-
"main": "./dist/client/src/extension",
201+
"main": "./bazel-bin/client/src/extension",
202202
"scripts": {
203203
"ng-dev": "cross-env TS_NODE_PROJECT=$PWD/.ng-dev/tsconfig.json TS_NODE_TRANSPILE_ONLY=1 node --no-warnings --loader ts-node/esm node_modules/@angular/dev-infra-private/ng-dev/bundles/cli.mjs",
204204
"compile": "tsc -b && yarn bazel build :npm",
205+
"compile:client-server": "yarn bazel build //client:index.js //server:index.js",
205206
"compile:test": "tsc -b test.tsconfig.json",
206207
"compile:integration": "tsc -b integration && yarn --cwd integration/project build",
207208
"compile:syntaxes-test": "tsc -b syntaxes/test",
208209
"build:syntaxes": "tsc -b syntaxes && node dist/syntaxes/build.js",
209210
"format": "scripts/format.sh",
210-
"watch": "tsc -b -w",
211+
"watch": "yarn ibazel build //client:index.js //server:index.js",
211212
"package": "scripts/build.sh package.json",
212213
"test": "yarn bazel test --test_tag_filters=unit_test //...",
213214
"test:watch": "yarn ibazel test --test_tag_filters=unit_test //...",

0 commit comments

Comments
 (0)