Skip to content

Commit 9d9b202

Browse files
committed
Migrated Gatsby website source and config
1 parent 93aa551 commit 9d9b202

File tree

93 files changed

+16351
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+16351
-0
lines changed

.babelrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ['react', 'es2015', 'stage-1'],
3+
"plugins": ['add-module-exports']
4+
}

.eslintignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules/*
2+
3+
# Ignore markdown files and examples
4+
content/*
5+
6+
# Ignore built files
7+
public/*

.eslintrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"plugins": [
3+
"prettier",
4+
"react"
5+
],
6+
"parser": "babel-eslint",
7+
}

.flowconfig

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[ignore]
2+
3+
<PROJECT_ROOT>/content/.*
4+
<PROJECT_ROOT>/node_modules/.*
5+
<PROJECT_ROOT>/public/.*
6+
7+
[include]
8+
9+
[libs]
10+
./node_modules/fbjs/flow/lib/dev.js
11+
./flow
12+
13+
[options]
14+
module.system=haste
15+
16+
esproposal.class_static_fields=enable
17+
esproposal.class_instance_fields=enable
18+
unsafe.enable_getters_and_setters=true
19+
20+
munge_underscores=false
21+
22+
suppress_type=$FlowIssue
23+
suppress_type=$FlowFixMe
24+
suppress_type=$FixMe
25+
suppress_type=$FlowExpectedError
26+
27+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-3]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*www[a-z,_]*\\)?)\\)
28+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-3]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*www[a-z,_]*\\)?)\\)?:? #[0-9]+
29+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
30+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
31+
32+
[version]
33+
^0.56.0

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.cache
2+
.DS_STORE
3+
node_modules
4+
public

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8.4

LICENSE.md

+393
Large diffs are not rendered by default.

README.md

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# reactjs.org
2+
3+
## Getting started
4+
5+
### Prerequisites
6+
7+
1. Git
8+
1. Node: install version 8.4 or greater
9+
1. Yarn: `npm i -g yarn` to install it globally via NPM
10+
1. A clone of the [reactjs.org repo](https://github.com/facebook/reactjs.org) on your local machine
11+
1. A fork of the repo (for any contributions)
12+
13+
### Installation
14+
15+
1. `cd reactjs.org` to go into the project root
16+
1. `yarn` to install the website's NPM dependencies
17+
18+
### Running locally
19+
20+
1. `yarn dev` to start the hot-reloading development server (powered by [Gatsby](https://www.gatsbyjs.org))
21+
1. `open http://localhost:8000` to open the site in your favorite browser
22+
23+
## Contributing
24+
25+
### Create a branch
26+
27+
1. `git checkout master` from any folder in your local react repository
28+
1. `git pull origin master` to ensure you have the latest main code
29+
1. `git checkout -b the-name-of-my-branch` (replacing `the-name-of-my-branch` with a suitable name) to create a branch
30+
31+
### Make the change
32+
33+
1. Follow the "Running locally" instructions
34+
1. Save the files and check in the browser
35+
1. Changes to React components in `src` will hot-reload
36+
1. Changes to markdown files in `content` will hot-reload
37+
1. If working with plugins, you may need to remove the `.cache` directory and restart the server
38+
39+
### Test the change
40+
41+
1. If possible, test any visual changes in all latest versions of common browsers, on both desktop and mobile.
42+
1. Run `yarn check-all` from the project root. (This will run Prettier, ESlint, and Flow.)
43+
44+
### Push it
45+
46+
1. `git add -A && git commit -m "My message"` (replacing `My message` with a commit message, such as `Fixed header logo on Android`) to stage and commit your changes
47+
1. `git push my-fork-name the-name-of-my-branch`
48+
1. Go to the [reactjs.org repo](https://github.com/facebook/reactjs.org) and you should see recently pushed branches.
49+
1. Follow GitHub's instructions.
50+
1. If possible include screenshots of visual changes. A Netlify build will also be automatically created once you make your PR so other people can see your change.
51+
52+
## Troubleshooting
53+
54+
- `yarn reset` to clear the local cache

flow-typed/hex2rgba.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare module 'hex2rgba' {
2+
declare module.exports: (hex : string, alpha? : number) => string;
3+
}

gatsby-config.js

+142
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
/**
2+
* Copyright (c) 2013-present, Facebook, Inc.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @emails react-core
8+
*/
9+
10+
'use strict';
11+
12+
module.exports = {
13+
siteMetadata: {
14+
title: 'React: A JavaScript library for building user interfaces',
15+
siteUrl: 'https://reactjs.org',
16+
rssFeedTitle: 'React',
17+
rssFeedDescription: 'A JavaScript library for building user interfaces',
18+
},
19+
mapping: {
20+
'MarkdownRemark.frontmatter.author': 'AuthorYaml',
21+
},
22+
plugins: [
23+
'gatsby-source-react-error-codes',
24+
'gatsby-transformer-authors-yaml',
25+
'gatsby-plugin-netlify',
26+
'gatsby-plugin-glamor',
27+
'gatsby-plugin-react-next',
28+
'gatsby-plugin-twitter',
29+
{
30+
resolve: 'gatsby-plugin-nprogress',
31+
options: {
32+
color: '#61dafb',
33+
},
34+
},
35+
{
36+
resolve: 'gatsby-source-filesystem',
37+
options: {
38+
path: `${__dirname}/src/pages`,
39+
name: 'pages',
40+
},
41+
},
42+
{
43+
resolve: 'gatsby-source-filesystem',
44+
options: {
45+
name: 'packages',
46+
path: `${__dirname}/content/`,
47+
},
48+
},
49+
{
50+
resolve: 'gatsby-transformer-remark',
51+
options: {
52+
plugins: [
53+
'gatsby-remark-responsive-iframe',
54+
{
55+
resolve: 'gatsby-remark-images',
56+
options: {
57+
maxWidth: 840,
58+
},
59+
},
60+
'gatsby-remark-autolink-headers',
61+
'gatsby-remark-use-jsx',
62+
{
63+
resolve: 'gatsby-remark-prismjs',
64+
options: {
65+
classPrefix: 'gatsby-code-',
66+
},
67+
},
68+
'gatsby-remark-copy-linked-files',
69+
'gatsby-remark-smartypants',
70+
],
71+
},
72+
},
73+
'gatsby-transformer-sharp',
74+
'gatsby-plugin-sharp',
75+
{
76+
resolve: 'gatsby-plugin-google-analytics',
77+
options: {
78+
trackingId: 'UA-41298772-1',
79+
},
80+
},
81+
{
82+
resolve: 'gatsby-plugin-feed',
83+
options: {
84+
query: `
85+
{
86+
site {
87+
siteMetadata {
88+
title: rssFeedTitle
89+
description: rssFeedDescription
90+
siteUrl
91+
site_url: siteUrl
92+
}
93+
}
94+
}`,
95+
feeds: [
96+
{
97+
serialize: ({query: {site, allMarkdownRemark}}) => {
98+
return allMarkdownRemark.edges.map(edge => {
99+
return Object.assign(
100+
{},
101+
{
102+
title: edge.node.frontmatter.title,
103+
description: edge.node.html,
104+
date: require('moment')(edge.node.fields.date).format(
105+
'MMMM DD, YYYY, h:mm A',
106+
),
107+
url: site.siteMetadata.siteUrl + edge.node.fields.slug,
108+
guid: site.siteMetadata.siteUrl + edge.node.fields.slug,
109+
},
110+
);
111+
});
112+
},
113+
query: `
114+
{
115+
allMarkdownRemark
116+
(limit: 10,
117+
filter: {id: {regex: "/blog/"}},
118+
sort: {fields: [fields___date],
119+
order: DESC}) {
120+
edges {
121+
node {
122+
fields {
123+
date
124+
slug
125+
}
126+
frontmatter {
127+
title
128+
}
129+
html
130+
}
131+
}
132+
}
133+
}
134+
`,
135+
output: '/feed.xml',
136+
},
137+
],
138+
},
139+
},
140+
'gatsby-plugin-react-helmet',
141+
],
142+
};

0 commit comments

Comments
 (0)