Skip to content

Commit 72d3921

Browse files
committed
Merge branch 'main' into tsgo-port
2 parents 1dcae83 + 206ed1a commit 72d3921

File tree

113 files changed

+4655
-2582
lines changed

Some content is hidden

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

113 files changed

+4655
-2582
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ jobs:
120120
- name: Tests
121121
id: test
122122
# run tests, but lint separately
123-
run: npm run test -- --no-lint --bundle=${{ matrix.config.bundle }}
123+
env:
124+
BUNDLE: ${{ matrix.config.bundle }}
125+
run: npm run test -- --no-lint --bundle="$BUNDLE"
124126

125127
- name: Print baseline diff on failure
126128
if: ${{ failure() && steps.test.conclusion == 'failure' }}
@@ -152,7 +154,7 @@ jobs:
152154
run: npm test -- --no-lint --coverage
153155

154156
- name: Upload coverage artifact
155-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
157+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
156158
with:
157159
name: coverage
158160
path: coverage
@@ -266,10 +268,12 @@ jobs:
266268
id: pack
267269
268270
- name: Smoke test
271+
env:
272+
PACKAGE: ${{ steps.pack.outputs.package }}
269273
run: |
270274
cd "$(mktemp -d)"
271275
npm init --yes
272-
npm install ${{ steps.pack.outputs.package }}
276+
npm install "$PACKAGE"
273277
274278
echo "Testing tsc..."
275279
npx tsc --version
@@ -406,7 +410,7 @@ jobs:
406410
407411
- name: Upload baseline diff artifact
408412
if: ${{ failure() && steps.check-baselines.conclusion == 'failure' }}
409-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
413+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
410414
with:
411415
name: fix_baselines.patch
412416
path: fix_baselines.patch

.github/workflows/close-issues.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ jobs:
2626
- name: Close issues
2727
env:
2828
GH_TOKEN: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
29+
REPO: ${{ github.repository }}
2930
run: |
3031
DATE=$(date --date='2 days ago' --iso-8601)
3132
3233
close_issues() {
3334
echo "Closing issues marked as '$1'."
34-
for issue in $(gh issue list --limit 100 --label "$1" --repo ${{ github.repository }} --state open --search "updated:<$DATE" --json number --jq '.[].number'); do
35-
echo "Closing https://github.com/${{ github.repository }}/issues/$issue"
36-
gh issue close $issue --repo ${{ github.repository }} --reason "not planned" --comment "This issue has been marked as \"$1\" and has seen no recent activity. It has been automatically closed for house-keeping purposes."
35+
for issue in $(gh issue list --limit 100 --label "$1" --repo "$REPO" --state open --search "updated:<$DATE" --json number --jq '.[].number'); do
36+
echo "Closing https://github.com/$REPO/issues/$issue"
37+
gh issue close $issue --repo "$REPO" --reason "not planned" --comment "This issue has been marked as \"$1\" and has seen no recent activity. It has been automatically closed for house-keeping purposes."
3738
done
3839
}
3940

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
# Initializes the CodeQL tools for scanning.
4848
- name: Initialize CodeQL
49-
uses: github/codeql-action/init@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0
49+
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
5050
with:
5151
config-file: ./.github/codeql/codeql-configuration.yml
5252
# Override language selection by uncommenting this and choosing your languages
@@ -56,7 +56,7 @@ jobs:
5656
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5757
# If this step fails, then you should remove it and run the build manually (see below).
5858
- name: Autobuild
59-
uses: github/codeql-action/autobuild@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0
59+
uses: github/codeql-action/autobuild@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
6060

6161
# ℹ️ Command-line programs to run using the OS shell.
6262
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -70,4 +70,4 @@ jobs:
7070
# make release
7171

7272
- name: Perform CodeQL Analysis
73-
uses: github/codeql-action/analyze@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0
73+
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4

