diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 222882b20196..593f5ff48bab 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -45,7 +45,7 @@ jobs: if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' with: name: site - path: packages/typescriptlang-org/public + path: packages/typescriptlang-org/dist # Run all the package's tests - run: pnpm test diff --git a/.github/workflows/deploy-prod-static.yml b/.github/workflows/deploy-prod-static.yml index 72aaa2ec79a8..7d3d04cfeefb 100644 --- a/.github/workflows/deploy-prod-static.yml +++ b/.github/workflows/deploy-prod-static.yml @@ -49,7 +49,7 @@ jobs: - name: Makes the site run: | pnpm build-site - cp -r packages/typescriptlang-org/public site + cp -r packages/typescriptlang-org/dist site - name: Setup Pages uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 diff --git a/.gitignore b/.gitignore index 5cc7faa8b479..9bf3a57499b4 100644 --- a/.gitignore +++ b/.gitignore @@ -88,3 +88,5 @@ packages/typescriptlang-org/src/lib/documentationNavigation.ts !**/.vscode/extensions.json *.tsbuildinfo +# astro +.astro/ \ No newline at end of file diff --git a/package.json b/package.json index 21b31ec901ee..4cbcd53090c5 100644 --- a/package.json +++ b/package.json @@ -44,9 +44,7 @@ "sharp": "0.28.1" }, "patchedDependencies": { - "react-server-dom-webpack@0.0.0-experimental-c8b778b7f-20220825": "patches/react-server-dom-webpack@0.0.0-experimental-c8b778b7f-20220825.patch", - "react-intl@3.12.1": "patches/react-intl@3.12.1.patch", - "gatsby-remark-shiki-twoslash@3.0.38": "patches/gatsby-remark-shiki-twoslash@3.0.38.patch" + "react-intl@3.12.1": "patches/react-intl@3.12.1.patch" } }, "jest": { @@ -62,7 +60,7 @@ "build-site": "pnpm run --filter=typescriptlang-org build", "compile": "pnpm run --filter=typescriptlang-org tsc", "update-snapshots": "pnpm run --filter=typescriptlang-org update-snapshots", - "clean": "pnpm run --filter=typescriptlang-org gatsby clean", + "clean": "pnpm run --filter=typescriptlang-org clean", "clean-twoslash": "rm -rf packages/.cache/twoslash", "test": "CI=true pnpm -r run test", "update-test-snapshots": "CI=true pnpm run --filter=@typescript/twoslash --filter=@typescript/vfs test -u" diff --git a/packages/playground-examples/scripts/copyFiles.js b/packages/playground-examples/scripts/copyFiles.js index 057d30c95356..d1ca36b03444 100644 --- a/packages/playground-examples/scripts/copyFiles.js +++ b/packages/playground-examples/scripts/copyFiles.js @@ -7,9 +7,9 @@ const fse = require("fs-extra"); const copyDir = join(__dirname, "..", "copy"); const jsonDir = join(__dirname, "..", "generated"); -const outDir = join(__dirname, "..", "..", "typescriptlang-org", "static", "js", "examples"); +const outDir = join(__dirname, "..", "..", "typescriptlang-org", "public", "js", "examples"); -if (!existsSync(outDir)) execSync(`mkdir ${outDir}`); +if (!existsSync(outDir)) execSync(`mkdir -p ${outDir}`); // Move samples fse.copySync(copyDir, outDir); diff --git a/packages/playground-worker/package.json b/packages/playground-worker/package.json index c5bdb62ab500..139750dc0e11 100644 --- a/packages/playground-worker/package.json +++ b/packages/playground-worker/package.json @@ -4,7 +4,7 @@ "license": "MIT", "private": true, "scripts": { - "build": "esbuild index.ts --outdir=../typescriptlang-org/static/js/playground-worker --format=esm --target=es2020 --bundle" + "build": "esbuild index.ts --outdir=../typescriptlang-org/public/js/playground-worker --format=esm --target=es2020 --bundle" }, "dependencies": { "esbuild": "^0.17.8" diff --git a/packages/playground/package.json b/packages/playground/package.json index e3a862f30744..c2ff607671e3 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -4,13 +4,13 @@ "main": "dist/index.js", "license": "MIT", "private": true, - "types": "../../typescriptlang-org/static/js/playground/index.d.ts", + "types": "../../typescriptlang-org/public/js/playground/index.d.ts", "files": [ "dist" ], "scripts": { "//bootstrap": "node scripts/getListOfPluginsFromNPM.js", - "build-fast-test": "esbuild src/index.ts --outdir=../typescriptlang-org/static/js/playground/2 --format=esm --target=es2020 --bundle", + "build-fast-test": "esbuild src/index.ts --outdir=../typescriptlang-org/public/js/playground/2 --format=esm --target=es2020 --bundle", "build": "tsc", "test": "jest" }, diff --git a/packages/playground/tsconfig.json b/packages/playground/tsconfig.json index 885a5495a406..139e1753990c 100644 --- a/packages/playground/tsconfig.json +++ b/packages/playground/tsconfig.json @@ -1,7 +1,7 @@ { "include": ["src"], "compilerOptions": { - "outDir": "../typescriptlang-org/static/js/playground", + "outDir": "../typescriptlang-org/public/js/playground", "jsx": "react", "target": "ES2016", "module": "AMD", diff --git a/packages/sandbox/tsconfig.json b/packages/sandbox/tsconfig.json index 2612cde3e8a0..7ab674649ab9 100644 --- a/packages/sandbox/tsconfig.json +++ b/packages/sandbox/tsconfig.json @@ -2,7 +2,7 @@ "include": ["src", "src/vendor/lzstring.min.js"], "compilerOptions": { - "outDir": "../typescriptlang-org/static/js/sandbox", + "outDir": "../typescriptlang-org/public/js/sandbox", "target": "ES2016", "module": "AMD", "lib": ["DOM", "esnext"], diff --git a/packages/tsconfig-reference/scripts/tsconfig/generateMarkdown.ts b/packages/tsconfig-reference/scripts/tsconfig/generateMarkdown.ts index 6c338f6f8966..a6f9aa873832 100644 --- a/packages/tsconfig-reference/scripts/tsconfig/generateMarkdown.ts +++ b/packages/tsconfig-reference/scripts/tsconfig/generateMarkdown.ts @@ -318,7 +318,7 @@ languages.forEach((lang) => { JSON.stringify({ options: optionsSummary }) ); - const jsonDir = new URL("../../../typescriptlang-org/static/js/json/", import.meta.url); + const jsonDir = new URL("../../../typescriptlang-org/public/js/json/", import.meta.url); if (!existsSync(jsonDir)) mkdirSync(jsonDir); // This is used by the tsconfig popups diff --git a/packages/tsconfig-reference/tsconfig.json b/packages/tsconfig-reference/tsconfig.json index 07b6e09075f4..4ce51d268fae 100644 --- a/packages/tsconfig-reference/tsconfig.json +++ b/packages/tsconfig-reference/tsconfig.json @@ -4,6 +4,7 @@ "moduleResolution": "node", "resolveJsonModule": true, "allowSyntheticDefaultImports": true, - "target": "es2019" + "target": "es2019", + "skipLibCheck": true } } diff --git a/packages/typescriptlang-org/.gitignore b/packages/typescriptlang-org/.gitignore index e28b807d548f..aafd22f33d56 100644 --- a/packages/typescriptlang-org/.gitignore +++ b/packages/typescriptlang-org/.gitignore @@ -58,6 +58,9 @@ typings/ .cache/ public +# astro +.astro/ + # Mac files .DS_Store @@ -73,14 +76,14 @@ schema.json apollo.config.js # Build artifacts -static/js/sandbox/ -!static/js/sandbox/.gitkeep -static/js/playground/ -!static/js/playground/.gitkeep -static/js/examples/ -!static/js/examples/.gitkeep -static/js/json -static/js/playground-worker/ +public/js/sandbox/ +!public/js/sandbox/.gitkeep +public/js/playground/ +!public/js/playground/.gitkeep +public/js/examples/ +!public/js/examples/.gitkeep +public/js/json +public/js/playground-worker/ .now @@ -88,8 +91,8 @@ static/js/playground-worker/ src/__generated__/* # gatsby-plugin-typegen doesn't create this file when CI=true !src/__generated__/gatsby-types.ts -static/assets/typescript-handbook.epub -static/assets/typescript-handbook.pdf +public/assets/typescript-handbook.epub +public/assets/typescript-handbook.pdf /src/lib/release-info.json diff --git a/packages/typescriptlang-org/astro.config.mjs b/packages/typescriptlang-org/astro.config.mjs new file mode 100644 index 000000000000..c8e6e1a5d420 --- /dev/null +++ b/packages/typescriptlang-org/astro.config.mjs @@ -0,0 +1,55 @@ +import { defineConfig } from 'astro/config'; +import react from '@astrojs/react'; +import sitemap from '@astrojs/sitemap'; +import { DOMParser } from 'xmldom'; + +// Polyfill DOMParser for SSR so react-intl can format rich text messages +// (equivalent to the old gatsby-ssr.js polyfill) +globalThis.DOMParser = DOMParser; + +export default defineConfig({ + site: 'https://www.typescriptlang.org', + integrations: [ + react(), + sitemap({ + filter: (page) => + !page.includes('/glossary') && !page.includes('/vo/'), + }), + ], + build: { + format: 'file', + }, + trailingSlash: 'ignore', + redirects: { + '/Tutorial': '/docs', + '/Handbook': '/docs', + '/samples': '/docs', + '/docs/home.html': '/docs', + '/playground': '/play/', + '/docs/home': '/docs', + '/docs/handbook/writing-declaration-files': '/docs/handbook/declaration-files/introduction.html', + '/docs/handbook/writing-declaration-files.html': '/docs/handbook/declaration-files/introduction.html', + '/docs/handbook/writing-definition-files': '/docs/handbook/declaration-files/introduction.html', + '/docs/handbook/typings-for-npm-packages': '/docs/handbook/declaration-files/publishing.html', + '/docs/tutorial.html': '/docs/', + '/docs/handbook/release-notes': '/docs/', + '/docs/handbook/release-notes/overview': '/docs/', + '/docs/handbook/release-notes/overview.html': '/docs', + '/docs/handbook/react-&-webpack.html': 'https://webpack.js.org/guides/typescript/', + '/docs/bootstrap': '/docs/', + '/docs/handbook/esm-node': '/docs/handbook/modules/reference.html#node16-node18-node20-nodenext', + '/docs/handbook/esm-node.html': '/docs/handbook/modules/reference.html#node16-node18-node20-nodenext', + '/docs/handbook/modules': '/docs/handbook/modules/introduction.html', + '/docs/handbook/modules.html': '/docs/handbook/modules/introduction.html', + '/docs/handbook/module-resolution': '/docs/handbook/modules/theory.html#module-resolution', + '/docs/handbook/module-resolution.html': '/docs/handbook/modules/theory.html#module-resolution', + }, + vite: { + resolve: { + dedupe: ['react', 'react-dom'], + }, + ssr: { + noExternal: ['react-intl', 'intl-format-cache', 'intl-messageformat', 'intl-messageformat-parser', '@formatjs/intl-utils'], + }, + }, +}); diff --git a/packages/typescriptlang-org/gatsby-config.js b/packages/typescriptlang-org/gatsby-config.js index 1322dfda213a..e369e26b1901 100644 --- a/packages/typescriptlang-org/gatsby-config.js +++ b/packages/typescriptlang-org/gatsby-config.js @@ -45,7 +45,7 @@ module.exports = { background_color: `white`, theme_color: `#3178C6`, display: `standalone`, - icon: `static/icons/ts-logo-512.png`, + icon: `public/icons/ts-logo-512.png`, }, }, diff --git a/packages/typescriptlang-org/lib/bootup/createPages.ts b/packages/typescriptlang-org/lib/bootup/createPages.ts deleted file mode 100644 index 355a6957ff94..000000000000 --- a/packages/typescriptlang-org/lib/bootup/createPages.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { setupRedirects } from "../../src/redirects/setupRedirects" -import { createDocumentationPages } from "./ingestion/createPagesForDocumentation" -import { createTSConfigReference } from "./ingestion/createTSConfigReference" - -import { GatsbyNode } from "gatsby" -import { createPlaygrounds } from "./ingestion/createPlaygrounds" -import { createPlaygroundExamplePages } from "./ingestion/createPlaygroundExamplePages" -import { createRootPagesLocalized } from "./ingestion/createRootPagesLocalized" -import { createGlossaryPages } from "./ingestion/createGlossaryPages" -import { createTSConfigSingleFlagPages } from "./ingestion/createTSConfigSingleFlagPages" -import { createPlaygroundHandbookPages } from "./ingestion/createPlaygroundHandbook" - -export const createPages: GatsbyNode["createPages"] = async args => { - // Basically this function should be passing the right - // functions down to other places to handle their own - // creation of the pages - - setupRedirects(args.actions.createRedirect) - await createDocumentationPages(args.graphql, args.actions.createPage) - await createTSConfigReference(args.graphql, args.actions.createPage) - await createGlossaryPages(args.graphql, args.actions.createPage) - await createPlaygrounds(args.graphql, args.actions.createPage) - await createPlaygroundExamplePages(args.graphql, args.actions.createPage) - await createTSConfigSingleFlagPages(args.graphql, args.actions.createPage) - await createRootPagesLocalized(args.graphql, args.actions.createPage) - await createPlaygroundHandbookPages(args.graphql, args.actions.createPage) - - return undefined -} diff --git a/packages/typescriptlang-org/lib/bootup/ingestion/createGlossaryPages.ts b/packages/typescriptlang-org/lib/bootup/ingestion/createGlossaryPages.ts deleted file mode 100644 index faff8b70d353..000000000000 --- a/packages/typescriptlang-org/lib/bootup/ingestion/createGlossaryPages.ts +++ /dev/null @@ -1,57 +0,0 @@ -const path = require(`path`) -const { green } = require("chalk") -const { readFileSync } = require("fs") - -import { NodePluginArgs, CreatePagesArgs } from "gatsby" -import { addPathToSite } from "../pathsOnSiteTracker" -import { isMultiLingual } from "./languageFilter" - -export const createGlossaryPages = async ( - graphql: CreatePagesArgs["graphql"], - createPage: NodePluginArgs["actions"]["createPage"] -) => { - console.log(`${green("success")} Creating Glossary pages`) - const GlossaryTemplatePath = path.resolve(`./src/templates/glossary.tsx`) - const result = await graphql(` - query GetAllHandbookDocs { - allFile( - filter: { sourceInstanceName: { eq: "glossary" }, ext: { eq: ".md" } } - ) { - nodes { - name - modifiedTime - absolutePath - } - } - } - `) - - if (result.errors) { - throw result.errors - } - - const anyData = result.data as any - const docs = anyData.allFile.nodes - - docs.forEach(element => { - const lang = element.name - if (!isMultiLingual && lang !== "en") return - - // prettier-ignore - const termsForLang = JSON.parse(readFileSync(path.join( __dirname, "..", "..", "..", "..", "glossary", "output", element.name + ".json"), "utf8")) - - // Support urls being consistent with the current infra, e.g. en with no prefix - const pagePath = (lang === "en" ? "" : "/" + lang) + "/glossary" - addPathToSite(pagePath) - - createPage({ - path: pagePath, - component: GlossaryTemplatePath, - context: { - locale: element.name, - glossaryPath: element.absolutePath, - languageMeta: termsForLang, - }, - }) - }) -} diff --git a/packages/typescriptlang-org/lib/bootup/ingestion/createPagesForDocumentation.ts b/packages/typescriptlang-org/lib/bootup/ingestion/createPagesForDocumentation.ts deleted file mode 100644 index 3b981d654a08..000000000000 --- a/packages/typescriptlang-org/lib/bootup/ingestion/createPagesForDocumentation.ts +++ /dev/null @@ -1,130 +0,0 @@ -const path = require(`path`) -const fs = require(`fs`) -const { green } = require("chalk") -import { NodePluginArgs, CreatePagesArgs } from "gatsby" -import { getDocumentationNavForLanguage } from "../../../src/lib/documentationNavigation" -import { - getNextPageID, - getPreviousPageID, - SidebarNavItem, -} from "../../../src/lib/documentationNavigationUtils" -import { addPathToSite } from "../pathsOnSiteTracker" -import { isMultiLingual } from "./languageFilter" - -export const createDocumentationPages = async ( - graphql: CreatePagesArgs["graphql"], - createPage: NodePluginArgs["actions"]["createPage"] -) => { - console.log(`${green("success")} Creating Documentation Pages`) - const handbookPage = path.resolve(`./src/templates/documentation.tsx`) - const result = await graphql(` - query GetAllHandbookDocs { - allFile( - filter: { - sourceInstanceName: { eq: "documentation" } - extension: { eq: "md" } - relativeDirectory: { ne: "en/modules-reference/diagrams" } - } - ) { - nodes { - id - name - modifiedTime - absolutePath - - childMarkdownRemark { - frontmatter { - permalink - } - } - } - } - } - `) - - if (result.errors) { - throw result.errors - } - - // prettier-ignore - const documentationCopyPath = path.join(__dirname, "..", "..", "..", "..", "documentation", "copy") - const langs = fs - .readdirSync(documentationCopyPath) - .filter(f => fs.statSync(path.join(documentationCopyPath, f)).isDirectory()) - - const anyData = result.data as any - const docs = anyData.allFile.nodes as any - - const findWithPage = (item: SidebarNavItem, permalink: string) => { - if (item.permalink === permalink) return item.id - if (!item.items) return false - for (const subItem of item.items) { - const foundID = findWithPage(subItem, permalink) - if (foundID) return foundID - } - return undefined - } - - docs.forEach((post: any) => { - const permalink = post.childMarkdownRemark.frontmatter.permalink - if (!permalink) - // prettier-ignore - throw new Error(`Did not find a permalink for page: ${JSON.stringify(post)}`) - - const lang = langs.find(l => permalink.startsWith("/" + l + "/")) || "en" - if (!isMultiLingual && lang !== "en") return - - const handbookNav = getDocumentationNavForLanguage(lang) - - const fakeTopRoot = { - id: "if-you-see-this-there-is-a-bug", - items: handbookNav, - title: "misc", - } - const id = findWithPage(fakeTopRoot, permalink) - - let previousID = null - let nextID = null - if (id) { - const previousPath = getPreviousPageID(handbookNav, id) - if (previousPath) { - const path = getPreviousPageID(handbookNav, id)!.path - // prettier-ignore - const previousDoc = docs.find((d) => d.childMarkdownRemark.frontmatter.permalink === path) - if (previousDoc) previousID = previousDoc.id - } - - const nextPath = getNextPageID(handbookNav, id) - if (nextPath) { - const path = getNextPageID(handbookNav, id)!.path - // prettier-ignore - const nextDoc = docs.find((d) => d.childMarkdownRemark.frontmatter.permalink === path) - if (nextDoc) nextID = nextDoc.id - } - } - - const repoRoot = path.join(process.cwd(), "..", "..") - const repoPath = post.absolutePath.replace(repoRoot, "") - - if (post.childMarkdownRemark) { - const path = post.childMarkdownRemark.frontmatter.permalink - addPathToSite(path) - - createPage({ - path, - component: handbookPage, - context: { - id: id, - slug: path, - repoPath, - previousID, - nextID, - lang, - modifiedTime: post.modifiedTime, - }, - }) - } else { - console.log(`skipping page generation for ${post.name}`) - } - }) -} diff --git a/packages/typescriptlang-org/lib/bootup/ingestion/createPlaygroundExamplePages.ts b/packages/typescriptlang-org/lib/bootup/ingestion/createPlaygroundExamplePages.ts deleted file mode 100644 index d260a748d5c1..000000000000 --- a/packages/typescriptlang-org/lib/bootup/ingestion/createPlaygroundExamplePages.ts +++ /dev/null @@ -1,130 +0,0 @@ -import path from "path" -import fs from "fs" -const { green } = require("chalk") - -import { NodePluginArgs, CreatePagesArgs, withPrefix } from "gatsby" -import { invertCodeToHTML } from "../../utils/invertCodeToHTML" -import { isMultiLingual } from "./languageFilter" - -export const createPlaygroundExamplePages = async ( - graphql: CreatePagesArgs["graphql"], - createPage: NodePluginArgs["actions"]["createPage"] -) => { - console.log(`${green("success")} Creating Playground Example Pages`) - - const playPage = path.resolve(`./src/templates/play-example.tsx`) - const result = await graphql(` - query GetAllPlaygroundSamples { - allFile( - filter: { - sourceInstanceName: { eq: "all-playground-examples" } - extension: { in: ["js", "ts"] } - } - ) { - nodes { - name - relativePath - } - } - } - `) - - if (result.errors) { - throw result.errors - } - - const anyData = result.data as any - const docs = anyData.allFile.nodes - - // { - // "name": "Code Flow", - // "relativePath": "vo/JavaScript/JavaScript Essentials/Code Flow.ts" - // } - - docs.forEach(example => { - const rPath = example.relativePath - const name = example.name - const idize = string => - string - .toLowerCase() - .replace(/[^\x00-\x7F]/g, "-") - .replace(/ /g, "-") - .replace(/\//g, "-") - .replace(/\+/g, "-") - - const language = rPath.split("/")[0] - if (!isMultiLingual && language !== "en") return - - const postLangPath = rPath.split("/").slice(1).map(idize).join("/") - - const langPrefix = language === "en" ? "" : language - const newPagePath = langPrefix + "/play/" + postLangPath - - const appRoot = path.join(__dirname, "..", "..", "..", "..") - // prettier-ignore - const exampleCodePath = path.join(appRoot, "playground-examples", "copy", rPath) - const code = fs.readFileSync(exampleCodePath, "utf8") - - const id = postLangPath.split("/").slice(-1)[0].split(".")[0] - - const { inlineTitle, compilerSettings } = getCompilerDetailsFromCode(code) - - // Intentionally not adding addPathToSite here - - createPage({ - path: newPagePath + ".html", - component: playPage, - context: { - name, - title: inlineTitle || name, - lang: language, - html: invertCodeToHTML(code), - redirectHref: hrefForExample({ name, compilerSettings, id }, language), - }, - }) - }) -} - -const hrefForExample = ( - example: { name: string; compilerSettings: any; id: string }, - lang: string -) => { - const isJS = example.name.indexOf(".js") !== -1 - const prefix = isJS ? "filetype=js" : "" - const hash = "example/" + example.id - const params = example.compilerSettings || {} - const queryParams = Object.keys(params) - .map(key => key + "=" + params[key]) - .join("&") - - const langURL = lang === "en" ? "" : lang - return `${langURL}/play/?${prefix + queryParams}#${hash}` -} - -const getCompilerDetailsFromCode = (contents: string) => { - let compilerSettings = {} - let inlineTitle = undefined - - if (contents.startsWith("//// {")) { - // convert windows newlines to linux new lines - const preJSON = contents - .replace(/\r\n/g, "\n") - .split("//// {")[1] - .split("}\n")[0] - contents = contents.split("\n").slice(1).join("\n") - const code = "{" + preJSON + "}" - - try { - const obj = JSON.parse(code) - if (obj.title) { - inlineTitle = obj.title - delete obj.title - } - compilerSettings = obj.compiler - } catch (err) { - console.error("Issue with: ", code) - throw err - } - } - return { compilerSettings, inlineTitle } -} diff --git a/packages/typescriptlang-org/lib/bootup/ingestion/createPlaygroundHandbook.ts b/packages/typescriptlang-org/lib/bootup/ingestion/createPlaygroundHandbook.ts deleted file mode 100644 index 90763b54e224..000000000000 --- a/packages/typescriptlang-org/lib/bootup/ingestion/createPlaygroundHandbook.ts +++ /dev/null @@ -1,69 +0,0 @@ -import path from "path" -const { green } = require("chalk") - -import { NodePluginArgs, CreatePagesArgs, withPrefix } from "gatsby" - -export const createPlaygroundHandbookPages = async ( - graphql: CreatePagesArgs["graphql"], - createPage: NodePluginArgs["actions"]["createPage"] -) => { - console.log(`${green("success")} Creating Playground Handbook Pages`) - - const result = await graphql(` - query GetAllHandbookDocs { - allFile( - filter: { - sourceInstanceName: { eq: "playground-handbook" } - extension: { eq: "md" } - } - ) { - nodes { - id - name - absolutePath - childMarkdownRemark { - html - } - } - } - } - `) - - if (result.errors) { - throw result.errors - } - - const anyData = result.data as any - const options = anyData.allFile.nodes - - // { - // "id": "419262d5-8911-5ad4-a7a2-91a318ad0e1f", - // "name": "allowJs", - // "absolutePath": "/Users/ortatherox/dev/typescript/new-website/packages/tsconfig-reference/copy/en/options/allowJs.md" - // "html": "..." - // }, - - options.forEach(option => { - // Intentionally not adding addPathToSite here - - const idize = string => - string - .toLowerCase() - .replace(/[^\x00-\x7F]/g, "-") - .replace(/ /g, "-") - .replace(/\//g, "-") - .replace(/\+/g, "-") - - const id = idize(path.basename(option.absolutePath.replace(".md", ""))) - const url = `/_playground-handbook/${id}` - createPage({ - path: url + ".html", - component: path.resolve(`./src/templates/playgroundHandbook.tsx`), - context: { - title: option.name, - lang: "en", - html: option.childMarkdownRemark.html, - }, - }) - }) -} diff --git a/packages/typescriptlang-org/lib/bootup/ingestion/createPlaygrounds.ts b/packages/typescriptlang-org/lib/bootup/ingestion/createPlaygrounds.ts deleted file mode 100644 index a093a18a2ce0..000000000000 --- a/packages/typescriptlang-org/lib/bootup/ingestion/createPlaygrounds.ts +++ /dev/null @@ -1,76 +0,0 @@ -const path = require(`path`) -const fs = require(`fs`) -const { green } = require("chalk") - -import { NodePluginArgs, CreatePagesArgs } from "gatsby" -import { addPathToSite } from "../pathsOnSiteTracker" -import { isMultiLingual } from "./languageFilter" - -export const createPlaygrounds = async ( - graphql: CreatePagesArgs["graphql"], - createPage: NodePluginArgs["actions"]["createPage"] -) => { - console.log(`${green("success")} Creating Playground Pages`) - - const playPage = path.resolve(`./src/templates/play.tsx`) - const result = await graphql(` - query GetAllPlaygroundLocalizations { - allFile( - filter: { - sourceInstanceName: { eq: "playground-examples" } - ext: { eq: ".json" } - } - ) { - nodes { - name - } - } - } - `) - - if (result.errors) { - throw result.errors - } - - const anyData = result.data as any - const docs = anyData.allFile.nodes - - docs.forEach(lang => { - if (!isMultiLingual && lang !== "en") return - - const appRoot = path.join(__dirname, "..", "..", "..", "..") - - const examplesForLang = path.join(appRoot, "playground-examples", "generated", lang.name + ".json") - const examplesTOC = JSON.parse(fs.readFileSync(examplesForLang, "utf8")) - - const playgroundHandbookTOCPath = path.join(appRoot, "playground-handbook", "output", "play-handbook.json") - const playgroundHandbookTOC = JSON.parse(fs.readFileSync(playgroundHandbookTOCPath, "utf8")) - - // prettier-ignore - const compilerOptsForLang = path.join(appRoot, "tsconfig-reference", "output", lang.name + "-summary.json") - // prettier-ignore - const compilerOptsForLangFallback = path.join(appRoot, "tsconfig-reference", "output", "en-summary.json") - - const hasOptsForLang = fs.existsSync(compilerOptsForLang) - const optionsPath = hasOptsForLang - ? compilerOptsForLang - : compilerOptsForLangFallback - - const optionsSummary = JSON.parse(fs.readFileSync(optionsPath, "utf8")) - .options - - const pathName = lang.name === "en" ? "/play" : `/${lang.name}/play` - addPathToSite(pathName) - - createPage({ - path: pathName, - component: playPage, - context: { - lang: lang.name, - examplesTOC, - optionsSummary, - playgroundHandbookTOC - }, - }) - }) -} diff --git a/packages/typescriptlang-org/lib/bootup/ingestion/createRootPagesLocalized.ts b/packages/typescriptlang-org/lib/bootup/ingestion/createRootPagesLocalized.ts deleted file mode 100644 index e3210d7feae4..000000000000 --- a/packages/typescriptlang-org/lib/bootup/ingestion/createRootPagesLocalized.ts +++ /dev/null @@ -1,81 +0,0 @@ -import path from "path" -import fs from "fs" -const { green } = require("chalk") - -import { NodePluginArgs, CreatePagesArgs } from "gatsby" -import { recursiveReadDirSync } from "../../utils/recursiveReadDirSync" -import { isMultiLingual } from "./languageFilter" -import { addPathToSite } from "../pathsOnSiteTracker" - -/** - * Basically you can have a set of files in src/templates/pages - * and we'll make a language prefixed version of it when there are languages - * in the copy dir. - */ - -export const createRootPagesLocalized = async ( - graphql: CreatePagesArgs["graphql"], - createPage: NodePluginArgs["actions"]["createPage"] -) => { - console.log(`${green("success")} Creating Internationalized Pages`) - - // prettier-ignore - const rootPagesDir = path.join(__dirname, "..", "..", "..", "src", "templates", "pages") - const languageRootDir = path.join(__dirname, "..", "..", "..", "src", "copy") - - const langs = fs - .readdirSync(languageRootDir) - .filter( - f => - !( - f.endsWith(".ts") || - f.endsWith(".ts") || - f.endsWith(".md") || - f.startsWith(".") - ) - ) - - const files = recursiveReadDirSync(rootPagesDir) - .filter(f => !f.startsWith(".")) // only useful files - .filter(f => !f.includes("dev") && !f.includes("css")) // skip these - - files.forEach(f => { - const fullpath = path - .join(__dirname, "..", "..", "..", "..", f) - .replace("..//", "../") - let originalSitePath = path - .relative(rootPagesDir, fullpath) - .replace(/.tsx$/g, "") - - // Remove the index files - if (originalSitePath.endsWith("index")) { - // prettier-ignore - originalSitePath = originalSitePath.substring(0, originalSitePath.length - 5) - } - // If they have .en then just drop that completely - if (originalSitePath.endsWith(".en")) { - // prettier-ignore - originalSitePath = originalSitePath.substring(0, originalSitePath.length - 3) - } - - // Always use /s for the path, because the join above in windows would be \ - originalSitePath = originalSitePath.split("\\").join("/") - - langs.forEach(lang => { - if (!isMultiLingual && lang !== "en") return - - const prefix = lang === "en" ? "/" : `/${lang}/` - const sitePath = `${prefix}${originalSitePath}` - const pageOpts = { - path: sitePath, - component: fullpath, - context: { - lang: lang === "" ? "en" : lang, - }, - } - - addPathToSite(sitePath) - createPage(pageOpts) - }) - }) -} diff --git a/packages/typescriptlang-org/lib/bootup/ingestion/createTSConfigReference.ts b/packages/typescriptlang-org/lib/bootup/ingestion/createTSConfigReference.ts deleted file mode 100644 index 4d52f08c1d7c..000000000000 --- a/packages/typescriptlang-org/lib/bootup/ingestion/createTSConfigReference.ts +++ /dev/null @@ -1,84 +0,0 @@ -const path = require(`path`) -const fs = require(`fs`) -const { green } = require("chalk") - -import { read as readMarkdownFile } from "gray-matter" -import { NodePluginArgs, CreatePagesArgs } from "gatsby" -import { addPathToSite } from "../pathsOnSiteTracker" -import { isMultiLingual } from "./languageFilter" -import remark = require("remark") -import remarkHTML = require("remark-html") - -const parseMarkdown = (md: string) => - remark().use(remarkHTML).processSync(md).toString() - -export const createTSConfigReference = async ( - graphql: CreatePagesArgs["graphql"], - createPage: NodePluginArgs["actions"]["createPage"] -) => { - console.log(`${green("success")} Creating TSConfig Reference pages`) - const tsConfigRefPage = path.resolve(`./src/templates/tsconfigReference.tsx`) - const result = await graphql(` - query GetAllHandbookDocs { - allFile( - filter: { - sourceInstanceName: { eq: "tsconfig-reference" } - ext: { eq: ".md" } - } - ) { - nodes { - name - modifiedTime - absolutePath - } - } - } - `) - - if (result.errors) { - throw result.errors - } - - const anyData = result.data as any - const docs = anyData.allFile.nodes - - docs.forEach(element => { - const lang = element.name - if (lang.includes("-")) { - return - } - - // prettier-ignore - const categoriesForLang = path.join( __dirname, "..", "..", "..", "..", "tsconfig-reference", "output", element.name + ".json") - - // prettier-ignore - const localeIntro = path.join( __dirname, "..", "..", "..", "..", "tsconfig-reference", "copy", lang, "intro.md") - // prettier-ignore - const enIntro = path.join( __dirname, "..", "..", "..", "..", "tsconfig-reference", "copy", "en", "intro.md") - const introPath = fs.existsSync(localeIntro) ? localeIntro : enIntro - const intro = readMarkdownFile(introPath) - const introHTML = parseMarkdown(intro.content) - - if (lang.length !== 2) return - if (!isMultiLingual && lang !== "en") return - - // Support urls being consistent with the current infra, e.g. en with no prefix - const pagePath = (lang === "en" ? "" : "/" + lang) + "/tsconfig" - addPathToSite(pagePath) - - createPage({ - path: pagePath, - component: tsConfigRefPage, - context: { - locale: element.name, - tsconfigMDPath: element.absolutePath, - intro: { - html: introHTML, - header: intro.data.header, - preview: intro.data.firstLine, - }, - categories: require(categoriesForLang).categories, - }, - }) - }) -} diff --git a/packages/typescriptlang-org/lib/bootup/ingestion/createTSConfigSingleFlagPages.ts b/packages/typescriptlang-org/lib/bootup/ingestion/createTSConfigSingleFlagPages.ts deleted file mode 100644 index 1aa83f5eb5bc..000000000000 --- a/packages/typescriptlang-org/lib/bootup/ingestion/createTSConfigSingleFlagPages.ts +++ /dev/null @@ -1,62 +0,0 @@ -import path from "path" -const { green } = require("chalk") - -import { NodePluginArgs, CreatePagesArgs, withPrefix } from "gatsby" - -export const createTSConfigSingleFlagPages = async ( - graphql: CreatePagesArgs["graphql"], - createPage: NodePluginArgs["actions"]["createPage"] -) => { - console.log(`${green("success")} Creating TSConfig One Off Pages`) - - const playPage = path.resolve(`./src/templates/tsconfigOptionOnePage.tsx`) - const result = await graphql(` - query GetAllHandbookDocs { - allFile( - filter: { - sourceInstanceName: { eq: "tsconfig-en" } - extension: { eq: "md" } - } - ) { - nodes { - id - name - absolutePath - childMarkdownRemark { - html - } - } - } - } - `) - - if (result.errors) { - throw result.errors - } - - const anyData = result.data as any - const options = anyData.allFile.nodes - - // { - // "id": "419262d5-8911-5ad4-a7a2-91a318ad0e1f", - // "name": "allowJs", - // "absolutePath": "/Users/ortatherox/dev/typescript/new-website/packages/tsconfig-reference/copy/en/options/allowJs.md" - // "html": "..." - // }, - - options.forEach(option => { - // Intentionally not adding addPathToSite here - const url = `/tsconfig/${option.name}` - - createPage({ - path: url + ".html", - component: playPage, - context: { - title: option.name, - lang: "en", - html: option.childMarkdownRemark.html, - redirectHref: `/tsconfig#${option.name}`, - }, - }) - }) -} diff --git a/packages/typescriptlang-org/lib/bootup/ingestion/languageFilter.ts b/packages/typescriptlang-org/lib/bootup/ingestion/languageFilter.ts deleted file mode 100644 index 06c6680a765f..000000000000 --- a/packages/typescriptlang-org/lib/bootup/ingestion/languageFilter.ts +++ /dev/null @@ -1 +0,0 @@ -export const isMultiLingual = !process.env.NO_TRANSLATIONS diff --git a/packages/typescriptlang-org/lib/bootup/pathsOnSiteTracker.ts b/packages/typescriptlang-org/lib/bootup/pathsOnSiteTracker.ts deleted file mode 100644 index 898e248904d9..000000000000 --- a/packages/typescriptlang-org/lib/bootup/pathsOnSiteTracker.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { existsSync, mkdirSync, writeFileSync } from "fs" -import { join } from "path" - -const paths = [] as string[] -export const addPathToSite = (path: string) => paths.push(path) - -export const writeAllPathsToFixture = () => { - const generated = join(__dirname, "..", "..", "src", "__generated__") - if (!existsSync(generated)) { - mkdirSync(generated) - } - - const allPagesPath = join(generated, "allPages.ts") - writeFileSync( - allPagesPath, - ` -// Generated during bootstapping via pathsOnSiteTracker.ts - -export const allFiles = [${paths - .map(item => '"' + item.replace(/\\/g, "/") + '",') - .join("\n")}]` - ) -} diff --git a/packages/typescriptlang-org/package.json b/packages/typescriptlang-org/package.json index 358ecc8d1b05..6e63e97a761a 100644 --- a/packages/typescriptlang-org/package.json +++ b/packages/typescriptlang-org/package.json @@ -5,71 +5,54 @@ "version": "0.0.0", "license": "MIT", "scripts": { - "build": "GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES=true gatsby build", - "clean": "gatsby clean", + "build": "astro build", + "clean": "rm -rf dist .astro", "bootstrap": "pnpm update-versions", "update-static-assets": "node scripts/downloadSearchAssets.js", "update-versions": "node scripts/getTypeScriptNPMVersions.js", "setup-playground-cache-bust": "node scripts/cacheBustPlayground.mjs", "create-lighthouse-json": "node scripts/createLighthouseJSON.js", "compile-index-examples": "twoslash --reactAlso src/components/index/twoslash/*.ts src/components/index/twoslash/*.js src/components/index/twoslash/*.tsx src/components/index/twoslash/generated && node scripts/updateIndexTwoslashExamples.js", - "start": "gatsby develop", - "serve": "gatsby serve", - "test": "pnpm tsc && jest" + "start": "astro dev", + "serve": "astro preview", + "test": "jest" }, "dependencies": { - "@babel/core": "^7.24.5", + "@astrojs/react": "^4.2.0", + "@astrojs/sitemap": "^3.3.0", "@formatjs/intl-relativetimeformat": "^4.5.15", - "@types/react-helmet": "^5.0.15", "@typescript/playground": "workspace:*", "@typescript/sandbox": "workspace:*", "@typescript/twoslash": "workspace:*", "@typescript/vfs": "workspace:*", - "gatsby": "^5.13.5", - "gatsby-link": "5.6.0", - "gatsby-plugin-catch-links": "^5.6.0", - "gatsby-plugin-client-side-redirect": "^1.1.0", - "gatsby-plugin-i18n": "^1.0.1", - "gatsby-plugin-manifest": "^5.6.0", - "gatsby-plugin-offline": "^6.6.0", - "gatsby-plugin-react-helmet": "^6.6.0", - "gatsby-plugin-sass": "^6.6.0", - "gatsby-plugin-sharp": "^5.6.0", - "gatsby-plugin-sitemap": "^6.6.0", - "gatsby-react-router-scroll": "6.6.0", - "gatsby-remark-autolink-headers": "^6.6.0", - "gatsby-remark-copy-linked-files": "^6.6.0", - "gatsby-remark-emojis": "^0.4.3", - "gatsby-remark-images": "^7.6.0", - "gatsby-remark-responsive-iframe": "^6.6.0", - "gatsby-remark-shiki-twoslash": "^3.0.36", - "gatsby-remark-smartypants": "^6.6.0", - "gatsby-source-filesystem": "^5.6.0", - "gatsby-transformer-remark": "^6.6.0", + "astro": "^5.3.0", "github-slugger": "^1.5.0", + "gray-matter": "^4.0.3", "jsdom": "^16.2.0", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-helmet": "^6.1.0", "react-intl": "^3.12.1", + "remark": "^14.0.3", + "remark-html": "^15.0.2", "sass": "^1.26.10", "shiki-twoslash": "^3.1.2", "ts-debounce": "^2.2.0", - "ts-node": "^10.9.1", "twoslash-cli": "^1.3.22", "typescript": "*", + "unified": "^10.1.2", + "remark-parse": "^10.0.2", + "remark-rehype": "^10.1.0", + "rehype-stringify": "^9.0.4", + "rehype-autolink-headings": "^6.1.1", + "rehype-slug": "^5.1.0", "xml-js": "^1.6.11" }, "devDependencies": { - "@babel/plugin-syntax-optional-chaining": "^7.8.3", "@types/jest": "^29.5.12", "@types/react": "^18.3.2", "@types/react-dom": "^18.3.0", - "gatsby-plugin-typegen": "^3.1.0", - "gatsby-plugin-typescript": "^5.6.0", "jest": "^29.5.0", "monaco-editor": "^0.32.1", - "node-polyfill-webpack-plugin": "^3.0.0", "semver": "^7.6.2", "ts-jest": "^29.0.5", "xmldom": "^0.5.0" diff --git a/packages/typescriptlang-org/scripts/cacheBustPlayground.mjs b/packages/typescriptlang-org/scripts/cacheBustPlayground.mjs index 3fe7ab120069..1c324e916f19 100644 --- a/packages/typescriptlang-org/scripts/cacheBustPlayground.mjs +++ b/packages/typescriptlang-org/scripts/cacheBustPlayground.mjs @@ -31,9 +31,9 @@ function copyFolderSync(from, to) { // Create a sha copy of the playground and sandbox folders. We want to have // a copy (and not just move) because folks rely on the un-prefixed URLs. -copyFolderSync("static/js/playground", `static/js/${gitSha}/playground`) -copyFolderSync("static/js/sandbox", `static/js/${gitSha}/sandbox`) +copyFolderSync("public/js/playground", `public/js/${gitSha}/playground`) +copyFolderSync("public/js/sandbox", `public/js/${gitSha}/sandbox`) copyFolderSync( - "static/js/playground-worker", - `static/js/${gitSha}/playground-worker` + "public/js/playground-worker", + `public/js/${gitSha}/playground-worker` ) diff --git a/packages/typescriptlang-org/scripts/downloadPlaygroundAssets.js b/packages/typescriptlang-org/scripts/downloadPlaygroundAssets.js index 44aa1ac35558..c2b1d5679ba4 100644 --- a/packages/typescriptlang-org/scripts/downloadPlaygroundAssets.js +++ b/packages/typescriptlang-org/scripts/downloadPlaygroundAssets.js @@ -14,26 +14,26 @@ const getFileAndStoreLocally = async (url, path) => { const go = async () => { await getFileAndStoreLocally( "https://unpkg.com/monaco-editor@0.19.0/min/vs/loader.js", - "static/js/vs.loader.js" + "public/js/vs.loader.js" ) - const newLoader = readFileSync("static/js/vs.loader.js", "utf8").replace( + const newLoader = readFileSync("public/js/vs.loader.js", "utf8").replace( "//# sourceMappingURL=../../min-maps/vs/loader.js.map", "//# sourceMappingURL=vs.loader.js.map" ) - new writeFileSync("static/js/vs.loader.js", newLoader) + new writeFileSync("public/js/vs.loader.js", newLoader) await getFileAndStoreLocally( "https://unpkg.com/monaco-editor@0.19.0/min-maps/vs/loader.js.map", - "static/js/vs.loader.js.map" + "public/js/vs.loader.js.map" ) const newLoaderMap = readFileSync( - "static/js/vs.loader.js.map", + "public/js/vs.loader.js.map", "utf8" ).replace('"sources":["vs/vs/loader.js"]', '"sources":["vs.loader.js"]') - new writeFileSync("static/js/vs.loader.js.map", newLoaderMap) + new writeFileSync("public/js/vs.loader.js.map", newLoaderMap) } go() diff --git a/packages/typescriptlang-org/scripts/downloadSearchAssets.js b/packages/typescriptlang-org/scripts/downloadSearchAssets.js index 87696e53cee7..78faea7d0029 100644 --- a/packages/typescriptlang-org/scripts/downloadSearchAssets.js +++ b/packages/typescriptlang-org/scripts/downloadSearchAssets.js @@ -15,7 +15,7 @@ const getFileAndStoreLocally = async (url, path, editFunc) => { const go = async () => { await getFileAndStoreLocally( "https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js", - "static/js/docsearch.js", + "public/js/docsearch.js", js => { const fixAriaByDroppingCustomText = js.replace( 'aria-label="Link to the result"', @@ -37,7 +37,7 @@ const go = async () => { // Remove the mapping reference await getFileAndStoreLocally( "https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css", - "static/css/docsearch.css", + "public/css/docsearch.css", css => { return css.replace("/*# sourceMappingURL=docsearch.min.css.map */", "") } diff --git a/packages/typescriptlang-org/src/components/HeadSEO.tsx b/packages/typescriptlang-org/src/components/HeadSEO.tsx index 51414647a668..d4f2e4a58a0d 100644 --- a/packages/typescriptlang-org/src/components/HeadSEO.tsx +++ b/packages/typescriptlang-org/src/components/HeadSEO.tsx @@ -1,40 +1,10 @@ -import * as React from "react" -import { Helmet } from "react-helmet"; +/** + * Legacy Gatsby component — replaced by BaseLayout.astro for management. + * Only the SeoProps type is still used. + */ export type SeoProps = { title: string description: string ogTags?: { [key: string]: string } } - -export const HeadSEO = (props: SeoProps) => { - - const ogTags = { - ...props.ogTags, - "og:title": props.title, - "og:description": props.description, - "twitter:site": "typescriptlang", - } - - - - // do we want localized pages to be the english version? - //{seo.url && } - - // TODO: a lot of pages should have this - // - - // TODO: Maybe on prod we can generate an image for each file - // - - return ( - <> - - - { - Object.keys(ogTags).map(k => ) - } - - - ) -} diff --git a/packages/typescriptlang-org/src/components/Intl.tsx b/packages/typescriptlang-org/src/components/Intl.tsx index 22d976deeb77..1a54cd491511 100644 --- a/packages/typescriptlang-org/src/components/Intl.tsx +++ b/packages/typescriptlang-org/src/components/Intl.tsx @@ -1,5 +1,11 @@ import * as React from "react" import { IntlProvider } from 'react-intl'; +import { lang as enMessages } from "../copy/en/en"; + +// Static message map - add languages here as needed +const messagesByLocale: Record> = { + en: enMessages, +}; type IntlProps = { locale: string @@ -8,12 +14,7 @@ type IntlProps = { export const Intl = (props: IntlProps) => { const { children, locale } = props - let messages = require("../copy/en/en").lang - try { - messages = require("../copy/" + locale + "/" + locale).lang - } catch (error) { - // NOOP - } + const messages = messagesByLocale[locale] || messagesByLocale.en return ( {children} diff --git a/packages/typescriptlang-org/src/components/IntlLink.tsx b/packages/typescriptlang-org/src/components/IntlLink.tsx index 46c74b7fdeaf..7d4a568c9574 100644 --- a/packages/typescriptlang-org/src/components/IntlLink.tsx +++ b/packages/typescriptlang-org/src/components/IntlLink.tsx @@ -1,36 +1,25 @@ import * as React from "react" -import { GatsbyLinkProps, Link } from "gatsby" -import { allFiles } from "../__generated__/allPages" /** - * Creates a which supports gradual migration, you provide a link to the english page and + * Creates a link which supports gradual migration, you provide a link to the english page and * if the page supports the same version but in your language, it opts for that. */ export const createIntlLink = (currentLocale: string) => { - const paths = allFiles + // paths list for locale support - in the future this could be populated + const paths: string[] = [] - return (linkProps: GatsbyLinkProps<{}>) => { + return (linkProps: React.AnchorHTMLAttributes & { to: string }) => { let to = linkProps.to // /thing -> /ja/thing // This occurs when we want URL compat with old site - const localeVersion = "/" + currentLocale + to if (currentLocale !== "en" && paths.includes(localeVersion)) { to = localeVersion } - // This effectively needs to be duplicated in gatsby-config.js too - const blocklistIncludes = ["/play", "sandbox", "/dev"] - const blocklisted = blocklistIncludes.find(blocked => to.includes(blocked)) - - if (blocklisted) { - // @ts-ignore - return - } else { - // @ts-ignore - return - } + const { to: _to, ...rest } = linkProps + return } } diff --git a/packages/typescriptlang-org/src/components/QuickJump.tsx b/packages/typescriptlang-org/src/components/QuickJump.tsx index 59c9592129be..f184f91ed2ce 100644 --- a/packages/typescriptlang-org/src/components/QuickJump.tsx +++ b/packages/typescriptlang-org/src/components/QuickJump.tsx @@ -6,7 +6,7 @@ import { createIntlLink } from "./IntlLink"; // Automatic metadata from npm and VS Marketplace import releaseInfo from "../lib/release-info.json"; -import { withPrefix } from "gatsby"; +import { withPrefix } from "../lib/withPrefix"; export type Props = { title: string; diff --git a/packages/typescriptlang-org/src/components/ShowExamples.tsx b/packages/typescriptlang-org/src/components/ShowExamples.tsx index 92443572919d..3671ac1e06b3 100644 --- a/packages/typescriptlang-org/src/components/ShowExamples.tsx +++ b/packages/typescriptlang-org/src/components/ShowExamples.tsx @@ -1,9 +1,9 @@ import React, { useEffect } from "react" -import { withPrefix } from "gatsby" +import { withPrefix } from "../lib/withPrefix" import "./ShowExamples.scss" // @ts-ignore - this is a fallback to english -import english from "../../static/js/examples/en" +import english from "../data/examples/en.json" import { hasLocalStorage } from "../lib/hasLocalStorage" interface SamplesJSON { @@ -35,7 +35,8 @@ const hrefForExample = (example: Example, lang: string) => { const prefix = isJS ? "useJavaScript=true" : "" const hash = "example/" + example.id const params = example.compilerSettings || {} - params.q = Math.floor(Math.random() * 512) + // Use a fixed cache-bust value for deterministic SSR/client rendering (avoids hydration mismatch) + params.q = 0 const queryParams = Object.keys(params).map(key => key + '=' + params[key]).join('&'); const langPrefix = lang === "en" ? "" : lang return withPrefix(`${langPrefix}/play/?${prefix + queryParams}#${hash}`) @@ -77,7 +78,7 @@ export type Props = { locale?: string /** DI'd copy of the examples, or fallback to eng */ - examples?: typeof import("../../static/js/examples/en.json") + examples?: typeof import("../data/examples/en.json") } export const RenderExamples = (props: Props) => { diff --git a/packages/typescriptlang-org/src/components/TmpLink.tsx b/packages/typescriptlang-org/src/components/TmpLink.tsx index 67b44864ef8c..c2a5ae9138e9 100644 --- a/packages/typescriptlang-org/src/components/TmpLink.tsx +++ b/packages/typescriptlang-org/src/components/TmpLink.tsx @@ -1,7 +1,8 @@ import * as React from "react" -import { GatsbyLinkProps } from "gatsby"; +type LinkProps = React.AnchorHTMLAttributes & { to: string } -export const Link = (props: GatsbyLinkProps<{}>) => { - return +export const Link = (props: LinkProps) => { + const { to, ...rest } = props + return } diff --git a/packages/typescriptlang-org/src/components/VersionBar.tsx b/packages/typescriptlang-org/src/components/VersionBar.tsx index d6682dfa7c08..2b3124cd87b6 100644 --- a/packages/typescriptlang-org/src/components/VersionBar.tsx +++ b/packages/typescriptlang-org/src/components/VersionBar.tsx @@ -1,5 +1,5 @@ import * as React from "react" -import { withPrefix } from "gatsby" +import { withPrefix } from "../lib/withPrefix" import releaseInfo from "../lib/release-info.json" import { navCopy } from "../copy/en/nav" diff --git a/packages/typescriptlang-org/src/components/devNav.tsx b/packages/typescriptlang-org/src/components/devNav.tsx index 5df18fe75b52..a07b657018d2 100644 --- a/packages/typescriptlang-org/src/components/devNav.tsx +++ b/packages/typescriptlang-org/src/components/devNav.tsx @@ -1,5 +1,5 @@ import * as React from "react" -import { withPrefix } from "gatsby" +import { withPrefix } from "../lib/withPrefix" interface DevNavProps { active?: string diff --git a/packages/typescriptlang-org/src/components/display/GreyButton.tsx b/packages/typescriptlang-org/src/components/display/GreyButton.tsx index 80a489b66bc9..f7125a06c45c 100644 --- a/packages/typescriptlang-org/src/components/display/GreyButton.tsx +++ b/packages/typescriptlang-org/src/components/display/GreyButton.tsx @@ -1,5 +1,5 @@ import * as React from "react" -import { withPrefix } from "gatsby" +import { withPrefix } from "../../lib/withPrefix" export type Props = { href: string diff --git a/packages/typescriptlang-org/src/components/handbook/NextPrev.tsx b/packages/typescriptlang-org/src/components/handbook/NextPrev.tsx index 3868009a97a6..9e63720d5bea 100644 --- a/packages/typescriptlang-org/src/components/handbook/NextPrev.tsx +++ b/packages/typescriptlang-org/src/components/handbook/NextPrev.tsx @@ -1,11 +1,10 @@ import * as React from "react" -import { Link } from "gatsby" interface NextPrevProps { - prev: { childMarkdownRemark: { frontmatter: { title: string, oneline: string, permalink: string } } } | undefined - next: { childMarkdownRemark: { frontmatter: { title: string, oneline: string, permalink: string } } } | undefined, + prev: { title: string, oneline: string, permalink: string } | undefined + next: { title: string, oneline: string, permalink: string } | undefined, i: (string) => string, - IntlLink: typeof Link + IntlLink: any } const Row = (props: { children: any, className?: string }) =>
{props.children}
@@ -13,8 +12,8 @@ const Row = (props: { children: any, className?: string }) =>
{ if (!props.prev && !props.next) return null - const prev = props.prev && props.prev.childMarkdownRemark.frontmatter - const next = props.next && props.next.childMarkdownRemark.frontmatter + const prev = props.prev + const next = props.next return (
@@ -32,12 +31,12 @@ const EmptyLink = () =>
interface Section { data: { title: string, oneline: string, permalink: string } i: (string) => string, - InltLink: typeof Link + InltLink: any type: string } const LinkSection = (props: Section) => - +
@@ -51,4 +50,4 @@ const LinkSection = (props: Section) =>

{props.data.oneline}

- +
diff --git a/packages/typescriptlang-org/src/components/index/AboveTheFold.tsx b/packages/typescriptlang-org/src/components/index/AboveTheFold.tsx index 548c1dbafbd1..6e0f0bf4e0af 100644 --- a/packages/typescriptlang-org/src/components/index/AboveTheFold.tsx +++ b/packages/typescriptlang-org/src/components/index/AboveTheFold.tsx @@ -63,7 +63,7 @@ export const AboveTheFold = () => {

Get Started With TypeScript

- + { - + {
- +
Web diff --git a/packages/typescriptlang-org/src/components/index/twoslash/typeDefinitions.tsx b/packages/typescriptlang-org/src/components/index/twoslash/typeDefinitions.tsx.sample similarity index 100% rename from packages/typescriptlang-org/src/components/index/twoslash/typeDefinitions.tsx rename to packages/typescriptlang-org/src/components/index/twoslash/typeDefinitions.tsx.sample diff --git a/packages/typescriptlang-org/src/components/layout.tsx b/packages/typescriptlang-org/src/components/layout.tsx index c57113d201f0..148caa92dce3 100644 --- a/packages/typescriptlang-org/src/components/layout.tsx +++ b/packages/typescriptlang-org/src/components/layout.tsx @@ -1,12 +1,15 @@ import * as React from "react" import { SiteNav, Props } from "./layout/TopNav" import { SiteFooter } from "./layout/SiteFooter" -import { SeoProps, HeadSEO } from "./HeadSEO"; import "./layout/main.scss" -import { Helmet } from "react-helmet"; import { CookieBanner } from "./layout/CookieBanner" import { LanguageRecommendations } from "./layout/LanguageRecommendation"; -import { withPrefix } from "gatsby"; + +export type SeoProps = { + title: string; + description: string; + ogTags?: { [key: string]: string }; +} type LayoutProps = SeoProps & Props & { lang: string, @@ -16,23 +19,12 @@ type LayoutProps = SeoProps & Props & { } export const Layout = (props: LayoutProps) => { return ( - <> - - - - - -
- - -
{props.children}
- - -
- +
+ + +
{props.children}
+ + +
) } diff --git a/packages/typescriptlang-org/src/components/layout/CookieBanner.tsx b/packages/typescriptlang-org/src/components/layout/CookieBanner.tsx index db1b8de5b6e9..c2b46144d5f9 100644 --- a/packages/typescriptlang-org/src/components/layout/CookieBanner.tsx +++ b/packages/typescriptlang-org/src/components/layout/CookieBanner.tsx @@ -2,21 +2,30 @@ import * as React from "react" import "./cookie.scss" -import { useState } from "react" -import { Helmet } from "react-helmet" +import { useState, useEffect } from "react" declare const WcpConsent: any export const CookieBanner = (props: { lang: string }) => { const [scriptLoaded, setScriptLoaded] = useState(typeof window !== 'undefined' && typeof WcpConsent !== 'undefined') - const handleChangeClientState = (newState, addedTags) => { - if (addedTags && addedTags.scriptTags) { - const foundScript = addedTags.scriptTags.find(({ src }) => src === "https://consentdeliveryfd.azurefd.net/mscc/lib/v2/wcp-consent.js") - if (foundScript) { - foundScript.addEventListener('load', () => setScriptLoaded(true), { once: true }) - } + + useEffect(() => { + if (typeof WcpConsent !== 'undefined') { + setScriptLoaded(true) + return } - } + + const script = document.createElement('script') + script.src = "https://consentdeliveryfd.azurefd.net/mscc/lib/v2/wcp-consent.js" + script.async = true + script.onload = () => setScriptLoaded(true) + document.head.appendChild(script) + + const link = document.createElement('link') + link.rel = 'preconnect' + link.href = 'https://consentdeliveryfd.azurefd.net/' + document.head.appendChild(link) + }, []) const verboseCookieLogging = () => { let siteConsent @@ -42,12 +51,6 @@ export const CookieBanner = (props: { lang: string }) => { return ( <> - - {typeof window !== 'undefined' && typeof WcpConsent === 'undefined' - && + + + diff --git a/packages/typescriptlang-org/src/lib/astro/loadDocPages.ts b/packages/typescriptlang-org/src/lib/astro/loadDocPages.ts new file mode 100644 index 000000000000..e65231c5d7c8 --- /dev/null +++ b/packages/typescriptlang-org/src/lib/astro/loadDocPages.ts @@ -0,0 +1,179 @@ +import fs from "node:fs"; +import path from "node:path"; +import matter from "gray-matter"; +import { markdownToHTML, extractHeadings } from "./markdownProcessor"; +import { getDocumentationNavForLanguage } from "../documentationNavigation"; +import { + getNextPageID, + getPreviousPageID, + type SidebarNavItem, +} from "../documentationNavigationUtils"; + +export interface DocPage { + permalink: string; + title: string; + oneline?: string; + html: string; + headings: { value: string; depth: number }[]; + frontmatter: Record; + repoPath: string; + slug: string; + lang: string; + modifiedTime: string; + id?: string; + prev?: { title: string; oneline: string; permalink: string }; + next?: { title: string; oneline: string; permalink: string }; +} + +function getAllMdFiles(dir: string): string[] { + const results: string[] = []; + if (!fs.existsSync(dir)) return results; + const entries = fs.readdirSync(dir, { withFileTypes: true }); + for (const entry of entries) { + const fullPath = path.join(dir, entry.name); + if (entry.isDirectory()) { + // Skip diagram directories + if (entry.name === "diagrams") continue; + results.push(...getAllMdFiles(fullPath)); + } else if (entry.name.endsWith(".md")) { + results.push(fullPath); + } + } + return results; +} + +function findNavIDByPermalink( + items: SidebarNavItem[], + permalink: string +): string | undefined { + for (const item of items) { + if (item.permalink === permalink) return item.id; + if (item.items) { + const found = findNavIDByPermalink(item.items, permalink); + if (found) return found; + } + } + return undefined; +} + +function findPermalinkByID( + items: SidebarNavItem[], + id: string +): string | undefined { + for (const item of items) { + if (item.id === id) return item.permalink; + if (item.items) { + const found = findPermalinkByID(item.items, id); + if (found) return found; + } + } + return undefined; +} + +export async function loadAllDocPages( + lang: string = "en" +): Promise { + const projectRoot = process.cwd(); + const docsDir = path.resolve(projectRoot, "..", "documentation", "copy", lang); + + if (!fs.existsSync(docsDir)) { + console.warn(`Documentation directory not found: ${docsDir}`); + return []; + } + + const files = getAllMdFiles(docsDir); + const repoRoot = path.resolve(projectRoot, "..", ".."); + + // First pass: parse all files for frontmatter and build permalink map + const rawPages: { + filePath: string; + frontmatter: Record; + content: string; + modifiedTime: string; + repoPath: string; + }[] = []; + + for (const file of files) { + const content = fs.readFileSync(file, "utf-8"); + const { data: frontmatter, content: md } = matter(content); + if (!frontmatter.permalink) continue; + const stat = fs.statSync(file); + rawPages.push({ + filePath: file, + frontmatter, + content: md, + modifiedTime: stat.mtime.toISOString(), + repoPath: file.replace(repoRoot + "/", ""), + }); + } + + // Build permalink → frontmatter map for prev/next lookup + const permalinkMap = new Map< + string, + { title: string; oneline: string; permalink: string } + >(); + for (const raw of rawPages) { + permalinkMap.set(raw.frontmatter.permalink, { + title: raw.frontmatter.title || "", + oneline: raw.frontmatter.oneline || "", + permalink: raw.frontmatter.permalink, + }); + } + + // Get nav for prev/next resolution + const nav = getDocumentationNavForLanguage(lang); + + // Second pass: process markdown and resolve nav links + const pages: DocPage[] = []; + + for (const raw of rawPages) { + const html = await markdownToHTML(raw.content); + const headings = extractHeadings(raw.content); + const permalink = raw.frontmatter.permalink; + + // Find this page's position in the nav tree + const navID = findNavIDByPermalink(nav, permalink); + + let prev: DocPage["prev"] = undefined; + let next: DocPage["next"] = undefined; + + if (navID) { + const prevInfo = getPreviousPageID(nav, navID); + if (prevInfo?.path) { + prev = permalinkMap.get(prevInfo.path); + } + + const nextInfo = getNextPageID(nav, navID); + if (nextInfo?.path) { + next = permalinkMap.get(nextInfo.path); + } + } + + pages.push({ + permalink, + title: raw.frontmatter.title || "", + oneline: raw.frontmatter.oneline, + html, + headings, + frontmatter: raw.frontmatter, + repoPath: raw.repoPath, + slug: permalink, + lang, + modifiedTime: raw.modifiedTime, + id: navID, + prev, + next, + }); + } + + return pages; +} + +/** + * Convert a permalink like /docs/handbook/2/basic-types.html to a slug + * suitable for Astro's [...slug] catch-all route. + * The .html extension is auto-added by Astro's build.format: 'file'. + */ +export function docPermalinkToSlug(permalink: string): string { + return permalink.replace(/^\/docs\//, "").replace(/\.html$/, ""); +} diff --git a/packages/typescriptlang-org/src/lib/astro/loadGlossaryData.ts b/packages/typescriptlang-org/src/lib/astro/loadGlossaryData.ts new file mode 100644 index 000000000000..7c47cc2b894f --- /dev/null +++ b/packages/typescriptlang-org/src/lib/astro/loadGlossaryData.ts @@ -0,0 +1,31 @@ +import fs from "node:fs"; +import path from "node:path"; +import { markdownToHTML } from "./markdownProcessor"; + +export interface GlossaryPageData { + locale: string; + html: string; + languageMeta: { terms: { id: string; display: string }[] }; +} + +export async function loadGlossaryPage( + lang: string = "en" +): Promise { + const projectRoot = process.cwd(); + const outputDir = path.resolve(projectRoot, "..", "glossary", "output"); + + // Load the terms metadata + const termsPath = path.join(outputDir, `${lang}.json`); + const languageMeta = JSON.parse(fs.readFileSync(termsPath, "utf-8")); + + // Load the rendered markdown + const mdPath = path.join(outputDir, `${lang}.md`); + const mdContent = fs.readFileSync(mdPath, "utf-8"); + const html = await markdownToHTML(mdContent); + + return { + locale: lang, + html, + languageMeta, + }; +} diff --git a/packages/typescriptlang-org/src/lib/astro/loadPlaygroundData.ts b/packages/typescriptlang-org/src/lib/astro/loadPlaygroundData.ts new file mode 100644 index 000000000000..57842bc915e5 --- /dev/null +++ b/packages/typescriptlang-org/src/lib/astro/loadPlaygroundData.ts @@ -0,0 +1,228 @@ +import fs from "node:fs"; +import path from "node:path"; + +export interface PlaygroundPageData { + lang: string; + examplesTOC: any; + optionsSummary: any; + playgroundHandbookTOC: any; +} + +export function loadPlaygroundData(lang: string = "en"): PlaygroundPageData { + const projectRoot = process.cwd(); + const appRoot = path.resolve(projectRoot, ".."); + + // Examples TOC + const examplesPath = path.join( + appRoot, + "playground-examples", + "generated", + `${lang}.json` + ); + const examplesTOC = JSON.parse(fs.readFileSync(examplesPath, "utf-8")); + + // Playground handbook TOC + const handbookTOCPath = path.join( + appRoot, + "playground-handbook", + "output", + "play-handbook.json" + ); + const playgroundHandbookTOC = JSON.parse( + fs.readFileSync(handbookTOCPath, "utf-8") + ); + + // Compiler options summary + const compilerOptsPath = path.join( + appRoot, + "tsconfig-reference", + "output", + `${lang}-summary.json` + ); + const compilerOptsFallback = path.join( + appRoot, + "tsconfig-reference", + "output", + "en-summary.json" + ); + const optionsPath = fs.existsSync(compilerOptsPath) + ? compilerOptsPath + : compilerOptsFallback; + const optionsSummary = JSON.parse( + fs.readFileSync(optionsPath, "utf-8") + ).options; + + return { + lang, + examplesTOC, + optionsSummary, + playgroundHandbookTOC, + }; +} + +export interface PlaygroundExamplePage { + slug: string; + name: string; + title: string; + html: string; + lang: string; + redirectHref: string; +} + +export function loadPlaygroundExamplePages( + lang: string = "en" +): PlaygroundExamplePage[] { + const projectRoot = process.cwd(); + const appRoot = path.resolve(projectRoot, ".."); + const copyDir = path.join(appRoot, "playground-examples", "copy"); + + if (!fs.existsSync(copyDir)) return []; + + const pages: PlaygroundExamplePage[] = []; + + function walkDir(dir: string) { + const entries = fs.readdirSync(dir, { withFileTypes: true }); + for (const entry of entries) { + const fullPath = path.join(dir, entry.name); + if (entry.isDirectory()) { + walkDir(fullPath); + } else if (entry.name.endsWith(".ts") || entry.name.endsWith(".js")) { + const relativePath = path.relative(copyDir, fullPath); + const parts = relativePath.split(path.sep); + const fileLang = parts[0]; + if (fileLang !== lang) return; + + const name = entry.name; + const code = fs.readFileSync(fullPath, "utf-8"); + + const idize = (s: string) => + s + .toLowerCase() + .replace(/[^\x00-\x7F]/g, "-") + .replace(/ /g, "-") + .replace(/\//g, "-") + .replace(/\+/g, "-"); + + const postLangPath = parts.slice(1).map(idize).join("/"); + const id = postLangPath.split("/").slice(-1)[0].split(".")[0]; + const { inlineTitle, compilerSettings } = + getCompilerDetailsFromCode(code); + + const isJS = name.indexOf(".js") !== -1; + const prefix = isJS ? "filetype=js" : ""; + const params = compilerSettings || {}; + const queryParams = Object.keys(params) + .map((key) => key + "=" + (params as any)[key]) + .join("&"); + const hash = "example/" + id; + const langURL = lang === "en" ? "" : lang; + const redirectHref = `${langURL}/play/?${prefix + queryParams}#${hash}`; + + pages.push({ + slug: postLangPath, + name, + title: inlineTitle || name, + html: invertCodeToHTML(code), + lang, + redirectHref, + }); + } + } + } + + walkDir(path.join(copyDir, lang)); + return pages; +} + +function getCompilerDetailsFromCode(contents: string) { + let compilerSettings: Record = {}; + let inlineTitle: string | undefined; + + if (contents.startsWith("//// {")) { + const preJSON = contents + .replace(/\r\n/g, "\n") + .split("//// {")[1] + .split("}\n")[0]; + const code = "{" + preJSON + "}"; + try { + const obj = JSON.parse(code); + if (obj.title) { + inlineTitle = obj.title; + delete obj.title; + } + compilerSettings = obj.compiler || {}; + } catch { + // ignore parse errors + } + } + return { compilerSettings, inlineTitle }; +} + +function invertCodeToHTML(code: string): string { + const escaped = code + .replace(/&/g, "&") + .replace(//g, ">"); + return `
${escaped}
`; +} + +export interface PlaygroundHandbookPage { + slug: string; + title: string; + html: string; +} + +export async function loadPlaygroundHandbookPages(): Promise< + PlaygroundHandbookPage[] +> { + const projectRoot = process.cwd(); + const handbookDir = path.resolve( + projectRoot, + "..", + "playground-handbook", + "copy" + ); + + if (!fs.existsSync(handbookDir)) return []; + + const { markdownToHTML } = await import("./markdownProcessor"); + const matter = (await import("gray-matter")).default; + + const pages: PlaygroundHandbookPage[] = []; + + function walkDir(dir: string) { + const entries = fs.readdirSync(dir, { withFileTypes: true }); + for (const entry of entries) { + const fullPath = path.join(dir, entry.name); + if (entry.isDirectory()) { + walkDir(fullPath); + } else if (entry.name.endsWith(".md")) { + const content = fs.readFileSync(fullPath, "utf-8"); + const { data: frontmatter, content: md } = matter(content); + const name = entry.name.replace(".md", ""); + const idize = (s: string) => + s + .toLowerCase() + .replace(/[^\x00-\x7F]/g, "-") + .replace(/ /g, "-") + .replace(/\//g, "-") + .replace(/\+/g, "-"); + + pages.push({ + slug: idize(name), + title: frontmatter.title || name, + html: md, // Will be processed later + }); + } + } + } + + walkDir(handbookDir); + + // Process markdown to HTML + for (const page of pages) { + page.html = await markdownToHTML(page.html); + } + + return pages; +} diff --git a/packages/typescriptlang-org/src/lib/astro/loadTSConfigData.ts b/packages/typescriptlang-org/src/lib/astro/loadTSConfigData.ts new file mode 100644 index 000000000000..59c145584f30 --- /dev/null +++ b/packages/typescriptlang-org/src/lib/astro/loadTSConfigData.ts @@ -0,0 +1,88 @@ +import fs from "node:fs"; +import path from "node:path"; +import matter from "gray-matter"; +import { markdownToHTML } from "./markdownProcessor"; + +export interface TSConfigPageData { + locale: string; + html: string; + categories: any[]; + intro: { + html: string; + header: string; + preview: string; + }; +} + +export async function loadTSConfigReference( + lang: string = "en" +): Promise { + const projectRoot = process.cwd(); + const outputDir = path.resolve(projectRoot, "..", "tsconfig-reference", "output"); + + // Load categories from the generated JSON + const categoriesPath = path.join(outputDir, `${lang}.json`); + const categoriesData = JSON.parse(fs.readFileSync(categoriesPath, "utf-8")); + + // Load the rendered markdown + const mdPath = path.join(outputDir, `${lang}.md`); + const mdContent = fs.readFileSync(mdPath, "utf-8"); + const html = await markdownToHTML(mdContent); + + // Load the intro from copy + const copyDir = path.resolve(projectRoot, "..", "tsconfig-reference", "copy"); + const localeIntroPath = path.join(copyDir, lang, "intro.md"); + const enIntroPath = path.join(copyDir, "en", "intro.md"); + const introPath = fs.existsSync(localeIntroPath) ? localeIntroPath : enIntroPath; + const introFile = matter(fs.readFileSync(introPath, "utf-8")); + const introHTML = await markdownToHTML(introFile.content); + + return { + locale: lang, + html, + categories: categoriesData.categories, + intro: { + html: introHTML, + header: introFile.data.header, + preview: introFile.data.firstLine, + }, + }; +} + +export interface TSConfigOptionPage { + name: string; + html: string; + redirectHref: string; +} + +export async function loadTSConfigOptionPages(): Promise { + const projectRoot = process.cwd(); + const optionsDir = path.resolve( + projectRoot, + "..", + "tsconfig-reference", + "copy", + "en", + "options" + ); + + if (!fs.existsSync(optionsDir)) return []; + + const files = fs.readdirSync(optionsDir).filter((f) => f.endsWith(".md")); + const pages: TSConfigOptionPage[] = []; + + for (const file of files) { + const name = file.replace(".md", ""); + const content = fs.readFileSync(path.join(optionsDir, file), "utf-8"); + const { content: md } = matter(content); + const html = await markdownToHTML(md); + + pages.push({ + name, + html, + redirectHref: `/tsconfig#${name}`, + }); + } + + return pages; +} diff --git a/packages/typescriptlang-org/src/lib/astro/markdownProcessor.ts b/packages/typescriptlang-org/src/lib/astro/markdownProcessor.ts new file mode 100644 index 000000000000..1c568878c850 --- /dev/null +++ b/packages/typescriptlang-org/src/lib/astro/markdownProcessor.ts @@ -0,0 +1,37 @@ +import { unified } from "unified"; +import remarkParse from "remark-parse"; +import remarkRehype from "remark-rehype"; +import rehypeStringify from "rehype-stringify"; +import rehypeSlug from "rehype-slug"; +import rehypeAutolinkHeadings from "rehype-autolink-headings"; + +const processor = unified() + .use(remarkParse) + .use(remarkRehype, { allowDangerousHtml: true }) + .use(rehypeSlug) + .use(rehypeAutolinkHeadings) + .use(rehypeStringify, { allowDangerousHtml: true }); + +/** + * Process a markdown string into HTML. + */ +export async function markdownToHTML(md: string): Promise { + const result = await processor.process(md); + return String(result); +} + +/** + * Extract heading nodes from a markdown string (simple regex-based). + */ +export function extractHeadings( + md: string +): { value: string; depth: number }[] { + const headings: { value: string; depth: number }[] = []; + for (const line of md.split("\n")) { + const match = line.match(/^(#{1,6})\s+(.+)$/); + if (match) { + headings.push({ depth: match[1].length, value: match[2].trim() }); + } + } + return headings; +} diff --git a/packages/typescriptlang-org/src/lib/playgroundURLs.ts b/packages/typescriptlang-org/src/lib/playgroundURLs.ts index 4d064d45d167..cec6b425f7a3 100644 --- a/packages/typescriptlang-org/src/lib/playgroundURLs.ts +++ b/packages/typescriptlang-org/src/lib/playgroundURLs.ts @@ -1,4 +1,4 @@ -import { withPrefix } from "gatsby" +import { withPrefix } from "./withPrefix" export const getPlaygroundUrls = () => { // This will get switched out in CI by: diff --git a/packages/typescriptlang-org/src/lib/withPrefix.ts b/packages/typescriptlang-org/src/lib/withPrefix.ts new file mode 100644 index 000000000000..11cbd56be35b --- /dev/null +++ b/packages/typescriptlang-org/src/lib/withPrefix.ts @@ -0,0 +1,7 @@ +/** + * Shim for Gatsby's withPrefix utility. + * In Astro, there's no path prefix by default, so this is an identity function. + */ +export function withPrefix(path: string): string { + return path; +} diff --git a/packages/typescriptlang-org/src/pages/branding.scss b/packages/typescriptlang-org/src/pages/_branding.scss similarity index 100% rename from packages/typescriptlang-org/src/pages/branding.scss rename to packages/typescriptlang-org/src/pages/_branding.scss diff --git a/packages/typescriptlang-org/src/pages/branding.tsx b/packages/typescriptlang-org/src/pages/_branding.tsx similarity index 98% rename from packages/typescriptlang-org/src/pages/branding.tsx rename to packages/typescriptlang-org/src/pages/_branding.tsx index ada0f00f3a5f..3619ac50c113 100644 --- a/packages/typescriptlang-org/src/pages/branding.tsx +++ b/packages/typescriptlang-org/src/pages/_branding.tsx @@ -1,10 +1,10 @@ import * as React from "react" import { Layout } from "../components/layout" -import { withPrefix } from "gatsby" +import { withPrefix } from "../lib/withPrefix" import { Intl } from "../components/Intl" -import "./branding.scss" +import "./_branding.scss" type Props = {} diff --git a/packages/typescriptlang-org/src/pages/_playground-handbook/[...id].astro b/packages/typescriptlang-org/src/pages/_playground-handbook/[...id].astro new file mode 100644 index 000000000000..bd439ac1146d --- /dev/null +++ b/packages/typescriptlang-org/src/pages/_playground-handbook/[...id].astro @@ -0,0 +1,30 @@ +--- +import BaseLayout from "../../layouts/BaseLayout.astro"; +import PlaygroundHandbookPage from "../../templates/playgroundHandbook.tsx"; +import { loadPlaygroundHandbookPages } from "../../lib/astro/loadPlaygroundData"; + +export async function getStaticPaths() { + const pages = await loadPlaygroundHandbookPages(); + + return pages.map((page) => ({ + params: { id: page.slug }, + props: { + pageContext: { + title: page.title, + lang: "en", + html: page.html, + }, + }, + })); +} + +const { pageContext } = Astro.props; +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/branding.astro b/packages/typescriptlang-org/src/pages/branding.astro new file mode 100644 index 000000000000..48325d0713c3 --- /dev/null +++ b/packages/typescriptlang-org/src/pages/branding.astro @@ -0,0 +1,12 @@ +--- +import BaseLayout from "../layouts/BaseLayout.astro"; +import BrandingPage from "./_branding.tsx"; +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/cheatsheets.astro b/packages/typescriptlang-org/src/pages/cheatsheets.astro new file mode 100644 index 000000000000..83f1f6bd14cd --- /dev/null +++ b/packages/typescriptlang-org/src/pages/cheatsheets.astro @@ -0,0 +1,12 @@ +--- +import BaseLayout from "../layouts/BaseLayout.astro"; +import CheatsheetsPage from "../templates/pages/cheatsheets.tsx"; +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/community.astro b/packages/typescriptlang-org/src/pages/community.astro new file mode 100644 index 000000000000..c8e87ab392ef --- /dev/null +++ b/packages/typescriptlang-org/src/pages/community.astro @@ -0,0 +1,12 @@ +--- +import BaseLayout from "../layouts/BaseLayout.astro"; +import CommunityPage from "../templates/pages/community.tsx"; +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/dev/bug-workbench.tsx b/packages/typescriptlang-org/src/pages/dev/_bug-workbench.tsx old mode 100755 new mode 100644 similarity index 98% rename from packages/typescriptlang-org/src/pages/dev/bug-workbench.tsx rename to packages/typescriptlang-org/src/pages/dev/_bug-workbench.tsx index 63e89ee0b98e..d4a1a7a4bff9 --- a/packages/typescriptlang-org/src/pages/dev/bug-workbench.tsx +++ b/packages/typescriptlang-org/src/pages/dev/_bug-workbench.tsx @@ -1,7 +1,7 @@ import React, { useEffect } from "react" import ReactDOM from "react-dom" import { Layout } from "../../components/layout" -import { withPrefix, graphql } from "gatsby" +import { withPrefix } from "../../lib/withPrefix" import { debounce } from 'ts-debounce'; import "../../templates/play.scss" @@ -22,7 +22,7 @@ import { createDefaultMapFromCDN } from "@typescript/vfs" import { twoslasher, TwoSlashReturn } from "@typescript/twoslash" import { getPlaygroundUrls } from "../../lib/playgroundURLs"; -import type * as playgroundPackage from "../../../static/js/playground"; +import type * as playgroundPackage from "../../../public/js/playground"; type TwoSlashReturns = import("@typescript/twoslash").TwoSlashReturn @@ -63,7 +63,7 @@ const Play: React.FC = (props) => { const { sandboxRoot, playgroundRoot, playgroundWorker } = getPlaygroundUrls() // @ts-ignore - const re: any = global.require + const re: any = (window as any).require re.config({ paths: { vs: `https://playgroundcdn.typescriptlang.org/cdn/${tsVersionParam}/monaco/dev/vs`, diff --git a/packages/typescriptlang-org/src/pages/dev/dev.scss b/packages/typescriptlang-org/src/pages/dev/_dev.scss similarity index 100% rename from packages/typescriptlang-org/src/pages/dev/dev.scss rename to packages/typescriptlang-org/src/pages/dev/_dev.scss diff --git a/packages/typescriptlang-org/src/pages/dev/playground-plugins.tsx b/packages/typescriptlang-org/src/pages/dev/_playground-plugins.tsx similarity index 93% rename from packages/typescriptlang-org/src/pages/dev/playground-plugins.tsx rename to packages/typescriptlang-org/src/pages/dev/_playground-plugins.tsx index 321d9ce5a8e1..b446de768055 100644 --- a/packages/typescriptlang-org/src/pages/dev/playground-plugins.tsx +++ b/packages/typescriptlang-org/src/pages/dev/_playground-plugins.tsx @@ -1,8 +1,9 @@ import * as React from "react" import { Layout } from "../../components/layout" -import { withPrefix, graphql } from "gatsby" +import { withPrefix } from "../../lib/withPrefix" -import "./dev.scss" +import "./_dev.scss" +import pluginPreview from "../../assets/plugin-preview.png" with { type: "asset" } import { Intl } from "../../components/Intl" import { DevNav } from "../../components/devNav" @@ -27,7 +28,7 @@ const Index: React.FC = (props) => {
- Screenshot of the playground showing the plugins tab + Screenshot of the playground showing the plugins tab
diff --git a/packages/typescriptlang-org/src/pages/dev/sandbox.tsx b/packages/typescriptlang-org/src/pages/dev/_sandbox.tsx similarity index 99% rename from packages/typescriptlang-org/src/pages/dev/sandbox.tsx rename to packages/typescriptlang-org/src/pages/dev/_sandbox.tsx index 5b50fe2f77ca..294a52facd93 100644 --- a/packages/typescriptlang-org/src/pages/dev/sandbox.tsx +++ b/packages/typescriptlang-org/src/pages/dev/_sandbox.tsx @@ -1,8 +1,8 @@ import React, { useEffect } from "react" import { Layout } from "../../components/layout" -import { withPrefix, graphql } from "gatsby" +import { withPrefix } from "../../lib/withPrefix" -import "./dev.scss" +import "./_dev.scss" import { Intl } from "../../components/Intl" import { DevNav } from "../../components/devNav" import { isTouchDevice } from "../../lib/isTouchDevice" @@ -22,7 +22,7 @@ const Index: React.FC = props => { getLoaderScript.async = true getLoaderScript.onload = () => { // @ts-ignore - const re: any = global.require + const re: any = (window as any).require re.config({ paths: { diff --git a/packages/typescriptlang-org/src/pages/dev/twoslash.tsx b/packages/typescriptlang-org/src/pages/dev/_twoslash.tsx old mode 100755 new mode 100644 similarity index 99% rename from packages/typescriptlang-org/src/pages/dev/twoslash.tsx rename to packages/typescriptlang-org/src/pages/dev/_twoslash.tsx index d9f15055c704..254330324d81 --- a/packages/typescriptlang-org/src/pages/dev/twoslash.tsx +++ b/packages/typescriptlang-org/src/pages/dev/_twoslash.tsx @@ -1,12 +1,12 @@ import React, { useEffect } from "react" import { Layout } from "../../components/layout" -import { withPrefix } from "gatsby" +import { withPrefix } from "../../lib/withPrefix" import { twoslasher } from "@typescript/twoslash" import { createDefaultMapFromCDN } from "@typescript/vfs" import { renderers } from "shiki-twoslash" import { debounce } from "ts-debounce" -import "./dev.scss" +import "./_dev.scss" import { Intl } from "../../components/Intl" import { DevNav } from "../../components/devNav" import { isTouchDevice } from "../../lib/isTouchDevice" @@ -36,7 +36,7 @@ const Index: React.FC = props => { const {sandboxRoot} = getPlaygroundUrls() // @ts-ignore - const re: any = global.require + const re: any = (window as any).require re.config({ paths: { diff --git a/packages/typescriptlang-org/src/pages/dev/typescript-vfs.tsx b/packages/typescriptlang-org/src/pages/dev/_typescript-vfs.tsx similarity index 95% rename from packages/typescriptlang-org/src/pages/dev/typescript-vfs.tsx rename to packages/typescriptlang-org/src/pages/dev/_typescript-vfs.tsx index e82da968ba2a..4e7ee0d5480b 100644 --- a/packages/typescriptlang-org/src/pages/dev/typescript-vfs.tsx +++ b/packages/typescriptlang-org/src/pages/dev/_typescript-vfs.tsx @@ -1,8 +1,8 @@ import * as React from "react" import { Layout } from "../../components/layout" -import { withPrefix, graphql, Link } from "gatsby" +import { withPrefix } from "../../lib/withPrefix" -import "./dev.scss" +import "./_dev.scss" import { Intl } from "../../components/Intl" import { DevNav } from "../../components/devNav" @@ -17,7 +17,7 @@ const Index: React.FC = (props) => {

Easy access to the compiler API

-

TypeScript VFS lets you create a self-contained TypeScript environment entirely under your control. This library is used to power the Playground, and provides the underlying tooling for twoslash code samples.

+

TypeScript VFS lets you create a self-contained TypeScript environment entirely under your control. This library is used to power the Playground, and provides the underlying tooling for twoslash code samples.

There are 3 main uses for TypeScript VFS:

  • Creating a TypeScript Program as an entry-point to the compiler API
  • diff --git a/packages/typescriptlang-org/src/pages/dev/bug-workbench.astro b/packages/typescriptlang-org/src/pages/dev/bug-workbench.astro new file mode 100644 index 000000000000..21e5760d5676 --- /dev/null +++ b/packages/typescriptlang-org/src/pages/dev/bug-workbench.astro @@ -0,0 +1,12 @@ +--- +import BaseLayout from "../../layouts/BaseLayout.astro"; +import BugWorkbenchPage from "./_bug-workbench.tsx"; +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/dev/playground-plugins.astro b/packages/typescriptlang-org/src/pages/dev/playground-plugins.astro new file mode 100644 index 000000000000..270e89c8cfc3 --- /dev/null +++ b/packages/typescriptlang-org/src/pages/dev/playground-plugins.astro @@ -0,0 +1,12 @@ +--- +import BaseLayout from "../../layouts/BaseLayout.astro"; +import PlaygroundPluginsPage from "./_playground-plugins.tsx"; +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/dev/sandbox.astro b/packages/typescriptlang-org/src/pages/dev/sandbox.astro new file mode 100644 index 000000000000..75552c3988a9 --- /dev/null +++ b/packages/typescriptlang-org/src/pages/dev/sandbox.astro @@ -0,0 +1,12 @@ +--- +import BaseLayout from "../../layouts/BaseLayout.astro"; +import SandboxPage from "./_sandbox.tsx"; +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/dev/twoslash.astro b/packages/typescriptlang-org/src/pages/dev/twoslash.astro new file mode 100644 index 000000000000..de269122bd0b --- /dev/null +++ b/packages/typescriptlang-org/src/pages/dev/twoslash.astro @@ -0,0 +1,12 @@ +--- +import BaseLayout from "../../layouts/BaseLayout.astro"; +import TwoslashPage from "./_twoslash.tsx"; +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/dev/typescript-vfs.astro b/packages/typescriptlang-org/src/pages/dev/typescript-vfs.astro new file mode 100644 index 000000000000..56ec3c0a19ad --- /dev/null +++ b/packages/typescriptlang-org/src/pages/dev/typescript-vfs.astro @@ -0,0 +1,12 @@ +--- +import BaseLayout from "../../layouts/BaseLayout.astro"; +import TypeScriptVFSPage from "./_typescript-vfs.tsx"; +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/docs/[...slug].astro b/packages/typescriptlang-org/src/pages/docs/[...slug].astro new file mode 100644 index 000000000000..35d94cde84ee --- /dev/null +++ b/packages/typescriptlang-org/src/pages/docs/[...slug].astro @@ -0,0 +1,48 @@ +--- +import BaseLayout from "../../layouts/BaseLayout.astro"; +import DocumentationPage from "../../templates/documentation.tsx"; +import { + loadAllDocPages, + docPermalinkToSlug, +} from "../../lib/astro/loadDocPages"; + +export async function getStaticPaths() { + const pages = await loadAllDocPages("en"); + + return pages.map((page) => { + const slug = docPermalinkToSlug(page.permalink); + + return { + params: { slug }, + props: { + pageContext: { + id: page.id, + nextID: "", + previousID: "", + repoPath: page.repoPath, + slug: page.permalink, + lang: page.lang, + modifiedTime: page.modifiedTime, + html: page.html, + title: page.title, + oneline: page.oneline, + headings: page.headings, + frontmatter: page.frontmatter, + prev: page.prev, + next: page.next, + }, + }, + }; + }); +} + +const { pageContext } = Astro.props; +const isHandbook = pageContext.frontmatter?.handbook; +const prefix = isHandbook ? "Handbook" : "Documentation"; +const title = `${prefix} - ${pageContext.title}`; +const description = pageContext.frontmatter?.oneline || ""; +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/docs/handbook/index.astro b/packages/typescriptlang-org/src/pages/docs/handbook/index.astro new file mode 100644 index 000000000000..ee2df52bce05 --- /dev/null +++ b/packages/typescriptlang-org/src/pages/docs/handbook/index.astro @@ -0,0 +1,12 @@ +--- +import BaseLayout from "../../../layouts/BaseLayout.astro"; +import HandbookIndexPage from "../../../templates/pages/docs/handbook/index.tsx"; +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/docs/index.astro b/packages/typescriptlang-org/src/pages/docs/index.astro new file mode 100644 index 000000000000..fb469835b564 --- /dev/null +++ b/packages/typescriptlang-org/src/pages/docs/index.astro @@ -0,0 +1,12 @@ +--- +import BaseLayout from "../../layouts/BaseLayout.astro"; +import DocsIndexPage from "../../templates/pages/docs/index.tsx"; +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/download.astro b/packages/typescriptlang-org/src/pages/download.astro new file mode 100644 index 000000000000..5fbbb02eb3e8 --- /dev/null +++ b/packages/typescriptlang-org/src/pages/download.astro @@ -0,0 +1,12 @@ +--- +import BaseLayout from "../layouts/BaseLayout.astro"; +import DownloadPage from "../templates/pages/download.tsx"; +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/dt/search.astro b/packages/typescriptlang-org/src/pages/dt/search.astro new file mode 100644 index 000000000000..3c98a5feda44 --- /dev/null +++ b/packages/typescriptlang-org/src/pages/dt/search.astro @@ -0,0 +1,12 @@ +--- +import BaseLayout from "../../layouts/BaseLayout.astro"; +import DTSearchPage from "../../templates/pages/dt/search.tsx"; +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/empty.astro b/packages/typescriptlang-org/src/pages/empty.astro new file mode 100644 index 000000000000..583715eabf57 --- /dev/null +++ b/packages/typescriptlang-org/src/pages/empty.astro @@ -0,0 +1,8 @@ +--- +import BaseLayout from "../layouts/BaseLayout.astro"; +import EmptyPage from "../templates/pages/empty.tsx"; +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/glossary.astro b/packages/typescriptlang-org/src/pages/glossary.astro new file mode 100644 index 000000000000..ab3470bdd883 --- /dev/null +++ b/packages/typescriptlang-org/src/pages/glossary.astro @@ -0,0 +1,15 @@ +--- +import BaseLayout from "../layouts/BaseLayout.astro"; +import GlossaryPage from "../templates/glossary.tsx"; +import { loadGlossaryPage } from "../lib/astro/loadGlossaryData"; + +const data = await loadGlossaryPage("en"); +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/index.astro b/packages/typescriptlang-org/src/pages/index.astro new file mode 100644 index 000000000000..f0b7a01a2ea2 --- /dev/null +++ b/packages/typescriptlang-org/src/pages/index.astro @@ -0,0 +1,12 @@ +--- +import BaseLayout from "../layouts/BaseLayout.astro"; +import IndexPage from "../templates/pages/index.tsx"; +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/play/[...slug].astro b/packages/typescriptlang-org/src/pages/play/[...slug].astro new file mode 100644 index 000000000000..149d0b71d0f0 --- /dev/null +++ b/packages/typescriptlang-org/src/pages/play/[...slug].astro @@ -0,0 +1,32 @@ +--- +import BaseLayout from "../../layouts/BaseLayout.astro"; +import PlayExamplePage from "../../templates/play-example.tsx"; +import { loadPlaygroundExamplePages } from "../../lib/astro/loadPlaygroundData"; + +export async function getStaticPaths() { + const pages = loadPlaygroundExamplePages("en"); + + return pages.map((page) => ({ + params: { slug: page.slug }, + props: { + pageContext: { + lang: page.lang, + name: page.name, + title: page.title, + html: page.html, + redirectHref: page.redirectHref, + }, + }, + })); +} + +const { pageContext } = Astro.props; +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/play/index.astro b/packages/typescriptlang-org/src/pages/play/index.astro new file mode 100644 index 000000000000..9dc463633f80 --- /dev/null +++ b/packages/typescriptlang-org/src/pages/play/index.astro @@ -0,0 +1,23 @@ +--- +import BaseLayout from "../../layouts/BaseLayout.astro"; +import PlayPage from "../../templates/play.tsx"; +import { loadPlaygroundData } from "../../lib/astro/loadPlaygroundData"; + +const data = loadPlaygroundData("en"); +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/tools.astro b/packages/typescriptlang-org/src/pages/tools.astro new file mode 100644 index 000000000000..cc5817bca33e --- /dev/null +++ b/packages/typescriptlang-org/src/pages/tools.astro @@ -0,0 +1,12 @@ +--- +import BaseLayout from "../layouts/BaseLayout.astro"; +import ToolsPage from "../templates/pages/tools.tsx"; +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/tsconfig.astro b/packages/typescriptlang-org/src/pages/tsconfig.astro new file mode 100644 index 000000000000..631837f40248 --- /dev/null +++ b/packages/typescriptlang-org/src/pages/tsconfig.astro @@ -0,0 +1,15 @@ +--- +import BaseLayout from "../layouts/BaseLayout.astro"; +import TSConfigRefPage from "../templates/tsconfigReference.tsx"; +import { loadTSConfigReference } from "../lib/astro/loadTSConfigData"; + +const data = await loadTSConfigReference("en"); +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/tsconfig/[...option].astro b/packages/typescriptlang-org/src/pages/tsconfig/[...option].astro new file mode 100644 index 000000000000..12471068bfba --- /dev/null +++ b/packages/typescriptlang-org/src/pages/tsconfig/[...option].astro @@ -0,0 +1,32 @@ +--- +import BaseLayout from "../../layouts/BaseLayout.astro"; +import TSConfigOptionPage from "../../templates/tsconfigOptionOnePage.tsx"; +import { loadTSConfigOptionPages } from "../../lib/astro/loadTSConfigData"; + +export async function getStaticPaths() { + const pages = await loadTSConfigOptionPages(); + + return pages.map((page) => ({ + params: { option: page.name }, + props: { + pageContext: { + lang: "en", + title: page.name, + name: page.name, + html: page.html, + redirectHref: page.redirectHref, + }, + }, + })); +} + +const { pageContext } = Astro.props; +--- + + + + diff --git a/packages/typescriptlang-org/src/pages/why-create-typescript.astro b/packages/typescriptlang-org/src/pages/why-create-typescript.astro new file mode 100644 index 000000000000..c2f36b169497 --- /dev/null +++ b/packages/typescriptlang-org/src/pages/why-create-typescript.astro @@ -0,0 +1,12 @@ +--- +import BaseLayout from "../layouts/BaseLayout.astro"; +import WhyPage from "../templates/pages/why-create-typescript.tsx"; +--- + + + + diff --git a/packages/typescriptlang-org/src/redirects/setupRedirects.ts b/packages/typescriptlang-org/src/redirects/setupRedirects.ts index b33008fe834e..4eab7aa53191 100644 --- a/packages/typescriptlang-org/src/redirects/setupRedirects.ts +++ b/packages/typescriptlang-org/src/redirects/setupRedirects.ts @@ -24,7 +24,7 @@ const handbookRedirects = { "/docs/bootstrap": "/docs/" } -import { NodePluginArgs } from "gatsby" + export const setupRedirects = ( createRedirect: NodePluginArgs["actions"]["createRedirect"] diff --git a/packages/typescriptlang-org/src/templates/documentation.tsx b/packages/typescriptlang-org/src/templates/documentation.tsx index 7ee2e7f76272..87382b3d6be0 100644 --- a/packages/typescriptlang-org/src/templates/documentation.tsx +++ b/packages/typescriptlang-org/src/templates/documentation.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from "react" -import { graphql } from "gatsby" + import { Layout } from "../components/layout" import { Sidebar, SidebarToggleButton } from "../components/layout/Sidebar" import { getDocumentationNavForLanguage } from "../lib/documentationNavigation" @@ -20,7 +20,6 @@ import { Contributors } from "../components/handbook/Contributors" import { overrideSubNavLinksWithSmoothScroll, updateSidebarOnScroll } from "./scripts/setupSubNavigationSidebar" import { setupLikeDislikeButtons } from "./scripts/setupLikeDislikeButtons" import { DislikeUnfilledSVG, LikeUnfilledSVG } from "../components/svgs/documentation" -import Helmet from "react-helmet" type Props = { pageContext: { @@ -32,19 +31,39 @@ type Props = { slug: string lang: string modifiedTime: string + // Pre-processed data (replaces GraphQL) + html: string + title: string + oneline?: string + headings: { value: string; depth: number }[] + frontmatter: { + permalink?: string + title?: string + disable_toc?: boolean + handbook?: boolean + oneline?: string + preamble?: string + deprecated_by?: string + deprecation_redirects?: string[] + experimental?: boolean + } + prev?: { title: string; oneline: string; permalink: string } + next?: { title: string; oneline: string; permalink: string } } - data: GatsbyTypes.GetDocumentBySlugQuery - path: string } const HandbookTemplate: React.FC = (props) => { - const post = props.data.markdownRemark - if (!post) { + const post = { + html: props.pageContext.html, + frontmatter: props.pageContext.frontmatter, + headings: props.pageContext.headings, + } + if (!post.html) { console.log("Could not render:", JSON.stringify(props)) return
    } - const [deprecationURL, setDeprecationURL] = useState(post.frontmatter!.deprecated_by) + const [deprecationURL, setDeprecationURL] = useState(post.frontmatter?.deprecated_by) const i = createInternational(useIntl()) const IntlLink = createIntlLink(props.pageContext.lang) @@ -74,8 +93,8 @@ const HandbookTemplate: React.FC = (props) => { }, []) - if (!post.frontmatter) throw new Error(`No front-matter found for the file with props: ${props}`) - if (!post.html) throw new Error(`No html found for the file with props: ${props}`) + if (!post.frontmatter) throw new Error(`No front-matter found for the file`) + if (!post.html) throw new Error(`No html found for the file`) const selectedID = props.pageContext.id || "NO-ID" const sidebarHeaders = post.headings?.filter(h => (h?.depth || 0) <= 3) || [] @@ -113,9 +132,6 @@ const HandbookTemplate: React.FC = (props) => {
    {deprecationURL && <> - - -
    @@ -174,7 +190,7 @@ const HandbookTemplate: React.FC = (props) => { } - +
    @@ -188,7 +204,7 @@ type MarkdownHeadingTreeNode = { children?: MarkdownHeadingTreeNode[] } -function headerListToTree(sidebarHeaders: GatsbyTypes.Maybe>[]) { +function headerListToTree(sidebarHeaders: { value?: string; depth?: number }[]) { const tree: MarkdownHeadingTreeNode[] = [] const stack: { node: MarkdownHeadingTreeNode; depth: number }[] = [] @@ -237,48 +253,3 @@ function MarkdownHeadingTree(props: { tree: MarkdownHeadingTreeNode[], slug: typ } export default (props: Props) => - -export const pageQuery = graphql` - query GetDocumentBySlug($slug: String!, $previousID: String, $nextID: String) { - markdownRemark(frontmatter: { permalink: {eq: $slug}}) { - id - excerpt(pruneLength: 160) - html - headings { - value - depth - } - frontmatter { - permalink - title - disable_toc - handbook - oneline - preamble - deprecated_by - deprecation_redirects - experimental - } - } - - prev: file(id: { eq: $previousID } ) { - childMarkdownRemark { - frontmatter { - title - oneline - permalink - } - } - } - - next: file(id: { eq: $nextID } ) { - childMarkdownRemark { - frontmatter { - title - oneline - permalink - } - } - } - } -` diff --git a/packages/typescriptlang-org/src/templates/glossary.tsx b/packages/typescriptlang-org/src/templates/glossary.tsx index 451c48e05bba..1c10362f27c5 100644 --- a/packages/typescriptlang-org/src/templates/glossary.tsx +++ b/packages/typescriptlang-org/src/templates/glossary.tsx @@ -1,5 +1,4 @@ import React from "react" -import { graphql } from "gatsby" import { Layout } from "../components/layout" @@ -11,18 +10,12 @@ import { headCopy } from "../copy/en/head-seo" import "./markdown.scss" import "./glossary.scss" -type Props = { pageContext: any, data: GatsbyTypes.TSConfigReferenceTemplateQuery, path: string } +type Props = { pageContext: { locale: string; html: string; languageMeta: { terms: { id: string; display: string }[] } } } -const GlossaryTemplateComponent = (props) => { +const GlossaryTemplateComponent = (props: Props) => { const i = createInternational(useIntl()) - const post = props.data.markdownRemark - if (!post) { - console.log("Could not render:", JSON.stringify(props)) - return
    - } - - const meta = props.pageContext.languageMeta as typeof import("../../../glossary/output/en.json") + const meta = props.pageContext.languageMeta return (
    @@ -33,22 +26,10 @@ const GlossaryTemplateComponent = (props) => { meta.terms.map(t =>
  • {t.display}
  • ) }
-
+
) } -export const pageQuery = graphql` - query GlossaryTemplate($glossaryPath: String!) { - markdownRemark(fileAbsolutePath: {eq: $glossaryPath} ) { - id - html - frontmatter { - permalink - } - } - } -` - export default (props: Props) => diff --git a/packages/typescriptlang-org/src/templates/pages/cheatsheets.tsx b/packages/typescriptlang-org/src/templates/pages/cheatsheets.tsx index f090ee6ea6bd..1c76aff03723 100644 --- a/packages/typescriptlang-org/src/templates/pages/cheatsheets.tsx +++ b/packages/typescriptlang-org/src/templates/pages/cheatsheets.tsx @@ -32,21 +32,21 @@ const Index: React.FC = (props) => {
- - Control Flow Analysis Cheat Sheet + + Control Flow Analysis Cheat Sheet
{i("cht_cfa")}
- - Interfaces Cheat Sheet + + Interfaces Cheat Sheet
{i("cht_interfaces")}
- - Types Cheat Sheet + + Types Cheat Sheet
{i("cht_types")}
- - Classes Cheat Sheet + + Classes Cheat Sheet
{i("cht_classes")}
diff --git a/packages/typescriptlang-org/src/templates/pages/community.tsx b/packages/typescriptlang-org/src/templates/pages/community.tsx index 45dabd3b0c4e..243596c7c20f 100644 --- a/packages/typescriptlang-org/src/templates/pages/community.tsx +++ b/packages/typescriptlang-org/src/templates/pages/community.tsx @@ -1,6 +1,6 @@ import * as React from "react" import { Layout } from "../../components/layout" -import { graphql } from "gatsby" + import { createInternational } from "../../lib/createInternational" import { useIntl } from "react-intl" import { Intl } from "../../components/Intl" @@ -18,8 +18,8 @@ const conferences = url: "https://tsconf.eu", date: "March 31st, 2020", country: "Austria", - logo: require("../../assets/community/conferences/tsconf-eu-2020-logo.png"), - headline: require("../../assets/community/conferences/tsconf-eu-2020-logo.png"), + logo: "/assets/community/conferences/tsconf-eu-2020-logo.png", + headline: "/assets/community/conferences/tsconf-eu-2020-logo.png", bio: "TSConf:EU 2020 is the first conference for the TypeScript community. Join us for an unforgettable day in the heart of Europe!", } ] @@ -186,7 +186,7 @@ export const Comm: React.FC = props => {
{meetups.map(({ meetup }, index) => ( - {"logo + {"logo

{meetup.title}

{meetup.country}
diff --git a/packages/typescriptlang-org/src/templates/pages/css/index.scss b/packages/typescriptlang-org/src/templates/pages/css/index.scss index 929591f5e180..183cd9df3fb8 100644 --- a/packages/typescriptlang-org/src/templates/pages/css/index.scss +++ b/packages/typescriptlang-org/src/templates/pages/css/index.scss @@ -506,15 +506,44 @@ $headline-foreground-bg: white; pre { margin: 0; + padding: 12px; background-color: #235a97; border: none; code { font-size: 14px; line-height: 16px; + white-space: pre; + } + .line { + min-height: 1rem; + } + .error, + .error-behind { + margin-left: -14px; + margin-top: 8px; + margin-bottom: 4px; + padding: 6px; + padding-left: 14px; + width: calc(100% - 20px); + white-space: pre-wrap; + display: block; } .error { + position: absolute; background-color: #ff000026; color: #ffc5c5; + display: flex; + align-items: center; + padding-left: 12px; + padding-right: 8px; + } + .error .code { + display: none; + } + .error-behind { + user-select: none; + visibility: hidden; + color: transparent; } } diff --git a/packages/typescriptlang-org/src/templates/pages/docs/handbook/index.tsx b/packages/typescriptlang-org/src/templates/pages/docs/handbook/index.tsx index 4bc85a4e238f..c8611065bae1 100644 --- a/packages/typescriptlang-org/src/templates/pages/docs/handbook/index.tsx +++ b/packages/typescriptlang-org/src/templates/pages/docs/handbook/index.tsx @@ -1,6 +1,6 @@ import * as React from "react" import { Layout } from "../../../../components/layout" -import { Link } from "gatsby" +/* Link replaced with */ import "../../css/documentation.scss" import "../../../documentation.scss" @@ -45,7 +45,7 @@ const HandbookIndex: React.FC = (props) => { if (item.items) return null return
  • - {item.title} + {item.title}
  • })} diff --git a/packages/typescriptlang-org/src/templates/pages/docs/index.tsx b/packages/typescriptlang-org/src/templates/pages/docs/index.tsx index 41ed2f824f42..03431960dd51 100644 --- a/packages/typescriptlang-org/src/templates/pages/docs/index.tsx +++ b/packages/typescriptlang-org/src/templates/pages/docs/index.tsx @@ -12,7 +12,7 @@ import { useIntl } from "react-intl"; import { QuickJump } from "../../../components/QuickJump"; import { getDocumentationNavForLanguage } from "../../../lib/documentationNavigation" -import { Link } from "gatsby" +/* Link replaced with */ import "../css/documentation.scss" import "../../documentation.scss" @@ -35,22 +35,22 @@ const Index: React.FC = (props) => { { id: "1", title: i("cht_cfa"), - permalink: require("../../../../static/images/cheatsheets/TypeScript Control Flow Analysis.png").default + permalink: "/images/cheatsheets/TypeScript Control Flow Analysis.png" }, { id: "2", title: i("cht_classes"), - permalink: require("../../../../static/images/cheatsheets/TypeScript Classes.png").default + permalink: "/images/cheatsheets/TypeScript Classes.png" }, { id: "3", title: i("cht_interfaces"), - permalink: require("../../../../static/images/cheatsheets/TypeScript Interfaces.png").default + permalink: "/images/cheatsheets/TypeScript Interfaces.png" }, { id: "4", title: i("cht_types"), - permalink: require("../../../../static/images/cheatsheets/TypeScript Types.png").default + permalink: "/images/cheatsheets/TypeScript Types.png" }, { id: "5", @@ -75,7 +75,7 @@ const Index: React.FC = (props) => { return
  • { path.endsWith(".png") || path.endsWith(".zip") ? {item.title} : - {item.title} + {item.title} }
  • } diff --git a/packages/typescriptlang-org/src/templates/pages/index.tsx b/packages/typescriptlang-org/src/templates/pages/index.tsx index 69ab950fa409..bbe947bd6155 100644 --- a/packages/typescriptlang-org/src/templates/pages/index.tsx +++ b/packages/typescriptlang-org/src/templates/pages/index.tsx @@ -1,5 +1,5 @@ import React, { useEffect } from "react" -import {withPrefix} from "gatsby" +import { withPrefix } from "../../lib/withPrefix" import { Layout } from "../../components/layout" import { Intl } from "../../components/Intl" import { VersionBar } from "../../components/VersionBar" diff --git a/packages/typescriptlang-org/src/templates/pages/tools.tsx b/packages/typescriptlang-org/src/templates/pages/tools.tsx index 761b3fc62f7e..b5afcacd8d1e 100644 --- a/packages/typescriptlang-org/src/templates/pages/tools.tsx +++ b/packages/typescriptlang-org/src/templates/pages/tools.tsx @@ -22,14 +22,14 @@ const Index: React.FC = (props) => { - Preview of the TypeScript Playground screenshot + Preview of the TypeScript Playground screenshot

    Playground

    A live environment for exploring, learning and sharing TypeScript code. Try different compiler flags, run through extensive code samples to learn specifics about how TypeScript works.

    - +

    TSConfig Reference

    An annotated reference to more than a hundred compiler options available in a tsconfig.json or jsconfig.json.

    @@ -38,7 +38,7 @@ const Index: React.FC = (props) => { - Preview of the cheat sheets page + Preview of the cheat sheets page

    Cheat Sheets

    Quickly look up the syntax for common TypeScript code.

    diff --git a/packages/typescriptlang-org/src/templates/play-example.tsx b/packages/typescriptlang-org/src/templates/play-example.tsx index 1bae139d83db..821ee3ac55f7 100644 --- a/packages/typescriptlang-org/src/templates/play-example.tsx +++ b/packages/typescriptlang-org/src/templates/play-example.tsx @@ -7,7 +7,7 @@ import { useIntl } from "react-intl"; import { createInternational } from "../lib/createInternational" import { headCopy } from "../copy/en/head-seo" import { Intl } from "../components/Intl" -import { withPrefix } from "gatsby"; +import { withPrefix } from "../lib/withPrefix" type Props = { pageContext: { diff --git a/packages/typescriptlang-org/src/templates/play.tsx b/packages/typescriptlang-org/src/templates/play.tsx index d22b956618ad..8969a30084fc 100644 --- a/packages/typescriptlang-org/src/templates/play.tsx +++ b/packages/typescriptlang-org/src/templates/play.tsx @@ -1,7 +1,7 @@ import React, { useEffect } from "react" import ReactDOM from "react-dom" import { Layout } from "../components/layout" -import { withPrefix } from "gatsby" +import { withPrefix } from "../lib/withPrefix" import "./play.scss" import { RenderExamples } from "../components/ShowExamples" @@ -18,7 +18,7 @@ import "reflect-metadata" import playgroundReleases from "../../../sandbox/src/releases.json" import { getPlaygroundUrls } from "../lib/playgroundURLs" -import type * as playgroundPackage from "../../static/js/playground"; +import type * as playgroundPackage from "../../public/js/playground"; // This gets set by the playground declare const playground: playgroundPackage.Playground; @@ -26,7 +26,7 @@ declare const playground: playgroundPackage.Playground; type Props = { pageContext: { lang: string - examplesTOC: typeof import("../../static/js/examples/en.json") + examplesTOC: typeof import("../data/examples/en.json") optionsSummary: any // this is just passed through to the playground JS library at this point playgroundHandbookTOC: { docs: any[] } } @@ -141,8 +141,8 @@ const Play: React.FC = (props) => { // Allow prod builds to set a custom commit prefix to bust caches const { sandboxRoot, playgroundRoot, playgroundWorker } = getPlaygroundUrls() - // @ts-ignore - const re: any = global.require + // @ts-ignore - vs.loader.js sets window.require + const re: any = window.require re.config({ paths: { vs: urlForMonaco, @@ -166,7 +166,7 @@ const Play: React.FC = (props) => { re(["vs/editor/editor.main", "vs/language/typescript/tsWorker", "typescript-sandbox/index", "typescript-playground/index"], async (main: typeof import("monaco-editor"), tsWorker: any, sandbox: typeof import("@typescript/sandbox"), playground: typeof playgroundPackage) => { // Importing "vs/language/typescript/tsWorker" will set ts as a global - const ts = (global as any).ts || tsWorker.typescript + const ts = (window as any).ts || tsWorker.typescript const isOK = main && ts && sandbox && playground if (isOK) { document.getElementById("loader")!.parentNode?.removeChild(document.getElementById("loader")!) diff --git a/packages/typescriptlang-org/src/templates/playgroundHandbook.tsx b/packages/typescriptlang-org/src/templates/playgroundHandbook.tsx index 83d71ce96ab6..334f03fc734f 100644 --- a/packages/typescriptlang-org/src/templates/playgroundHandbook.tsx +++ b/packages/typescriptlang-org/src/templates/playgroundHandbook.tsx @@ -7,7 +7,7 @@ import { useIntl } from "react-intl"; import { createInternational } from "../lib/createInternational" import { headCopy } from "../copy/en/head-seo" import { Intl } from "../components/Intl" -import { withPrefix } from "gatsby"; +import { withPrefix } from "../lib/withPrefix" type Props = { pageContext: { diff --git a/packages/typescriptlang-org/src/templates/tsconfigOptionOnePage.tsx b/packages/typescriptlang-org/src/templates/tsconfigOptionOnePage.tsx index 23fb2ca59f0c..e19790148257 100644 --- a/packages/typescriptlang-org/src/templates/tsconfigOptionOnePage.tsx +++ b/packages/typescriptlang-org/src/templates/tsconfigOptionOnePage.tsx @@ -7,7 +7,7 @@ import { useIntl } from "react-intl"; import { createInternational } from "../lib/createInternational" import { headCopy } from "../copy/en/head-seo" import { Intl } from "../components/Intl" -import { withPrefix } from "gatsby"; +import { withPrefix } from "../lib/withPrefix" type Props = { pageContext: { diff --git a/packages/typescriptlang-org/src/templates/tsconfigReference.tsx b/packages/typescriptlang-org/src/templates/tsconfigReference.tsx index ab8b719b5ee1..9a6b935c8927 100644 --- a/packages/typescriptlang-org/src/templates/tsconfigReference.tsx +++ b/packages/typescriptlang-org/src/templates/tsconfigReference.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from "react" -import { graphql } from "gatsby" + import { Layout } from "../components/layout" @@ -16,7 +16,7 @@ type Category = { anchor: string, display: string, options: Array<{ anchor: stri type Props = { pageContext: { categories: Category[], - tsconfigMDPath: string, + html: string, intro: { html: string header: string @@ -24,19 +24,11 @@ type Props = { }, locale: string }, - data: GatsbyTypes.TSConfigReferenceTemplateQuery, - path: string } const TSConfigReferenceTemplateComponent = (props: Props) => { const i = createInternational(useIntl()) - const post = props.data.markdownRemark - if (!post) { - console.log("Could not render:", JSON.stringify(props)) - return
    - } - useEffect(() => { const calculateOffset = ( target: HTMLElement, @@ -200,25 +192,11 @@ const TSConfigReferenceTemplateComponent = (props: Props) => {
    -
    +
    ) } -export const pageQuery = graphql` -query TSConfigReferenceTemplate($tsconfigMDPath: String!) { - - markdownRemark(fileAbsolutePath: {eq: $tsconfigMDPath} ) { - id - html - frontmatter { - permalink - } - } -} -` - - export default (props: Props) => diff --git a/packages/typescriptlang-org/static/.gitattributes b/packages/typescriptlang-org/static/.gitattributes deleted file mode 100644 index db1dbfc4eec0..000000000000 --- a/packages/typescriptlang-org/static/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -js/* -diff -css/* -diff diff --git a/packages/typescriptlang-org/static/License.html b/packages/typescriptlang-org/static/License.html deleted file mode 100644 index 7d38555c635c..000000000000 --- a/packages/typescriptlang-org/static/License.html +++ /dev/null @@ -1,1265 +0,0 @@ - - - - TypeScript for Microsoft Visual Studio - - - -
    -

    - MICROSOFT SOFTWARE LICENSE TERMS -

    - -
    -

    - MICROSOFT VISUAL STUDIO 2015 ADD-ONs, VISUAL STUDIO SHELLS and C++ - REDISTRIBUTABLE - -

    -
    - -

    - These license terms are an agreement between Microsoft Corporation - (or based on where you live, one of its affiliates) and you. They - apply to the software named above. The terms also apply to any - Microsoft services or updates for the software, except to the extent - those have different terms. -

    - -
    -

    - IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS - BELOW. -

    -
    - -

    - 1.    - INSTALLATION AND USE RIGHTS. -

    - -

    - a.    - You may install and use any number of copies of the software. -

    - -

    - b.    - Backup copy. You may make one backup copy of the software, for reinstalling the - software. -

    - -

    - 2.    - TERMS FOR SPECIFIC COMPONENTS. -

    - -

    - a.    - Utilities. The software may contain some items on the Utilities List at - http://go.microsoft.com/fwlink/?LinkID=615231&clcid=0x409.   You may copy and install those items, if included with the - software, on your machines or third party machines, to debug and - deploy your applications and databases you develop with the software. Please note that Utilities are designed for temporary use, that - Microsoft may not be able to patch or update Utilities separately from - the rest of the software, and that some Utilities by their nature may - make it possible for others to access machines on which they are - installed. As a result, you should delete all Utilities you have - installed after you finish debugging or deploying your applications - and databases.  Microsoft is not responsible for any third party use - or access of Utilities you install on any machine. -

    - -

    - b.    - Microsoft Platforms. The software may include components from Microsoft Windows; Microsoft - Windows Server; Microsoft SQL Server; Microsoft Exchange; Microsoft - Office; and Microsoft SharePoint. These components are governed by - separate agreements and their own product support policies, as - described in - the license terms found in the installation directory for that - component or in the “Licenses” folder accompanying the software. -

    - -

    - c.     - Third Party Components.  The software may include third party components with separate legal - notices or governed by other agreements, as may be described in the - ThirdPartyNotices file accompanying the software. Even if such - components are governed by other agreements, the disclaimers and the - limitations on and exclusions of damages below also apply.  - -

    - -

    - 3.    - DATA. The software may collect information about you and your use of the - software, and send that to Microsoft. Microsoft may use this - information to provide services and improve our products and services. -  You may opt-out of many of these scenarios, but not all, as described - in the product documentation. There are also some features in the software that may enable you to collect data - from users of your applications. - If you use these features to enable data collection in your - applications, you must comply with applicable law, including providing - appropriate notices to users of your applications. You can learn more - about data collection and use in the help documentation and the - privacy statement at http://go.microsoft.com/fwlink/?LinkId=528096&clcid=0x409. - Your use of the software operates as your consent to these - practices. -

    - -

    - 4.    - SCOPE OF LICENSE. - The software is licensed, not sold. This agreement only gives you some - rights to use the software. Microsoft reserves all other rights. - Unless applicable law gives you more rights despite this limitation, - you may use the software only as expressly permitted in this - agreement. In doing so, you must comply with any technical limitations - in the software that only allow you to use it in certain ways. You may - not -

    - -

    - ·         - work around any technical limitations in the software; -

    - -

    - ·         - reverse engineer, decompile or disassemble the software, except and - only to the extent that applicable law expressly permits, despite this - limitation; -

    - -

    - ·         - remove, minimize, block or modify any notices of Microsoft or its - suppliers in the software; - -

    - -

    - ·         - use the software in any way that is against the law; or -

    - -

    - ·         - share, publish or lend the software, or provide the software as a - stand-alone hosted as solution for others to use, or transfer the - software or this agreement to any third party. -

    - -

    - 5.    - EXPORT RESTRICTIONS. Microsoft software, online services, professional services and related - technology are subject to U.S. export jurisdiction. You must comply - with all applicable international and national laws, including the - U.S. Export Administration Regulations, the International Traffic in - Arms Regulations, Office of Foreign Assets Control sanctions programs, - and end-user, end use and destination restrictions by the U.S. and - other governments related to Microsoft products, services and - technologies. For additional information, see www.microsoft.com/exporting. -

    - -

    - 6.    - SUPPORT SERVICES. Because this software is “as is,” we may not provide support services - for it. -

    - -

    - 7.    - ENTIRE AGREEMENT. - This agreement, and the terms for supplements, updates, Internet-based - services and support services that you use, are the entire agreement - for the software and support services. -

    - -

    - 8.    - APPLICABLE LAW. If you acquired the software in the United States, Washington law - applies to interpretation of and claims for breach of this agreement, - and the laws of the state where you live apply to all other claims. If - you acquired the software in any other country, its laws apply. -

    - -

    - 9.    - LEGAL EFFECT. - This agreement describes certain legal rights. You may have other - rights under the laws of your state or country. This agreement does - not change your rights under the laws of your state or country if the - laws of your state or country do not permit it to do so. Without limitation of the foregoing, for Australia, YOU HAVE STATUTORY GUARANTEES UNDER THE AUSTRALIAN CONSUMER LAW AND - NOTHING IN THESE TERMS IS INTENDED TO AFFECT THOSE RIGHTS -

    - -

    - 10.  DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS.” YOU BEAR - THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, - GUARANTEES OR CONDITIONS. TO THE EXTENT PERMITTED UNDER YOUR LOCAL - LAWS, MICROSOFT EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -

    - -

    - 11.  LIMITATION ON AND EXCLUSION OF DAMAGES. YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT - DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, - INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL - DAMAGES. -

    - -

    - This limitation applies to (a) anything related to the software, - services, content (including code) on third party Internet sites, or - third party applications; and (b) claims for breach of contract, - breach of warranty, guarantee or condition, strict liability, - negligence, or other tort to the extent permitted by applicable - law. -

    - -

    - It also applies even if Microsoft knew or should have known about the - possibility of the damages. The above limitation or exclusion may not - apply to you because your country may not allow the exclusion or - limitation of incidental, consequential or other damages. -

    -
    - - diff --git a/packages/typescriptlang-org/static/Web.config b/packages/typescriptlang-org/static/Web.config deleted file mode 100644 index 4ef9bd913682..000000000000 --- a/packages/typescriptlang-org/static/Web.config +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/typescriptlang-org/static/assets/.gitkeep b/packages/typescriptlang-org/static/assets/.gitkeep deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/packages/typescriptlang-org/static/assets/typescript-cheat-sheets.zip b/packages/typescriptlang-org/static/assets/typescript-cheat-sheets.zip deleted file mode 100644 index 6647d9b11161..000000000000 Binary files a/packages/typescriptlang-org/static/assets/typescript-cheat-sheets.zip and /dev/null differ diff --git a/packages/typescriptlang-org/static/branding/palette.png b/packages/typescriptlang-org/static/branding/palette.png deleted file mode 100644 index 32d3719b0cf4..000000000000 Binary files a/packages/typescriptlang-org/static/branding/palette.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/branding/ts-lettermark-blue.png b/packages/typescriptlang-org/static/branding/ts-lettermark-blue.png deleted file mode 100644 index f1b095f0e5af..000000000000 Binary files a/packages/typescriptlang-org/static/branding/ts-lettermark-blue.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/branding/ts-lettermark-blue.svg b/packages/typescriptlang-org/static/branding/ts-lettermark-blue.svg deleted file mode 100644 index f3a050d25c49..000000000000 --- a/packages/typescriptlang-org/static/branding/ts-lettermark-blue.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/typescriptlang-org/static/branding/ts-lettermark-white.png b/packages/typescriptlang-org/static/branding/ts-lettermark-white.png deleted file mode 100644 index 8f45ca2aec70..000000000000 Binary files a/packages/typescriptlang-org/static/branding/ts-lettermark-white.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/branding/ts-lettermark-white.svg b/packages/typescriptlang-org/static/branding/ts-lettermark-white.svg deleted file mode 100644 index 8572bab07cc2..000000000000 --- a/packages/typescriptlang-org/static/branding/ts-lettermark-white.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/typescriptlang-org/static/branding/ts-logo-128.png b/packages/typescriptlang-org/static/branding/ts-logo-128.png deleted file mode 100644 index fb2bb1c9638c..000000000000 Binary files a/packages/typescriptlang-org/static/branding/ts-logo-128.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/branding/ts-logo-128.svg b/packages/typescriptlang-org/static/branding/ts-logo-128.svg deleted file mode 100644 index b65a93a8d7cf..000000000000 --- a/packages/typescriptlang-org/static/branding/ts-logo-128.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/typescriptlang-org/static/branding/ts-logo-256.png b/packages/typescriptlang-org/static/branding/ts-logo-256.png deleted file mode 100644 index c6b95b2afae4..000000000000 Binary files a/packages/typescriptlang-org/static/branding/ts-logo-256.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/branding/ts-logo-256.svg b/packages/typescriptlang-org/static/branding/ts-logo-256.svg deleted file mode 100644 index 1233b3860b7d..000000000000 --- a/packages/typescriptlang-org/static/branding/ts-logo-256.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/typescriptlang-org/static/branding/ts-logo-512.png b/packages/typescriptlang-org/static/branding/ts-logo-512.png deleted file mode 100644 index 28d71eb7c3ca..000000000000 Binary files a/packages/typescriptlang-org/static/branding/ts-logo-512.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/branding/ts-logo-512.svg b/packages/typescriptlang-org/static/branding/ts-logo-512.svg deleted file mode 100644 index a46d53d49f36..000000000000 --- a/packages/typescriptlang-org/static/branding/ts-logo-512.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/typescriptlang-org/static/branding/ts-logo-round-128.png b/packages/typescriptlang-org/static/branding/ts-logo-round-128.png deleted file mode 100644 index 0e7a6187b340..000000000000 Binary files a/packages/typescriptlang-org/static/branding/ts-logo-round-128.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/branding/ts-logo-round-128.svg b/packages/typescriptlang-org/static/branding/ts-logo-round-128.svg deleted file mode 100644 index f48767a49c26..000000000000 --- a/packages/typescriptlang-org/static/branding/ts-logo-round-128.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/typescriptlang-org/static/branding/ts-logo-round-256.png b/packages/typescriptlang-org/static/branding/ts-logo-round-256.png deleted file mode 100644 index f276199cf358..000000000000 Binary files a/packages/typescriptlang-org/static/branding/ts-logo-round-256.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/branding/ts-logo-round-256.svg b/packages/typescriptlang-org/static/branding/ts-logo-round-256.svg deleted file mode 100644 index ead0ed21944b..000000000000 --- a/packages/typescriptlang-org/static/branding/ts-logo-round-256.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/typescriptlang-org/static/branding/ts-logo-round-512.png b/packages/typescriptlang-org/static/branding/ts-logo-round-512.png deleted file mode 100644 index ffb9df3b8240..000000000000 Binary files a/packages/typescriptlang-org/static/branding/ts-logo-round-512.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/branding/ts-logo-round-512.svg b/packages/typescriptlang-org/static/branding/ts-logo-round-512.svg deleted file mode 100644 index cf7ce8ff2ce9..000000000000 --- a/packages/typescriptlang-org/static/branding/ts-logo-round-512.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/typescriptlang-org/static/branding/ts-logo-single-color-black.svg b/packages/typescriptlang-org/static/branding/ts-logo-single-color-black.svg deleted file mode 100644 index dfc6c8cacf9d..000000000000 --- a/packages/typescriptlang-org/static/branding/ts-logo-single-color-black.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/packages/typescriptlang-org/static/branding/ts-logo-single-color-white.svg b/packages/typescriptlang-org/static/branding/ts-logo-single-color-white.svg deleted file mode 100644 index effda54177cb..000000000000 --- a/packages/typescriptlang-org/static/branding/ts-logo-single-color-white.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/packages/typescriptlang-org/static/branding/typescript-design-assets.zip b/packages/typescriptlang-org/static/branding/typescript-design-assets.zip deleted file mode 100644 index 8e26a3cc75a4..000000000000 Binary files a/packages/typescriptlang-org/static/branding/typescript-design-assets.zip and /dev/null differ diff --git a/packages/typescriptlang-org/static/css/docsearch.css b/packages/typescriptlang-org/static/css/docsearch.css deleted file mode 100644 index 06bada07d657..000000000000 --- a/packages/typescriptlang-org/static/css/docsearch.css +++ /dev/null @@ -1 +0,0 @@ -.searchbox{display:inline-block;position:relative;width:200px;height:32px!important;white-space:nowrap;box-sizing:border-box;visibility:visible!important}.searchbox .algolia-autocomplete{display:block;width:100%;height:100%}.searchbox__wrapper{width:100%;height:100%;z-index:999;position:relative}.searchbox__input{display:inline-block;box-sizing:border-box;transition:box-shadow .4s ease,background .4s ease;border:0;border-radius:16px;box-shadow:inset 0 0 0 1px #ccc;background:#fff!important;padding:0 26px 0 32px;width:100%;height:100%;vertical-align:middle;white-space:normal;font-size:12px;-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbox__input::-webkit-search-cancel-button,.searchbox__input::-webkit-search-decoration,.searchbox__input::-webkit-search-results-button,.searchbox__input::-webkit-search-results-decoration{display:none}.searchbox__input:hover{box-shadow:inset 0 0 0 1px #b3b3b3}.searchbox__input:active,.searchbox__input:focus{outline:0;box-shadow:inset 0 0 0 1px #aaa;background:#fff}.searchbox__input::-webkit-input-placeholder{color:#aaa}.searchbox__input:-ms-input-placeholder{color:#aaa}.searchbox__input::-ms-input-placeholder{color:#aaa}.searchbox__input::placeholder{color:#aaa}.searchbox__submit{position:absolute;top:0;margin:0;border:0;border-radius:16px 0 0 16px;background-color:rgba(69,142,225,0);padding:0;width:32px;height:100%;vertical-align:middle;text-align:center;font-size:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;right:inherit;left:0}.searchbox__submit:before{display:inline-block;margin-right:-4px;height:100%;vertical-align:middle;content:""}.searchbox__submit:active,.searchbox__submit:hover{cursor:pointer}.searchbox__submit:focus{outline:0}.searchbox__submit svg{width:14px;height:14px;vertical-align:middle;fill:#6d7e96}.searchbox__reset{display:block;position:absolute;top:8px;right:8px;margin:0;border:0;background:none;cursor:pointer;padding:0;font-size:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;fill:rgba(0,0,0,.5)}.searchbox__reset.hide{display:none}.searchbox__reset:focus{outline:0}.searchbox__reset svg{display:block;margin:4px;width:8px;height:8px}.searchbox__input:valid~.searchbox__reset{display:block;-webkit-animation-name:sbx-reset-in;animation-name:sbx-reset-in;-webkit-animation-duration:.15s;animation-duration:.15s}@-webkit-keyframes sbx-reset-in{0%{-webkit-transform:translate3d(-20%,0,0);transform:translate3d(-20%,0,0);opacity:0}to{-webkit-transform:none;transform:none;opacity:1}}@keyframes sbx-reset-in{0%{-webkit-transform:translate3d(-20%,0,0);transform:translate3d(-20%,0,0);opacity:0}to{-webkit-transform:none;transform:none;opacity:1}}.algolia-autocomplete.algolia-autocomplete-right .ds-dropdown-menu{right:0!important;left:inherit!important}.algolia-autocomplete.algolia-autocomplete-right .ds-dropdown-menu:before{right:48px}.algolia-autocomplete.algolia-autocomplete-left .ds-dropdown-menu{left:0!important;right:inherit!important}.algolia-autocomplete.algolia-autocomplete-left .ds-dropdown-menu:before{left:48px}.algolia-autocomplete .ds-dropdown-menu{top:-6px;border-radius:4px;margin:6px 0 0;padding:0;text-align:left;height:auto;position:relative;background:transparent;border:none;z-index:999;max-width:600px;min-width:500px;box-shadow:0 1px 0 0 rgba(0,0,0,.2),0 2px 3px 0 rgba(0,0,0,.1)}.algolia-autocomplete .ds-dropdown-menu:before{display:block;position:absolute;content:"";width:14px;height:14px;background:#fff;z-index:1000;top:-7px;border-top:1px solid #d9d9d9;border-right:1px solid #d9d9d9;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);border-radius:2px}.algolia-autocomplete .ds-dropdown-menu .ds-suggestions{position:relative;z-index:1000;margin-top:8px}.algolia-autocomplete .ds-dropdown-menu .ds-suggestions a:hover{text-decoration:none}.algolia-autocomplete .ds-dropdown-menu .ds-suggestion{cursor:pointer}.algolia-autocomplete .ds-dropdown-menu .ds-suggestion.ds-cursor .algolia-docsearch-suggestion.suggestion-layout-simple,.algolia-autocomplete .ds-dropdown-menu .ds-suggestion.ds-cursor .algolia-docsearch-suggestion:not(.suggestion-layout-simple) .algolia-docsearch-suggestion--content{background-color:rgba(69,142,225,.05)}.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-]{position:relative;border:1px solid #d9d9d9;background:#fff;border-radius:4px;overflow:auto;padding:0 8px 8px}.algolia-autocomplete .ds-dropdown-menu *{box-sizing:border-box}.algolia-autocomplete .algolia-docsearch-suggestion{display:block;position:relative;padding:0 8px;background:#fff;color:#02060c;overflow:hidden}.algolia-autocomplete .algolia-docsearch-suggestion--highlight{color:#174d8c;background:rgba(143,187,237,.1);padding:.1em .05em}.algolia-autocomplete .algolia-docsearch-suggestion--category-header .algolia-docsearch-suggestion--category-header-lvl0 .algolia-docsearch-suggestion--highlight,.algolia-autocomplete .algolia-docsearch-suggestion--category-header .algolia-docsearch-suggestion--category-header-lvl1 .algolia-docsearch-suggestion--highlight,.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight{padding:0 0 1px;background:inherit;box-shadow:inset 0 -2px 0 0 rgba(69,142,225,.8);color:inherit}.algolia-autocomplete .algolia-docsearch-suggestion--content{display:block;float:right;width:70%;position:relative;padding:5.33333px 0 5.33333px 10.66667px;cursor:pointer}.algolia-autocomplete .algolia-docsearch-suggestion--content:before{content:"";position:absolute;display:block;top:0;height:100%;width:1px;background:#ddd;left:-1px}.algolia-autocomplete .algolia-docsearch-suggestion--category-header{position:relative;border-bottom:1px solid #ddd;display:none;margin-top:8px;padding:4px 0;font-size:1em;color:#33363d}.algolia-autocomplete .algolia-docsearch-suggestion--wrapper{width:100%;float:left;padding:8px 0 0}.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column{float:left;width:30%;text-align:right;position:relative;padding:5.33333px 10.66667px;color:#a4a7ae;font-size:.9em;word-wrap:break-word}.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column:before{content:"";position:absolute;display:block;top:0;height:100%;width:1px;background:#ddd;right:0}.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-inline{display:none}.algolia-autocomplete .algolia-docsearch-suggestion--title{margin-bottom:4px;color:#02060c;font-size:.9em;font-weight:700}.algolia-autocomplete .algolia-docsearch-suggestion--text{display:block;line-height:1.2em;font-size:.85em;color:#63676d}.algolia-autocomplete .algolia-docsearch-suggestion--no-results{width:100%;padding:8px 0;text-align:center;font-size:1.2em}.algolia-autocomplete .algolia-docsearch-suggestion--no-results:before{display:none}.algolia-autocomplete .algolia-docsearch-suggestion code{padding:1px 5px;font-size:90%;border:none;color:#222;background-color:#ebebeb;border-radius:3px;font-family:Menlo,Monaco,Consolas,Courier New,monospace}.algolia-autocomplete .algolia-docsearch-suggestion code .algolia-docsearch-suggestion--highlight{background:none}.algolia-autocomplete .algolia-docsearch-suggestion.algolia-docsearch-suggestion__main .algolia-docsearch-suggestion--category-header,.algolia-autocomplete .algolia-docsearch-suggestion.algolia-docsearch-suggestion__secondary{display:block}@media (min-width:768px){.algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--subcategory-column{display:block}}@media (max-width:768px){.algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--subcategory-column{display:inline-block;width:auto;float:left;padding:0;color:#02060c;font-size:.9em;font-weight:700;text-align:left;opacity:.5}.algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--subcategory-column:before{display:none}.algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--subcategory-column:after{content:"|"}.algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--content{display:inline-block;width:auto;text-align:left;float:left;padding:0}.algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--content:before{display:none}}.algolia-autocomplete .suggestion-layout-simple.algolia-docsearch-suggestion{border-bottom:1px solid #eee;padding:8px;margin:0}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--content{width:100%;padding:0}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--content:before{display:none}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--category-header{margin:0;padding:0;display:block;width:100%;border:none}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--category-header-lvl0,.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--category-header-lvl1{opacity:.6;font-size:.85em}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--category-header-lvl1:before{background-image:url('data:image/svg+xml;utf8,');content:"";width:10px;height:10px;display:inline-block}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--wrapper{width:100%;float:left;margin:0;padding:0}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--duplicate-content,.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--subcategory-inline{display:none!important}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--title{margin:0;color:#458ee1;font-size:.9em;font-weight:400}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--title:before{content:"#";font-weight:700;color:#458ee1;display:inline-block}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--text{margin:4px 0 0;display:block;line-height:1.4em;padding:5.33333px 8px;background:#f8f8f8;font-size:.85em;opacity:.8}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight{color:#3f4145;font-weight:700;box-shadow:none}.algolia-autocomplete .algolia-docsearch-footer{width:134px;height:20px;z-index:2000;margin-top:10.66667px;float:right;font-size:0;line-height:0}.algolia-autocomplete .algolia-docsearch-footer--logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='168' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cpath d='M78.988.938h16.594a2.968 2.968 0 0 1 2.966 2.966V20.5a2.967 2.967 0 0 1-2.966 2.964H78.988a2.967 2.967 0 0 1-2.966-2.964V3.897A2.961 2.961 0 0 1 78.988.938zm41.937 17.866c-4.386.02-4.386-3.54-4.386-4.106l-.007-13.336 2.675-.424v13.254c0 .322 0 2.358 1.718 2.364v2.248zm-10.846-2.18c.821 0 1.43-.047 1.855-.129v-2.719a6.334 6.334 0 0 0-1.574-.199 5.7 5.7 0 0 0-.897.069 2.699 2.699 0 0 0-.814.24c-.24.116-.439.28-.582.491-.15.212-.219.335-.219.656 0 .628.219.991.616 1.23s.938.362 1.615.362zm-.233-9.7c.883 0 1.629.109 2.231.328.602.218 1.088.525 1.444.915.363.396.609.922.76 1.483.157.56.232 1.175.232 1.85v6.874a32.5 32.5 0 0 1-1.868.314c-.834.123-1.772.185-2.813.185-.69 0-1.327-.069-1.895-.198a4.001 4.001 0 0 1-1.471-.636 3.085 3.085 0 0 1-.951-1.134c-.226-.465-.343-1.12-.343-1.803 0-.656.13-1.073.384-1.525a3.24 3.24 0 0 1 1.047-1.106c.445-.287.95-.492 1.532-.615a8.8 8.8 0 0 1 1.82-.185 8.404 8.404 0 0 1 1.972.24v-.438c0-.307-.035-.6-.11-.874a1.88 1.88 0 0 0-.384-.73 1.784 1.784 0 0 0-.724-.493 3.164 3.164 0 0 0-1.143-.205c-.616 0-1.177.075-1.69.164a7.735 7.735 0 0 0-1.26.307l-.321-2.192c.335-.117.834-.233 1.478-.349a10.98 10.98 0 0 1 2.073-.178zm52.842 9.626c.822 0 1.43-.048 1.854-.13V13.7a6.347 6.347 0 0 0-1.574-.199c-.294 0-.595.021-.896.069a2.7 2.7 0 0 0-.814.24 1.46 1.46 0 0 0-.582.491c-.15.212-.218.335-.218.656 0 .628.218.991.615 1.23.404.245.938.362 1.615.362zm-.226-9.694c.883 0 1.629.108 2.231.327.602.219 1.088.526 1.444.915.355.39.609.923.759 1.483a6.8 6.8 0 0 1 .233 1.852v6.873c-.41.088-1.034.19-1.868.314-.834.123-1.772.184-2.813.184-.69 0-1.327-.068-1.895-.198a4.001 4.001 0 0 1-1.471-.635 3.085 3.085 0 0 1-.951-1.134c-.226-.465-.343-1.12-.343-1.804 0-.656.13-1.073.384-1.524.26-.45.608-.82 1.047-1.107.445-.286.95-.491 1.532-.614a8.803 8.803 0 0 1 2.751-.13c.329.034.671.096 1.04.185v-.437a3.3 3.3 0 0 0-.109-.875 1.873 1.873 0 0 0-.384-.731 1.784 1.784 0 0 0-.724-.492 3.165 3.165 0 0 0-1.143-.205c-.616 0-1.177.075-1.69.164a7.75 7.75 0 0 0-1.26.307l-.321-2.193c.335-.116.834-.232 1.478-.348a11.633 11.633 0 0 1 2.073-.177zm-8.034-1.271a1.626 1.626 0 0 1-1.628-1.62c0-.895.725-1.62 1.628-1.62.904 0 1.63.725 1.63 1.62 0 .895-.733 1.62-1.63 1.62zm1.348 13.22h-2.689V7.27l2.69-.423v11.956zm-4.714 0c-4.386.02-4.386-3.54-4.386-4.107l-.008-13.336 2.676-.424v13.254c0 .322 0 2.358 1.718 2.364v2.248zm-8.698-5.903c0-1.156-.253-2.119-.746-2.788-.493-.677-1.183-1.01-2.067-1.01-.882 0-1.574.333-2.065 1.01-.493.676-.733 1.632-.733 2.788 0 1.168.246 1.953.74 2.63.492.683 1.183 1.018 2.066 1.018.882 0 1.574-.342 2.067-1.019.492-.683.738-1.46.738-2.63zm2.737-.007c0 .902-.13 1.584-.397 2.33a5.52 5.52 0 0 1-1.128 1.906 4.986 4.986 0 0 1-1.752 1.223c-.685.286-1.739.45-2.265.45-.528-.006-1.574-.157-2.252-.45a5.096 5.096 0 0 1-1.744-1.223c-.487-.527-.863-1.162-1.137-1.906a6.345 6.345 0 0 1-.41-2.33c0-.902.123-1.77.397-2.508a5.554 5.554 0 0 1 1.15-1.892 5.133 5.133 0 0 1 1.75-1.216c.679-.287 1.425-.423 2.232-.423.808 0 1.553.142 2.237.423a4.88 4.88 0 0 1 1.753 1.216 5.644 5.644 0 0 1 1.135 1.892c.287.738.431 1.606.431 2.508zm-20.138 0c0 1.12.246 2.363.738 2.882.493.52 1.13.78 1.91.78.424 0 .828-.062 1.204-.178.377-.116.677-.253.917-.417V9.33a10.476 10.476 0 0 0-1.766-.226c-.971-.028-1.71.37-2.23 1.004-.513.636-.773 1.75-.773 2.788zm7.438 5.274c0 1.824-.466 3.156-1.404 4.004-.936.846-2.367 1.27-4.296 1.27-.705 0-2.17-.137-3.34-.396l.431-2.118c.98.205 2.272.26 2.95.26 1.074 0 1.84-.219 2.299-.656.459-.437.684-1.086.684-1.948v-.437a8.07 8.07 0 0 1-1.047.397c-.43.13-.93.198-1.492.198-.739 0-1.41-.116-2.018-.349a4.206 4.206 0 0 1-1.567-1.025c-.431-.45-.774-1.017-1.013-1.694-.24-.677-.363-1.885-.363-2.773 0-.834.13-1.88.384-2.577.26-.696.629-1.298 1.129-1.796.493-.498 1.095-.881 1.8-1.162a6.605 6.605 0 0 1 2.428-.457c.87 0 1.67.109 2.45.24.78.129 1.444.265 1.985.415V18.17z' fill='%235468FF'/%3E%3Cpath d='M6.972 6.677v1.627c-.712-.446-1.52-.67-2.425-.67-.585 0-1.045.13-1.38.391a1.24 1.24 0 0 0-.502 1.03c0 .425.164.765.494 1.02.33.256.835.532 1.516.83.447.192.795.356 1.045.495.25.138.537.332.862.582.324.25.563.548.718.894.154.345.23.741.23 1.188 0 .947-.334 1.691-1.004 2.234-.67.542-1.537.814-2.601.814-1.18 0-2.16-.229-2.936-.686v-1.708c.84.628 1.814.942 2.92.942.585 0 1.048-.136 1.388-.407.34-.271.51-.646.51-1.125 0-.287-.1-.55-.302-.79-.203-.24-.42-.42-.655-.542-.234-.123-.585-.29-1.053-.503a61.27 61.27 0 0 1-.582-.271 13.67 13.67 0 0 1-.55-.287 4.275 4.275 0 0 1-.567-.351 6.92 6.92 0 0 1-.455-.4c-.18-.17-.31-.34-.39-.51-.08-.17-.155-.37-.224-.598a2.553 2.553 0 0 1-.104-.742c0-.915.333-1.638.998-2.17.664-.532 1.523-.798 2.576-.798.968 0 1.793.17 2.473.51zm7.468 5.696v-.287c-.022-.607-.187-1.088-.495-1.444-.309-.357-.75-.535-1.324-.535-.532 0-.99.194-1.373.583-.382.388-.622.949-.717 1.683h3.909zm1.005 2.792v1.404c-.596.34-1.383.51-2.362.51-1.255 0-2.255-.377-3-1.132-.744-.755-1.116-1.744-1.116-2.968 0-1.297.34-2.316 1.021-3.055.68-.74 1.548-1.11 2.6-1.11 1.033 0 1.852.323 2.458.966.606.644.91 1.572.91 2.784 0 .33-.033.676-.096 1.038h-5.314c.107.702.405 1.239.894 1.611.49.372 1.106.558 1.85.558.862 0 1.58-.202 2.155-.606zm6.605-1.77h-1.212c-.596 0-1.045.116-1.349.35-.303.234-.454.532-.454.894 0 .372.117.664.35.877.235.213.575.32 1.022.32.51 0 .912-.142 1.204-.424.293-.281.44-.651.44-1.108v-.91zm-4.068-2.554V9.325c.627-.361 1.457-.542 2.489-.542 2.116 0 3.175 1.026 3.175 3.08V17h-1.548v-.957c-.415.68-1.143 1.02-2.186 1.02-.766 0-1.38-.22-1.843-.661-.462-.442-.694-1.003-.694-1.684 0-.776.293-1.38.878-1.81.585-.431 1.404-.647 2.457-.647h1.34V11.8c0-.554-.133-.971-.399-1.253-.266-.282-.707-.423-1.324-.423a4.07 4.07 0 0 0-2.345.718zm9.333-1.93v1.42c.394-1 1.101-1.5 2.123-1.5.148 0 .313.016.494.048v1.531a1.885 1.885 0 0 0-.75-.143c-.542 0-.989.24-1.34.718-.351.479-.527 1.048-.527 1.707V17h-1.563V8.91h1.563zm5.01 4.084c.022.82.272 1.492.75 2.019.479.526 1.15.79 2.01.79.639 0 1.235-.176 1.788-.527v1.404c-.521.319-1.186.479-1.995.479-1.265 0-2.276-.4-3.031-1.197-.755-.798-1.133-1.792-1.133-2.984 0-1.16.38-2.151 1.14-2.975.761-.825 1.79-1.237 3.088-1.237.702 0 1.346.149 1.93.447v1.436a3.242 3.242 0 0 0-1.77-.495c-.84 0-1.513.266-2.019.798-.505.532-.758 1.213-.758 2.042zM40.24 5.72v4.579c.458-1 1.293-1.5 2.505-1.5.787 0 1.42.245 1.899.734.479.49.718 1.17.718 2.042V17h-1.564v-5.106c0-.553-.14-.98-.422-1.284-.282-.303-.652-.455-1.11-.455-.531 0-1.002.202-1.411.606-.41.405-.615 1.022-.615 1.851V17h-1.563V5.72h1.563zm14.966 10.02c.596 0 1.096-.253 1.5-.758.404-.506.606-1.157.606-1.955 0-.915-.202-1.62-.606-2.114-.404-.495-.92-.742-1.548-.742-.553 0-1.05.224-1.491.67-.442.447-.662 1.133-.662 2.058 0 .958.212 1.67.638 2.138.425.469.946.703 1.563.703zM53.004 5.72v4.42c.574-.894 1.388-1.341 2.44-1.341 1.022 0 1.857.383 2.506 1.149.649.766.973 1.781.973 3.047 0 1.138-.309 2.109-.925 2.912-.617.803-1.463 1.205-2.537 1.205-1.075 0-1.894-.447-2.457-1.34V17h-1.58V5.72h1.58zm9.908 11.104l-3.223-7.913h1.739l1.005 2.632 1.26 3.415c.096-.32.48-1.458 1.15-3.415l.909-2.632h1.66l-2.92 7.866c-.777 2.074-1.963 3.11-3.559 3.11a2.92 2.92 0 0 1-.734-.079v-1.34c.17.042.351.064.543.064 1.032 0 1.755-.57 2.17-1.708z' fill='%235D6494'/%3E%3Cpath d='M89.632 5.967v-.772a.978.978 0 0 0-.978-.977h-2.28a.978.978 0 0 0-.978.977v.793c0 .088.082.15.171.13a7.127 7.127 0 0 1 1.984-.28c.65 0 1.295.088 1.917.259.082.02.164-.04.164-.13m-6.248 1.01l-.39-.389a.977.977 0 0 0-1.382 0l-.465.465a.973.973 0 0 0 0 1.38l.383.383c.062.061.15.047.205-.014.226-.307.472-.601.746-.874.281-.28.568-.526.883-.751.068-.042.075-.137.02-.2m4.16 2.453v3.341c0 .096.104.165.192.117l2.97-1.537c.068-.034.089-.117.055-.184a3.695 3.695 0 0 0-3.08-1.866c-.068 0-.136.054-.136.13m0 8.048a4.489 4.489 0 0 1-4.49-4.482 4.488 4.488 0 0 1 4.49-4.482 4.488 4.488 0 0 1 4.489 4.482 4.484 4.484 0 0 1-4.49 4.482m0-10.85a6.363 6.363 0 1 0 0 12.729 6.37 6.37 0 0 0 6.372-6.368 6.358 6.358 0 0 0-6.371-6.36' fill='%23FFF'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;background-position:50%;background-size:100%;overflow:hidden;text-indent:-9000px;padding:0!important;width:100%;height:100%;display:block} diff --git a/packages/typescriptlang-org/static/favicon.ico b/packages/typescriptlang-org/static/favicon.ico deleted file mode 100644 index 7ecbadc45868..000000000000 Binary files a/packages/typescriptlang-org/static/favicon.ico and /dev/null differ diff --git a/packages/typescriptlang-org/static/fonts/CascadiaCode-SemiLight.woff2 b/packages/typescriptlang-org/static/fonts/CascadiaCode-SemiLight.woff2 deleted file mode 100644 index d3f5aa51c4ec..000000000000 Binary files a/packages/typescriptlang-org/static/fonts/CascadiaCode-SemiLight.woff2 and /dev/null differ diff --git a/packages/typescriptlang-org/static/fonts/CascadiaMono-SemiLight.woff2 b/packages/typescriptlang-org/static/fonts/CascadiaMono-SemiLight.woff2 deleted file mode 100644 index 045403556d44..000000000000 Binary files a/packages/typescriptlang-org/static/fonts/CascadiaMono-SemiLight.woff2 and /dev/null differ diff --git a/packages/typescriptlang-org/static/fonts/DankMono-Regular.woff2 b/packages/typescriptlang-org/static/fonts/DankMono-Regular.woff2 deleted file mode 100644 index 99c1425ce4f3..000000000000 Binary files a/packages/typescriptlang-org/static/fonts/DankMono-Regular.woff2 and /dev/null differ diff --git a/packages/typescriptlang-org/static/fonts/FiraCode-Regular.woff2 b/packages/typescriptlang-org/static/fonts/FiraCode-Regular.woff2 deleted file mode 100644 index c856e7bec833..000000000000 Binary files a/packages/typescriptlang-org/static/fonts/FiraCode-Regular.woff2 and /dev/null differ diff --git a/packages/typescriptlang-org/static/fonts/JetBrainsMono-Regular.woff2 b/packages/typescriptlang-org/static/fonts/JetBrainsMono-Regular.woff2 deleted file mode 100644 index cc9a1ae35fd6..000000000000 Binary files a/packages/typescriptlang-org/static/fonts/JetBrainsMono-Regular.woff2 and /dev/null differ diff --git a/packages/typescriptlang-org/static/fonts/OpenDyslexic-Regular.woff b/packages/typescriptlang-org/static/fonts/OpenDyslexic-Regular.woff deleted file mode 100644 index 9c15fa09e64d..000000000000 Binary files a/packages/typescriptlang-org/static/fonts/OpenDyslexic-Regular.woff and /dev/null differ diff --git a/packages/typescriptlang-org/static/fonts/OpenDyslexicMono-Regular.woff b/packages/typescriptlang-org/static/fonts/OpenDyslexicMono-Regular.woff deleted file mode 100644 index 2aac658ad42e..000000000000 Binary files a/packages/typescriptlang-org/static/fonts/OpenDyslexicMono-Regular.woff and /dev/null differ diff --git a/packages/typescriptlang-org/static/fonts/SourceCodePro-Regular.woff2 b/packages/typescriptlang-org/static/fonts/SourceCodePro-Regular.woff2 deleted file mode 100644 index 10b558e0b69a..000000000000 Binary files a/packages/typescriptlang-org/static/fonts/SourceCodePro-Regular.woff2 and /dev/null differ diff --git a/packages/typescriptlang-org/static/icons/ts-logo-512.png b/packages/typescriptlang-org/static/icons/ts-logo-512.png deleted file mode 100644 index aea910d746f6..000000000000 Binary files a/packages/typescriptlang-org/static/icons/ts-logo-512.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/branding/logo-grouping.svg b/packages/typescriptlang-org/static/images/branding/logo-grouping.svg deleted file mode 100644 index fc741bade0ce..000000000000 --- a/packages/typescriptlang-org/static/images/branding/logo-grouping.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/typescriptlang-org/static/images/branding/logos.png b/packages/typescriptlang-org/static/images/branding/logos.png deleted file mode 100644 index d2189d1d6c22..000000000000 Binary files a/packages/typescriptlang-org/static/images/branding/logos.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/branding/palette-bg.svg b/packages/typescriptlang-org/static/images/branding/palette-bg.svg deleted file mode 100644 index 27f0e394d09b..000000000000 --- a/packages/typescriptlang-org/static/images/branding/palette-bg.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/packages/typescriptlang-org/static/images/branding/palette.svg b/packages/typescriptlang-org/static/images/branding/palette.svg deleted file mode 100644 index b52dacf55252..000000000000 --- a/packages/typescriptlang-org/static/images/branding/palette.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/packages/typescriptlang-org/static/images/branding/two-colors.svg b/packages/typescriptlang-org/static/images/branding/two-colors.svg deleted file mode 100644 index c14cf023427b..000000000000 --- a/packages/typescriptlang-org/static/images/branding/two-colors.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/packages/typescriptlang-org/static/images/branding/two-longform.svg b/packages/typescriptlang-org/static/images/branding/two-longform.svg deleted file mode 100644 index d995ec62d4de..000000000000 --- a/packages/typescriptlang-org/static/images/branding/two-longform.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/packages/typescriptlang-org/static/images/cheatsheets/TypeScript Classes.png b/packages/typescriptlang-org/static/images/cheatsheets/TypeScript Classes.png deleted file mode 100644 index 933f997be635..000000000000 Binary files a/packages/typescriptlang-org/static/images/cheatsheets/TypeScript Classes.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/cheatsheets/TypeScript Control Flow Analysis.png b/packages/typescriptlang-org/static/images/cheatsheets/TypeScript Control Flow Analysis.png deleted file mode 100644 index 5bf463dfd49e..000000000000 Binary files a/packages/typescriptlang-org/static/images/cheatsheets/TypeScript Control Flow Analysis.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/cheatsheets/TypeScript Interfaces.png b/packages/typescriptlang-org/static/images/cheatsheets/TypeScript Interfaces.png deleted file mode 100644 index 5522b9081f32..000000000000 Binary files a/packages/typescriptlang-org/static/images/cheatsheets/TypeScript Interfaces.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/cheatsheets/TypeScript Types.png b/packages/typescriptlang-org/static/images/cheatsheets/TypeScript Types.png deleted file mode 100644 index 93c74a33c30c..000000000000 Binary files a/packages/typescriptlang-org/static/images/cheatsheets/TypeScript Types.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/docs/greet_person.png b/packages/typescriptlang-org/static/images/docs/greet_person.png deleted file mode 100644 index 21583fad4d89..000000000000 Binary files a/packages/typescriptlang-org/static/images/docs/greet_person.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/index/get-started-download-blue.svg b/packages/typescriptlang-org/static/images/index/get-started-download-blue.svg deleted file mode 100644 index 711f4b78ab2d..000000000000 --- a/packages/typescriptlang-org/static/images/index/get-started-download-blue.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/packages/typescriptlang-org/static/images/index/get-started-download.svg b/packages/typescriptlang-org/static/images/index/get-started-download.svg deleted file mode 100644 index 496c1f800707..000000000000 --- a/packages/typescriptlang-org/static/images/index/get-started-download.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/packages/typescriptlang-org/static/images/index/get-started-handbook-blue.svg b/packages/typescriptlang-org/static/images/index/get-started-handbook-blue.svg deleted file mode 100644 index 7948ca6b1752..000000000000 --- a/packages/typescriptlang-org/static/images/index/get-started-handbook-blue.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/packages/typescriptlang-org/static/images/index/get-started-handbook.svg b/packages/typescriptlang-org/static/images/index/get-started-handbook.svg deleted file mode 100644 index 6a808fe240fe..000000000000 --- a/packages/typescriptlang-org/static/images/index/get-started-handbook.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/packages/typescriptlang-org/static/images/index/get-started-playground-blue.svg b/packages/typescriptlang-org/static/images/index/get-started-playground-blue.svg deleted file mode 100644 index 4c01b155310c..000000000000 --- a/packages/typescriptlang-org/static/images/index/get-started-playground-blue.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/packages/typescriptlang-org/static/images/index/get-started-playground.svg b/packages/typescriptlang-org/static/images/index/get-started-playground.svg deleted file mode 100644 index f3d2930113b6..000000000000 --- a/packages/typescriptlang-org/static/images/index/get-started-playground.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/packages/typescriptlang-org/static/images/index/stack-overflow.svg b/packages/typescriptlang-org/static/images/index/stack-overflow.svg deleted file mode 100644 index b5e7474e32e9..000000000000 --- a/packages/typescriptlang-org/static/images/index/stack-overflow.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/packages/typescriptlang-org/static/images/index/state-of-js.svg b/packages/typescriptlang-org/static/images/index/state-of-js.svg deleted file mode 100644 index d63e846f2980..000000000000 --- a/packages/typescriptlang-org/static/images/index/state-of-js.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/packages/typescriptlang-org/static/images/index/ts-at-scale.jpg b/packages/typescriptlang-org/static/images/index/ts-at-scale.jpg deleted file mode 100644 index 4efcd751af58..000000000000 Binary files a/packages/typescriptlang-org/static/images/index/ts-at-scale.jpg and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/index/ts-conf-keynote.jpg b/packages/typescriptlang-org/static/images/index/ts-conf-keynote.jpg deleted file mode 100644 index 4ed71958027d..000000000000 Binary files a/packages/typescriptlang-org/static/images/index/ts-conf-keynote.jpg and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/index/what-is-new-ts.jpg b/packages/typescriptlang-org/static/images/index/what-is-new-ts.jpg deleted file mode 100644 index 36d746103663..000000000000 Binary files a/packages/typescriptlang-org/static/images/index/what-is-new-ts.jpg and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/index/wrong-ts.jpg b/packages/typescriptlang-org/static/images/index/wrong-ts.jpg deleted file mode 100644 index 1e7dacfec452..000000000000 Binary files a/packages/typescriptlang-org/static/images/index/wrong-ts.jpg and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/tools/cheat-sheets.png b/packages/typescriptlang-org/static/images/tools/cheat-sheets.png deleted file mode 100644 index 3e7ef7702b41..000000000000 Binary files a/packages/typescriptlang-org/static/images/tools/cheat-sheets.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/tools/dt-search.png b/packages/typescriptlang-org/static/images/tools/dt-search.png deleted file mode 100644 index ce644800fee1..000000000000 Binary files a/packages/typescriptlang-org/static/images/tools/dt-search.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/tools/play.png b/packages/typescriptlang-org/static/images/tools/play.png deleted file mode 100644 index 146ab7e83b89..000000000000 Binary files a/packages/typescriptlang-org/static/images/tools/play.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/tools/tsconfig-ref.png b/packages/typescriptlang-org/static/images/tools/tsconfig-ref.png deleted file mode 100644 index 955352913055..000000000000 Binary files a/packages/typescriptlang-org/static/images/tools/tsconfig-ref.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/tutorials/aspnet/choosedependencies.png b/packages/typescriptlang-org/static/images/tutorials/aspnet/choosedependencies.png deleted file mode 100644 index 7ce2af1a3adc..000000000000 Binary files a/packages/typescriptlang-org/static/images/tutorials/aspnet/choosedependencies.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/tutorials/aspnet/createwebapp.png b/packages/typescriptlang-org/static/images/tutorials/aspnet/createwebapp.png deleted file mode 100644 index f57d417d3c1f..000000000000 Binary files a/packages/typescriptlang-org/static/images/tutorials/aspnet/createwebapp.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/tutorials/aspnet/debugger.png b/packages/typescriptlang-org/static/images/tutorials/aspnet/debugger.png deleted file mode 100644 index 759c87573751..000000000000 Binary files a/packages/typescriptlang-org/static/images/tutorials/aspnet/debugger.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/tutorials/aspnet/downloaddependency.png b/packages/typescriptlang-org/static/images/tutorials/aspnet/downloaddependency.png deleted file mode 100644 index fd27d20a7166..000000000000 Binary files a/packages/typescriptlang-org/static/images/tutorials/aspnet/downloaddependency.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/tutorials/aspnet/emptytemplate.png b/packages/typescriptlang-org/static/images/tutorials/aspnet/emptytemplate.png deleted file mode 100644 index cd9d4a99d5a2..000000000000 Binary files a/packages/typescriptlang-org/static/images/tutorials/aspnet/emptytemplate.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/tutorials/aspnet/namewebapp.png b/packages/typescriptlang-org/static/images/tutorials/aspnet/namewebapp.png deleted file mode 100644 index 5e36aa32deb8..000000000000 Binary files a/packages/typescriptlang-org/static/images/tutorials/aspnet/namewebapp.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/tutorials/aspnet/newfolder.png b/packages/typescriptlang-org/static/images/tutorials/aspnet/newfolder.png deleted file mode 100644 index 55382877cbd0..000000000000 Binary files a/packages/typescriptlang-org/static/images/tutorials/aspnet/newfolder.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/tutorials/aspnet/npm.png b/packages/typescriptlang-org/static/images/tutorials/aspnet/npm.png deleted file mode 100644 index 74186d7d33df..000000000000 Binary files a/packages/typescriptlang-org/static/images/tutorials/aspnet/npm.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/tutorials/aspnet/packagejson.png b/packages/typescriptlang-org/static/images/tutorials/aspnet/packagejson.png deleted file mode 100644 index 2e170404de2f..000000000000 Binary files a/packages/typescriptlang-org/static/images/tutorials/aspnet/packagejson.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/tutorials/aspnet/scripts.png b/packages/typescriptlang-org/static/images/tutorials/aspnet/scripts.png deleted file mode 100644 index 9840f073159c..000000000000 Binary files a/packages/typescriptlang-org/static/images/tutorials/aspnet/scripts.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/tutorials/aspnet/taskrunner.png b/packages/typescriptlang-org/static/images/tutorials/aspnet/taskrunner.png deleted file mode 100644 index 3c2c1d95a411..000000000000 Binary files a/packages/typescriptlang-org/static/images/tutorials/aspnet/taskrunner.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/tutorials/aspnet/taskrunnerrefresh.png b/packages/typescriptlang-org/static/images/tutorials/aspnet/taskrunnerrefresh.png deleted file mode 100644 index 6fc447fa5a02..000000000000 Binary files a/packages/typescriptlang-org/static/images/tutorials/aspnet/taskrunnerrefresh.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/tutorials/aspnet/tsconfig.png b/packages/typescriptlang-org/static/images/tutorials/aspnet/tsconfig.png deleted file mode 100644 index 652ec8df9ed4..000000000000 Binary files a/packages/typescriptlang-org/static/images/tutorials/aspnet/tsconfig.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/tutorials/aspnet/tsfile.png b/packages/typescriptlang-org/static/images/tutorials/aspnet/tsfile.png deleted file mode 100644 index 0c3fed03ec0a..000000000000 Binary files a/packages/typescriptlang-org/static/images/tutorials/aspnet/tsfile.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/tutorials/aspnet/tsgif.mov b/packages/typescriptlang-org/static/images/tutorials/aspnet/tsgif.mov deleted file mode 100644 index dbb0c437e16f..000000000000 Binary files a/packages/typescriptlang-org/static/images/tutorials/aspnet/tsgif.mov and /dev/null differ diff --git a/packages/typescriptlang-org/static/images/tutorials/aspnet/workingsite.png b/packages/typescriptlang-org/static/images/tutorials/aspnet/workingsite.png deleted file mode 100644 index 993876c51901..000000000000 Binary files a/packages/typescriptlang-org/static/images/tutorials/aspnet/workingsite.png and /dev/null differ diff --git a/packages/typescriptlang-org/static/js/docsearch.js b/packages/typescriptlang-org/static/js/docsearch.js deleted file mode 100644 index d5747f6dc06d..000000000000 --- a/packages/typescriptlang-org/static/js/docsearch.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! docsearch 2.6.3 | © Algolia | github.com/algolia/docsearch */ -(function webpackUniversalModuleDefinition(root,factory){if(typeof exports==="object"&&typeof module==="object")module.exports=factory();else if(typeof define==="function"&&define.amd)define([],factory);else if(typeof exports==="object")exports["docsearch"]=factory();else root["docsearch"]=factory()})(typeof self!=="undefined"?self:this,function(){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId]){return installedModules[moduleId].exports}var module=installedModules[moduleId]={i:moduleId,l:false,exports:{}};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.l=true;return module.exports}__webpack_require__.m=modules;__webpack_require__.c=installedModules;__webpack_require__.d=function(exports,name,getter){if(!__webpack_require__.o(exports,name)){Object.defineProperty(exports,name,{configurable:false,enumerable:true,get:getter})}};__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module["default"]}:function getModuleExports(){return module};__webpack_require__.d(getter,"a",getter);return getter};__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)};__webpack_require__.p="";return __webpack_require__(__webpack_require__.s=22)}([function(module,exports,__webpack_require__){"use strict";var DOM=__webpack_require__(1);function escapeRegExp(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}module.exports={isArray:null,isFunction:null,isObject:null,bind:null,each:null,map:null,mixin:null,isMsie:function(agentString){if(agentString===undefined){agentString=navigator.userAgent}if(/(msie|trident)/i.test(agentString)){var match=agentString.match(/(msie |rv:)(\d+(.\d+)?)/i);if(match){return match[2]}}return false},escapeRegExChars:function(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isNumber:function(obj){return typeof obj==="number"},toStr:function toStr(s){return s===undefined||s===null?"":s+""},cloneDeep:function cloneDeep(obj){var clone=this.mixin({},obj);var self=this;this.each(clone,function(value,key){if(value){if(self.isArray(value)){clone[key]=[].concat(value)}else if(self.isObject(value)){clone[key]=self.cloneDeep(value)}}});return clone},error:function(msg){throw new Error(msg)},every:function(obj,test){var result=true;if(!obj){return result}this.each(obj,function(val,key){if(result){result=test.call(null,val,key,obj)&&result}});return!!result},any:function(obj,test){var found=false;if(!obj){return found}this.each(obj,function(val,key){if(test.call(null,val,key,obj)){found=true;return false}});return found},getUniqueId:function(){var counter=0;return function(){return counter++}}(),templatify:function templatify(obj){if(this.isFunction(obj)){return obj}var $template=DOM.element(obj);if($template.prop("tagName")==="SCRIPT"){return function template(){return $template.text()}}return function template(){return String(obj)}},defer:function(fn){setTimeout(fn,0)},noop:function(){},formatPrefix:function(prefix,noPrefix){return noPrefix?"":prefix+"-"},className:function(prefix,clazz,skipDot){return(skipDot?"":".")+prefix+clazz},escapeHighlightedString:function(str,highlightPreTag,highlightPostTag){highlightPreTag=highlightPreTag||"";var pre=document.createElement("div");pre.appendChild(document.createTextNode(highlightPreTag));highlightPostTag=highlightPostTag||"";var post=document.createElement("div");post.appendChild(document.createTextNode(highlightPostTag));var div=document.createElement("div");div.appendChild(document.createTextNode(str));return div.innerHTML.replace(RegExp(escapeRegExp(pre.innerHTML),"g"),highlightPreTag).replace(RegExp(escapeRegExp(post.innerHTML),"g"),highlightPostTag)}}},function(module,exports,__webpack_require__){"use strict";module.exports={element:null}},function(module,exports){var hasOwn=Object.prototype.hasOwnProperty;var toString=Object.prototype.toString;module.exports=function forEach(obj,fn,ctx){if(toString.call(fn)!=="[object Function]"){throw new TypeError("iterator must be a function")}var l=obj.length;if(l===+l){for(var i=0;i was loaded but did not call our provided callback"),JSONPScriptError:createCustomError("JSONPScriptError","