+## TypeScript Website
-Kick off your project with this UI Fabric boilerplate. This starter ships with the main Gatsby configuration files you might need to get up and running blazing fast with the blazing fast app generator for React.
+This a pretty traditional Gatsby site. You can start it up via:
-## π Quick start
+```sh
+yarn start
+```
-1. **Create a Gatsby site.**
+Which starts up a dev server.
- Use the Gatsby CLI to create a new site, specifying the UI Fabric starter.
+### Visual Regression Testing
- ```sh
- # create a new Gatsby site using the UI Fabric starter
- gatsby new my-uifabric-starter https://github.com/kenotron/gatsby-starter-uifabric
- ```
+Right now one of the main ways in which the site is tested is via visual regression testing using
+[BackstopJS](https://github.com/garris/BackstopJS). Currently this is directly tied to Orta's computers
+and set-up so it isn't feasible for others to run them.
-1. **Start developing.**
+To run them from this folder:
- Navigate into your new siteβs directory and start it up.
+```sh
+# install globally
+# npm install -g backstopjs
- ```sh
- cd my-uifabric-starter/
- gatsby develop
- ```
+# To run the tests
+backstop test
-1. **Open the source code and start editing!**
-
- Your site is now running at `http://localhost:8000`!
-
- _Note: You'll also see a second link: _`http://localhost:8000/___graphql`_. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the [Gatsby tutorial](https://www.gatsbyjs.org/tutorial/part-five/#introducing-graphiql)._
-
- Open the `my-uifabric-starter` directory in your code editor of choice and edit `src/pages/index.js`. Save your changes and the browser will update in real time!
-
-## π§ What's inside?
-
-A quick look at the top-level files and directories you'll see in a Gatsby project.
-
- .
- βββ node_modules
- βββ src
- βββ .gitignore
- βββ .prettierrc
- βββ gatsby-browser.js
- βββ gatsby-config.js
- βββ gatsby-node.js
- βββ gatsby-ssr.js
- βββ LICENSE
- βββ package-lock.json
- βββ package.json
- βββ README.md
-
-1. **`/node_modules`**: This directory contains all of the modules of code that your project depends on (npm packages) are automatically installed.
-
-2. **`/src`**: This directory will contain all of the code related to what you will see on the front-end of your site (what you see in the browser) such as your site header or a page template. `src` is a convention for βsource codeβ.
-
-3. **`.gitignore`**: This file tells git which files it should not track / not maintain a version history for.
-
-4. **`.prettierrc`**: This is a configuration file for [Prettier](https://prettier.io/). Prettier is a tool to help keep the formatting of your code consistent.
-
-5. **`gatsby-browser.js`**: This file is where Gatsby expects to find any usage of the [Gatsby browser APIs](https://www.gatsbyjs.org/docs/browser-apis/) (if any). These allow customization/extension of default Gatsby settings affecting the browser.
-
-6. **`gatsby-config.js`**: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins youβd like to include, etc. (Check out the [config docs](https://www.gatsbyjs.org/docs/gatsby-config/) for more detail).
-
-7. **`gatsby-node.js`**: This file is where Gatsby expects to find any usage of the [Gatsby Node APIs](https://www.gatsbyjs.org/docs/node-apis/) (if any). These allow customization/extension of default Gatsby settings affecting pieces of the site build process.
-
-8. **`gatsby-ssr.js`**: This file is where Gatsby expects to find any usage of the [Gatsby server-side rendering APIs](https://www.gatsbyjs.org/docs/ssr-apis/) (if any). These allow customization of default Gatsby settings affecting server-side rendering.
-
-9. **`LICENSE`**: Gatsby is licensed under the MIT license.
-
-10. **`package-lock.json`** (See `package.json` below, first). This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your project. **(You wonβt change this file directly).**
-
-11. **`package.json`**: A manifest file for Node.js projects, which includes things like metadata (the projectβs name, author, etc). This manifest is how npm knows which packages to install for your project.
-
-12. **`README.md`**: A text file containing useful reference information about your project.
-
-## π Learning Gatsby
-
-Looking for more guidance? Full documentation for Gatsby lives [on the website](https://www.gatsbyjs.org/). Here are some places to start:
-
-- **For most developers, we recommend starting with our [in-depth tutorial for creating a site with Gatsby](https://www.gatsbyjs.org/tutorial/).** It starts with zero assumptions about your level of ability and walks through every step of the process.
-
-- **To dive straight into code samples, head [to our documentation](https://www.gatsbyjs.org/docs/).** In particular, check out the _Guides_, _API Reference_, and _Advanced Tutorials_ sections in the sidebar.
-
-## π« Deploy
-
-[](https://azuredeploy.net/?repository=https://github.com/kenotron/gatsby-starter-uifabric)
-
-[](https://app.netlify.com/start/deploy?repository=https://github.com/kenotron/gatsby-starter-uifabric)
+# To agree to changes
+backstop approve
+```
diff --git a/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_Index_0_document_0_phone.png b/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_Index_0_document_0_phone.png
new file mode 100644
index 000000000000..46981cb7b53b
Binary files /dev/null and b/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_Index_0_document_0_phone.png differ
diff --git a/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_Index_0_document_1_tablet.png b/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_Index_0_document_1_tablet.png
new file mode 100644
index 000000000000..f6ce2a3aeae7
Binary files /dev/null and b/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_Index_0_document_1_tablet.png differ
diff --git a/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_Index_0_document_2_computer.png b/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_Index_0_document_2_computer.png
new file mode 100644
index 000000000000..451195eec813
Binary files /dev/null and b/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_Index_0_document_2_computer.png differ
diff --git a/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_Old_Handbook_Example_0_viewport_0_phone.png b/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_Old_Handbook_Example_0_viewport_0_phone.png
new file mode 100644
index 000000000000..4ff2c4a8c475
Binary files /dev/null and b/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_Old_Handbook_Example_0_viewport_0_phone.png differ
diff --git a/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_Old_Handbook_Example_0_viewport_1_tablet.png b/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_Old_Handbook_Example_0_viewport_1_tablet.png
new file mode 100644
index 000000000000..fbf465440b6a
Binary files /dev/null and b/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_Old_Handbook_Example_0_viewport_1_tablet.png differ
diff --git a/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_Old_Handbook_Example_0_viewport_2_computer.png b/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_Old_Handbook_Example_0_viewport_2_computer.png
new file mode 100644
index 000000000000..b7983835c200
Binary files /dev/null and b/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_Old_Handbook_Example_0_viewport_2_computer.png differ
diff --git a/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_TSConfig_Example_0_viewport_0_phone.png b/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_TSConfig_Example_0_viewport_0_phone.png
new file mode 100644
index 000000000000..475c37a90d8f
Binary files /dev/null and b/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_TSConfig_Example_0_viewport_0_phone.png differ
diff --git a/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_TSConfig_Example_0_viewport_1_tablet.png b/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_TSConfig_Example_0_viewport_1_tablet.png
new file mode 100644
index 000000000000..8fb776ffb662
Binary files /dev/null and b/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_TSConfig_Example_0_viewport_1_tablet.png differ
diff --git a/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_TSConfig_Example_0_viewport_2_computer.png b/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_TSConfig_Example_0_viewport_2_computer.png
new file mode 100644
index 000000000000..9d8dd37ce768
Binary files /dev/null and b/packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/backstop_default_TSConfig_Example_0_viewport_2_computer.png differ
diff --git a/packages/typescriptlang-org/backstop.json b/packages/typescriptlang-org/backstop.json
new file mode 100644
index 000000000000..e456a617a639
--- /dev/null
+++ b/packages/typescriptlang-org/backstop.json
@@ -0,0 +1,62 @@
+{
+ "id": "backstop_default",
+ "viewports": [
+ {
+ "label": "phone",
+ "width": 320,
+ "height": 480
+ },
+ {
+ "label": "tablet",
+ "width": 1024,
+ "height": 768
+ },
+ {
+ "label": "computer",
+ "width": 1280,
+ "height": 900
+ }
+ ],
+ "onBeforeScript": "puppet/onBefore.js",
+ "onReadyScript": "puppet/onReady.js",
+ "scenarios": [
+ {
+ "label": "Index",
+ "url": "file:///Users/ortatherox/dev/typescript/new-website/packages/typescriptlang-org/public/index.html",
+ "misMatchThreshold" : 0.1
+ },
+ {
+ "label": "Old Handbook Example",
+ "url": "file:///Users/ortatherox/dev/typescript/new-website/packages/typescriptlang-org/public/docs/handbook/functions.html",
+ "misMatchThreshold" : 0.1,
+ "selectors": [
+ "viewport"
+ ]
+ },
+
+ {
+ "label": "TSConfig Example",
+ "url": "file:///Users/ortatherox/dev/typescript/new-website/packages/typescriptlang-org/public/tsconfig/index.html",
+ "misMatchThreshold" : 0.1,
+ "selectors": [
+ "viewport"
+ ]
+ }
+ ],
+ "paths": {
+ "bitmaps_reference": "_tests/backstop_data/bitmaps_reference",
+ "bitmaps_test": "_tests/backstop_data/bitmaps_test",
+ "engine_scripts": "_tests/backstop_data/engine_scripts",
+ "html_report": "_tests/backstop_data/html_report",
+ "ci_report": "_tests/backstop_data/ci_report"
+ },
+ "report": ["browser"],
+ "engine": "puppeteer",
+ "engineOptions": {
+ "args": ["--no-sandbox"]
+ },
+ "asyncCaptureLimit": 5,
+ "asyncCompareLimit": 50,
+ "debug": false,
+ "debugWindow": false
+}
diff --git a/packages/typescriptlang-org/gatsby-config.js b/packages/typescriptlang-org/gatsby-config.js
index d737866aa5b8..f390a40667e6 100644
--- a/packages/typescriptlang-org/gatsby-config.js
+++ b/packages/typescriptlang-org/gatsby-config.js
@@ -1,10 +1,17 @@
// https://github.com/gatsbyjs/gatsby/issues/1457
-require('ts-node').register({ files: true })
+require("ts-node").register({ files: true })
module.exports = {
plugins: [
+ // Creates TS types for queries during `gatsby dev`
"gatsby-plugin-codegen",
- `gatsby-plugin-typescript`,
+ // Support ts/tsx files in src
+ "gatsby-plugin-typescript",
+
+ // Let's you edit the head from inside a react tree
+ "gatsby-plugin-react-helmet",
+
+ // Grabs the old handbook markdown files
{
resolve: `gatsby-source-filesystem`,
options: {
@@ -12,6 +19,7 @@ module.exports = {
name: `handbook-v1`,
},
},
+ // Grabs file from the tsconfig reference
{
resolve: `gatsby-source-filesystem`,
options: {
@@ -19,6 +27,7 @@ module.exports = {
name: `tsconfig-reference`,
},
},
+ // Markdown support
{
resolve: `gatsby-transformer-remark`,
options: {
diff --git a/packages/typescriptlang-org/package.json b/packages/typescriptlang-org/package.json
index dad2a2120e8f..3ee4e7de7bff 100644
--- a/packages/typescriptlang-org/package.json
+++ b/packages/typescriptlang-org/package.json
@@ -9,13 +9,16 @@
"develop": "gatsby develop",
"format": "prettier --write src/**/*.{js,jsx}",
"start": "npm run develop",
- "serve": "gatsby serve"
+ "serve": "gatsby serve",
+ "test": "echo 'no tests'"
},
"dependencies": {
+ "@types/react-helmet": "^5.0.14",
"@uifabric/fluent-theme": "^7.1.4",
"@uifabric/react-cards": "^0.108.2",
"gatsby": "^2.15.29",
"gatsby-plugin-codegen": "^1.0.4",
+ "gatsby-plugin-react-helmet": "^3.1.13",
"gatsby-plugin-sharp": "^2.2.28",
"gatsby-remark-copy-linked-files": "^2.1.24",
"gatsby-remark-images": "^3.1.25",
@@ -28,6 +31,7 @@
"prismjs": "^1.17.1",
"react": "^16.10.2",
"react-dom": "^16.10.2",
+ "react-helmet": "^5.2.1",
"ts-node": "^8.4.1"
},
"devDependencies": {
diff --git a/packages/typescriptlang-org/src/components/layout.tsx b/packages/typescriptlang-org/src/components/layout.tsx
index 5f4e14d78141..0f3288f035ad 100644
--- a/packages/typescriptlang-org/src/components/layout.tsx
+++ b/packages/typescriptlang-org/src/components/layout.tsx
@@ -1,52 +1,18 @@
import React from "react"
import { Link } from "gatsby"
+import { SiteNav } from "./layout/TopNav"
declare const __PATH_PREFIX__: string
export class Layout extends React.Component {
render() {
- const { location, title, children } = this.props
- const rootPath = `${__PATH_PREFIX__}/`
- let header
-
- header = (
-