.github/workflows/lkg.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ jobs:
2121
build:
2222
runs-on: ubuntu-latest
2323
steps:
24-
- run: |
25-
if [[ ! "${{ inputs.branch_name }}" =~ ^release- ]]; then
24+
- env:
25+
BRANCH_NAME: ${{ inputs.branch_name }}
26+
run: |
27+
if [[ ! "$BRANCH_NAME" =~ ^release- ]]; then
2628
echo "Branch name must start with 'release-'"
2729
exit 1
2830
fi

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,16 @@ jobs:
6363
# corepack enable npm
6464
npm install -g $(jq -r '.packageManager' < package.json)
6565
npm --version
66-
- run: |
67-
git checkout -b ${{ inputs.branch_name }}
68-
sed -i -e 's/"version": ".*"/"version": "${{ inputs.package_version }}"/g' package.json
69-
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ inputs.core_major_minor }}"/g' src/compiler/corePublic.ts
70-
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ inputs.core_major_minor }}"/g' tests/baselines/reference/api/typescript.d.ts
71-
sed -i -e 's/const version\(: string\)\{0,1\} = .*;/const version = "${{ inputs.package_version }}" as string;/g' src/compiler/corePublic.ts
66+
- env:
67+
BRANCH_NAME: ${{ inputs.branch_name }}
68+
PACKAGE_VERSION: ${{ inputs.package_version }}
69+
CORE_MAJOR_MINOR: ${{ inputs.core_major_minor }}
70+
run: |
71+
git checkout -b "$BRANCH_NAME"
72+
sed -i -e 's/"version": ".*"/"version": "'"$PACKAGE_VERSION"'"/g' package.json
73+
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "'"$CORE_MAJOR_MINOR"'"/g' src/compiler/corePublic.ts
74+
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "'"$CORE_MAJOR_MINOR"'"/g' tests/baselines/reference/api/typescript.d.ts
75+
sed -i -e 's/const version\(: string\)\{0,1\} = .*;/const version = "'"$PACKAGE_VERSION"'" as string;/g' src/compiler/corePublic.ts
7276
npm ci
7377
npm install # update package-lock.json to ensure the version bump is included
7478
npx hereby LKG
@@ -80,8 +84,8 @@ jobs:
8084
git add --force ./lib
8185
git config user.email "typescriptbot@microsoft.com"
8286
git config user.name "TypeScript Bot"
83-
git commit -m 'Bump version to ${{ inputs.package_version }} and LKG'
84-
git push --set-upstream origin ${{ inputs.branch_name }}
87+
git commit -m "Bump version to $PACKAGE_VERSION and LKG"
88+
git push --set-upstream origin "$BRANCH_NAME"
8589
8690
- uses: microsoft/typescript-bot-test-triggerer/.github/actions/post-workflow-result@master
8791
if: ${{ !cancelled() && inputs.distinct_id }}

.github/workflows/pr-modified-files.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,16 @@ jobs:
3333

3434
env:
3535
GH_TOKEN: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
36+
PR_NUMBER: ${{ github.event.pull_request.number }}
37+
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
38+
REPO: ${{ github.repository }}
3639

