Skip to content

Commit 1a003b9

Browse files
author
Armando Aguirre
committed
Merge remote-tracking branch 'upstream/main' into TestBranch
2 parents 92ab2e2 + 6f9a062 commit 1a003b9

File tree

6,470 files changed

+1144637
-1045454
lines changed

Some content is hidden

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

6,470 files changed

+1144637
-1045454
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
"allowDeclarations": true
9898
}],
9999
"local/no-double-space": "error",
100-
"local/boolean-trivia": "error",
100+
"local/argument-trivia": "error",
101101
"local/no-in-operator": "error",
102102
"local/simple-indent": "error",
103103
"local/debug-assert": "error",

.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 "typescriptbot@microsoft.com"
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: 51 additions & 37 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
@@ -92,65 +95,76 @@ jobs:
9295

9396
steps:
9497
- uses: actions/checkout@v3
98+
9599
- uses: actions/setup-node@v3
96100
with:
97101
node-version: "*"
98102
check-latest: true
103+
- run: |
104+
corepack enable npm
105+
npm --version
106+
99107
- run: npm ci
100108

101109
- run: npx hereby lkg
102110
- run: |
103111
npm pack
104112
mv typescript*.tgz typescript.tgz
105-
echo "PACKAGE=$PWD/typescript.tgz" >> $GITHUB_ENV
113+
echo "package=$PWD/typescript.tgz" >> "$GITHUB_OUTPUT"
114+
id: pack
106115
107116
- name: Smoke test
108117
run: |
109118
cd "$(mktemp -d)"
110119
npm init --yes
111-
npm install $PACKAGE tslib
120+
npm install ${{ steps.pack.outputs.package }}
112121
113122
echo "Testing tsc..."
114123
npx tsc --version
115124
116125
echo "Testing tsserver..."
117126
echo '{"seq": 1, "command": "status"}' | npx tsserver
118127
119-
cat > smoke.js << 'EOF'
120-
console.log(`Testing ${process.argv[2]}...`);
121-
const { __importDefault, __importStar } = require("tslib");
122-
const ts = require(process.argv[2]);
123-
124-
// See: https://github.com/microsoft/TypeScript/pull/51474#issuecomment-1310871623
125-
const fns = [
126-
[() => ts.version, true],
127-
[() => ts.default.version, false],
128-
[() => __importDefault(ts).version, false],
129-
[() => __importDefault(ts).default.version, true],
130-
[() => __importStar(ts).version, true],
131-
[() => __importStar(ts).default.version, true],
132-
];
133-
134-
for (const [fn, shouldSucceed] of fns) {
135-
let success = false;
136-
try {
137-
success = !!fn();
138-
}
139-
catch {}
140-
const status = success ? "succeeded" : "failed";
141-
if (success === shouldSucceed) {
142-
console.log(`${fn.toString()} ${status} as expected.`);
143-
}
144-
else {
145-
console.log(`${fn.toString()} unexpectedly ${status}.`);
146-
process.exitCode = 1;
147-
}
148-
}
149-
console.log("ok");
150-
EOF
151-
152-
node ./smoke.js typescript
153-
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
154168
155169
misc:
156170
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: 10 additions & 1 deletion
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
@@ -28,7 +37,7 @@ jobs:
2837
git add src/compiler/corePublic.ts
2938
git add tests/baselines/reference/api/typescript.d.ts
3039
git add tests/baselines/reference/api/tsserverlibrary.d.ts
31-
git add ./lib
40+
git add --force ./lib
3241
git config user.email "typescriptbot@microsoft.com"
3342
git config user.name "TypeScript Bot"
3443
git commit -m 'Bump version to ${{ github.event.client_payload.package_version }} and LKG'

.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

.github/workflows/rich-navigation.yml

Lines changed: 3 additions & 0 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
richnav:
1518
runs-on: windows-latest

.github/workflows/set-version.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,24 @@ on:
44
repository_dispatch:
55
types: set-version
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
1319
- uses: actions/checkout@v3
1420
with:
1521
ref: ${{ github.event.client_payload.branch_name }}
22+
- run: |
23+
corepack enable npm
24+
npm --version
1625
# notably, this is essentially the same script as `new-release-branch.yaml` (with fewer inputs), but it assumes the branch already exists
1726
# do note that executing the transform below will prevent the `configurePrerelease` script from running on the source, as it makes the
1827
# `version` identifier no longer match the regex it uses
@@ -34,7 +43,7 @@ jobs:
3443
git add src/compiler/corePublic.ts
3544
git add tests/baselines/reference/api/typescript.d.ts
3645
git add tests/baselines/reference/api/tsserverlibrary.d.ts
37-
git add ./lib
46+
git add --force ./lib
3847
git config user.email "typescriptbot@microsoft.com"
3948
git config user.name "TypeScript Bot"
4049
git commit -m 'Bump version to ${{ github.event.client_payload.package_version }} and LKG'

.github/workflows/sync-branch.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@ on:
99
description: 'Target Branch Name'
1010
required: true
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
build:
1417
runs-on: ubuntu-latest
1518

19+
permissions:
20+
contents: write
21+
1622
steps:
1723
- uses: actions/setup-node@v3
1824
- uses: actions/checkout@v3

.github/workflows/sync-wiki.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Sync Two Wiki Repos
22

33
on: [gollum]
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
sync:
710
runs-on: ubuntu-latest

.github/workflows/twoslash-repros.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ on:
1919
required: false
2020
type: string
2121

22+
permissions:
23+
contents: read
24+
2225
jobs:
2326
run:
2427
if: ${{ github.repository == 'microsoft/TypeScript' }}

.github/workflows/update-lkg.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ name: Update LKG
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
@@ -19,6 +25,6 @@ jobs:
1925
npx hereby LKG
2026
npm test
2127
git diff
22-
git add ./lib
28+
git add --force ./lib
2329
git commit -m "Update LKG"
2430
git push

0 commit comments

Comments
 (0)