Skip to content

Adds a rough layout to the site #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build Website

on:
pull_request

jobs:
build:
runs-on: ubuntu-latest

steps:
# Check out, and set up the node/ruby infra
- uses: actions/checkout@v1
- uses: actions/setup-node@v1

# Get local dependencies
- run: yarn install
- run: yarn bootstrap
- run: yarn build

# PR: Deploy if we can
- name: Deploy PR Version
if: github.event_name == 'pull_request'
run: 'if test -z "$NOW_ACCESS_TOKEN"; then echo "Skipping deploy";
else npx now packages/typescriptlang-org/public/ --token="$NOW_ACCESS_TOKEN" --name="typescript-v2-$PR_NUMBER"; fi'
env:
NOW_ACCESS_TOKEN: ${{ secrets.NOW_ACCESS_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}

# Run any tests
- run: yarn workspaces run test --ci
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,3 @@ typings/
# tdsx
dist

packages/typescriptlang-org/schema.json
packages/typescriptlang-org/apollo.config.js
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"semi": false,
"printWidth": 120
}
12 changes: 10 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{
"files.exclude": {
"**/.rts2_cache*": true
}
}
},
"workbench.colorCustomizations": {
"activityBar.background": "#3178C6",
"activityBar.foreground": "#000000",
"activityBar.inactiveForeground": "#15202b99",
"activityBarBadge.background": "#ffffff",
"activityBarBadge.foreground": "#15202b"
},
"peacock.color": "#3178C6",
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"husky": {
"hooks": {
"pre-push": "git-branch-is v2 && yarn run clean && yarn run build || echo 'skipping'"
"pre-push": "git-branch-is v2 && yarn run clean && yarn run build || echo 'skipping'"
}
}
}
3 changes: 2 additions & 1 deletion packages/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"license": "MIT",
"scripts": {
"start": "parcel index.html",
"build": "parcel build index.html"
"build": "parcel build index.html",
"test": "echo 'no tests'"
},
"dependencies": {
"react-app-polyfill": "^1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/sandbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"scripts": {
"start": "tsdx watch",
"build": "tsdx build",
"test": "tsdx test --env=jsdom",
"test": "echo 'no tests'; #tsdx test --env=jsdom",
"lint": "tsdx lint"
},
"peerDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion packages/tsconfig-reference/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"scripts" : {
"generate-json": "yarn ts-node scripts/generateJSON.ts",
"generate-markdown": "yarn ts-node --project tsconfig.json scripts/generateMarkdown.ts ",
"build": "yarn generate-json; yarn generate-markdown"
"build": "yarn generate-json; yarn generate-markdown",
"test": "echo 'no tests'"
}
}
9 changes: 9 additions & 0 deletions packages/typescriptlang-org/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,12 @@ yarn-error.log
.pnp.js
# Yarn Integrity file
.yarn-integrity

# The TS auto-complete stuff
schema.json
apollo.config.js

# backstop files
_tests/backstop_data/bitmaps_test
_tests/backstop_data/engine_scripts
_tests/backstop_data/html_report
104 changes: 19 additions & 85 deletions packages/typescriptlang-org/README.md
Original file line number Diff line number Diff line change
@@ -1,94 +1,28 @@
<p align="center">
<a href="https://www.gatsbyjs.org">
<img alt="Gatsby" src="https://www.gatsbyjs.org/monogram.svg" width="60" />
</a>
</p>
<h1 align="center">
UI Fabric Gatsby.js
</h1>
## 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

[![Deploy to Azure](http://azuredeploy.net/deploybutton.png)](https://azuredeploy.net/?repository=https://github.com/kenotron/gatsby-starter-uifabric)

[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/kenotron/gatsby-starter-uifabric)
# To agree to changes
backstop approve
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions packages/typescriptlang-org/backstop.json
Original file line number Diff line number Diff line change
@@ -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
}
13 changes: 11 additions & 2 deletions packages/typescriptlang-org/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
// 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: {
path: `${__dirname}/../handbook-v1/en`,
name: `handbook-v1`,
},
},
// Grabs file from the tsconfig reference
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/../tsconfig-reference/output`,
name: `tsconfig-reference`,
},
},
// Markdown support
{
resolve: `gatsby-transformer-remark`,
options: {
Expand Down
6 changes: 5 additions & 1 deletion packages/typescriptlang-org/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": {
Expand Down
Loading