Skip to content

Commit 1d96eb4

Browse files
authored
Merge pull request #51387 from jakebailey/typeformer-2
Closes #35210 Closes #39247 Closes #49037 Closes #49332 Closes #50758
2 parents d83a5e1 + da6f067 commit 1d96eb4

File tree

656 files changed

+282700
-284842
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

656 files changed

+282700
-284842
lines changed

.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

.eslintignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
**/node_modules/**
2-
/built/local/**
2+
/built/**
33
/tests/**
44
/lib/**
55
/src/lib/*.generated.d.ts

.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"local/simple-indent": "error",
8888
"local/debug-assert": "error",
8989
"local/no-keywords": "error",
90-
"local/one-namespace-per-file": "error",
90+
"local/jsdoc-format": "error",
9191

9292
// eslint-plugin-import
9393
"import/no-extraneous-dependencies": ["error", { "optionalDependencies": false }],

.git-blame-ignore-revs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Generated module conversion step - inlineImports
2+
07758c08ab72481885e662c98d67a0e3a071b032
3+
# Generated module conversion step - stripNamespaces
4+
b6c053882696af8ddd94a600429f30584d303d7f
5+
# Generated module conversion step - explicitify
6+
9a0b85ce2a3f85f498ab2c05474b4c0b96b111c9
7+
# Generated module conversion step - unindent
8+
94724a8c2e68a4c7e267072ca79971f317c45e4a

.github/codeql/codeql-configuration.yml

+26
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,29 @@ paths:
66
- Gulpfile.mjs
77
paths-ignore:
88
- src/lib
9+
10+
# These queries appear to time out after the module conversion.
11+
# https://github.com/github/codeql/issues/10937
12+
query-filters:
13+
- exclude:
14+
id: js/path-injection # TaintedPath.ql
15+
- exclude:
16+
id: js/command-line-injection # CommandInjection.ql
17+
- exclude:
18+
id: js/code-injection # CodeInjection.ql
19+
- exclude:
20+
id: js/bad-code-sanitization # ImproperCodeSanitization.ql
21+
- exclude:
22+
id: js/unsafe-dynamic-method-access # UnsafeDynamicMethodAccess.ql
23+
- exclude:
24+
id: js/clear-text-logging # CleartextLogging.ql
25+
- exclude:
26+
id: js/regex-injection # RegExpInjection.ql
27+
- exclude:
28+
id: js/unvalidated-dynamic-method-call # UnvalidatedDynamicMethodCall.ql
29+
- exclude:
30+
id: js/insecure-download # InsecureDownload.ql
31+
- exclude:
32+
id: js/prototype-polluting-assignment # PrototypePollutingAssignment.ql
33+
- exclude:
34+
id: js/request-forgery # RequestForgery.ql

.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.

.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

.github/workflows/ci.yml

+46-7
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ jobs:
2121
- "*"
2222
- lts/*
2323
- lts/-1
24+
bundle:
25+
- "true"
26+
include:
27+
- node-version: "*"
28+
bundle: "false"
29+
30+
name: Test Node ${{ matrix.node-version }} with --bundle=${{ matrix.bundle }}
2431

2532
steps:
2633
- uses: actions/checkout@v3
@@ -32,7 +39,7 @@ jobs:
3239
- run: npm ci
3340

3441
- name: Tests
35-
run: npm test
42+
run: npm run test -- --bundle=${{ matrix.bundle }}
3643

3744
lint:
3845
runs-on: ubuntu-latest
@@ -62,11 +69,23 @@ jobs:
6269
- name: Adding playwright
6370
run: npm install --no-save --no-package-lock playwright
6471

65-
- name: Build local
66-
run: gulp local
67-
6872
- name: Validate the browser can import TypeScript
69-
run: gulp test-browser-integration
73+
run: npx hereby test-browser-integration
74+
75+
typecheck:
76+
runs-on: ubuntu-latest
77+
78+
steps:
79+
- uses: actions/checkout@v3
80+
- uses: actions/setup-node@v3
81+
with:
82+
node-version: "*"
83+
check-latest: true
84+
- run: npm ci
85+
86+
- name: Build src
87+
run: npx hereby build-src
88+
7089

7190
misc:
7291
runs-on: ubuntu-latest
@@ -80,7 +99,27 @@ jobs:
8099
- run: npm ci
81100

82101
- name: Build scripts
83-
run: gulp scripts
102+
run: npx hereby scripts
84103

85104
- name: ESLint tests
86-
run: gulp run-eslint-rules-tests
105+
run: npx hereby run-eslint-rules-tests
106+
107+
self-check:
108+
runs-on: ubuntu-latest
109+
110+
steps:
111+
- uses: actions/checkout@v3
112+
- uses: actions/setup-node@v3
113+
with:
114+
node-version: "*"
115+
check-latest: true
116+
- run: npm ci
117+
118+
- name: Build tsc
119+
run: npx hereby tsc
120+
121+
- name: Clean
122+
run: npx hereby clean-src
123+
124+
- name: Self build
125+
run: npx hereby build-src --built

.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

.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}}

.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

.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

.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

.gulp.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const cp = require("child_process");
2+
const path = require("path");
3+
const chalk = require("chalk");
4+
5+
const argv = process.argv.slice(2);
6+
7+
// --tasks-simple is used by VS Code to infer a task list; try and keep that working.
8+
if (!argv.includes("--tasks-simple")) {
9+
console.error(chalk.yellowBright("Warning: using gulp shim; please consider running hereby directly."));
10+
}
11+
12+
const args = [
13+
...process.execArgv,
14+
path.join(__dirname, "node_modules", "hereby", "bin", "hereby.js"),
15+
...argv,
16+
];
17+
18+
const { status } = cp.spawnSync(process.execPath, args, { stdio: "inherit" });
19+
process.exit(status ?? 1);

.vscode/launch.template.json

+3-7
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"],
@@ -43,20 +42,17 @@
4342
},
4443
"sourceMaps": true,
4544
"smartStep": true,
46-
"preLaunchTask": "gulp: tests",
45+
"preLaunchTask": "npm: build:tests",
4746
"console": "integratedTerminal",
48-
"outFiles": [
49-
"${workspaceRoot}/built/local/run.js"
50-
],
51-
"customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue",
47+
"customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue"
5248
},
5349
{
5450
// See: https://github.com/microsoft/TypeScript/wiki/Debugging-Language-Service-in-VS-Code
5551
"type": "node",
5652
"request": "attach",
5753
"name": "Attach to VS Code TS Server via Port",
5854
"processId": "${command:PickProcess}",
59-
"customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue",
55+
"customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue"
6056
}
6157
]
6258
}

.vscode/settings.template.json

+14
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,18 @@
66

77
// To use the locally built compiler, after 'npm run build':
88
// "typescript.tsdk": "built/local"
9+
10+
// To ignore commits listed in .git-blame-ignore-revs in GitLens:
11+
// "gitlens.advanced.blame.customArguments": [
12+
// "--ignore-revs-file",
13+
// ".git-blame-ignore-revs"
14+
// ]
15+
16+
// These options search the repo recursively and slow down
17+
// the build task menu. We define our own in tasks.json.
18+
"typescript.tsc.autoDetect": "off",
19+
"npm.autoDetect": "off",
20+
"grunt.autoDetect": "off",
21+
"jake.autoDetect": "off",
22+
"gulp.autoDetect": "off"
923
}

.vscode/tasks.json

+29-20
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,51 @@
44
"version": "2.0.0",
55
"tasks": [
66
{
7-
"type": "gulp",
8-
"label": "gulp: local",
9-
"task": "local",
10-
"group": {
11-
"kind": "build",
12-
"isDefault": true
13-
},
7+
// Kept for backwards compat for old launch.json files so it's
8+
// less annoying if moving up to the new build or going back to
9+
// the old build.
10+
//
11+
// This is first because the acutal "npm: build:tests" task
12+
// below has the same script value, and VS Code ignores labels
13+
// and deduplicates them.
14+
// https://github.com/microsoft/vscode/issues/93001
15+
"label": "gulp: tests",
16+
"type": "npm",
17+
"script": "build:tests",
18+
"group": "build",
19+
"hide": true,
1420
"problemMatcher": [
1521
"$tsc"
1622
]
1723
},
1824
{
19-
"type": "gulp",
20-
"label": "gulp: tsc",
21-
"task": "tsc",
25+
"label": "tsc: watch ./src",
26+
"type": "shell",
27+
"command": "node",
28+
"args": ["${workspaceFolder}/lib/tsc.js", "--build", "${workspaceFolder}/src", "--watch"],
2229
"group": "build",
30+
"isBackground": true,
2331
"problemMatcher": [
24-
"$tsc"
32+
"$tsc-watch"
2533
]
2634
},
2735
{
28-
"type": "gulp",
29-
"label": "gulp: tests",
30-
"task": "tests",
36+
"label": "npm: build:compiler",
37+
"type": "npm",
38+
"script": "build:compiler",
3139
"group": "build",
3240
"problemMatcher": [
3341
"$tsc"
3442
]
3543
},
3644
{
37-
"type": "gulp",
38-
"task": "services",
39-
"label": "gulp: services",
45+
"label": "npm: build:tests",
46+
"type": "npm",
47+
"script": "build:tests",
48+
"group": "build",
4049
"problemMatcher": [
4150
"$tsc"
42-
],
43-
}
51+
]
52+
},
4453
]
45-
}
54+
}

0 commit comments

Comments
 (0)