Skip to content

Commit b88df81

Browse files
committed
Change build system to hereby
This eliminates a significant number of dependencies, eliminating all npm audit issues, speeding up `npm ci` by 20%, and overall making the build faster (faster startup, direct code is faster than streams, etc) and clearer to understand. I'm finding it much easier to make build changes for the module transform with this; I can more clearly indicate task dependencies and prevent running tasks that don't need to be run. Given we're changing our build process entirely (new deps, new steps), it seems like this is a good time to change things up.
1 parent ce2b59b commit b88df81

27 files changed

+2346
-10741
lines changed

Diff for: .devcontainer/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
ARG VARIANT="14-buster"
55
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
66

7-
RUN sudo -u node npm install -g gulp-cli
7+
RUN sudo -u node npm install -g hereby

Diff for: .github/pull_request_template.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Thank you for submitting a pull request!
44
Please verify that:
55
* [ ] There is an associated issue in the `Backlog` milestone (**required**)
66
* [ ] Code is up-to-date with the `main` branch
7-
* [ ] You've successfully run `gulp runtests` locally
7+
* [ ] You've successfully run `hereby runtests` locally
88
* [ ] There are new or updated unit tests validating the change
99
1010
Refer to CONTRIBUTING.MD for more details.

Diff for: .github/workflows/accept-baselines-fix-lints.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
git config user.name "TypeScript Bot"
1818
npm install
1919
git rm -r --quiet tests/baselines/reference :^tests/baselines/reference/docker :^tests/baselines/reference/user
20-
gulp runtests-parallel --ci --fix || true
21-
gulp baseline-accept
20+
npx hereby runtests-parallel --ci --fix || true
21+
npx hereby baseline-accept
2222
git add ./src
2323
git add ./tests/baselines/reference
2424
git diff --cached

Diff for: .github/workflows/ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ jobs:
6868
run: npm install --no-save --no-package-lock playwright
6969

7070
- name: Build local
71-
run: gulp local
71+
run: npx hereby local
7272

7373
- name: Validate the browser can import TypeScript
74-
run: gulp test-browser-integration
74+
run: npx hereby test-browser-integration
7575

7676
misc:
7777
runs-on: ubuntu-latest
@@ -85,7 +85,7 @@ jobs:
8585
- run: npm ci
8686

8787
- name: Build scripts
88-
run: gulp scripts
88+
run: npx hereby scripts
8989

9090
- name: ESLint tests
91-
run: gulp run-eslint-rules-tests
91+
run: npx hereby run-eslint-rules-tests

Diff for: .github/workflows/new-release-branch.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/tsserverlibrary.d.ts
2222
sed -i -e 's/const version\(: string\)\{0,1\} = `${versionMajorMinor}.0-.*`/const version = `${versionMajorMinor}.0-${{ github.event.client_payload.core_tag || 'dev' }}`/g' src/compiler/corePublic.ts
2323
npm ci
24-
gulp LKG
24+
npx hereby LKG
2525
npm test
2626
git diff
2727
git add package.json

Diff for: .github/workflows/nightly.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
run: |
2424
npm whoami
2525
npm ci
26-
gulp configure-nightly
27-
gulp LKG
28-
gulp runtests-parallel
29-
gulp clean
26+
npx hereby configure-nightly
27+
npx hereby LKG
28+
npx hereby runtests-parallel
29+
npx hereby clean
3030
npm publish --tag next
3131
env:
3232
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

Diff for: .github/workflows/release-branch-artifact.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ jobs:
1919
- name: Adding playwright
2020
run: npm install --no-save --no-package-lock playwright
2121
- name: Validate the browser can import TypeScript
22-
run: gulp test-browser-integration
22+
run: npx hereby test-browser-integration
2323
- name: LKG, clean, and pack
2424
run: |
25-
gulp LKG
26-
gulp clean
25+
npx hereby LKG
26+
npx hereby clean
2727
npm pack ./
2828
mv typescript-*.tgz typescript.tgz
2929
- name: Upload built tarfile

