This repository is a monorepo. All build outputs are created in the bazel-bin
directory.
The dependencies
in root package.json
must include all production dependencies
of the client and and the server.
The dependencies of the server
need to be duplicated in the root package.json
.
Therefore, if a new prod dependency is added to the server, it needs to be
added to both package.json
and server/package.json
.
Note that we do not install the dependencies in server
,
hence there should not be a yarn.lock
file.
This repository contains multiple TypeScript projects, each with its own tsconfig.json
.
TypeScript's project references are used to handle the builds.
As a result, some projects depend on the .d.ts
output of their dependencies, like client
and server
depend on common
. In order to navigate the projects in your IDE,
you need to first build them by running
yarn compile
If you'd like to force a clean build, you can delete the existing build artifacts by running
./scripts/build.sh
This repository uses the NPM distribution of
clang-format
to format source code.
Code is automatically formatted by running yarn format
. You can also set up your IDE to format
files on each save.
- Install the
Clang-Format
extension for VS Code. - Copy
.vscode/recommended-settings.json
to a new.vscode/settings.json
file. VS Code will automatically pick up relevant formatting options for the workspace from this file.
- Install the
ClangFormatIJ
plugin for IntelliJ IDEs. - Open
Preferences->Tools->clang-format
. - Set the field named "PATH" to
<PATH_TO_REPOSITORY>/node_modules/.bin/
.
- Install Vim Clang-Format.
- Create a project-specific
.vimrc
in the repository root directory containing
let g:clang_format#command = '<PATH_TO_REPOSITORY>/node_modules/.bin/clang-format'
Any changes made to the code in this repository or the upstream
@angular/language-service
package can be immediately tested out in a
development version of VSCode. The instructions below explain how to bring up
a local instance and then install a local version of @angular/language-service
.
First, make sure that the TypeScript version in @angular/angular
is the same
as that used in this repository. If not, update the following files:
typescript
dependency inpackage.json
MIN_TS_VERSION
inversion_provider.ts
The scripts in .vscode
directory are setup to automatically compile the code,
then launch a new instance of VSCode with the Angular extension installed.
To do so, either
- Press F5, or
- Go to Run on the sidebar, select
Launch Client
from the task list
After the client is launched, you can optionally choose to attach a debugger to the local instance. To do so,
- Go to Run on the sidebar, select
Attach to Server
from the task list
As a shortcut, there's also a task setup to automatically launch the client and attach the debugger in a single step. To do so,
- Go to Run on the sidebar, select
Client + Server
from the task list
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.
If changes are made to the upstream language service package, they can also be
tested locally. This involves building the NPM package, then updating the server
dependency. To do so, run the following script from the @angular/angular
repository.
./packages/language-service/build.sh /path/to/vscode-ng-language-service