Skip to content

Commit e17734f

Browse files
dcalhounthymikee
authored andcommitted
docs: Publish website (#113)
* docs: Remove unused commented code Remove unused Docusaurus defaults as [requested](https://git.io/fh9po) by [core maintainer](https://git.io/fh9p1). * docs: Remove unused Users page * docs: Remove unused help page * docs: Fix website dependencies Add required dependencies and package attributes to avoid yarn and lint warnings. * docs: Add StackOverflow tag * docs: Reinstate i18n props While additional language translations have not been created, there did not appear to be a reason to comment these props out. * docs: Add docs CI script * docs: Remove unnecessary CI config
1 parent 2ccadbe commit e17734f

File tree

7 files changed

+61
-202
lines changed

7 files changed

+61
-202
lines changed

.circleci/config.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
version: 2
22

3+
aliases:
4+
- &filter-only-master
5+
branches:
6+
only:
7+
- master
8+
39
defaults: &defaults
410
docker:
511
- image: circleci/node:10
@@ -49,6 +55,17 @@ jobs:
4955
- store_artifacts:
5056
path: coverage
5157
destination: coverage
58+
deploy-website:
59+
<<: *defaults
60+
steps:
61+
- checkout
62+
- run:
63+
name: Deploying to GitHub Pages
64+
command: |
65+
git config --global user.email "thymikee@users.noreply.github.com"
66+
git config --global user.name "Michał Pierzchała"
67+
echo "machine github.com login thymikee password $GITHUB_TOKEN" > ~/.netrc
68+
cd website && yarn install && GIT_USER=thymikee yarn run publish-gh-pages
5269
5370
workflows:
5471
version: 2
@@ -64,3 +81,7 @@ workflows:
6481
- tests:
6582
requires:
6683
- install-dependencies
84+
- deploy-website:
85+
requires:
86+
- install-dependencies
87+
filters: *filter-only-master

website/core/Footer.js

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,18 @@ class Footer extends React.Component {
3434
</a>
3535
<div>
3636
<h5>Docs</h5>
37-
<a
38-
href={this.docUrl(
39-
'getting-started.html'
40-
// TODO: fix i18n
41-
/* , this.props.language */
42-
)}
43-
>
37+
<a href={this.docUrl('getting-started.html', this.props.language)}>
4438
Getting Started
4539
</a>
4640

47-
<a
48-
href={this.docUrl(
49-
'api.html'
50-
// TODO: fix i18n
51-
/* , this.props.language */
52-
)}
53-
>
41+
<a href={this.docUrl('api.html', this.props.language)}>
5442
API Reference
5543
</a>
5644
</div>
5745
<div>
5846
<h5>Community</h5>
5947
<a
60-
href="http://stackoverflow.com/questions/tagged/"
48+
href="http://stackoverflow.com/questions/tagged/react-native-testing-library"
6149
target="_blank"
6250
rel="noreferrer noopener"
6351
>
@@ -82,19 +70,6 @@ class Footer extends React.Component {
8270
</div>
8371
</section>
8472

85-
{/* <a
86-
href="https://code.facebook.com/projects/"
87-
target="_blank"
88-
rel="noreferrer noopener"
89-
className="fbOpenSource"
90-
>
91-
<img
92-
src={`${this.props.config.baseUrl}img/oss_logo.png`}
93-
alt="Facebook Open Source"
94-
width="170"
95-
height="45"
96-
/>
97-
</a> */}
9873
<section className="copyright">{this.props.config.copyright}</section>
9974
</footer>
10075
);

website/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"name": "react-native-testing-library-website",
3+
"version": "0.0.0",
4+
"private": true,
25
"scripts": {
36
"examples": "docusaurus-examples",
47
"start": "docusaurus-start",
@@ -8,7 +11,9 @@
811
"version": "docusaurus-version",
912
"rename-version": "docusaurus-rename-version"
1013
},
11-
"devDependencies": {
12-
"docusaurus": "^1.5.1"
14+
"dependencies": {
15+
"docusaurus": "^1.5.1",
16+
"react": "^16.8.1",
17+
"react-dom": "^16.8.1"
1318
}
1419
}

website/pages/en/help.js

Lines changed: 0 additions & 51 deletions
This file was deleted.

website/pages/en/index.js

Lines changed: 2 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,14 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
const React = require('react'); // eslint-disable-line import/no-extraneous-dependencies
9-
10-
const {
11-
// MarkdownBlock,
12-
Container,
13-
GridBlock,
14-
} = require('../../core/CompLibrary.js'); // eslint-disable-line import/no-unresolved
8+
const React = require('react');
159

1610
const siteConfig = require(`${process.cwd()}/siteConfig.js`);
1711

18-
// function imgUrl(img) {
19-
// return `${siteConfig.baseUrl}img/${img}`;
20-
// }
21-
2212
function docUrl(doc, language) {
2313
return `${siteConfig.baseUrl}docs/${language ? `${language}/` : ''}${doc}`;
2414
}
2515

26-
// function pageUrl(page, language) {
27-
// return siteConfig.baseUrl + (language ? `${language}/` : '') + page;
28-
// }
29-
3016
class Button extends React.Component {
3117
render() {
3218
return (
@@ -51,12 +37,6 @@ const SplashContainer = props => (
5137
</div>
5238
);
5339

54-
// const Logo = props => (
55-
// <div className="projectLogo">
56-
// <img src={props.img_src} alt="Project Logo" />
57-
// </div>
58-
// );
59-
6040
const ProjectTitle = () => (
6141
<React.Fragment>
6242
<h2 className="projectTitle">
@@ -71,7 +51,6 @@ class HomeSplash extends React.Component {
7151
render() {
7252
return (
7353
<SplashContainer>
74-
{/* <Logo img_src={imgUrl('docusaurus.svg')} /> */}
7554
<div className="inner">
7655
<ProjectTitle />
7756
</div>
@@ -80,60 +59,11 @@ class HomeSplash extends React.Component {
8059
}
8160
}
8261

83-
const Block = props => (
84-
<Container
85-
padding={['bottom', 'top']}
86-
id={props.id}
87-
background={props.background}
88-
>
89-
<GridBlock align="center" contents={props.children} layout={props.layout} />
90-
</Container>
91-
);
92-
93-
const Features = () => (
94-
<Block layout="fourColumn">
95-
{[
96-
{
97-
content:
98-
'Built on top of `react-test-renderer`, letting you always be up to date with latest React features',
99-
// image: imgUrl('docusaurus.svg'),
100-
imageAlign: 'top',
101-
title: 'Lightweight',
102-
},
103-
{
104-
content:
105-
'Prevents you from testing implementation details because we stand this is a very bad practice',
106-
// image: imgUrl('docusaurus.svg'),
107-
imageAlign: 'top',
108-
title: 'Opinionated',
109-
},
110-
]}
111-
</Block>
112-
);
113-
114-
// const FeatureCallout = () => (
115-
// <div
116-
// className="productShowcaseSection paddingBottom"
117-
// style={{ textAlign: 'center' }}
118-
// >
119-
// <h2>Feature Callout</h2>
120-
// <MarkdownBlock>These are features of this project</MarkdownBlock>
121-
// </div>
122-
// );
123-
12462
class Index extends React.Component {
12563
render() {
12664
const language = this.props.language || '';
12765

128-
return (
129-
<div>
130-
<HomeSplash language={language} />
131-
<div className="mainContainer">
132-
<Features />
133-
{/* <FeatureCallout /> */}
134-
</div>
135-
</div>
136-
);
66+
return <HomeSplash language={language} />;
13767
}
13868
}
13969

website/pages/en/users.js

Lines changed: 0 additions & 49 deletions
This file was deleted.

website/yarn.lock

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4593,6 +4593,16 @@ react-dom@^16.5.0:
45934593
prop-types "^15.6.2"
45944594
scheduler "^0.11.2"
45954595

4596+
react-dom@^16.8.1:
4597+
version "16.8.1"
4598+
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.1.tgz#ec860f98853d09d39bafd3a6f1e12389d283dbb4"
4599+
integrity sha512-N74IZUrPt6UiDjXaO7UbDDFXeUXnVhZzeRLy/6iqqN1ipfjrhR60Bp5NuBK+rv3GMdqdIuwIl22u1SYwf330bg==
4600+
dependencies:
4601+
loose-envify "^1.1.0"
4602+
object-assign "^4.1.1"
4603+
prop-types "^15.6.2"
4604+
scheduler "^0.13.1"
4605+
45964606
react-error-overlay@^4.0.1:
45974607
version "4.0.1"
45984608
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-4.0.1.tgz#417addb0814a90f3a7082eacba7cee588d00da89"
@@ -4608,6 +4618,16 @@ react@^16.5.0:
46084618
prop-types "^15.6.2"
46094619
scheduler "^0.11.2"
46104620

4621+
react@^16.8.1:
4622+
version "16.8.1"
4623+
resolved "https://registry.yarnpkg.com/react/-/react-16.8.1.tgz#ae11831f6cb2a05d58603a976afc8a558e852c4a"
4624+
integrity sha512-wLw5CFGPdo7p/AgteFz7GblI2JPOos0+biSoxf1FPsGxWQZdN/pj6oToJs1crn61DL3Ln7mN86uZ4j74p31ELQ==
4625+
dependencies:
4626+
loose-envify "^1.1.0"
4627+
object-assign "^4.1.1"
4628+
prop-types "^15.6.2"
4629+
scheduler "^0.13.1"
4630+
46114631
read-all-stream@^3.0.0:
46124632
version "3.1.0"
46134633
resolved "https://registry.yarnpkg.com/read-all-stream/-/read-all-stream-3.1.0.tgz#35c3e177f2078ef789ee4bfafa4373074eaef4fa"
@@ -4916,6 +4936,14 @@ scheduler@^0.11.2:
49164936
loose-envify "^1.1.0"
49174937
object-assign "^4.1.1"
49184938

4939+
scheduler@^0.13.1:
4940+
version "0.13.1"
4941+
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.1.tgz#1a217df1bfaabaf4f1b92a9127d5d732d85a9591"
4942+
integrity sha512-VJKOkiKIN2/6NOoexuypwSrybx13MY7NSy9RNt8wPvZDMRT1CW6qlpF5jXRToXNHz3uWzbm2elNpZfXfGPqP9A==
4943+
dependencies:
4944+
loose-envify "^1.1.0"
4945+
object-assign "^4.1.1"
4946+
49194947
seek-bzip@^1.0.3:
49204948
version "1.0.5"
49214949
resolved "https://registry.yarnpkg.com/seek-bzip/-/seek-bzip-1.0.5.tgz#cfe917cb3d274bcffac792758af53173eb1fabdc"

0 commit comments

Comments
 (0)