Skip to content

Commit f435fad

Browse files
committed
Merge branch 'main' into implement49733-part5
2 parents 100c145 + 2db688e commit f435fad

File tree

7,256 files changed

+1268078
-1224497
lines changed

Some content is hidden

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

7,256 files changed

+1268078
-1224497
lines changed

.eslintrc.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"es6": true
1212
},
1313
"plugins": [
14-
"@typescript-eslint", "no-null", "import", "eslint-plugin-local"
14+
"@typescript-eslint", "no-null", "import", "eslint-plugin-local", "simple-import-sort"
1515
],
1616
"ignorePatterns": [
1717
"**/node_modules/**",
@@ -25,11 +25,8 @@
2525
"/coverage/**"
2626
],
2727
"rules": {
28-
"sort-imports": ["error", {
29-
"ignoreCase": true,
30-
"ignoreDeclarationSort": true,
31-
"allowSeparatedGroups": true
32-
}],
28+
"simple-import-sort/imports": "error",
29+
"simple-import-sort/exports": "error",
3330

3431
"@typescript-eslint/adjacent-overload-signatures": "error",
3532
"@typescript-eslint/array-type": "error",
@@ -100,7 +97,7 @@
10097
"allowDeclarations": true
10198
}],
10299
"local/no-double-space": "error",
103-
"local/boolean-trivia": "error",
100+
"local/argument-trivia": "error",
104101
"local/no-in-operator": "error",
105102
"local/simple-indent": "error",
106103
"local/debug-assert": "error",
@@ -180,6 +177,14 @@
180177
{ "name": "exports" }
181178
]
182179
}
180+
},
181+
{
182+
// These files contain imports in a specific order that are generally unsafe to modify.
183+
"files": ["**/_namespaces/**"],
184+
"rules": {
185+
"simple-import-sort/imports": "off",
186+
"simple-import-sort/exports": "off"
187+
}
183188
}
184189
]
185190
}

.github/fabricbot.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
{
3232
"name": "addReply",
3333
"parameters": {
34-
"comment": "Thanks for the PR! It looks like you've changed the TSServer protocol in some way. Please ensure that any changes here don't break consumers of the current TSServer API. For some extra review, we'll ping @sheetalkamat, @mjbvz, and @minestarks for you. Feel free to loop in other consumers/maintainers if necessary"
34+
"comment": "Thanks for the PR! It looks like you've changed the TSServer protocol in some way. Please ensure that any changes here don't break consumers of the current TSServer API. For some extra review, we'll ping @sheetalkamat, @mjbvz, @zkat, and @joj for you. Feel free to loop in other consumers/maintainers if necessary"
3535
}
3636
}
3737
],
@@ -487,7 +487,7 @@
487487
{
488488
"name": "addReply",
489489
"parameters": {
490-
"comment": "Thanks for the PR! It looks like you've changed 'preProcess.ts' in some way. Please ensure that any changes here don't break consumers with unique project systems such as Visual Studio. Pinging @sheetalkamat and @minestarks so they are aware of the changes."
490+
"comment": "Thanks for the PR! It looks like you've changed 'preProcess.ts' in some way. Please ensure that any changes here don't break consumers with unique project systems such as Visual Studio. Pinging @sheetalkamat, @zkat, and @joj so they are aware of the changes."
491491
}
492492
}
493493
]

.github/workflows/accept-baselines-fix-lints.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ name: Accept Baselines and Fix Lints
33
on:
44
workflow_dispatch: {}
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
build:
811
runs-on: ubuntu-latest
912

13+
permissions:
14+
contents: write
15+
1016
steps:
1117
- uses: actions/checkout@v3
1218
- uses: actions/setup-node@v3
@@ -15,8 +21,8 @@ jobs:
1521
run: |
1622
git config user.email "[email protected]"
1723
git config user.name "TypeScript Bot"
18-
npm install
19-
git rm -r --quiet tests/baselines/reference :^tests/baselines/reference/docker :^tests/baselines/reference/user
24+
npm ci
25+
git rm -r --quiet tests/baselines/reference
2026
npx hereby runtests-parallel --ci --fix || true
2127
npx hereby baseline-accept
2228
git add ./src

.github/workflows/ci.yml

Lines changed: 53 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
- main
1111
- release-*
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
test:
1518
runs-on: ubuntu-latest
@@ -39,7 +42,8 @@ jobs:
3942
- run: npm ci
4043

4144
- name: Tests
42-
run: npm run test -- --bundle=${{ matrix.bundle }}
45+
# run tests, but lint separately
46+
run: npm run test -- --no-lint --bundle=${{ matrix.bundle }}
4347

