Skip to content

Commit 0b2f2e5

Browse files
committed
merging all conflicts
2 parents 1623a87 + af252ce commit 0b2f2e5

File tree

7 files changed

+336
-3
lines changed

7 files changed

+336
-3
lines changed

Diff for: .github/workflows/CI.yml

+120
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
branches:
5+
- v2
6+
7+
# Ensure scripts are run with pipefail. See:
8+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
9+
defaults:
10+
run:
11+
shell: bash
12+
13+
jobs:
14+
tests:
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os:
19+
- ubuntu-latest
20+
- windows-latest
21+
- macos-latest
22+
23+
runs-on: ${{ matrix.os }}
24+
25+
steps:
26+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
28+
with:
29+
node-version: "18.x"
30+
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
31+
32+
- run: pnpm install
33+
34+
# Grab localizations
35+
- run: pnpm docs-sync pull microsoft/TypeScript-Website-localizations#main 1
36+
37+
# Build the packages
38+
- run: pnpm bootstrap
39+
- run: pnpm build
40+
41+
# Verify it compiles
42+
- run: pnpm build-site
43+
44+
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
45+
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest'
46+
with:
47+
name: site
48+
path: packages/typescriptlang-org/public
49+
50+
# Run all the package's tests
51+
- run: pnpm test
52+
53+
# danger for PR builds
54+
- if: github.event_name == 'pull_request' && github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id && matrix.os == 'ubuntu-latest'
55+
run: "pnpm danger ci"
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
59+
- run: |
60+
git add .
61+
if ! git diff --staged --exit-code --quiet; then
62+
echo "This PR is missing some generated changes. Please update locally or merge the patch artifact."
63+
echo ""
64+
git diff --staged
65+
git diff --staged > missing.patch
66+
exit 1
67+
fi
68+
name: Check for uncommitted changes
69+
id: check-diff
70+
if: github.event_name == 'pull_request'
71+
72+
- name: Upload diff artifact
73+
if: ${{ failure() && steps.check-diff.conclusion == 'failure' }}
74+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
75+
with:
76+
name: missing.patch
77+
path: missing.patch
78+
79+
changesets:
80+
name: changesets
81+
runs-on: ubuntu-latest
82+
steps:
83+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
84+
with:
85+
fetch-depth: 0
86+
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
87+
with:
88+
node-version: 'lts/*'
89+
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
90+
91+
- run: pnpm install
92+
93+
- name: Check for missing changesets
94+
run: |
95+
PR_CHANGESETS=$(ls .changeset | (grep -v -E 'README\.md|config\.json' || true) | wc -l)
96+
MAIN_CHANGESETS=$(git ls-tree -r origin/v2 .changeset | (grep -v -E 'README\.md|config\.json' || true) | wc -l)
97+
98+
# If the PR has no changesets, but main has changesets, assume this is PR is a versioning PR and exit
99+
if [[ $PR_CHANGESETS -eq 0 && $MAIN_CHANGESETS -gt 0 ]]; then
100+
echo "This PR is a versioning PR, exiting"
101+
exit 0
102+
fi
103+
104+
# git switch -c changesets-temp
105+
# git checkout origin/v2 -- <ignored files>
106+
pnpm changeset status --since=origin/v2
107+
108+
required:
109+
runs-on: ubuntu-latest
110+
if: ${{ always() }}
111+
needs:
112+
- tests
113+
- changesets
114+
115+
steps:
116+
- name: Check required jobs
117+
env:
118+
NEEDS: ${{ toJson(needs) }}
119+
run: |
120+
! echo $NEEDS | jq -e 'to_entries[] | { job: .key, result: .value.result } | select(.result != "success")'

Diff for: .github/workflows/codeql.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: 'Code Scanning - Action'
2+
3+
on:
4+
push:
5+
branches:
6+
- v2
7+
pull_request:
8+
branches:
9+
- v2
10+
schedule:
11+
# ┌───────────── minute (0 - 59)
12+
# │ ┌───────────── hour (0 - 23)
13+
# │ │ ┌───────────── day of the month (1 - 31)
14+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
15+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
16+
# │ │ │ │ │
17+
# │ │ │ │ │
18+
# │ │ │ │ │
19+
# * * * * *
20+
- cron: '30 1 * * 0'
21+
22+
permissions:
23+
contents: read
24+
25+
# Ensure scripts are run with pipefail. See:
26+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
27+
defaults:
28+
run:
29+
shell: bash
30+
31+
jobs:
32+
CodeQL-Build:
33+
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
34+
runs-on: ubuntu-latest
35+
if: github.repository == 'microsoft/TypeScript-Website'
36+
37+
permissions:
38+
# required for all workflows
39+
security-events: write
40+
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
44+
45+
# Initializes the CodeQL tools for scanning.
46+
- name: Initialize CodeQL
47+
uses: github/codeql-action/init@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
48+
with:
49+
config-file: ./.github/codeql/codeql-configuration.yml
50+
# Override language selection by uncommenting this and choosing your languages
51+
# with:
52+
# languages: go, javascript, csharp, python, cpp, java
53+
54+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55+
# If this step fails, then you should remove it and run the build manually (see below).
56+
- name: Autobuild
57+
uses: github/codeql-action/autobuild@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
58+
59+
# ℹ️ Command-line programs to run using the OS shell.
60+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
61+
62+
# ✏️ If the Autobuild fails above, remove it and uncomment the following
63+
# three lines and modify them (or add more) to build your code if your
64+
# project uses a compiled language
65+
66+
#- run: |
67+
# make bootstrap
68+
# make release
69+
70+
- name: Perform CodeQL Analysis
71+
uses: github/codeql-action/analyze@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11

