Skip to content

Commit ce91909

Browse files
committed
Merge branch 'main' into preserve-alias-symbols-on-type-alias-references-more
2 parents bcdac1a + 00dc0b6 commit ce91909

File tree

2,550 files changed

+364532
-295050
lines changed

Some content is hidden

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

2,550 files changed

+364532
-295050
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@
1010
"es6": true
1111
},
1212
"plugins": [
13-
"@typescript-eslint", "jsdoc", "no-null", "import", "eslint-plugin-local"
13+
"@typescript-eslint", "no-null", "import", "eslint-plugin-local"
1414
],
1515
"rules": {
16+
"sort-imports": ["error", {
17+
"ignoreCase": true,
18+
"ignoreDeclarationSort": true,
19+
"allowSeparatedGroups": true
20+
}],
21+
1622
"@typescript-eslint/adjacent-overload-signatures": "error",
1723
"@typescript-eslint/array-type": "error",
1824
"@typescript-eslint/no-array-constructor": "error",
@@ -87,17 +93,14 @@
8793
"local/simple-indent": "error",
8894
"local/debug-assert": "error",
8995
"local/no-keywords": "error",
90-
"local/one-namespace-per-file": "error",
96+
"local/jsdoc-format": "error",
9197

9298
// eslint-plugin-import
9399
"import/no-extraneous-dependencies": ["error", { "optionalDependencies": false }],
94100

95101
// eslint-plugin-no-null
96102
"no-null/no-null": "error",
97103

98-
// eslint-plugin-jsdoc
99-
"jsdoc/check-alignment": "error",
100-
101104
// eslint
102105
"constructor-super": "error",
103106
"curly": ["error", "multi-line"],

.git-blame-ignore-revs

Lines changed: 8 additions & 0 deletions
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
Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,34 @@
11
name : CodeQL Configuration
22

33
paths:
4-
- './src'
4+
- src
5+
- scripts
6+
- Gulpfile.mjs
7+
paths-ignore:
8+
- 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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 110 additions & 7 deletions
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,87 @@ 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+
89+
smoke:
90+
runs-on: ubuntu-latest
91+
92+
steps:
93+
- uses: actions/checkout@v3
94+
- uses: actions/setup-node@v3
95+
with:
96+
node-version: "*"
97+
check-latest: true
98+
- run: npm ci
99+
100+
- run: npx hereby lkg
101+
- run: |
102+
npm pack
103+
mv typescript*.tgz typescript.tgz
104+
echo "PACKAGE=$PWD/typescript.tgz" >> $GITHUB_ENV
105+
106+
- name: Smoke test
107+
run: |
108+
cd "$(mktemp -d)"
109+
npm init --yes
110+
npm install $PACKAGE tslib
111+
112+
echo "Testing tsc..."
113+
npx tsc --version
114+
115+
echo "Testing tsserver..."
116+
echo '{"seq": 1, "command": "status"}' | npx tsserver
117+
118+
cat > smoke.js << 'EOF'
119+
console.log(`Testing ${process.argv[2]}...`);
120+
const { __importDefault, __importStar } = require("tslib");
121+
const ts = require(process.argv[2]);
122+
123+
// See: https://github.com/microsoft/TypeScript/pull/51474#issuecomment-1310871623
124+
const fns = [
125+
[() => ts.version, true],
126+
[() => ts.default.version, false],
127+
[() => __importDefault(ts).version, false],
128+
[() => __importDefault(ts).default.version, true],
129+
[() => __importStar(ts).version, true],
130+
[() => __importStar(ts).default.version, true],
131+
];
132+
133+
for (const [fn, shouldSucceed] of fns) {
134+
let success = false;
135+
try {
136+
success = !!fn();
137+
}
138+
catch {}
139+
const status = success ? "succeeded" : "failed";
140+
if (success === shouldSucceed) {
141+
console.log(`${fn.toString()} ${status} as expected.`);
142+
}
143+
else {
144+
console.log(`${fn.toString()} unexpectedly ${status}.`);
145+
process.exitCode = 1;
146+
}
147+
}
148+
console.log("ok");
149+
EOF
150+
151+
node ./smoke.js typescript
152+
node ./smoke.js typescript/lib/tsserverlibrary
70153
71154
misc:
72155
runs-on: ubuntu-latest
@@ -80,7 +163,27 @@ jobs:
80163
- run: npm ci
81164

82165
- name: Build scripts
83-
run: gulp scripts
166+
run: npx hereby scripts
84167

85168
- name: ESLint tests
86-
run: gulp run-eslint-rules-tests
169+
run: npx hereby run-eslint-rules-tests
170+
171+
self-check:
172+
runs-on: ubuntu-latest
173+
174+
steps:
175+
- uses: actions/checkout@v3
176+
- uses: actions/setup-node@v3
177+
with:
178+
node-version: "*"
179+
check-latest: true
180+
- run: npm ci
181+
182+
- name: Build tsc
183+
run: npx hereby tsc
184+
185+
- name: Clean
186+
run: npx hereby clean-src
187+
188+
- name: Self build
189+
run: npx hereby build-src --built

.github/workflows/codeql.yml

Lines changed: 52 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,64 @@
1-
name: "Code scanning - action"
1+
name: "Code Scanning - Action"
22

33
on:
44
push:
5+
branches:
6+
- main
7+
- release-*
58
pull_request:
9+
branches:
10+
- main
11+
- release-*
612
schedule:
7-
- cron: '0 19 * * 0'
13+
# ┌───────────── minute (0 - 59)
14+
# │ ┌───────────── hour (0 - 23)
15+
# │ │ ┌───────────── day of the month (1 - 31)
16+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
17+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
18+
# │ │ │ │ │
19+
# │ │ │ │ │
20+
# │ │ │ │ │
21+
# * * * * *
22+
- cron: '30 1 * * 0'
823

924
jobs:
1025
CodeQL-Build:
11-
12-
# CodeQL runs on ubuntu-latest and windows-latest
26+
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
1327
runs-on: ubuntu-latest
1428
if: github.repository == 'microsoft/TypeScript'
1529

30+
permissions:
31+
# required for all workflows
32+
security-events: write
33+
1634
steps:
17-
- name: Checkout repository
18-
uses: actions/checkout@v3
19-
with:
20-
# We must fetch at least the immediate parents so that if this is
21-
# a pull request then we can checkout the head.
22-
fetch-depth: 2
23-
24-
# Initializes the CodeQL tools for scanning.
25-
- name: Initialize CodeQL
26-
uses: github/codeql-action/init@v2
27-
with:
28-
config-file: ./.github/codeql/codeql-configuration.yml
29-
# Override language selection by uncommenting this and choosing your languages
30-
# with:
31-
# languages: go, javascript, csharp, python, cpp, java
32-
33-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
34-
# If this step fails, then you should remove it and run the build manually (see below)
35-
- name: Autobuild
36-
uses: github/codeql-action/autobuild@v2
37-
38-
# ℹ️ Command-line programs to run using the OS shell.
39-
# 📚 https://git.io/JvXDl
40-
41-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
42-
# and modify them (or add more) to build your code if your project
43-
# uses a compiled language
44-
45-
#- run: |
46-
# make bootstrap
47-
# make release
48-
49-
- name: Perform CodeQL Analysis
50-
uses: github/codeql-action/analyze@v2
35+
- name: Checkout repository
36+
uses: actions/checkout@v3
37+
38+
# Initializes the CodeQL tools for scanning.
39+
- name: Initialize CodeQL
40+
uses: github/codeql-action/init@v2
41+
with:
42+
config-file: ./.github/codeql/codeql-configuration.yml
43+
# Override language selection by uncommenting this and choosing your languages
44+
# with:
45+
# languages: go, javascript, csharp, python, cpp, java
46+
47+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
48+
# If this step fails, then you should remove it and run the build manually (see below).
49+
- name: Autobuild
50+
uses: github/codeql-action/autobuild@v2
51+
52+
# ℹ️ Command-line programs to run using the OS shell.
53+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
54+
55+
# ✏️ If the Autobuild fails above, remove it and uncomment the following
56+
# three lines and modify them (or add more) to build your code if your
57+
# project uses a compiled language
58+
59+
#- run: |
60+
# make bootstrap
61+
# make release
62+
63+
- name: Perform CodeQL Analysis
64+
uses: github/codeql-action/analyze@v2
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "typescript-error-deltas Watchdog"
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 0 * * 3' # Every Wednesday
7+
8+
jobs:
9+
check-for-recent:
10+
runs-on: ubuntu-latest
11+
if: github.repository == 'microsoft/TypeScript'
12+
permissions:
13+
contents: read # Apparently required to create issues
14+
issues: write
15+
env:
16+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
TAGS: "@navya9singh @RyanCavanaugh @DanielRosenwasser"
18+
steps:
19+
- name: NewErrors
20+
run: | # --json and --jq prints exactly one issue number per line of output
21+
DATE=$(date --date="7 days ago" --iso-8601)
22+
gh issue list --repo microsoft/typescript --search "[NewErrors] created:>=$DATE" --state all --json number --jq ".[].number" \
23+
| grep -qe "[0-9]" \
24+
|| gh issue create --repo ${{ github.repository }} --title "No NewErrors issue since $DATE" --body "$TAGS Please check the [pipeline](https://typescript.visualstudio.com/TypeScript/_build?definitionId=48)."
25+
- name: ServerErrors TS
26+
run: |
27+
DATE=$(date --date="7 days ago" --iso-8601)
28+
gh issue list --repo microsoft/typescript --search "[ServerErrors][TypeScript] created:>=$DATE" --state all --json number --jq ".[].number" \
29+
| grep -qe "[0-9]" \
30+
|| gh issue create --repo ${{ github.repository }} --title "No TypeScript ServerErrors issue since $DATE" --body "$TAGS Please check the [pipeline](https://typescript.visualstudio.com/TypeScript/_build?definitionId=59)."
31+
- name: ServerErrors JS
32+
run: |
33+
DATE=$(date --date="7 days ago" --iso-8601)
34+
gh issue list --repo microsoft/typescript --search "[ServerErrors][JavaScript] created:>=$DATE" --state all --json number --jq ".[].number" \
35+
| grep -qe "[0-9]" \
36+
|| gh issue create --repo ${{ github.repository }} --title "No JavaScript ServerErrors issue since $DATE" --body "$TAGS Please check the [pipeline](https://typescript.visualstudio.com/TypeScript/_build?definitionId=58)."

0 commit comments

Comments
 (0)