diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ad5d1ecba562..1ee3aeb41519 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -9,6 +9,8 @@ jobs: # Check out, and set up the node/ruby infra - uses: actions/checkout@v1 - uses: actions/setup-node@v1 + with: + node-version: '13.x' # Get local dependencies - run: yarn install @@ -51,6 +53,10 @@ jobs: path: './results' # For danger stuff + - uses: actions/setup-node@v1 + with: + node-version: '13.x' + - run: yarn install # danger for PR builds diff --git a/.vscode/settings.json b/.vscode/settings.json index 16370da3d9d6..2620575ed79c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,13 +6,14 @@ }, "workbench.colorCustomizations": { "activityBar.background": "#c4d3e4", - "activityBar.activeBorder": "#f2ccde", + "activityBar.activeBorder": "#c37c9d", "activityBar.foreground": "#15202b", "activityBar.inactiveForeground": "#15202b99", - "activityBarBadge.background": "#f2ccde", + "activityBarBadge.background": "#c37c9d", "activityBarBadge.foreground": "#15202b" }, "typescript.tsdk": "node_modules/typescript/lib", "debug.node.autoAttach": "on", - "editor.formatOnSave": true + "editor.formatOnSave": true, + "peacock.color": "#a1b9d4" } diff --git a/package.json b/package.json index 2a2d3ff1a795..1e1807b01a56 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,9 @@ "workspaces": [ "packages/*" ], + "engines": { + "node": "^13" + }, "devDependencies": { "concurrently": "^5.0.2", "danger": "^9.2.9", @@ -15,6 +18,11 @@ "resolutions": { "@types/react": "16.9.17" }, + "jest": { + "transformIgnorePatterns": [ + "/node_modules/(?!intl-messageformat|intl-messageformat-parser).+\\.js$" + ] + }, "scripts": { "bootstrap": "yarn workspaces run bootstrap; yarn workspaces run build", "start": "concurrently -p \"[{name}]\" -n \"BUILD,SITE\" -c \"bgBlue.bold,bgMagenta.bold\" \"node watcher.js\" \"yarn workspace typescriptlang-org start\"", diff --git a/packages/playground-examples/copy/leet/JavaScript/JavaScript Essentials/Code Flow.ts b/packages/playground-examples/copy/vo/JavaScript/JavaScript Essentials/Code Flow.ts similarity index 100% rename from packages/playground-examples/copy/leet/JavaScript/JavaScript Essentials/Code Flow.ts rename to packages/playground-examples/copy/vo/JavaScript/JavaScript Essentials/Code Flow.ts diff --git a/packages/playground-examples/copy/leet/JavaScript/JavaScript Essentials/Functions.ts b/packages/playground-examples/copy/vo/JavaScript/JavaScript Essentials/Functions.ts similarity index 100% rename from packages/playground-examples/copy/leet/JavaScript/JavaScript Essentials/Functions.ts rename to packages/playground-examples/copy/vo/JavaScript/JavaScript Essentials/Functions.ts diff --git a/packages/playground-examples/copy/leet/JavaScript/JavaScript Essentials/Hello World.ts b/packages/playground-examples/copy/vo/JavaScript/JavaScript Essentials/Hello World.ts similarity index 100% rename from packages/playground-examples/copy/leet/JavaScript/JavaScript Essentials/Hello World.ts rename to packages/playground-examples/copy/vo/JavaScript/JavaScript Essentials/Hello World.ts diff --git a/packages/playground-examples/copy/leet/JavaScript/JavaScript Essentials/Objects and Arrays.ts b/packages/playground-examples/copy/vo/JavaScript/JavaScript Essentials/Objects and Arrays.ts similarity index 100% rename from packages/playground-examples/copy/leet/JavaScript/JavaScript Essentials/Objects and Arrays.ts rename to packages/playground-examples/copy/vo/JavaScript/JavaScript Essentials/Objects and Arrays.ts diff --git a/packages/playground-examples/copy/leet/sections.json b/packages/playground-examples/copy/vo/sections.json similarity index 100% rename from packages/playground-examples/copy/leet/sections.json rename to packages/playground-examples/copy/vo/sections.json diff --git a/packages/ts-twoslasher/src/index.ts b/packages/ts-twoslasher/src/index.ts index 2012a8d3911a..e2d932c83a0b 100644 --- a/packages/ts-twoslasher/src/index.ts +++ b/packages/ts-twoslasher/src/index.ts @@ -358,7 +358,7 @@ export function twoslasher( length = 0 if (quickInfo && token && quickInfo.displayParts) { text = quickInfo.displayParts.map(dp => dp.text).join('') - docs = quickInfo.documentation ? quickInfo.documentation.map(d => d.text).join('\n') : undefined + docs = quickInfo.documentation ? quickInfo.documentation.map(d => d.text).join('
') : undefined length = token[0].textSpan.start start = token[0].textSpan.length } diff --git a/packages/tsconfig-reference/copy/leet/categories/Project_Files_0.md b/packages/tsconfig-reference/copy/leet/categories/Project_Files_0.md deleted file mode 100644 index 3d021c4803d2..000000000000 --- a/packages/tsconfig-reference/copy/leet/categories/Project_Files_0.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -display: "Files Ahoy" ---- - -Ahoy, these be a place where you decide what files are needed 'fer your project diff --git a/packages/tsconfig-reference/copy/leet/categories/Basic_Options_6172.md b/packages/tsconfig-reference/copy/vo/categories/Basic_Options_6172.md similarity index 78% rename from packages/tsconfig-reference/copy/leet/categories/Basic_Options_6172.md rename to packages/tsconfig-reference/copy/vo/categories/Basic_Options_6172.md index 834a54e4d75a..0a4263f0568f 100644 --- a/packages/tsconfig-reference/copy/leet/categories/Basic_Options_6172.md +++ b/packages/tsconfig-reference/copy/vo/categories/Basic_Options_6172.md @@ -2,4 +2,4 @@ display: "Pr0ject Opt1ons" --- -These settings ar3 used to define the runtime expectations of ur project, how and where u want the J\$ to be emittd and the lvl of integrat0n you want with existing JS code. +These settings ar3 used to define the runtime expectations of ur project, how and where u want the J\$ to be emittd and the lvl of integ8ion you want with existing JS code. diff --git a/packages/tsconfig-reference/copy/vo/categories/Project_Files_0.md b/packages/tsconfig-reference/copy/vo/categories/Project_Files_0.md new file mode 100644 index 000000000000..5a2e0b939868 --- /dev/null +++ b/packages/tsconfig-reference/copy/vo/categories/Project_Files_0.md @@ -0,0 +1,5 @@ +--- +display: "Fil3s" +--- + +B1ts and d1gits for setting up the filez diff --git a/packages/tsconfig-reference/copy/leet/options/files.md b/packages/tsconfig-reference/copy/vo/options/files.md similarity index 100% rename from packages/tsconfig-reference/copy/leet/options/files.md rename to packages/tsconfig-reference/copy/vo/options/files.md diff --git a/packages/tsconfig-reference/copy/leet/options/noImplicitAny.md b/packages/tsconfig-reference/copy/vo/options/noImplicitAny.md similarity index 100% rename from packages/tsconfig-reference/copy/leet/options/noImplicitAny.md rename to packages/tsconfig-reference/copy/vo/options/noImplicitAny.md diff --git a/packages/typescriptlang-org/gatsby-config.js b/packages/typescriptlang-org/gatsby-config.js index 8636c08f6618..c067835697f8 100644 --- a/packages/typescriptlang-org/gatsby-config.js +++ b/packages/typescriptlang-org/gatsby-config.js @@ -2,13 +2,8 @@ require("ts-node").register({ files: true }) const { join } = require("path") -const shiki = join( - require.resolve(`gatsby-remark-shiki`), - "..", - "..", - "package.json" -) -console.log(shiki) +// prettier-ignore +const shiki = join(require.resolve(`gatsby-remark-shiki`), "..", "..", "package.json") module.exports = { // This should only be used in a CI deploy while we're working in a v2 sub-folder @@ -69,6 +64,13 @@ module.exports = { name: `playground-examples`, }, }, + { + resolve: "gatsby-plugin-i18n", + options: { + langKeyDefault: "en", + useLangKeyLayout: true, + }, + }, // Markdown support { resolve: `gatsby-transformer-remark`, @@ -89,11 +91,10 @@ module.exports = { }, "gatsby-remark-autolink-headers", { - // resolve: require.resolve(`${__dirname}/../gatsby-remark-shiki`), - // resolve: require.resolve(`gatsby-remark-shiki`), resolve: shiki, options: { - theme: "nord", + // theme: "nord", + theme: require.resolve("./lib/themes/typescript-beta-light.json"), }, }, "gatsby-remark-copy-linked-files", diff --git a/packages/typescriptlang-org/lib/bootup/ingestion/createTSConfigReference.ts b/packages/typescriptlang-org/lib/bootup/ingestion/createTSConfigReference.ts index 805ed5722776..def1b0eb111e 100644 --- a/packages/typescriptlang-org/lib/bootup/ingestion/createTSConfigReference.ts +++ b/packages/typescriptlang-org/lib/bootup/ingestion/createTSConfigReference.ts @@ -48,6 +48,7 @@ export const createTSConfigReference = async ( path: element.name + "/tsconfig", component: tsConfigRefPage, context: { + locale: element.name, tsconfigMDPath: element.absolutePath, categoriesPath: categoriesForLang, }, diff --git a/packages/typescriptlang-org/lib/themes/themeGen.js b/packages/typescriptlang-org/lib/themes/themeGen.js new file mode 100644 index 000000000000..f208d63c2ffb --- /dev/null +++ b/packages/typescriptlang-org/lib/themes/themeGen.js @@ -0,0 +1,392 @@ +// @ts-check + +/* Run with + + node packages/typescriptlang-org/lib/themes/themeGen.js + +*/ + +// https://color.a11y.com/ContrastPair/?bgcolor=ffffff + +const colors = { + black: "#000000", + white: "#FFFFFF", + identifier: "#1a1a1a", + veryBrightBlue: "#0000FF", + veryDarkBlue: "#000080", + mutedGreenAA: "#09835A", + mutedBlueAAA: "#0451A5", + darkGreenAA: "#008000", + darkGreenAAA: "#036705", + lightBurgendyAAA: "#A31515", + burgendyAAA: "#811f3f", + darkBurgendyAAA: "#800000", + brightRedAAA: "#AF0B08", +} + +const lightTheme = { + name: "Light Visual Studio", + settings: [ + { + scope: "emphasis", + settings: { + fontStyle: "italic", + }, + }, + { + scope: "strong", + settings: { + fontStyle: "bold", + }, + }, + { + scope: [ + "meta.var-single-variable.expr.ts", + "variable", + "meta.definition.variable.ts", + "meta.function-call.ts", + ], + settings: { + foreground: colors.identifier, + }, + }, + { + scope: "meta.diff.header", + settings: { + foreground: colors.veryDarkBlue, + }, + }, + { + scope: "meta.diff.header", + settings: { + foreground: colors.veryDarkBlue, + }, + }, + { + scope: "comment", + settings: { + foreground: colors.darkGreenAA, + }, + }, + + { + scope: "constant.language", + settings: { + foreground: colors.veryBrightBlue, + }, + }, + { + scope: "constant.numeric", + settings: { + foreground: colors.mutedGreenAA, + }, + }, + { + scope: "constant.regexp", + settings: { + foreground: colors.burgendyAAA, + }, + }, + { + scope: [ + "constant.other.color.rgb-value.css", + "constant.numeric.color.rgb-value.scss", + "constant.other.rgb-value.css", + ], + settings: { + foreground: colors.mutedBlueAAA, + }, + }, + { + name: "css tags in selectors, xml tags", + scope: "entity.name.tag", + settings: { + foreground: colors.darkBurgendyAAA, + }, + }, + { + scope: "entity.name.selector", + settings: { + foreground: colors.darkBurgendyAAA, + }, + }, + { + scope: "entity.other.attribute-name", + settings: { + foreground: "#DC0000", + }, + }, + { + scope: [ + "entity.other.attribute-name.class.css", + "entity.other.attribute-name.class.mixin.css", + "entity.other.attribute-name.id.css", + "entity.other.attribute-name.parent-selector.css", + "entity.other.attribute-name.pseudo-class.css", + "entity.other.attribute-name.pseudo-element.css", + + "source.css.less entity.other.attribute-name.id", + + "entity.other.attribute-name.attribute.scss", + "entity.other.attribute-name.scss", + ], + settings: { + foreground: colors.darkBurgendyAAA, + }, + }, + { + scope: "invalid", + settings: { + foreground: colors.brightRedAAA, + }, + }, + { + scope: "markup.underline", + settings: { + fontStyle: "underline", + }, + }, + { + scope: "markup.bold", + settings: { + fontStyle: "bold", + foreground: colors.veryDarkBlue, + }, + }, + { + scope: "markup.heading", + settings: { + fontStyle: "bold", + foreground: colors.darkBurgendyAAA, + }, + }, + { + scope: "markup.italic", + settings: { + fontStyle: "italic", + }, + }, + { + scope: "markup.inserted", + settings: { + foreground: colors.mutedGreenAA, + }, + }, + { + scope: "markup.deleted", + settings: { + foreground: colors.lightBurgendyAAA, + }, + }, + { + scope: "markup.changed", + settings: { + foreground: colors.mutedBlueAAA, + }, + }, + { + scope: [ + "beginning.punctuation.definition.quote.markdown", + "beginning.punctuation.definition.list.markdown", + ], + settings: { + foreground: colors.mutedBlueAAA, + }, + }, + { + scope: "markup.inline.raw", + settings: { + foreground: colors.darkBurgendyAAA, + }, + }, + { + scope: "meta.selector", + settings: { + foreground: colors.darkBurgendyAAA, + }, + }, + { + name: "brackets of XML/HTML tags", + scope: "punctuation.definition.tag", + settings: { + foreground: colors.darkBurgendyAAA, + }, + }, + { + scope: "meta.preprocessor", + settings: { + foreground: colors.veryBrightBlue, + }, + }, + { + scope: "meta.preprocessor.string", + settings: { + foreground: colors.lightBurgendyAAA, + }, + }, + { + scope: "meta.preprocessor.numeric", + settings: { + foreground: colors.mutedGreenAA, + }, + }, + { + scope: "meta.structure.dictionary.key.python", + settings: { + foreground: colors.mutedBlueAAA, + }, + }, + { + scope: "storage", + settings: { + foreground: colors.veryBrightBlue, + }, + }, + { + scope: "storage.type", + settings: { + foreground: colors.veryBrightBlue, + }, + }, + { + scope: "storage.modifier", + settings: { + foreground: colors.veryBrightBlue, + }, + }, + { + scope: "string", + settings: { + foreground: colors.lightBurgendyAAA, + }, + }, + { + scope: [ + "string.comment.buffered.block.jade", + "string.quoted.jade", + "string.interpolated.jade", + + "string.unquoted.plain.in.yaml", + "string.unquoted.plain.out.yaml", + "string.unquoted.block.yaml", + "string.quoted.single.yaml", + + "string.quoted.double.xml", + "string.quoted.single.xml", + "string.unquoted.cdata.xml", + + "string.quoted.double.html", + "string.quoted.single.html", + "string.unquoted.html", + + "string.quoted.single.handlebars", + "string.quoted.double.handlebars", + ], + settings: { + foreground: colors.veryBrightBlue, + }, + }, + { + scope: "string.regexp", + settings: { + foreground: colors.burgendyAAA, + }, + }, + { + name: "JavaScript string interpolation ${}", + scope: [ + "punctuation.definition.template-expression.begin.ts", + "punctuation.definition.template-expression.end.ts", + ], + settings: { + foreground: colors.veryBrightBlue, + }, + }, + { + scope: [ + "support.property-value", + "meta.property-value.css support", + "meta.property-value.scss support", + ], + settings: { + foreground: colors.mutedBlueAAA, + }, + }, + { + scope: [ + "support.type.property-name.css", + "support.type.property-name.variable.css", + "support.type.property-name.media.css", + "support.type.property-name.less", + "support.type.property-name.scss", + ], + settings: { + foreground: colors.brightRedAAA, + }, + }, + { + scope: "support.type.property-name", + settings: { + foreground: colors.mutedBlueAAA, + }, + }, + { + scope: "keyword", + settings: { + foreground: colors.veryBrightBlue, + }, + }, + { + scope: "keyword.control", + settings: { + foreground: colors.veryBrightBlue, + }, + }, + { + scope: "keyword.operator", + settings: { + foreground: colors.black, + }, + }, + { + scope: ["keyword.operator.new", "keyword.operator.expression"], + settings: { + foreground: colors.veryBrightBlue, + }, + }, + { + scope: "keyword.other.unit", + settings: { + foreground: colors.mutedGreenAA, + }, + }, + { + scope: [ + "punctuation.section.embedded.metatag.begin.php", + "punctuation.section.embedded.metatag.end.php", + ], + settings: { + foreground: colors.darkBurgendyAAA, + }, + }, + { + name: "this.self", + scope: "variable.language", + settings: { + foreground: colors.veryBrightBlue, + }, + }, + ], +} + +const { writeFileSync } = require("fs") +const { join } = require("path") +const { format } = require("prettier") + +const betaLightPath = join(__dirname, "typescript-beta-light.json") + +// prettier-ignore +const jsonString = format(JSON.stringify(lightTheme), { filepath: betaLightPath, }) +writeFileSync("typescript-beta-light.json", jsonString) + +console.log("Updated ", betaLightPath) diff --git a/packages/typescriptlang-org/lib/themes/typescript-beta-light.json b/packages/typescriptlang-org/lib/themes/typescript-beta-light.json index c31acbc12b46..7255f3de24a9 100644 --- a/packages/typescriptlang-org/lib/themes/typescript-beta-light.json +++ b/packages/typescriptlang-org/lib/themes/typescript-beta-light.json @@ -1,359 +1,343 @@ { - "name": "Light Visual Studio", - "settings": [ - { - "scope": "emphasis", - "settings": { - "fontStyle": "italic" - } - }, - { - "scope": "strong", - "settings": { - "fontStyle": "bold" - } - }, - { - "scope": "meta.diff.header", - "settings": { - "foreground": "#000080" - } - }, + "name": "Light Visual Studio", + "settings": [ + { + "scope": "emphasis", + "settings": { + "fontStyle": "italic" + } + }, + { + "scope": "strong", + "settings": { + "fontStyle": "bold" + } + }, + { + "scope": "meta.diff.header", + "settings": { + "foreground": "#000080" + } + }, + { + "scope": "meta.diff.header", + "settings": { + "foreground": "#000080" + } + }, + { + "scope": "comment", + "settings": { + "foreground": "#008000" + } + }, - { - "scope": "comment", - "settings": { - "foreground": "#008000" - } - }, + { + "scope": "constant.language", + "settings": { + "foreground": "#0000ff" + } + }, + { + "scope": "constant.numeric", + "settings": { + "foreground": "#09835A" + } + }, + { + "scope": "constant.regexp", + "settings": { + "foreground": "#811f3f" + } + }, + { + "scope": [ + "constant.other.color.rgb-value.css", + "constant.numeric.color.rgb-value.scss", + "constant.other.rgb-value.css" + ], + "settings": { + "foreground": "#0451a5" + } + }, + { + "name": "css tags in selectors, xml tags", + "scope": "entity.name.tag", + "settings": { + "foreground": "#800000" + } + }, + { + "scope": "entity.name.selector", + "settings": { + "foreground": "#800000" + } + }, + { + "scope": "entity.other.attribute-name", + "settings": { + "foreground": "#DC0000" + } + }, + { + "scope": [ + "entity.other.attribute-name.class.css", + "entity.other.attribute-name.class.mixin.css", + "entity.other.attribute-name.id.css", + "entity.other.attribute-name.parent-selector.css", + "entity.other.attribute-name.pseudo-class.css", + "entity.other.attribute-name.pseudo-element.css", - { - "scope": "constant.language", - "settings": { - "foreground": "#0000ff" - } - }, - { - "scope": "constant.numeric", - "settings": { - "foreground": "#09835A" - } - }, - { - "scope": "constant.regexp", - "settings": { - "foreground": "#811f3f" - } - }, - { - "scope": [ - "constant.other.color.rgb-value.css", - "constant.numeric.color.rgb-value.scss", - "constant.other.rgb-value.css" - ], - "settings": { - "foreground": "#0451a5" - } - }, - { - "name": "css tags in selectors, xml tags", - "scope": "entity.name.tag", - "settings": { - "foreground": "#800000" - } - }, - { - "scope": "entity.name.selector", - "settings": { - "foreground": "#800000" - } - }, - { - "scope": "entity.other.attribute-name", - "settings": { - "foreground": "#DC0000" - } - }, - { - "scope": [ - "entity.other.attribute-name.class.css", - "entity.other.attribute-name.class.mixin.css", - "entity.other.attribute-name.id.css", - "entity.other.attribute-name.parent-selector.css", - "entity.other.attribute-name.pseudo-class.css", - "entity.other.attribute-name.pseudo-element.css", + "source.css.less entity.other.attribute-name.id", - "source.css.less entity.other.attribute-name.id", + "entity.other.attribute-name.attribute.scss", + "entity.other.attribute-name.scss" + ], + "settings": { + "foreground": "#800000" + } + }, + { + "scope": "invalid", + "settings": { + "foreground": "#cd3131" + } + }, + { + "scope": "markup.underline", + "settings": { + "fontStyle": "underline" + } + }, + { + "scope": "markup.bold", + "settings": { + "fontStyle": "bold", + "foreground": "#000080" + } + }, + { + "scope": "markup.heading", + "settings": { + "fontStyle": "bold", + "foreground": "#800000" + } + }, + { + "scope": "markup.italic", + "settings": { + "fontStyle": "italic" + } + }, + { + "scope": "markup.inserted", + "settings": { + "foreground": "#09835A" + } + }, + { + "scope": "markup.deleted", + "settings": { + "foreground": "#a31515" + } + }, + { + "scope": "markup.changed", + "settings": { + "foreground": "#0451a5" + } + }, + { + "scope": [ + "beginning.punctuation.definition.quote.markdown", + "beginning.punctuation.definition.list.markdown" + ], + "settings": { + "foreground": "#0451a5" + } + }, + { + "scope": "markup.inline.raw", + "settings": { + "foreground": "#800000" + } + }, + { + "scope": "meta.selector", + "settings": { + "foreground": "#800000" + } + }, + { + "name": "brackets of XML/HTML tags", + "scope": "punctuation.definition.tag", + "settings": { + "foreground": "#800000" + } + }, + { + "scope": "meta.preprocessor", + "settings": { + "foreground": "#0000ff" + } + }, + { + "scope": "meta.preprocessor.string", + "settings": { + "foreground": "#a31515" + } + }, + { + "scope": "meta.preprocessor.numeric", + "settings": { + "foreground": "#09835A" + } + }, + { + "scope": "meta.structure.dictionary.key.python", + "settings": { + "foreground": "#0451a5" + } + }, + { + "scope": "storage", + "settings": { + "foreground": "#0000ff" + } + }, + { + "scope": "storage.type", + "settings": { + "foreground": "#0000ff" + } + }, + { + "scope": "storage.modifier", + "settings": { + "foreground": "#0000ff" + } + }, + { + "scope": "string", + "settings": { + "foreground": "#a31515" + } + }, + { + "scope": [ + "string.comment.buffered.block.jade", + "string.quoted.jade", + "string.interpolated.jade", - "entity.other.attribute-name.attribute.scss", - "entity.other.attribute-name.scss" - ], - "settings": { - "foreground": "#800000" - } - }, - { - "scope": "invalid", - "settings": { - "foreground": "#cd3131" - } - }, - { - "scope": "markup.underline", - "settings": { - "fontStyle": "underline" - } - }, - { - "scope": "markup.bold", - "settings": { - "fontStyle": "bold", - "foreground": "#000080" + "string.unquoted.plain.in.yaml", + "string.unquoted.plain.out.yaml", + "string.unquoted.block.yaml", + "string.quoted.single.yaml", - } - }, - { - "scope": "markup.heading", - "settings": { - "fontStyle": "bold", - "foreground": "#800000" - } - }, - { - "scope": "markup.italic", - "settings": { - "fontStyle": "italic" - } - }, - { - "scope": "markup.inserted", - "settings": { - "foreground": "#09835A" - } - }, - { - "scope": "markup.deleted", - "settings": { - "foreground": "#a31515" - } - }, - { - "scope": "markup.changed", - "settings": { - "foreground": "#0451a5" - } - }, - { - "scope": [ - "beginning.punctuation.definition.quote.markdown", - "beginning.punctuation.definition.list.markdown" - ], - "settings": { - "foreground": "#0451a5" - } - }, - { - "scope": "markup.inline.raw", - "settings": { - "foreground": "#800000" - } - }, - { - "scope": "meta.selector", - "settings": { - "foreground": "#800000" - } - }, - { - "name": "brackets of XML/HTML tags", - "scope": "punctuation.definition.tag", - "settings": { - "foreground": "#800000" - } - }, - { - "scope": "meta.preprocessor", - "settings": { - "foreground": "#0000ff" - } - }, - { - "scope": "meta.preprocessor.string", - "settings": { - "foreground": "#a31515" - } - }, - { - "scope": "meta.preprocessor.numeric", - "settings": { - "foreground": "#09835A" - } - }, - { - "scope": "meta.structure.dictionary.key.python", - "settings": { - "foreground": "#0451a5" - } - }, - { - "scope": "storage", - "settings": { - "foreground": "#0000ff" - } - }, - { - "scope": "storage.type", - "settings": { - "foreground": "#0000ff" - } - }, - { - "scope": "storage.modifier", - "settings": { - "foreground": "#0000ff" - } - }, - { - "scope": "string", - "settings": { - "foreground": "#a31515" - } - }, - { - "scope": [ + "string.quoted.double.xml", + "string.quoted.single.xml", + "string.unquoted.cdata.xml", - "string.comment.buffered.block.jade", - "string.quoted.jade", - "string.interpolated.jade", + "string.quoted.double.html", + "string.quoted.single.html", + "string.unquoted.html", - "string.unquoted.plain.in.yaml", - "string.unquoted.plain.out.yaml", - "string.unquoted.block.yaml", - "string.quoted.single.yaml", - - "string.quoted.double.xml", - "string.quoted.single.xml", - "string.unquoted.cdata.xml", - - "string.quoted.double.html", - "string.quoted.single.html", - "string.unquoted.html", - - "string.quoted.single.handlebars", - "string.quoted.double.handlebars" - ], - "settings": { - "foreground": "#0000ff" - } - }, - { - "scope": "string.regexp", - "settings": { - "foreground": "#811f3f" - } - }, - { - "name": "JavaScript string interpolation ${}", - "scope": [ - "punctuation.definition.template-expression.begin.ts", - "punctuation.definition.template-expression.end.ts" - ], - "settings": { - "foreground": "#0000ff" - } - }, - { - "scope": [ - "support.property-value", - "meta.property-value.css support", - "meta.property-value.scss support" - ], - "settings": { - "foreground": "#0451a5" - } - }, - { - "scope": [ - "support.type.property-name.css", - "support.type.property-name.variable.css", - "support.type.property-name.media.css", - "support.type.property-name.less", - "support.type.property-name.scss" - ], - "settings": { - "foreground": "#ff0000" - } - }, - { - "scope": "support.type.property-name", - "settings": { - "foreground": "#0451a5" - } - }, - { - "scope": "keyword", - "settings": { - "foreground": "#0000ff" - } - }, - { - "scope": "keyword.control", - "settings": { - "foreground": "#0000ff" - } - }, - { - "scope": "keyword.operator", - "settings": { - "foreground": "#000000" - } - }, - { - "scope": ["keyword.operator.new", "keyword.operator.expression"], - "settings": { - "foreground": "#0000ff" - } - }, - { - "scope": "keyword.other.unit", - "settings": { - "foreground": "#09835A" - } - }, - { - "scope": [ - "punctuation.section.embedded.metatag.begin.php", - "punctuation.section.embedded.metatag.end.php" - ], - "settings": { - "foreground": "#800000" - } - }, - { - "scope": "support.function.git-rebase", - "settings": { - "foreground": "#0451a5" - } - }, - { - "scope": "constant.sha.git-rebase", - "settings": { - "foreground": "#09835A" - } - }, - { - "name": "coloring of the Java import and package identifiers", - "scope": ["storage.modifier.import.java", "storage.modifier.package.java"], - "settings": { - "foreground": "#000000" - } - }, - { - "name": "this.self", - "scope": "variable.language", - "settings": { - "foreground": "#0000ff" - } - } - ] + "string.quoted.single.handlebars", + "string.quoted.double.handlebars" + ], + "settings": { + "foreground": "#0000ff" + } + }, + { + "scope": "string.regexp", + "settings": { + "foreground": "#811f3f" + } + }, + { + "name": "JavaScript string interpolation ${}", + "scope": [ + "punctuation.definition.template-expression.begin.ts", + "punctuation.definition.template-expression.end.ts" + ], + "settings": { + "foreground": "#0000ff" + } + }, + { + "scope": [ + "support.property-value", + "meta.property-value.css support", + "meta.property-value.scss support" + ], + "settings": { + "foreground": "#0451a5" + } + }, + { + "scope": [ + "support.type.property-name.css", + "support.type.property-name.variable.css", + "support.type.property-name.media.css", + "support.type.property-name.less", + "support.type.property-name.scss" + ], + "settings": { + "foreground": "#ff0000" + } + }, + { + "scope": "support.type.property-name", + "settings": { + "foreground": "#0451a5" + } + }, + { + "scope": "keyword", + "settings": { + "foreground": "#0000ff" + } + }, + { + "scope": "keyword.control", + "settings": { + "foreground": "#0000ff" + } + }, + { + "scope": "keyword.operator", + "settings": { + "foreground": "#000000" + } + }, + { + "scope": ["keyword.operator.new", "keyword.operator.expression"], + "settings": { + "foreground": "#0000ff" + } + }, + { + "scope": "keyword.other.unit", + "settings": { + "foreground": "#09835A" + } + }, + { + "scope": [ + "punctuation.section.embedded.metatag.begin.php", + "punctuation.section.embedded.metatag.end.php" + ], + "settings": { + "foreground": "#800000" + } + }, + { + "name": "this.self", + "scope": "variable.language", + "settings": { + "foreground": "#0000ff" + } + } + ] } diff --git a/packages/typescriptlang-org/package.json b/packages/typescriptlang-org/package.json index c246713bc0f0..56772d0cdfa2 100644 --- a/packages/typescriptlang-org/package.json +++ b/packages/typescriptlang-org/package.json @@ -24,6 +24,7 @@ "gatsby": "^2.18.17", "gatsby-plugin-catch-links": "^2.1.21", "gatsby-plugin-codegen": "^1.0.10", + "gatsby-plugin-i18n": "^1.0.1", "gatsby-plugin-manifest": "^2.2.34", "gatsby-plugin-offline": "^3.0.30", "gatsby-plugin-react-helmet": "^3.1.18", @@ -45,6 +46,7 @@ "react": "^16.12.0", "react-dom": "^16.12.0", "react-helmet": "^5.2.1", + "react-intl": "^3.11.0", "rehype-shiki": "^0.0.5", "ts-node": "^8.5.4", "ts-twoslasher": "0.1.0", diff --git a/packages/typescriptlang-org/src/components/SuppressWhenTouch.tsx b/packages/typescriptlang-org/src/components/SuppressWhenTouch.tsx index f0abf2bde586..f86b1071d355 100644 --- a/packages/typescriptlang-org/src/components/SuppressWhenTouch.tsx +++ b/packages/typescriptlang-org/src/components/SuppressWhenTouch.tsx @@ -1,5 +1,5 @@ import React, { useEffect } from "react" -import { isTouchDevice } from "../../lib/utils/isTouchDevice" +import { isTouchDevice } from "../lib/isTouchDevice" /** * A React component which will remove its children (at runtime!) diff --git a/packages/typescriptlang-org/src/components/display/ButtonGrid.tsx b/packages/typescriptlang-org/src/components/display/ButtonGrid.tsx new file mode 100644 index 000000000000..0e4052d867a8 --- /dev/null +++ b/packages/typescriptlang-org/src/components/display/ButtonGrid.tsx @@ -0,0 +1,18 @@ +import React from "react" +import { GreyButton } from "./GreyButton" + +type ButtonProps = Omit +export type GridProps = { + buttons: ButtonProps[] + headline?: true +} + + +/** A pretty grid of grey buttons */ +export const ButtonGrid = (props: GridProps) => ( +
+ {props.buttons.map(b => + + )} +
+) diff --git a/packages/typescriptlang-org/src/components/display/GreyButton.tsx b/packages/typescriptlang-org/src/components/display/GreyButton.tsx new file mode 100644 index 000000000000..b2de91c12134 --- /dev/null +++ b/packages/typescriptlang-org/src/components/display/GreyButton.tsx @@ -0,0 +1,19 @@ +import React from "react" +import { withPrefix } from "gatsby" + +export type Props = { + href: string + blurb: string + title: string + headline?: true + badge?: string +} + +/** A pretty grey button */ +export const GreyButton = (props: Props) => { + const href = props.href.startsWith("http") ? props.href : withPrefix(props.href) + return +

{props.blurb}

+

{props.title}

+
+} diff --git a/packages/typescriptlang-org/src/components/layout.tsx b/packages/typescriptlang-org/src/components/layout.tsx index 4080fe265f67..b8a71a820ab9 100644 --- a/packages/typescriptlang-org/src/components/layout.tsx +++ b/packages/typescriptlang-org/src/components/layout.tsx @@ -1,14 +1,28 @@ import React from "react" import { SiteNav, Props } from "./layout/TopNav" import { SiteFooter } from "./layout/SiteFooter" +import { IntlProvider, } from 'react-intl'; -export const Layout = (props: Props & { children: any }) => { - const { children } = props +type LayoutProps = Props & { + locale?: string + children: any +} + +export const Layout = (props: LayoutProps) => { + const { children, locale } = props + let messages = require("../copy/en").lang + try { + messages = require("../copy/" + locale).lang + } catch (error) { + // NOOP + } return ( -
- -
{children}
- -
+ +
+ +
{children}
+ +
+
) } diff --git a/packages/typescriptlang-org/src/components/layout/TopNav.tsx b/packages/typescriptlang-org/src/components/layout/TopNav.tsx index 24724c73689b..77fb60f1bdcc 100644 --- a/packages/typescriptlang-org/src/components/layout/TopNav.tsx +++ b/packages/typescriptlang-org/src/components/layout/TopNav.tsx @@ -4,16 +4,21 @@ import { withPrefix } from "gatsby" import "./TopNav.scss" import { setupStickyNavigation } from "./stickyNavigation"; +import { FormattedMessage, useIntl } from "react-intl"; export type Props = { centeredLayout?: boolean disableBetaNotification?: boolean } +import { navCopy } from "../../copy/en/nav" +import { createInternational } from "../../lib/createInternational" + export const SiteNav = (props: Props) => { + const i = createInternational(useIntl()) + // This extra bit of mis-direction ensures that non-essential code runs after // the page is loaded - useEffect(() => { const searchScript = document.createElement('script'); const searchCSS = document.createElement('link'); @@ -89,7 +94,7 @@ export const SiteNav = (props: Props) => { - Skip to main content + {i("skip_to_content")}
@@ -101,10 +106,10 @@ export const SiteNav = (props: Props) => {
@@ -115,7 +120,7 @@ export const SiteNav = (props: Props) => {
  • - +
  • @@ -128,7 +133,7 @@ export const SiteNav = (props: Props) => {
    {props.disableBetaNotification ? null : -
    Note: this page is a beta page, don't rely on the URL and file issues on microsoft/TypeScript-Website.
    +
    {i("nav_beta_notification", { a: (...chunk) => {chunk} })}
    } { /** Used for skip past navigation button */}
    diff --git a/packages/typescriptlang-org/src/copy/en.ts b/packages/typescriptlang-org/src/copy/en.ts new file mode 100644 index 000000000000..ed326b3cabd1 --- /dev/null +++ b/packages/typescriptlang-org/src/copy/en.ts @@ -0,0 +1,10 @@ +import { defineMessages } from "react-intl" +import { navCopy } from "./en/nav" +import { docCopy } from "./en/documentation" + +export const lang = defineMessages({ + ...navCopy, + ...docCopy, +}) + +export type Copy = typeof lang diff --git a/packages/typescriptlang-org/src/copy/en/documentation.ts b/packages/typescriptlang-org/src/copy/en/documentation.ts new file mode 100644 index 000000000000..055875f77c78 --- /dev/null +++ b/packages/typescriptlang-org/src/copy/en/documentation.ts @@ -0,0 +1,6 @@ +export const docCopy = { + nav_: { + id: "foo", + defaultMessage: "foo", + }, +} diff --git a/packages/typescriptlang-org/src/copy/en/nav.ts b/packages/typescriptlang-org/src/copy/en/nav.ts new file mode 100644 index 000000000000..f4628ca0f9d3 --- /dev/null +++ b/packages/typescriptlang-org/src/copy/en/nav.ts @@ -0,0 +1,13 @@ +export const navCopy = { + skip_to_content: "Skip to main content", + nav_documentation: "Documentation", + nav_documentation_short: "Docs", + nav_download: "Download", + nav_connect: "Connect", + nav_playground: "Playground", + nav_search_placeholder: "Search Docs", + nav_search_aria: "Search the TypeScript site", + nav_beta: "Search the TypeScript site", + nav_beta_notification: + "Note: this page is a beta page, don't rely on the URL and file issues on microsoft/TypeScript-Website", +} diff --git a/packages/typescriptlang-org/src/copy/vo.ts b/packages/typescriptlang-org/src/copy/vo.ts new file mode 100644 index 000000000000..c478acc36e2f --- /dev/null +++ b/packages/typescriptlang-org/src/copy/vo.ts @@ -0,0 +1,9 @@ +import { defineMessages } from "react-intl" +import { navCopy } from "./vo/nav" +import { docCopy } from "./en/documentation" +import { Copy } from "./en" + +export const lang: Copy = defineMessages({ + ...navCopy, + ...docCopy, +}) diff --git a/packages/typescriptlang-org/src/copy/vo/nav.ts b/packages/typescriptlang-org/src/copy/vo/nav.ts new file mode 100644 index 000000000000..476cbb06cfb8 --- /dev/null +++ b/packages/typescriptlang-org/src/copy/vo/nav.ts @@ -0,0 +1,14 @@ +import { navCopy as enNavCopy } from "../en/nav" + +export const navCopy = { + ...enNavCopy, + skip_to_content: "Sk1p t0 main Con7ent", + nav_documentation: "D0cumentation", + nav_documentation_short: "Docs", + nav_download: "DL", + nav_connect: "Konnect", + nav_playground: "Playground", + nav_search_placeholder: "Se4rch D0cz", + nav_beta_notification: + "Note: this page is a b3ta page, don't rely on the URL and file issues on microsoft/TypeScript-Website", +} diff --git a/packages/typescriptlang-org/src/lib/createInternational.ts b/packages/typescriptlang-org/src/lib/createInternational.ts new file mode 100644 index 000000000000..3fc86c68d921 --- /dev/null +++ b/packages/typescriptlang-org/src/lib/createInternational.ts @@ -0,0 +1,13 @@ +import { IntlShape } from "react-intl" + +/** + * This will let you define an area for your localization and have typescript + * keep the keys in check + * + * @param intlUseEffect the result of `useIntl()` + */ +export function createInternational( + intlUseEffect: IntlShape +): (intlKey: keyof NavSection, obj?: any) => string { + return (k, obj) => intlUseEffect.formatMessage({ id: k as string }, obj) +} diff --git a/packages/typescriptlang-org/lib/utils/isTouchDevice.ts b/packages/typescriptlang-org/src/lib/isTouchDevice.ts similarity index 100% rename from packages/typescriptlang-org/lib/utils/isTouchDevice.ts rename to packages/typescriptlang-org/src/lib/isTouchDevice.ts diff --git a/packages/typescriptlang-org/src/pages/css/documentation.scss b/packages/typescriptlang-org/src/pages/css/documentation.scss new file mode 100644 index 000000000000..90de24660c88 --- /dev/null +++ b/packages/typescriptlang-org/src/pages/css/documentation.scss @@ -0,0 +1,56 @@ +.flow-links { + display: flex; + flex-wrap: wrap; + + .clicky-grey-button { + width: 18rem; + height: 12rem; + background-color: #d8d8d8; + margin-right: 20px; + margin-bottom: 20px; + color: black; + padding: 18px; + + display: flex; + flex-direction: column-reverse; + // For the badge + position: relative; + + &.headline { + width: 300px; + height: 200px; + } + + &.links { + height: 26rem; + } + + h4 { + color: black; + text-decoration: none; + font-size: 3rem; + font-style: normal; + margin-bottom: 0.2em; + + &:hover { + text-decoration: none; + } + } + + p { + margin-top: 0; + margin-bottom: 0; + } + + a { + text-decoration: none; + } + + .badge { + position: absolute; + background-color: #666; + top: 10px; + right: 10px; + } + } +} diff --git a/packages/typescriptlang-org/src/pages/dev/sandbox.tsx b/packages/typescriptlang-org/src/pages/dev/sandbox.tsx index 73a0c36de11f..892cdaea65c0 100644 --- a/packages/typescriptlang-org/src/pages/dev/sandbox.tsx +++ b/packages/typescriptlang-org/src/pages/dev/sandbox.tsx @@ -4,7 +4,7 @@ import { withPrefix } from "gatsby" import "./dev.scss" import { DevNav } from "../../components/dev-nav" -import { isTouchDevice } from "../../../lib/utils/isTouchDevice" +import { isTouchDevice } from "../../lib/isTouchDevice" import { SuppressWhenTouch } from "../../components/SuppressWhenTouch" const Index = (props: any) => { diff --git a/packages/typescriptlang-org/src/pages/dev/twoslash.tsx b/packages/typescriptlang-org/src/pages/dev/twoslash.tsx index 5ce03e54e397..3c12a502dc4e 100644 --- a/packages/typescriptlang-org/src/pages/dev/twoslash.tsx +++ b/packages/typescriptlang-org/src/pages/dev/twoslash.tsx @@ -8,7 +8,7 @@ import { renderToHTML } from "gatsby-remark-shiki/src/renderer" import "./dev.scss" import { DevNav } from "../../components/dev-nav" -import { isTouchDevice } from "../../../lib/utils/isTouchDevice" +import { isTouchDevice } from "../../lib/isTouchDevice" import { SuppressWhenTouch } from "../../components/SuppressWhenTouch" /** Note: to run all the web infra in debug, run: @@ -44,7 +44,7 @@ const Index = (props: any) => { if (isOK) { document.getElementById("loader")!.parentNode?.removeChild(document.getElementById("loader")!) } - + document.getElementById("monaco-editor-embed")!.style.display = "block" const sandbox = await sandboxEnv.createTypeScriptSandbox({ text: codeSamples[0].code, compilerOptions: {}, domID: "monaco-editor-embed", supportTwoslashCompilerOptions: true }, main, ts) sandbox.editor.focus() @@ -190,7 +190,7 @@ const Index = (props: any) => {

    Downloading Sandbox...

    -
    +
    {codeSamples.map(code => { const setExample = (e) => { diff --git a/packages/typescriptlang-org/src/pages/documentation.en.tsx b/packages/typescriptlang-org/src/pages/documentation.en.tsx new file mode 100644 index 000000000000..65da248b2a5e --- /dev/null +++ b/packages/typescriptlang-org/src/pages/documentation.en.tsx @@ -0,0 +1,259 @@ +import React from "react" +import { Layout } from "../components/layout" + +import "./css/documentation.scss" +import { ButtonGrid, GridProps } from "../components/display/ButtonGrid" + +const headlineGrid: GridProps = { + buttons: [ + { + title: "TS in 5m", + href: "/docs/handbook/typescript-in-5-minutes.html", + blurb: "5 minute overview of the language", + }, { + title: "TS Tooling", + href: "/docs/handbook/typescript-in-5-minutes.html", + blurb: "5 minute overview of the tooling", + }, { + title: "Handbook", + href: "/docs/handbook/basic-types.html", + blurb: "The TypeScript language reference", + }, { + title: "Examples", + href: "/play/index.html?#show-examples", + blurb: "Comprehensive hands-on playground tutorials", + } + ], + headline: true +} + + +const apis = [ + { + href: "https://code.visualstudio.com/tutorials/functions-extension/getting-started", + blurb: "Build and deploy from VS Code in minutes", + title: "Azure Functions" + }, + { + + href: "https://feathersjs.com", + blurb: "A framework for real-time applications and REST APIs", + title: "Feathers JS" + }, + { + + href: "https://github.com/graphql-boilerplates/typescript-graphql-server", + blurb: "Bootstrap your GraphQL server within seconds", + title: "GraphQL" + }, + { + + href: "https://nestjs.com", + blurb: "A progressive Node.js framework for building efficient and scalable server-side applications", + title: "Nest JS" + }, + { + + href: "https://github.com/Microsoft/TypeScript-Node-Starter", + blurb: "A documented starter template from the TS team", + title: "Node Starter" + }, + { + + href: "https://github.com/microsoft/TypeScript-WeChat-Starter/blob/master/README.md", + badge: "Guide", + blurb: "Use the WeChat JSSDK with TypeScript", + title: "WeChat" + } +] + +const webFrameworks = [ + { + href: "/docs/handbook/typescript-in-5-minutes.html", + blurb: "Makes writing beautiful apps be joyful and fun", + title: "Angular" + }, + { + href: "https://reactjs.org", + badge: "Examples below", + blurb: "A JavaScript library for building user interfaces", + title: "React" + }, + { + href: "https://vuejs.org", + blurb: "The Progressive JavaScript Framework", + title: "Vue" + }, + { + href: "https://github.com/typescript-ruby/typescript-rails", + badge: "Plugin", + blurb: "Convention over configuration web framework", + title: "Ruby on Rails" + }, + { + href: "https://www.typescriptlang.org/docs/handbook/asp-net-core.html", + badge: "Guide", + blurb: "Framework for building modern, cloud-based, Internet-connected applications", + title: "ASP.NET Core" + }, +] + +const nodeNPM = [ + { + href: "https://github.com/jaredpalmer/tsdx#readme", + blurb: "Zero config tool for building TypeScript libraries", + title: "TSDX" + }, + { + href: "https://oclif.io", + blurb: "Create command line tools your users love", + title: "oclif" + }, + { + href: "https://github.com/infinitered/gluegun#readme", + blurb: "A delightful toolkit for building TypeScript-powered command-line apps", + title: "Gluegun" + } +] + + +const react = [ + { + href: "https://create-react-app.dev", + blurb: "Set up a modern web app by running one command", + title: "Create React App" + }, + { + href: "https://www.gatsbyjs.org", + badge: "Plugin", + blurb: "Helps developers build blazing fast websites and apps", + title: "Gatsby" + }, + { + href: "https://nextjs.org", + blurb: "The React Framework", + title: "Next.js" + }, + { + href: "https://github.com/jaredpalmer/razzle", + blurb: "Server-rendered universal JavaScript applications with no configuration", + title: "Razzle" + }, + { + href: "https://reactjs.org/community/starter-kits.html", + blurb: "Recommendations from the React Team", + title: "Starter Kits" + } +] + +const apps = [ + { + href: "https://babeljs.io/docs/en/babel-preset-typescript", + badge: "Plugin", + blurb: "Set up a modern web app by running one command", + title: "Electron" + }, + { + href: "https://expo.io/", + blurb: "The fastest way to build an app", + title: "Expo" + }, + { + href: "https://facebook.github.io/react-native/", + blurb: "Learn once, write anywhere", + title: "React Native" + }, + { + href: "https://www.nativescript.org/", + blurb: "Open source framework for building truly native mobile apps", + title: "NativeScript" + }, + { + href: "https://www.microsoft.com/en-us/makecode/", + blurb: "Brings computer science to life for all students with fun projects", + title: "MakeCode" + } +] + + +const tooling = [ + { + href: "https://babeljs.io/docs/en/babel-preset-typescript", + badge: "Plugin", + blurb: "Use next generation JavaScript, today", + title: "Babel" + }, + { + href: "https://parceljs.org", + blurb: "Blazing fast, zero configuration web application bundler", + title: "Parcel" + }, + { + + href: "https://webpack.js.org/guides/typescript/", + badge: "Plugin", + blurb: "Bundle your assets, scripts, images and styles", + title: "Webpack" + } +] + +const learn = [ + { + href: "/docs/handbook/release-notes/typescript-3-5.html", + blurb: "3.5 Release Notes", + title: "Release Notes" + }, + { + href: "/docs/handbook/basic-types.html", + blurb: "The TypeScript language reference", + title: "Handbook" + }, + { + href: "/docs/handbook/declaration-files/introduction.html", + blurb: "Learn how to declare the shape of JS", + title: "d.ts Guide" + }, + { + href: "/play/index.html", + blurb: "Explore and share TypeScript online", + title: "Playground" + } +] + +const Index = () => + +
    +

    Start Learning

    + + + +

    Start a Project

    +

    Because TypeScript is a superset of JavaScript, it doesn't have a default template - there would be too many. + Instead, other projects have their own TypeScript bootstrap templates with their own context. These projects provide + templates which include TypeScript support.

    + +

    Node with NPM

    + + +

    Web Frameworks

    + + +

    Node APIs

    + + +

    React Projects

    + + +

    Building Apps

    + + +

    Tooling

    + + +

    Familiar With TypeScript already?

    + +
    + +
    + +export default Index diff --git a/packages/typescriptlang-org/src/pages/download.en.tsx b/packages/typescriptlang-org/src/pages/download.en.tsx new file mode 100644 index 000000000000..f87add797d18 --- /dev/null +++ b/packages/typescriptlang-org/src/pages/download.en.tsx @@ -0,0 +1,25 @@ +import React from "react" +import { Layout } from "../components/layout" + +const Index = () => + +
    +

    Download TypeScript

    +

    TypeScript is available in two ways depending on how you intend to use it: built as an npm module, and a nuget package.

    +
    + +
    +
    +

    via NPM

    +

    TypeScript is available in three ways depending on how you intend to use it: built as an npm momdule, and a nuget package.

    +
    + +
    +

    via Nuget

    +

    TypeScript is available in three ways depending on how you intend to use it: built as an npm momdule, and a nuget package.

    +
    +
    + +
    + +export default Index diff --git a/packages/typescriptlang-org/src/templates/handbook.tsx b/packages/typescriptlang-org/src/templates/handbook.tsx index 5e6c2a4b9ef5..802247d8e3e2 100644 --- a/packages/typescriptlang-org/src/templates/handbook.tsx +++ b/packages/typescriptlang-org/src/templates/handbook.tsx @@ -72,7 +72,7 @@ const HandbookTemplate = (props: { pageContext: any, data: GetHandbookBySlug, pa const showSidebar = post.headings && post.headings.length <= 25 return ( - +
    diff --git a/packages/typescriptlang-org/src/templates/markdown.scss b/packages/typescriptlang-org/src/templates/markdown.scss index 6a5acdd4e71e..30b8958066af 100644 --- a/packages/typescriptlang-org/src/templates/markdown.scss +++ b/packages/typescriptlang-org/src/templates/markdown.scss @@ -36,8 +36,8 @@ // Code blocks pre { - background-color: #141414; - color: #d8dee9; + background-color: white; + color: black; padding: 12px; border-left: 1px solid #999; diff --git a/packages/typescriptlang-org/src/templates/play.tsx b/packages/typescriptlang-org/src/templates/play.tsx index 6fdef26e8298..ba6d0d83d356 100644 --- a/packages/typescriptlang-org/src/templates/play.tsx +++ b/packages/typescriptlang-org/src/templates/play.tsx @@ -102,7 +102,7 @@ const Index = (props: Props) => { return ( <> - + {/** This is the top nav, which is outside of the editor */}
    - } - )} + })}