Skip to content

Commit 2d41b3c

Browse files
tt1
Signed-off-by: Qingpeng Li <43924785+qingpeng9802@users.noreply.github.com> tt2 Signed-off-by: Qingpeng Li <43924785+qingpeng9802@users.noreply.github.com> tt3 Signed-off-by: Qingpeng Li <43924785+qingpeng9802@users.noreply.github.com> Bump the github-actions group with 3 updates (microsoft#3474) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 5d333d7 commit 2d41b3c

24 files changed

+1496
-2756
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
# Verify it compiles
4242
- run: pnpm build-site
4343

44-
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
44+
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
4545
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest'
4646
with:
4747
name: site
@@ -71,7 +71,7 @@ jobs:
7171
7272
- name: Upload diff artifact
7373
if: ${{ failure() && steps.check-diff.conclusion == 'failure' }}
74-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
74+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
7575
with:
7676
name: missing.patch
7777
path: missing.patch

.github/workflows/codeql.yml

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

4545
# Initializes the CodeQL tools for scanning.
4646
- name: Initialize CodeQL
47-
uses: github/codeql-action/init@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4.31.7
47+
uses: github/codeql-action/init@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8
4848
with:
4949
config-file: ./.github/codeql/codeql-configuration.yml
5050
# Override language selection by uncommenting this and choosing your languages
@@ -54,7 +54,7 @@ jobs:
5454
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5555
# If this step fails, then you should remove it and run the build manually (see below).
5656
- name: Autobuild
57-
uses: github/codeql-action/autobuild@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4.31.7
57+
uses: github/codeql-action/autobuild@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8
5858

5959
# ℹ️ Command-line programs to run using the OS shell.
6060
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -68,4 +68,4 @@ jobs:
6868
# make release
6969

7070
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4.31.7
71+
uses: github/codeql-action/analyze@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8

.github/workflows/deploy-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ jobs:
132132
133133
- name: Download site build from PR
134134
if: ${{ steps.get-info.outputs.result != 'null' }}
135-
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
135+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
136136
with:
137137
name: site
138138
path: site

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@
4545
},
4646
"patchedDependencies": {
4747
"react-server-dom-webpack@0.0.0-experimental-c8b778b7f-20220825": "patches/react-server-dom-webpack@0.0.0-experimental-c8b778b7f-20220825.patch",
48-
"react-intl@3.12.1": "patches/react-intl@3.12.1.patch",
49-
"gatsby-remark-shiki-twoslash@3.0.38": "patches/gatsby-remark-shiki-twoslash@3.0.38.patch"
48+
"react-intl@3.12.1": "patches/react-intl@3.12.1.patch"
5049
}
5150
},
5251
"jest": {

packages/tsconfig-reference/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"moduleResolution": "node",
55
"resolveJsonModule": true,
66
"allowSyntheticDefaultImports": true,
7-
"target": "es2019"
7+
"target": "es2019",
8+
"skipLibCheck": true,
89
}
910
}