4448
lint:
4549
runs-on: ubuntu-latest
@@ -91,65 +95,76 @@ jobs:
9195

9296
steps:
9397
- uses: actions/checkout@v3
98+
9499
- uses: actions/setup-node@v3
95100
with:
96101
node-version: "*"
97102
check-latest: true
103+
- run: |
104+
corepack enable npm
105+
npm --version
106+
98107
- run: npm ci
99108

100109
- run: npx hereby lkg
101110
- run: |
102111
npm pack
103112
mv typescript*.tgz typescript.tgz
104-
echo "PACKAGE=$PWD/typescript.tgz" >> $GITHUB_ENV
113+
echo "package=$PWD/typescript.tgz" >> "$GITHUB_OUTPUT"
114+
id: pack
105115
106116
- name: Smoke test
107117
run: |
108118
cd "$(mktemp -d)"
109119
npm init --yes
110-
npm install $PACKAGE tslib
120+
npm install ${{ steps.pack.outputs.package }}
111121
112122
echo "Testing tsc..."
113123
npx tsc --version
114124
115125
echo "Testing tsserver..."
116126
echo '{"seq": 1, "command": "status"}' | npx tsserver
117127
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
128+
node $GITHUB_WORKSPACE/scripts/checkModuleFormat.mjs typescript
129+
node $GITHUB_WORKSPACE/scripts/checkModuleFormat.mjs typescript/lib/tsserverlibrary
130+
131+
package-size:
132+
runs-on: ubuntu-latest
133+
if: github.event_name == 'pull_request'
134+
135+
steps:
136+
- uses: actions/checkout@v3
137+
with:
138+
path: pr
139+
140+
- uses: actions/checkout@v3
141+
with:
142+
path: base
143+
ref: ${{ github.base_ref }}
144+
145+
- uses: actions/setup-node@v3
146+
with:
147+
node-version: "*"
148+
check-latest: true
149+
- run: |
150+
corepack enable npm
151+
npm --version
152+
153+
- run: npm ci
154+
working-directory: ./pr
155+
156+
- run: npm ci
157+
working-directory: ./base
158+
159+
- run: npx hereby lkg
160+
working-directory: ./pr
161+
162+
- run: npx hereby lkg
163+
working-directory: ./base
164+
165+
- run: |
166+
echo "See $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID for more info."
167+
node ./pr/scripts/checkPackageSize.mjs ./base ./pr >> $GITHUB_STEP_SUMMARY
153168
154169
misc:
155170
runs-on: ubuntu-latest

.github/workflows/codeql.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ on:
2121
# * * * * *
2222
- cron: '30 1 * * 0'
2323

24+
permissions:
25+
contents: read
26+
2427
jobs:
2528
CodeQL-Build:
2629
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest

.github/workflows/ensure-related-repos-run-crons.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
- cron: '0 0 1 * *'
1212
workflow_dispatch: {}
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
build:
1619
runs-on: ubuntu-latest

.github/workflows/error-deltas-watchdog.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
schedule:
66
- cron: '0 0 * * 3' # Every Wednesday
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
check-for-recent:
1013
runs-on: ubuntu-latest

.github/workflows/new-release-branch.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,21 @@ on:
44
repository_dispatch:
55
types: new-release-branch
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
build:
912
runs-on: ubuntu-latest
1013

14+
permissions:
15+
contents: write
16+
1117
steps:
1218
- uses: actions/setup-node@v3
19+
- run: |
20+
corepack enable npm
21+
npm --version
1322
- uses: actions/checkout@v3
1423
with:
1524
fetch-depth: 5

.github/workflows/nightly.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
repository_dispatch:
99
types: publish-nightly
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
build:
1316
runs-on: ubuntu-latest
@@ -19,6 +22,9 @@ jobs:
1922
with:
2023
# Use NODE_AUTH_TOKEN environment variable to authenticate to this registry.
2124
registry-url: https://registry.npmjs.org/
25+
- run: |
26+
corepack enable npm
27+
npm --version
2228
- name: Setup and publish nightly
2329
run: |
2430
npm whoami

.github/workflows/release-branch-artifact.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@ on:
55
branches:
66
- release-*
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
build:
1013
runs-on: ubuntu-latest
1114

1215
steps:
1316
- uses: actions/checkout@v3
1417
- uses: actions/setup-node@v3
18+
- run: |
19+
corepack enable npm
20+
npm --version
1521
- name: npm install and test
1622
run: |
1723
npm ci

0 commit comments

Comments
 (0)