Diff for: .github/workflows/deploy-prod-static.yml

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- v2
7+
workflow_dispatch:
8+
schedule:
9+
# https://crontab.guru/#0_12_*_*_1
10+
- cron: "0 12 * * 1"
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
build:
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30+
with:
31+
# Fetch the full history, to build attribution.json
32+
fetch-depth: 0
33+
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
34+
with:
35+
node-version: "18.x"
36+
37+
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
38+
39+
# Builds the modules, and boostraps the other modules
40+
- name: Build website
41+
run: |
42+
pnpm install
43+
pnpm docs-sync pull microsoft/TypeScript-Website-localizations#main 1
44+
pnpm bootstrap
45+
pnpm run --filter=typescriptlang-org setup-playground-cache-bust
46+
pnpm build
47+
48+
- name: Makes the site
49+
run: |
50+
pnpm build-site
51+
cp -r packages/typescriptlang-org/public site
52+
53+
- name: Setup Pages
54+
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
55+
56+
- name: Upload artifact
57+
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
58+
with:
59+
path: './site'
60+
61+
deploy:
62+
environment:
63+
name: github-pages
64+
url: ${{ steps.deployment.outputs.page_url }}
65+
runs-on: ubuntu-latest
66+
needs: build
67+
steps:
68+
- name: Deploy to GitHub Pages
69+
id: deployment
70+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4

Diff for: .github/workflows/publish-packages.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish packages
2+
3+
on:
4+
push:
5+
branches: [v2]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
concurrency: ${{ github.workflow }}-${{ github.ref }}
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
with:
21+
fetch-depth: 0
22+
filter: blob:none
23+
token: ${{ secrets.TS_BOT_TOKEN }}
24+
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
25+
with:
26+
node-version: "18.x"
27+
registry-url: "https://registry.npmjs.org/"
28+
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
29+
30+
- name: Prepare website v2
31+
run: |
32+
pnpm install
33+
pnpm bootstrap
34+
pnpm build
35+
36+
- uses: changesets/action@06245a4e0a36c064a573d4150030f5ec548e4fcc # v1.4.10
37+
with:
38+
publish: pnpm ci:publish
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.TS_BOT_TOKEN }}
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

Diff for: .github/workflows/weekly-stats.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish Weekly Stats
2+
3+
on:
4+
schedule:
5+
# https://crontab.guru/#0_12_*_*_1
6+
- cron: "0 12 * * 1"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
comments: write
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
19+
with:
20+
node-version: "18.x"
21+
22+
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
23+
24+
- run: pnpm install
25+
26+
# Update the site stats
27+
- run: node packages/typescriptlang-org/scripts/updateAppInsightsGitHubIssue.js
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
APP_INSIGHTS_API_KEY: ${{ secrets.APP_INSIGHTS_API_KEY }}
31+
APP_INSIGHTS_ID: ${{ secrets.APP_INSIGHTS_ID }}

Diff for: packages/documentation/copy/en/release-notes/TypeScript 4.9.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,8 @@ If this change impacts your library, you may need to add `types@` version select
481481
},
482482
"exports": {
483483
".": {
484-
+ "types@<4.8": "4.8-types/main.d.ts",
485-
+ "types": "modern-types/main.d.ts",
484+
+ "types@<4.8": "./4.8-types/main.d.ts",
485+
+ "types": "./modern-types/main.d.ts",
486486
"import": "./dist/main.js"
487487
}
488488
}

Diff for: packages/playground/src/sidebar/plugins.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export const optionsPlugin: PluginFactory = (i, utils) => {
8181
}
8282
customPlugins().forEach(module => {
8383
const li = document.createElement("li")
84-
li.innerHTML = module
84+
li.textContent = module
8585
const a = document.createElement("a")
8686
a.href = "#"
8787
a.textContent = "X"

0 commit comments

Comments
 (0)