Skip to content

Commit b4f7cc7

Browse files
authored
📚 (Docs): new documentation design (#296)
1 parent 3e1dce8 commit b4f7cc7

Some content is hidden

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

43 files changed

+4283
-3282
lines changed

.github/workflows/documentation.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ jobs:
1414
- uses: actions/checkout@v1
1515
- uses: actions/setup-node@v1
1616
with:
17-
node-version: '14.x'
17+
node-version: '16.x'
1818
- name: Test Build
1919
run: |
2020
cd documentation
2121
yarn install --frozen-lockfile
22+
rm -rf .docusaurus/
2223
npm run build
2324
gh-release:
2425
if: github.event_name != 'pull_request'
@@ -27,7 +28,7 @@ jobs:
2728
- uses: actions/checkout@v1
2829
- uses: actions/setup-node@v1
2930
with:
30-
node-version: '14.x'
31+
node-version: '16.x'
3132
- name: Add key to allow access to repository
3233
env:
3334
SSH_AUTH_SOCK: /tmp/ssh_agent.sock

documentation/.eslintrc.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
module.exports = {
2+
globals: {
3+
React: true,
4+
JSX: true,
5+
},
6+
env: {
7+
browser: true,
8+
es2021: true,
9+
},
10+
extends: [
11+
'plugin:react/recommended',
12+
'airbnb',
13+
'plugin:@docusaurus/recommended',
14+
],
15+
parser: '@typescript-eslint/parser',
16+
parserOptions: {
17+
ecmaFeatures: {
18+
jsx: true,
19+
},
20+
ecmaVersion: 'latest',
21+
sourceType: 'module',
22+
},
23+
settings: {
24+
'import/resolver': {
25+
node: {
26+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
27+
},
28+
},
29+
},
30+
plugins: [
31+
'react',
32+
'@typescript-eslint',
33+
'@docusaurus',
34+
],
35+
rules: {
36+
'react/jsx-filename-extension': [2, { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
37+
'import/no-unresolved': [2, { ignore: ['^@theme', '^@docusaurus', '^@site'] }],
38+
'react/jsx-props-no-spreading': 'off',
39+
'react/no-array-index-key': 'off',
40+
},
41+
};

documentation/README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Website
22

3-
This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator.
3+
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
44

55
### Installation
66

@@ -14,7 +14,7 @@ $ yarn
1414
$ yarn start
1515
```
1616

17-
This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
1818

1919
### Build
2020

@@ -26,17 +26,16 @@ This command generates static content into the `build` directory and can be serv
2626

2727
### Deployment
2828

29+
Using SSH:
30+
2931
```
30-
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
32+
$ USE_SSH=true yarn deploy
3133
```
3234

33-
34-
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
35-
36-
### Continuous Integration
37-
38-
Some common defaults for linting/formatting have been set for you. If you integrate your project with an open source Continuous Integration system (e.g. Travis CI, CircleCI), you may check for issues using the following command.
35+
Not using SSH:
3936

4037
```
41-
$ yarn ci
38+
$ GIT_USER=<Your GitHub username> yarn deploy
4239
```
40+
41+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

documentation/babel.config.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
/**
2-
* Copyright (c) Facebook, Inc. and its affiliates.
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-
* @format
8-
*/
9-
101
module.exports = {
112
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
123
};

documentation/blog/2020-04-19-React-Native-Boilerplate-3.0.0.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
---
22
title: React Native Boilerplate 3.0.0
3-
author: Jérémy Dollé
4-
author_title: React Native Boilerplate contributor
5-
author_url: https://github.com/JeremyDolle
6-
author_image_url: https://avatars.githubusercontent.com/u/15814069?v=4
3+
authors: jed
74
description: What's in the box? 📦
8-
image: https://i.imgur.com/mErPwqL.png
95
hide_table_of_contents: false
106
tags: [boilerplate, starter-kit, starter, kit, react, native, react-native, javascript, typescript]
117
---

documentation/blog/authors.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
jed:
2+
name: Jérémy dollé
3+
title: Maintainer of the React Native Boilerplate
4+
url: https://github.com/JeremyDolle
5+
image_url: https://avatars.githubusercontent.com/u/15814069?v=4
6+

documentation/docs/1_Introduction/1_1_RNBoilerplate.md renamed to documentation/docs/1_Introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
slug: /Introduction
3-
title: React Native Boilerplate 🐙
3+
title: What's in the box❓
44
---
55

66
<div align="center">
7-
<img width="300" height="300" src={require('../assets/TOM.png').default} />
7+
<img width="300" height="300" src={require('./assets/TOM.png').default} />
88
</div>
99

1010
This project is a [React Native](https://facebook.github.io/react-native/) boilerplate that can be used to kick-start a mobile application.

documentation/docusaurus.config.js

Lines changed: 116 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,142 @@
1-
/** @type {import('@docusaurus/types').DocusaurusConfig} */
2-
module.exports = {
3-
title: 'React Native Boilerplate',
4-
tagline: 'Ready to use react native architecture based on Separation of Concerns.',
1+
// @ts-check
2+
// Note: type annotations allow type checking and IDEs autocompletion
3+
4+
const lightCodeTheme = require('prism-react-renderer/themes/github');
5+
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
6+
7+
/** @type {import('@docusaurus/types').Config} */
8+
const config = {
9+
title: 'The React Native Boilerplate',
10+
tagline: 'Simple, Lightweight and Scalable.',
511
url: 'https://thecodingmachine.github.io',
612
baseUrl: '/react-native-boilerplate/',
7-
onBrokenLinks: 'warn',
13+
onBrokenLinks: 'throw',
814
onBrokenMarkdownLinks: 'warn',
915
favicon: 'img/favicon.png',
1016
organizationName: 'thecodingmachine',
1117
projectName: 'react-native-boilerplate',
12-
themeConfig: {
13-
algolia: {
14-
apiKey: '870ae81ec981530781f32849c55a593f',
15-
indexName: 'rnboilerplate',
16-
contextualSearch: true,
17-
},
18-
navbar: {
19-
title: 'RNBoilerplate',
20-
logo: {
21-
alt: 'React Native Boilerplate',
22-
src: 'img/TOM-small.png',
23-
},
24-
items: [
25-
{
26-
to: 'docs/Introduction',
27-
activeBasePath: 'docs',
28-
label: 'Docs',
29-
position: 'left',
30-
},
31-
{
32-
to: '/blog',
33-
label: 'Blog',
34-
position: 'left'
35-
},
36-
{
37-
href: 'https://github.com/thecodingmachine/react-native-boilerplate',
38-
label: 'GitHub',
39-
position: 'right',
18+
i18n: {
19+
defaultLocale: 'en',
20+
locales: ['en'],
21+
},
22+
plugins: [
23+
async function myPlugin() {
24+
return {
25+
name: 'docusaurus-tailwindcss',
26+
configurePostCss(postcssOptions) {
27+
// eslint-disable-next-line global-require
28+
postcssOptions.plugins.push(require('tailwindcss'));
29+
// eslint-disable-next-line global-require
30+
postcssOptions.plugins.push(require('autoprefixer'));
31+
return postcssOptions;
4032
},
41-
],
42-
},
43-
footer: {
44-
style: 'dark',
45-
logo: {
46-
alt: 'Facebook Open Source Logo',
47-
src: 'img/TOM.png',
48-
},
49-
copyright: `Copyright © ${new Date().getFullYear()} TheCodingMachine, Inc. Built with Docusaurus.`,
33+
};
5034
},
51-
},
35+
],
5236
presets: [
5337
[
54-
'@docusaurus/preset-classic',
55-
{
38+
'classic',
39+
/** @type {import('@docusaurus/preset-classic').Options} */
40+
({
5641
docs: {
5742
sidebarPath: require.resolve('./sidebars.js'),
5843
editUrl:
5944
'https://github.com/thecodingmachine/react-native-boilerplate/edit/master/website-documentation/docs',
6045
},
6146
blog: {
6247
showReadingTime: true,
63-
// Please change this to your repo.
6448
editUrl:
6549
'https://github.com/thecodingmachine/react-native-boilerplate/edit/master/website-documentation/blog',
6650
},
6751
theme: {
6852
customCss: require.resolve('./src/css/custom.css'),
6953
},
70-
},
54+
}),
7155
],
7256
],
57+
58+
themeConfig:
59+
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
60+
({
61+
algolia: {
62+
appId: '9PEYN0H12D',
63+
indexName: 'rnboilerplate',
64+
apiKey: '870ae81ec981530781f32849c55a593f',
65+
contextualSearch: true,
66+
},
67+
colorMode: {
68+
respectPrefersColorScheme: true,
69+
},
70+
navbar: {
71+
title: 'React Native Boilerplate',
72+
logo: {
73+
alt: 'React Native Boilerplate',
74+
src: 'img/TOM-small.png',
75+
},
76+
items: [
77+
{
78+
type: 'doc',
79+
docId: 'Introduction',
80+
position: 'left',
81+
label: 'Docs',
82+
},
83+
{ to: '/blog', label: 'Blog', position: 'left' },
84+
{
85+
href: 'https://github.com/thecodingmachine/react-native-boilerplate',
86+
label: 'GitHub',
87+
position: 'right',
88+
},
89+
],
90+
},
91+
footer: {
92+
style: 'dark',
93+
links: [
94+
{
95+
title: 'Docs',
96+
items: [
97+
{
98+
label: 'Installation',
99+
to: '/docs/Installation',
100+
},
101+
{
102+
label: 'Theme',
103+
to: '/docs/Theme',
104+
},
105+
{
106+
label: 'Loading data at startup',
107+
to: '/docs/SplashScreenLoadingData',
108+
},
109+
{
110+
label: 'Redux toolkit',
111+
to: '/docs/ReduxStore',
112+
},
113+
{
114+
label: 'Internationalization',
115+
to: '/docs/AddALangTranslation',
116+
},
117+
],
118+
},
119+
{
120+
title: 'More',
121+
items: [
122+
{
123+
label: 'Blog',
124+
to: '/blog',
125+
},
126+
{
127+
label: 'GitHub',
128+
href: 'https://github.com/thecodingmachine/react-native-boilerplate',
129+
},
130+
],
131+
},
132+
],
133+
copyright: `Copyright © ${new Date().getFullYear()} React Native Boilerplate, by TheCodingMachine. Built with Docusaurus.`,
134+
},
135+
prism: {
136+
theme: lightCodeTheme,
137+
darkTheme: darkCodeTheme,
138+
},
139+
}),
73140
};
141+
142+
module.exports = config;

documentation/package.json

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,37 @@
88
"build": "docusaurus build",
99
"swizzle": "docusaurus swizzle",
1010
"deploy": "docusaurus deploy",
11+
"clear": "docusaurus clear",
1112
"serve": "docusaurus serve",
1213
"write-translations": "docusaurus write-translations",
13-
"write-heading-ids": "docusaurus write-heading-ids"
14+
"write-heading-ids": "docusaurus write-heading-ids",
15+
"typecheck": "tsc"
1416
},
1517
"dependencies": {
16-
"@docusaurus/core": "2.0.0-beta.14",
17-
"@docusaurus/preset-classic": "2.0.0-beta.14",
18-
"@mdx-js/react": "^1.6.21",
18+
"@docusaurus/core": "2.0.0-beta.20",
19+
"@docusaurus/preset-classic": "2.0.0-beta.20",
20+
"@mdx-js/react": "^1.6.22",
21+
"autoprefixer": "^10.4.7",
1922
"clsx": "^1.1.1",
20-
"react": "^17.0.1",
21-
"react-dom": "^17.0.1"
23+
"postcss": "^8.4.14",
24+
"prism-react-renderer": "^1.3.1",
25+
"react": "^17.0.2",
26+
"react-dom": "^17.0.2",
27+
"tailwindcss": "^3.0.24"
28+
},
29+
"devDependencies": {
30+
"@docusaurus/eslint-plugin": "^2.0.0-beta.21",
31+
"@docusaurus/module-type-aliases": "2.0.0-beta.20",
32+
"@tsconfig/docusaurus": "^1.0.5",
33+
"@typescript-eslint/eslint-plugin": "^5.27.0",
34+
"@typescript-eslint/parser": "^5.27.0",
35+
"eslint": "^7.32.0 || ^8.2.0",
36+
"eslint-config-airbnb": "^19.0.4",
37+
"eslint-plugin-import": "^2.25.3",
38+
"eslint-plugin-jsx-a11y": "^6.5.1",
39+
"eslint-plugin-react": "^7.28.0",
40+
"eslint-plugin-react-hooks": "^4.3.0",
41+
"typescript": "^4.6.4"
2242
},
2343
"browserslist": {
2444
"production": [

0 commit comments

Comments
 (0)