Skip to content

Commit 32ffd39

Browse files
kyliauKeen Yee Liau
authored andcommitted
build: output all build artifacts to dist directory
This commit refactors the build system to output all build artifacts to the `dist` directory. With this change, we make this repository a monorepo so that code in `common` directory can be used seamlessly in `client` and `server`.
1 parent ffa4481 commit 32ffd39

29 files changed

+106
-184
lines changed

.gitignore

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,10 @@
22
.vscode-test
33
.DS_Store
44
node_modules
5-
client/node_modules/
6-
client/out/
7-
common/out
85
server/node_modules/
9-
server/out
10-
integration/out
116
dist/
127
**/.idea/
138
**/tsconfig.tsbuildinfo
149
.vscode/settings.json
1510
.vimrc
1611
.nvimrc
17-
syntaxes/out
18-
syntaxes/test/*.js
19-
syntaxes/test/*.map

.vscode/launch.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"name": "Launch Client",
99
"runtimeExecutable": "${execPath}",
1010
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
11-
"outFiles": ["${workspaceRoot}/client/out/**/*.js"],
11+
"outFiles": ["${workspaceRoot}/dist/client/*.js"],
1212
"preLaunchTask": {
1313
"type": "npm",
1414
"script": "watch"
@@ -20,7 +20,7 @@
2020
"name": "Attach to Server",
2121
"port": 6009,
2222
"restart": true,
23-
"outFiles": ["${workspaceRoot}/server/out/**/*.js"]
23+
"outFiles": ["${workspaceRoot}/dist/server/*.js"]
2424
},
2525
{
2626
"name": "Language Server E2E Test",
@@ -29,10 +29,10 @@
2929
"runtimeExecutable": "${execPath}",
3030
"args": [
3131
"--extensionDevelopmentPath=${workspaceRoot}",
32-
"--extensionTestsPath=${workspaceRoot}/integration/out/e2e",
32+
"--extensionTestsPath=${workspaceRoot}/dist/integration/e2e",
3333
"${workspaceRoot}/integration/project"
3434
],
35-
"outFiles": ["${workspaceRoot}/integration/out/e2e/*.js"],
35+
"outFiles": ["${workspaceRoot}/dist/integration/e2e/*.js"],
3636
"preLaunchTask": {
3737
"type": "npm",
3838
"script": "compile:integration"

DEVELOPER.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Monorepo setup
2+
3+
This repository is a monorepo. All build outputs are created in the `dist` directory.
4+
5+
The `dependencies` in root [`package.json`](package.json) must include all production dependencies
6+
of the client **and** and the server.
7+
8+
The dependencies of the `server` need to be duplicated in the root [`package.json`](package.json).
9+
Therefore, if a new prod dependency is added to the server, it needs to be
10+
added to both [`package.json`](package.json) and [`server/package.json`](server/package.json).
11+
12+
Note that we do not install the dependencies in [`server`](server),
13+
hence there should not be a `yarn.lock` file.
14+
115
## Navigating Projects in IDE
216

317
This repository contains multiple TypeScript projects, each with its own `tsconfig.json`.

banner.rollup.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module.exports = [
22
{
3-
input: 'server/out/banner/banner.js',
3+
input: 'dist/banner/banner.js',
44
output: {
5-
file: 'server/out/banner/banner.rollup.js',
5+
file: 'dist/banner/banner.rollup.js',
66
format: 'cjs',
77
},
88
external: [

client/language-configuration.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

client/package.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

client/src/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import * as vscode from 'vscode';
1010
import * as lsp from 'vscode-languageclient';
11-
import {ServerOptions} from '../../common/out/initialize';
11+
import {ServerOptions} from '../common/initialize';
1212

1313
/**
1414
* Represent a vscode command with an ID and an impl function `execute`.

client/src/extension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import * as path from 'path';
1111
import * as vscode from 'vscode';
1212
import * as lsp from 'vscode-languageclient';
1313

14-
import * as notification from '../../common/out/notifications';
14+
import * as notification from '../common/notifications';
1515

1616
import {resolveAndRunNgcc} from './command-ngcc';
1717
import {registerCommands} from './commands';
@@ -173,7 +173,7 @@ function getServerOptions(ctx: vscode.ExtensionContext, debug: boolean): lsp.Nod
173173

174174
// Node module for the language server
175175
const prodBundle = ctx.asAbsolutePath('server');
176-
const devBundle = ctx.asAbsolutePath(path.join('server', 'out', 'server.js'));
176+
const devBundle = ctx.asAbsolutePath(path.join('dist', 'server', 'server.js'));
177177

178178
// Argv options for Node.js
179179
const prodExecArgv: string[] = [];

client/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
4-
"outDir": "out"
4+
"outDir": "../dist/client",
5+
"rootDirs": [".", "../dist"]
56
},
67
"references": [
78
{"path": "../common"}

client/yarn.lock

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,3 @@
22
# yarn lockfile v1
33

44

5-
semver@^6.3.0:
6-
version "6.3.0"
7-
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
8-
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
9-
10-
vscode-jsonrpc@^5.0.1:
11-
version "5.0.1"
12-
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-5.0.1.tgz#9bab9c330d89f43fc8c1e8702b5c36e058a01794"
13-
integrity sha512-JvONPptw3GAQGXlVV2utDcHx0BiY34FupW/kI6mZ5x06ER5DdPG/tXWMVHjTNULF5uKPOUUD0SaXg5QaubJL0A==
14-
15-
16-
version "6.1.3"
17-
resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-6.1.3.tgz#c979c5bb5855714a0307e998c18ca827c1b3953a"
18-
integrity sha512-YciJxk08iU5LmWu7j5dUt9/1OLjokKET6rME3cI4BRpiF6HZlusm2ZwPt0MYJ0lV5y43sZsQHhyon2xBg4ZJVA==
19-
dependencies:
20-
semver "^6.3.0"
21-
vscode-languageserver-protocol "^3.15.3"
22-
23-
vscode-languageserver-protocol@^3.15.3:
24-
version "3.15.3"
25-
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.3.tgz#3fa9a0702d742cf7883cb6182a6212fcd0a1d8bb"
26-
integrity sha512-zrMuwHOAQRhjDSnflWdJG+O2ztMWss8GqUUB8dXLR/FPenwkiBNkMIJJYfSN6sgskvsF0rHAoBowNQfbyZnnvw==
27-
dependencies:
28-
vscode-jsonrpc "^5.0.1"
29-
vscode-languageserver-types "3.15.1"
30-
31-
32-
version "3.15.1"
33-
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.15.1.tgz#17be71d78d2f6236d414f0001ce1ef4d23e6b6de"
34-
integrity sha512-+a9MPUQrNGRrGU630OGbYVQ+11iOIovjCkqxajPa9w57Sd5ruK8WQNsslzpa0x/QJqC8kRc2DUxWjIFwoNm4ZQ==

0 commit comments

Comments
 (0)