packages/typescriptlang-org/gatsby-config.js renamed to packages/typescriptlang-org/gatsby-config.mjs

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
import { fileURLToPath } from 'url'
2+
import { dirname } from 'path'
3+
import { createRequire } from 'module'
4+
import rehypeShiki from '@shikijs/rehype'
5+
import { transformerTwoslash } from '@shikijs/twoslash'
6+
7+
const require = createRequire(import.meta.url)
8+
const __dirname = dirname(fileURLToPath(import.meta.url))
9+
110
if (process.env.BOOTSTRAPPING) {
211
const chalk = require("chalk")
312
const readline = require("readline")
@@ -14,16 +23,17 @@ if (process.env.BOOTSTRAPPING) {
1423

1524
require("./scripts/ensureDepsAreBuilt")
1625

17-
const ts = require("typescript");
18-
1926
// https://github.com/gatsbyjs/gatsby/issues/1457
2027
require("ts-node").register({ files: true })
21-
const { join } = require("path")
2228

23-
module.exports = {
29+
export default {
2430
siteMetadata: {
2531
siteUrl: `https://www.typescriptlang.org/`,
2632
},
33+
graphqlTypegen: {
34+
// Ensure it works in a monorepo
35+
typesOutputPath: `${__dirname}/src/__generated__/gatsby-types.ts`,
36+
},
2737
flags: {
2838
DEV_SSR: false,
2939
},
@@ -52,17 +62,6 @@ module.exports = {
5262
// Support for downloading or pre-caching pages, needed for PWAs
5363
// "gatsby-plugin-offline",
5464

55-
// Creates TS types for queries during `gatsby dev`
56-
{
57-
resolve: "gatsby-plugin-typegen",
58-
options: {
59-
// Ensure it works in a monorepo
60-
outputPath: __dirname + "/src/__generated__/gatsby-types.ts",
61-
},
62-
},
63-
64-
// Support ts/tsx files in src
65-
"gatsby-plugin-typescript",
6665
// SEO
6766
{
6867
resolve: `gatsby-plugin-sitemap`,
@@ -134,41 +133,42 @@ module.exports = {
134133
},
135134

136135
// Markdown support, and markdown + react
137-
// `gatsby-plugin-mdx`,
138136
{
139-
resolve: `gatsby-transformer-remark`,
137+
resolve: `gatsby-plugin-mdx`,
140138
options: {
141-
plugins: [
142-
{
143-
resolve: `gatsby-remark-images`,
144-
options: {
145-
maxWidth: 590,
146-
},
147-
},
148-
{
149-
resolve: `gatsby-remark-responsive-iframe`,
150-
options: {
151-
wrapperStyle: `margin-bottom: 1.0725rem`,
152-
},
153-
},
154-
"gatsby-remark-autolink-headers",
155-
{
156-
resolve: "gatsby-remark-shiki-twoslash",
157-
options: {
158-
theme: require("./lib/themes/typescript-beta-light.json"),
159-
addTryButton: true,
160-
defaultOptions: {
161-
noErrorValidation: true,
139+
extensions: [`.md`, `.mdx`],
140+
mdxOptions: {
141+
extensions: [`.md`, `.mdx`],
142+
remarkPlugins: [
143+
{
144+
resolve: `gatsby-remark-images`,
145+
options: {
146+
maxWidth: 590,
162147
},
163-
defaultCompilerOptions: {
164-
types: [],
165-
target: ts.ScriptTarget.ES2020,
148+
},
149+
{
150+
resolve: `gatsby-remark-responsive-iframe`,
151+
options: {
152+
wrapperStyle: `margin-bottom: 1.0725rem`,
166153
},
167154
},
168-
},
169-
"gatsby-remark-copy-linked-files",
170-
"gatsby-remark-smartypants",
171-
],
155+
"gatsby-remark-autolink-headers",
156+
"gatsby-remark-copy-linked-files",
157+
"gatsby-remark-smartypants",
158+
],
159+
rehypePlugins: [
160+
[
161+
rehypeShiki,
162+
{
163+
themes: {
164+
light: 'light-plus',
165+
dark: 'dark-plus',
166+
},
167+
transformers: [transformerTwoslash({explicitTrigger: true})],
168+
},
169+
],
170+
],
171+
},
172172
},
173173
},
174174
// Finds auto-generated <a>s and converts them

packages/typescriptlang-org/lib/bootup/ingestion/createGlossaryPages.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ export const createGlossaryPages = async (
2121
name
2222
modifiedTime
2323
absolutePath
24+
internal {
25+
contentFilePath
26+
}
2427
}
2528
}
2629
}
@@ -46,7 +49,7 @@ export const createGlossaryPages = async (
4649

4750
createPage({
4851
path: pagePath,
49-
component: GlossaryTemplatePath,
52+
component: `${GlossaryTemplatePath}?__contentFilePath=${element.internal.contentFilePath}`,
5053
context: {
5154
locale: element.name,
5255
glossaryPath: element.absolutePath,

packages/typescriptlang-org/lib/bootup/ingestion/createPagesForDocumentation.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@ export const createDocumentationPages = async (
3232
modifiedTime
3333
absolutePath
3434
35-
childMarkdownRemark {
35+
childMdx {
3636
frontmatter {
3737
permalink
3838
}
3939
}
40+
internal {
41+
contentFilePath
42+
}
4043
}
4144
}
4245
}
@@ -66,7 +69,7 @@ export const createDocumentationPages = async (
6669
}
6770

6871
docs.forEach((post: any) => {
69-
const permalink = post.childMarkdownRemark.frontmatter.permalink
72+
const permalink = post.childMdx.frontmatter.permalink
7073
if (!permalink)
7174
// prettier-ignore
7275
throw new Error(`Did not find a permalink for page: ${JSON.stringify(post)}`)
@@ -90,29 +93,29 @@ export const createDocumentationPages = async (
9093
if (previousPath) {
9194
const path = getPreviousPageID(handbookNav, id)!.path
9295
// prettier-ignore
93-
const previousDoc = docs.find((d) => d.childMarkdownRemark.frontmatter.permalink === path)
96+
const previousDoc = docs.find((d) => d.childMdx.frontmatter.permalink === path)
9497
if (previousDoc) previousID = previousDoc.id
9598
}
9699

97100
const nextPath = getNextPageID(handbookNav, id)
98101
if (nextPath) {
99102
const path = getNextPageID(handbookNav, id)!.path
100103
// prettier-ignore
101-
const nextDoc = docs.find((d) => d.childMarkdownRemark.frontmatter.permalink === path)
104+
const nextDoc = docs.find((d) => d.childMdx.frontmatter.permalink === path)
102105
if (nextDoc) nextID = nextDoc.id
103106
}
104107
}
105108

106109
const repoRoot = path.join(process.cwd(), "..", "..")
107110
const repoPath = post.absolutePath.replace(repoRoot, "")
108111

109-
if (post.childMarkdownRemark) {
110-
const path = post.childMarkdownRemark.frontmatter.permalink
112+
if (post.childMdx) {
113+
const path = post.childMdx.frontmatter.permalink
111114
addPathToSite(path)
112115

113116
createPage({
114117
path,
115-
component: handbookPage,
118+
component: `${handbookPage}?__contentFilePath=${post.internal.contentFilePath}`,
116119
context: {
117120
id: id,
118121
slug: path,

packages/typescriptlang-org/lib/bootup/ingestion/createPlaygroundExamplePages.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ export const createPlaygroundExamplePages = async (
2424
nodes {
2525
name
2626
relativePath
27+
internal {
28+
contentFilePath
29+
}
2730
}
2831
}
2932
}
@@ -73,7 +76,7 @@ export const createPlaygroundExamplePages = async (
7376

7477
createPage({
7578
path: newPagePath + ".html",
76-
component: playPage,
79+
component: `${playPage}?__contentFilePath=${example.internal.contentFilePath}`,
7780
context: {
7881
name,
7982
title: inlineTitle || name,

packages/typescriptlang-org/lib/bootup/ingestion/createPlaygroundHandbook.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export const createPlaygroundHandbookPages = async (
2121
id
2222
name
2323
absolutePath
24-
childMarkdownRemark {
25-
html
24+
internal {
25+
contentFilePath
2626
}
2727
}
2828
}
@@ -58,11 +58,10 @@ export const createPlaygroundHandbookPages = async (
5858
const url = `/_playground-handbook/${id}`
5959
createPage({
6060
path: url + ".html",
61-
component: path.resolve(`./src/templates/playgroundHandbook.tsx`),
61+
component: `${path.resolve(`./src/templates/playgroundHandbook.tsx`)}?__contentFilePath=${option.internal.contentFilePath}`,
6262
context: {
6363
title: option.name,
6464
lang: "en",
65-
html: option.childMarkdownRemark.html,
6665
},
6766
})
6867
})

0 commit comments

Comments
 (0)