Skip to content

Commit 8291654

Browse files
committed
Merge remote-tracking branch 'upstream/main'
# Conflicts: # tests/baselines/reference/arrayDestructuringInSwitch1.types # tests/baselines/reference/arraySlice.types # tests/baselines/reference/bestChoiceType.types # tests/baselines/reference/bivariantInferences.types # tests/baselines/reference/callsOnComplexSignatures.types # tests/baselines/reference/contextualOverloadListFromArrayUnion.types # tests/baselines/reference/controlFlowArrayErrors.types # tests/baselines/reference/sliceResultCast.types # tests/baselines/reference/typeParameterExtendingUnion1.types # tests/baselines/reference/typeParameterExtendingUnion2.types # tests/baselines/reference/typeParameterLeak.types # tests/baselines/reference/unionOfArraysFilterCall.types # tests/baselines/reference/unionOfClassCalls.types
2 parents 126f1bc + 278b4f9 commit 8291654

File tree

12,635 files changed

+606237
-7949
lines changed

Some content is hidden

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

12,635 files changed

+606237
-7949
lines changed

Diff for: .dprint.jsonc

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"trailingCommas": "never"
4545
},
4646
"excludes": [
47+
"**/.git",
4748
"**/node_modules",
4849
"**/*-lock.json",
4950
"coverage/**",

Diff for: .github/workflows/create-cherry-pick-pr.yml

+44-4
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,35 @@ jobs:
9292
await exec.exec("git", ["config", "user.name", "TypeScript Bot"]);
9393
await exec.exec("git", ["switch", "--detach", `origin/${TARGET_BRANCH}`]);
9494
await exec.exec("git", ["switch", "-c", pickBranch]);
95-
await exec.exec("git", ["cherry-pick", "-m", "1", pr.data.merge_commit_sha]);
95+
96+
let updatedBaselinesMessage = "";
97+
try {
98+
await exec.exec("git", ["cherry-pick", "-m", "1", pr.data.merge_commit_sha]);
99+
} catch (e) {
100+
console.log(e);
101+
102+
// The cherry-pick failed. If all of the conflicts are in tests/baselines,
103+
// try to run the tests and accept the new baselines.
104+
105+
await exec.exec("git", ["add", "tests/baselines"]);
106+
// This will fail if any other files were modified.
107+
await exec.exec("git", ["-c", "core.editor=true", "cherry-pick", "--continue"]);
108+
109+
await exec.exec("npm", ["ci"]);
110+
111+
try {
112+
await exec.exec("npm", ["test", "--", "--no-lint"]);
113+
} catch {
114+
// Expected to fail.
115+
}
116+
117+
await exec.exec("npx", ["hereby", "baseline-accept"]);
118+
await exec.exec("git", ["add", "tests/baselines"]);
119+
await exec.exec("git", ["commit", "-m", "Update baselines"]);
120+
121+
updatedBaselinesMessage = " This involved updating baselines; please check the diff.";
122+
}
123+
96124
await exec.exec("git", ["push", "--force", "--set-upstream", "origin", pickBranch]);
97125
98126
const existingPulls = await github.rest.pulls.list({
@@ -106,7 +134,7 @@ jobs:
106134
if (existingPulls.data.length === 0) {
107135
console.log(`No existing PRs found for ${pickBranch}`);
108136
109-
const body = `This cherry-pick was triggered by a request on #${PR}.\n\nPlease review the diff and merge if no changes are unexpected.`;
137+
const body = `This cherry-pick was triggered by a request on #${PR}.\n\nPlease review the diff and merge if no changes are unexpected.${updatedBaselinesMessage}`;
110138
111139
const newPr = await github.rest.pulls.create({
112140
owner: context.repo.owner,
@@ -115,11 +143,23 @@ jobs:
115143
head: pickBranch,
116144
title,
117145
body,
146+
});
147+
148+
await github.rest.issues.addAssignees({
149+
owner: context.repo.owner,
150+
repo: context.repo.repo,
151+
issue_number: newPr.data.number,
118152
assignees: ["DanielRosenwasser"],
153+
});
154+
155+
await github.rest.pulls.requestReviewers({
156+
owner: context.repo.owner,
157+
repo: context.repo.repo,
158+
pull_number: newPr.data.number,
119159
reviewers: ["DanielRosenwasser", REQUESTING_USER],
120160
});
121161
122-
commentBody = `I've created #${newPr.data.number} for you.`;
162+
commentBody = `I've created #${newPr.data.number} for you.${updatedBaselinesMessage}`;
123163
}
124164
else {
125165
const existing = existingPulls.data[0];
@@ -132,7 +172,7 @@ jobs:
132172
title,
133173
});
134174
135-
commentBody = `I've updated #${existing.number} for you.`;
175+
commentBody = `I've updated #${existing.number} for you.${updatedBaselinesMessage}`;
136176
}
137177
138178
return commentBody;

Diff for: .github/workflows/insiders.yaml

+21-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,27 @@ defaults:
1515
shell: bash
1616

1717
jobs:
18-
build:
18+
test:
19+
runs-on: ubuntu-latest
20+
if: github.repository == 'microsoft/TypeScript'
21+
22+
steps:
23+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
24+
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
25+
- run: |
26+
npm --version
27+
# corepack enable npm
28+
npm install -g $(jq -r '.packageManager' < package.json)
29+
npm --version
30+
- name: Test insiders
31+
run: |
32+
npm ci
33+
npx hereby configure-insiders
34+
npm test
35+
36+
publish:
37+
needs: test
38+
1939
runs-on: ubuntu-latest
2040
if: github.repository == 'microsoft/TypeScript'
2141

@@ -36,8 +56,6 @@ jobs:
3656
npm ci
3757
npx hereby configure-insiders
3858
npx hereby LKG
39-
npx hereby runtests-parallel
40-
npx hereby clean
4159
npm publish --tag insiders
4260
env:
4361
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

Diff for: .github/workflows/nightly.yaml

+20-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,26 @@ defaults:
1616
shell: bash
1717

1818
jobs:
19-
build:
19+
test:
20+
runs-on: ubuntu-latest
21+
if: github.repository == 'microsoft/TypeScript'
22+
23+
steps:
24+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
25+
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
26+
- run: |
27+
npm --version
28+
# corepack enable npm
29+
npm install -g $(jq -r '.packageManager' < package.json)
30+
npm --version
31+
- name: Setup and publish nightly
32+
run: |
33+
npm ci
34+
npx hereby configure-nightly
35+
npm test
36+
37+
publish:
38+
needs: [test]
2039
runs-on: ubuntu-latest
2140
if: github.repository == 'microsoft/TypeScript'
2241

@@ -37,8 +56,6 @@ jobs:
3756
npm ci
3857
npx hereby configure-nightly
3958
npx hereby LKG
40-
npx hereby runtests-parallel
41-
npx hereby clean
4259
npm publish --tag next
4360
env:
4461
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ tests/baselines/rwc/*
1616
tests/baselines/reference/projectOutput/*
1717
tests/baselines/local/projectOutput/*
1818
tests/baselines/reference/testresults.tap
19+
tests/baselines/symlinks/*
1920
tests/services/baselines/prototyping/local/*
2021
tests/services/browser/typescriptServices.js
2122
src/harness/*.js

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![GitHub Actions CI](https://github.com/microsoft/TypeScript/workflows/CI/badge.svg)](https://github.com/microsoft/TypeScript/actions?query=workflow%3ACI)
55
[![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript)
66
[![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript)
7-
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/microsoft/TypeScript/badge)](https://api.securityscorecards.dev/projects/github.com/microsoft/TypeScript)
7+
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/microsoft/TypeScript/badge)](https://securityscorecards.dev/viewer/?uri=github.com/microsoft/TypeScript)
88

99

1010
[TypeScript](https://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types to JavaScript that support tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](https://www.typescriptlang.org/play/), and stay up to date via [our blog](https://blogs.msdn.microsoft.com/typescript) and [Twitter account](https://twitter.com/typescript).

Diff for: azure-pipelines.release.yml

+24-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ extends:
2828
- stage: buildStage
2929
displayName: Build Stage
3030
jobs:
31-
- job: build
32-
displayName: Build
31+
- job: test
32+
displayName: Test
3333
steps:
3434
- checkout: self
3535
clean: true
@@ -52,6 +52,28 @@ extends:
5252
- script: 'npm test'
5353
displayName: 'npm test'
5454

55+
- job: build
56+
displayName: Build
57+
dependsOn: test
58+
steps:
59+
- checkout: self
60+
clean: true
61+
fetchDepth: 1
62+
fetchTags: false
63+
64+
- task: NodeTool@0
65+
inputs:
66+
versionSpec: 20.x
67+
displayName: 'Install Node'
68+
69+
- script: |
70+
npm install -g `node -e 'console.log(JSON.parse(fs.readFileSync("package.json", "utf8")).packageManager)'`
71+
npm --version
72+
displayName: 'Install packageManager from package.json'
73+
74+
- script: npm ci
75+
displayName: 'npm ci'
76+
5577
- script: |
5678
npx hereby LKG
5779
npx hereby clean

0 commit comments

Comments
 (0)