Diff for: .github/workflows/set-version.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/tsserverlibrary.d.ts
2828
sed -i -e 's/const version\(: string\)\{0,1\} = .*;/const version = "${{ github.event.client_payload.package_version }}" as string;/g' src/compiler/corePublic.ts
2929
npm ci
30-
gulp LKG
30+
npx hereby LKG
3131
npm test
3232
git diff
3333
git add package.json

Diff for: .github/workflows/update-lkg.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
git config user.email "typescriptbot@microsoft.com"
1717
git config user.name "TypeScript Bot"
1818
npm ci
19-
gulp LKG
19+
npx hereby LKG
2020
npm test
2121
git diff
2222
git add ./lib

Diff for: .vscode/launch.template.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"configurations": [
2121
{
2222
"type": "node",
23-
"protocol": "inspector",
2423
"request": "launch",
2524
"name": "Mocha Tests (currently opened test)",
2625
"runtimeArgs": ["--nolazy"],
@@ -48,15 +47,15 @@
4847
"outFiles": [
4948
"${workspaceRoot}/built/local/run.js"
5049
],
51-
"customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue",
50+
"customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue"
5251
},
5352
{
5453
// See: https://github.com/microsoft/TypeScript/wiki/Debugging-Language-Service-in-VS-Code
5554
"type": "node",
5655
"request": "attach",
5756
"name": "Attach to VS Code TS Server via Port",
5857
"processId": "${command:PickProcess}",
59-
"customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue",
58+
"customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue"
6059
}
6160
]
6261
}

Diff for: .vscode/tasks.json

+10-18
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"version": "2.0.0",
55
"tasks": [
66
{
7-
"type": "gulp",
8-
"label": "gulp: local",
9-
"task": "local",
7+
"label": "npm: build:compiler",
8+
"type": "npm",
9+
"script": "build:compiler",
1010
"group": {
1111
"kind": "build",
1212
"isDefault": true
@@ -16,30 +16,22 @@
1616
]
1717
},
1818
{
19-
"type": "gulp",
20-
"label": "gulp: tsc",
21-
"task": "tsc",
19+
"label": "npm: build:tests",
20+
"type": "npm",
21+
"script": "build:tests",
2222
"group": "build",
2323
"problemMatcher": [
2424
"$tsc"
2525
]
2626
},
2727
{
28-
"type": "gulp",
29-
"label": "gulp: tests",
30-
"task": "tests",
28+
"label": "gulp: tests", // Kept for backwards compat for old launch.json files.
29+
"type": "npm",
30+
"script": "build:tests",
3131
"group": "build",
3232
"problemMatcher": [
3333
"$tsc"
3434
]
3535
},
36-
{
37-
"type": "gulp",
38-
"task": "services",
39-
"label": "gulp: services",
40-
"problemMatcher": [
41-
"$tsc"
42-
],
43-
}
4436
]
45-
}
37+
}

Diff for: CONTRIBUTING.md