3740
steps:
3841
- name: Check if PR author is in pr_owners.txt
3942
id: pr_owner
4043
run: |
4144
curl -s https://raw.githubusercontent.com/microsoft/TypeScript/main/.github/pr_owners.txt > pr_owners.txt
42-
if grep -Fxq -m1 "${{ github.event.pull_request.user.login }}" pr_owners.txt; then
45+
if grep -Fxq -m1 "$PR_AUTHOR" pr_owners.txt; then
4346
echo "pr_owner=true" >> "$GITHUB_OUTPUT"
4447
else
4548
echo "pr_owner=false" >> "$GITHUB_OUTPUT"
@@ -57,7 +60,7 @@ jobs:
5760
gh api graphql -f query='
5861
query($endCursor: String) {
5962
repository(owner: "microsoft", name: "TypeScript") {
60-
pullRequest(number: ${{ github.event.pull_request.number }}) {
63+
pullRequest(number: '"$PR_NUMBER"') {
6164
files(first: 100, after: $endCursor) {
6265
pageInfo{ hasNextPage, endCursor }
6366
nodes {
@@ -79,7 +82,7 @@ jobs:
7982
#!/bin/bash
8083
FILENAME=bot_comments.txt
8184
if [ ! -f $FILENAME ]; then
82-
gh pr view ${{ github.event.pull_request.number }} --repo ${{ github.repository }} \
85+
gh pr view $PR_NUMBER --repo $REPO \
8386
--json 'comments' --jq '.comments[] | select(.author.login == "typescript-bot") | .body' > $FILENAME
8487
fi
8588
exec grep -Fq -m1 "$1" $FILENAME
@@ -99,7 +102,7 @@ jobs:
99102
MESSAGE+=" You can [read more here](https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md#contributing-libdts-fixes)."
100103
MESSAGE+=" For house-keeping purposes, this pull request will be closed."
101104
102-
gh pr close ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --comment "$MESSAGE"
105+
gh pr close "$PR_NUMBER" --repo "$REPO" --comment "$MESSAGE"
103106
exit 1 # Stop the pipeline; we just closed the PR.
104107
fi
105108
@@ -114,7 +117,7 @@ jobs:
114117
if ./already_commented.sh "It looks like you've changed the TSServer protocol in some way."; then
115118
echo "Already commented."
116119
else
117-
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "$MESSAGE"
120+
gh pr comment "$PR_NUMBER" --repo "$REPO" --body "$MESSAGE"
118121
fi
119122
fi
120123
@@ -130,6 +133,6 @@ jobs:
130133
if ./already_commented.sh "Looks like you're introducing a change to the public API surface area."; then
131134
echo "Already commented."
132135
else
133-
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "$MESSAGE"
136+
gh pr comment "$PR_NUMBER" --repo "$REPO" --body "$MESSAGE"
134137
fi
135138
fi

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
npm pack ./
4545
mv typescript-*.tgz typescript.tgz
4646
- name: Upload built tarfile
47-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
47+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
4848
with:
4949
name: tgz
5050
path: typescript.tgz

.github/workflows/scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ jobs:
4747
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
4848
# format to the repository Actions tab.
4949
- name: 'Upload artifact'
50-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
50+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
5151
with:
5252
name: SARIF file
5353
path: results.sarif
5454
retention-days: 5
5555

5656
# Upload the results to GitHub's code scanning dashboard.
5757
- name: 'Upload to code-scanning'
58-
uses: github/codeql-action/upload-sarif@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0
58+
uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
5959
with:
6060
sarif_file: results.sarif

.github/workflows/set-version.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,14 @@ jobs:
6868
# branch_name - the target branch
6969
# package_version - the full version string (eg, `3.9.1-rc` or `3.9.2`)
7070
# core_major_minor - the major.minor pair associated with the desired package_version (eg, `3.9` for `3.9.3`)
71-
- run: |
72-
sed -i -e 's/"version": ".*"/"version": "${{ inputs.package_version }}"/g' package.json
73-
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ inputs.core_major_minor }}"/g' src/compiler/corePublic.ts
74-
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ inputs.core_major_minor }}"/g' tests/baselines/reference/api/typescript.d.ts
75-
sed -i -e 's/const version\(: string\)\{0,1\} = .*;/const version = "${{ inputs.package_version }}" as string;/g' src/compiler/corePublic.ts
71+
- env:
72+
PACKAGE_VERSION: ${{ inputs.package_version }}
73+
CORE_MAJOR_MINOR: ${{ inputs.core_major_minor }}
74+
run: |
75+
sed -i -e 's/"version": ".*"/"version": "'"$PACKAGE_VERSION"'"/g' package.json
76+
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "'"$CORE_MAJOR_MINOR"'"/g' src/compiler/corePublic.ts
77+
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "'"$CORE_MAJOR_MINOR"'"/g' tests/baselines/reference/api/typescript.d.ts
78+
sed -i -e 's/const version\(: string\)\{0,1\} = .*;/const version = "'"$PACKAGE_VERSION"'" as string;/g' src/compiler/corePublic.ts
7679
npm ci
7780
npm install # update package-lock.json to ensure the version bump is included
7881
npx hereby LKG
@@ -84,7 +87,7 @@ jobs:
8487
git add --force ./lib
8588
git config user.email "typescriptbot@microsoft.com"
8689
git config user.name "TypeScript Bot"
87-
git commit -m 'Bump version to ${{ inputs.package_version }} and LKG'
90+
git commit -m "Bump version to $PACKAGE_VERSION and LKG"
8891
git push
8992
9093
- uses: microsoft/typescript-bot-test-triggerer/.github/actions/post-workflow-result@master

Herebyfile.mjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,14 +561,11 @@ export const lint = task({
561561
description: "Runs eslint on the compiler and scripts sources.",
562562
run: async () => {
563563
const folder = ".";
564-
const formatter = cmdLineOptions.ci ? "stylish" : "autolinkable-stylish";
565564
const args = [
566565
"node_modules/eslint/bin/eslint",
567566
"--cache",
568567
"--cache-location",
569568
`${folder}/.eslintcache`,
570-
"--format",
571-
formatter,
572569
"--report-unused-disable-directives",
573570
"--max-warnings",
574571
"0",

0 commit comments

Comments
 (0)