Skip to content

Commit 71beb36

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/52262
2 parents d34bc7d + b70784e commit 71beb36

File tree

4,576 files changed

+145435
-1012445
lines changed

Some content is hidden

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

4,576 files changed

+145435
-1012445
lines changed

.eslintrc.json

Lines changed: 11 additions & 6 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",
@@ -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/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

.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/scorecard.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# This workflow uses actions that are not certified by GitHub. They are provided
2+
# by a third-party and are governed by separate terms of service, privacy
3+
# policy, and support documentation.
4+
5+
name: Scorecard supply-chain security
6+
on:
7+
# For Branch-Protection check. Only the default branch is supported. See
8+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
9+
branch_protection_rule:
10+
# To guarantee Maintained check is occasionally updated. See
11+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
12+
schedule:
13+
- cron: '19 15 * * 4'
14+
push:
15+
branches: [ "main" ]
16+
17+
# Declare default permissions as read only.
18+
permissions: read-all
19+
20+
jobs:
21+
analysis:
22+
name: Scorecard analysis
23+
runs-on: ubuntu-latest
24+
permissions:
25+
# Needed to upload the results to code-scanning dashboard.
26+
security-events: write
27+
# Needed to publish results and get a badge (see publish_results below).
28+
id-token: write
29+
30+
steps:
31+
- name: "Checkout code"
32+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
33+
with:
34+
persist-credentials: false
35+
36+
- name: "Run analysis"
37+
uses: ossf/scorecard-action@99c53751e09b9529366343771cc321ec74e9bd3d # v2.0.6
38+
with:
39+
results_file: results.sarif
40+
results_format: sarif
41+
42+
# Publish results to OpenSSF REST API for easy access by consumers
43+
# Allows the repository to include the Scorecard badge.
44+
# See https://github.com/ossf/scorecard-action#publishing-results.
45+
publish_results: true
46+
47+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
48+
# format to the repository Actions tab.
49+
- name: "Upload artifact"
50+
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
51+
with:
52+
name: SARIF file
53+
path: results.sarif
54+
retention-days: 5
55+
56+
# Upload the results to GitHub's code scanning dashboard.
57+
- name: "Upload to code-scanning"
58+
uses: github/codeql-action/upload-sarif@807578363a7869ca324a79039e6db9c843e0e100 # v2.1.27
59+
with:
60+
sarif_file: results.sarif

.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

0 commit comments

Comments
 (0)