+33-33
Original file line numberDiff line numberDiff line change
@@ -54,42 +54,42 @@ In general, things we find useful when reviewing suggestions are:
5454
2. A copy of the TypeScript code. See the next steps for instructions.
5555
3. [Node](https://nodejs.org), which runs JavaScript locally. Current or LTS will both work.
5656
4. An editor. [VS Code](https://code.visualstudio.com) is the best place to start for TypeScript.
57-
5. The gulp command line tool, for building and testing changes. See the next steps for how to install it.
57+
5. The hereby command line tool, for building and testing changes. See the next steps for how to install it.
5858

5959
## Get Started
6060

6161
1. Install node using the version you downloaded from [nodejs.org](https://nodejs.org).
6262
2. Open a terminal.
6363
3. Make a fork—your own copy—of TypeScript on your GitHub account, then make a clone—a local copy—on your computer. ([Here are some step-by-step instructions](https://github.com/anitab-org/mentorship-android/wiki/Fork%2C-Clone-%26-Remote)). Add `--depth=1` to the end of the `git clone` command to save time.
64-
4. Install the gulp command line tool: `npm install -g gulp-cli`
64+
4. Install the hereby command line tool: `npm install -g hereby`
6565
5. Change to the TypeScript folder you made: `cd TypeScript`
6666
6. Install dependencies: `npm ci`
67-
7. Make sure everything builds and tests pass: `gulp runtests-parallel`
67+
7. Make sure everything builds and tests pass: `hereby runtests-parallel`
6868
8. Open the TypeScript folder in your editor.
6969
9. Follow the directions below to add and debug a test.
7070

7171
## Helpful tasks
7272

73-
Running `gulp --tasks --depth 1` provides the full listing, but here are a few common tasks you might use.
73+
Running `hereby --tasks` provides the full listing, but here are a few common tasks you might use.
7474

7575
```
76-
gulp local # Build the compiler into built/local.
77-
gulp clean # Delete the built compiler.
78-
gulp LKG # Replace the last known good with the built one.
79-
# Bootstrapping step to be executed when the built compiler reaches a stable state.
80-
gulp tests # Build the test infrastructure using the built compiler.
81-
gulp runtests # Run tests using the built compiler and test infrastructure.
82-
# You can override the specific suite runner used or specify a test for this command.
83-
# Use --tests=<testPath> for a specific test and/or --runner=<runnerName> for a specific suite.
84-
# Valid runners include conformance, compiler, fourslash, project, user, and docker
85-
# The user and docker runners are extended test suite runners - the user runner
86-
# works on disk in the tests/cases/user directory, while the docker runner works in containers.
87-
# You'll need to have the docker executable in your system path for the docker runner to work.
88-
gulp runtests-parallel # Like runtests, but split across multiple threads. Uses a number of threads equal to the system
89-
# core count by default. Use --workers=<number> to adjust this.
90-
gulp baseline-accept # This replaces the baseline test results with the results obtained from gulp runtests.
91-
gulp lint # Runs eslint on the TypeScript source.
92-
gulp help # List the above commands.
76+
hereby local # Build the compiler into built/local.
77+
hereby clean # Delete the built compiler.
78+
hereby LKG # Replace the last known good with the built one.
79+
# Bootstrapping step to be executed when the built compiler reaches a stable state.
80+
hereby tests # Build the test infrastructure using the built compiler.
81+
hereby runtests # Run tests using the built compiler and test infrastructure.
82+
# You can override the specific suite runner used or specify a test for this command.
83+
# Use --tests=<testPath> for a specific test and/or --runner=<runnerName> for a specific suite.
84+
# Valid runners include conformance, compiler, fourslash, project, user, and docker
85+
# The user and docker runners are extended test suite runners - the user runner
86+
# works on disk in the tests/cases/user directory, while the docker runner works in containers.
87+
# You'll need to have the docker executable in your system path for the docker runner to work.
88+
hereby runtests-parallel # Like runtests, but split across multiple threads. Uses a number of threads equal to the system
89+
# core count by default. Use --workers=<number> to adjust this.
90+
hereby baseline-accept # This replaces the baseline test results with the results obtained from hereby runtests.
91+
hereby lint # Runs eslint on the TypeScript source.
92+
hereby help # List the above commands.
9393
```
9494

9595
## Tips
@@ -111,7 +111,7 @@ You might need to run `git config --global core.longpaths true` before cloning T
111111

112112
### Using local builds
113113

114-
Run `gulp` to build a version of the compiler/language service that reflects changes you've made. You can then run `node <repo-root>/built/local/tsc.js` in place of `tsc` in your project. For example, to run `tsc --watch` from within the root of the repository on a file called `test.ts`, you can run `node ./built/local/tsc.js --watch test.ts`.
114+
Run `hereby` to build a version of the compiler/language service that reflects changes you've made. You can then run `node <repo-root>/built/local/tsc.js` in place of `tsc` in your project. For example, to run `tsc --watch` from within the root of the repository on a file called `test.ts`, you can run `node ./built/local/tsc.js --watch test.ts`.
115115

116116
## Contributing bug fixes
117117

@@ -163,7 +163,7 @@ Any changes should be made to [src/lib](https://github.com/Microsoft/TypeScript/
163163
Library files in `built/local/` are updated automatically by running the standard build task:
164164

165165
```sh
166-
gulp
166+
hereby
167167
```
168168

169169
The files in `lib/` are used to bootstrap compilation and usually **should not** be updated unless publishing a new version or updating the LKG.
@@ -178,36 +178,36 @@ If you need a head start understanding how the compiler works, or how the code i
178178

179179
## Running the Tests
180180

181-
To run all tests, invoke the `runtests-parallel` target using gulp:
181+
To run all tests, invoke the `runtests-parallel` target using hereby:
182182

183183
```Shell
184-
gulp runtests-parallel
184+
hereby runtests-parallel
185185
```
186186

187187
This will run all tests; to run only a specific subset of tests, use:
188188

189189
```Shell
190-
gulp runtests --tests=<regex>
190+
hereby runtests --tests=<regex>
191191
```
192192

193193
e.g. to run all compiler baseline tests:
194194

195195
```Shell
196-
gulp runtests --tests=compiler
196+
hereby runtests --tests=compiler
197197
```
198198

199199
or to run a specific test: `tests\cases\compiler\2dArrays.ts`
200200

201201
```Shell
202-
gulp runtests --tests=2dArrays
202+
hereby runtests --tests=2dArrays
203203
```
204204

205205
## Debugging the tests
206206

207-
You can debug with VS Code or Node instead with `gulp runtests -i`:
207+
You can debug with VS Code or Node instead with `hereby runtests -i`:
208208

209209
```Shell
210-
gulp runtests --tests=2dArrays -i
210+
hereby runtests --tests=2dArrays -i
211211
```
212212

213213
You can also use the [provided VS Code launch configuration](./.vscode/launch.template.json) to launch a debug session for an open test file. Rename the file 'launch.json', open the test file of interest, and launch the debugger from the debug panel (or press F5).
@@ -257,12 +257,12 @@ When a change in the baselines is detected, the test will fail. To inspect chang
257257
git diff --diff-filter=AM --no-index ./tests/baselines/reference ./tests/baselines/local
258258
```
259259

260-
Alternatively, you can set the `DIFF` environment variable and run `gulp diff`, or manually run your favorite folder diffing tool between `tests/baselines/reference` and `tests/baselines/local`. Our team largely uses Beyond Compare and WinMerge.
260+
Alternatively, you can set the `DIFF` environment variable and run `hereby diff`, or manually run your favorite folder diffing tool between `tests/baselines/reference` and `tests/baselines/local`. Our team largely uses Beyond Compare and WinMerge.
261261

262262
After verifying that the changes in the baselines are correct, run
263263

264264
```Shell
265-
gulp baseline-accept
265+
hereby baseline-accept
266266
```
267267

268268
This will change the files in `tests\baselines\reference`, which should be included as part of your commit.
@@ -271,6 +271,6 @@ Be sure to validate the changes carefully -- apparently unrelated changes to bas
271271
## Localization
272272

273273
All strings the user may see are stored in [`diagnosticMessages.json`](./src/compiler/diagnosticMessages.json).
274-
If you make changes to it, run `gulp generate-diagnostics` to push them to the `Diagnostic` interface in `diagnosticInformationMap.generated.ts`.
274+
If you make changes to it, run `hereby generate-diagnostics` to push them to the `Diagnostic` interface in `diagnosticInformationMap.generated.ts`.
275275

276276
See [coding guidelines on diagnostic messages](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines#diagnostic-messages).

Diff for: Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ FROM node:current
33
COPY . /typescript
44
WORKDIR /typescript
55
RUN npm ci
6-
RUN npm i -g gulp-cli
7-
RUN gulp configure-insiders && gulp LKG && gulp clean && npm pack .
6+
RUN npx hereby configure-insiders && npx hereby LKG && npx hereby clean && npm pack .

0 commit comments

Comments
 (0)