Skip to content

Commit a730533

Browse files
committed
Merged main branch into microsoftgh-52815
2 parents 4eff790 + 905a0b4 commit a730533

File tree

2,556 files changed

+54018
-775441
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,556 files changed

+54018
-775441
lines changed

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

Lines changed: 7 additions & 1 deletion
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,7 +21,7 @@ jobs:
1521
run: |
1622
git config user.email "typescriptbot@microsoft.com"
1723
git config user.name "TypeScript Bot"
18-
npm install
24+
npm ci
1925
git rm -r --quiet tests/baselines/reference
2026
npx hereby runtests-parallel --ci --fix || true
2127
npx hereby baseline-accept

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

.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: 9 additions & 0 deletions
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

.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: 6 additions & 0 deletions
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

.github/workflows/update-package-lock.yaml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,41 @@ on:
77
- cron: '0 6 * * *'
88
workflow_dispatch: {}
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
build:
1215
runs-on: ubuntu-latest
1316
if: github.repository == 'microsoft/TypeScript'
1417

18+
permissions:
19+
contents: write
20+
1521
steps:
1622
- uses: actions/checkout@v3
1723
with:
1824
token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
1925
- uses: actions/setup-node@v3
2026
with:
2127
node-version: 16
28+
- run: |
29+
corepack enable npm
30+
npm --version
2231
23-
- name: Configure git and update package-lock.json
32+
- name: Update package-lock.json and push
2433
run: |
25-
git config user.email "typescriptbot@microsoft.com"
26-
git config user.name "TypeScript Bot"
2734
rm package-lock.json
28-
npm install --package-lock-only --ignore-scripts # This is a no-op if package-lock.json is present.
35+
npm install
2936
git add -f package-lock.json
30-
if git commit -m "Update package-lock.json"; then
37+
38+
if git diff --exit-code --name-only package-lock.json; then
39+
echo "No change."
40+
else
41+
npm test
42+
npx hereby lkg
43+
git config user.email "typescriptbot@microsoft.com"
44+
git config user.name "TypeScript Bot"
45+
git commit -m "Update package-lock.json"
3146
git push
3247
fi

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ node_modules/
22
.node_modules/
33
built/*
44
tests/cases/rwc/*
5-
tests/cases/test262/*
65
tests/cases/perf/*
76
!tests/cases/webharness/compilerToString.js
87
test-args.txt
@@ -14,7 +13,6 @@ tests/baselines/local.old/*
1413
tests/services/baselines/local/*
1514
tests/baselines/prototyping/local/*
1615
tests/baselines/rwc/*
17-
tests/baselines/test262/*
1816
tests/baselines/reference/projectOutput/*
1917
tests/baselines/local/projectOutput/*
2018
tests/baselines/reference/testresults.tap
@@ -64,3 +62,4 @@ TEST-results.xml
6462
package-lock.json
6563
.eslintcache
6664
*v8.log
65+
lib/

0 commit comments

Comments
 (0)