Skip to content

Commit

Permalink
📚 (Docs): new documentation design (thecodingmachine#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyDolle authored May 31, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 3e1dce8 commit b4f7cc7
Showing 43 changed files with 4,283 additions and 3,282 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -14,11 +14,12 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '14.x'
node-version: '16.x'
- name: Test Build
run: |
cd documentation
yarn install --frozen-lockfile
rm -rf .docusaurus/
npm run build
gh-release:
if: github.event_name != 'pull_request'
@@ -27,7 +28,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '14.x'
node-version: '16.x'
- name: Add key to allow access to repository
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
41 changes: 41 additions & 0 deletions documentation/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module.exports = {
globals: {
React: true,
JSX: true,
},
env: {
browser: true,
es2021: true,
},
extends: [
'plugin:react/recommended',
'airbnb',
'plugin:@docusaurus/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
plugins: [
'react',
'@typescript-eslint',
'@docusaurus',
],
rules: {
'react/jsx-filename-extension': [2, { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
'import/no-unresolved': [2, { ignore: ['^@theme', '^@docusaurus', '^@site'] }],
'react/jsx-props-no-spreading': 'off',
'react/no-array-index-key': 'off',
},
};
19 changes: 9 additions & 10 deletions documentation/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Website

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

### Installation

@@ -14,7 +14,7 @@ $ yarn
$ yarn start
```

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

### Build

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

### Deployment

Using SSH:

```
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
$ USE_SSH=true yarn deploy
```


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.

### Continuous Integration

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.
Not using SSH:

```
$ yarn ci
$ GIT_USER=<Your GitHub username> yarn deploy
```

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.
9 changes: 0 additions & 9 deletions documentation/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/

module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
---
title: React Native Boilerplate 3.0.0
author: Jérémy Dollé
author_title: React Native Boilerplate contributor
author_url: https://github.com/JeremyDolle
author_image_url: https://avatars.githubusercontent.com/u/15814069?v=4
authors: jed
description: What's in the box? 📦
image: https://i.imgur.com/mErPwqL.png
hide_table_of_contents: false
tags: [boilerplate, starter-kit, starter, kit, react, native, react-native, javascript, typescript]
---
6 changes: 6 additions & 0 deletions documentation/blog/authors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
jed:
name: Jérémy dollé
title: Maintainer of the React Native Boilerplate
url: https://github.com/JeremyDolle
image_url: https://avatars.githubusercontent.com/u/15814069?v=4

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
slug: /Introduction
title: React Native Boilerplate 🐙
title: What's in the box❓
---

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

This project is a [React Native](https://facebook.github.io/react-native/) boilerplate that can be used to kick-start a mobile application.
163 changes: 116 additions & 47 deletions documentation/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,73 +1,142 @@
/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
title: 'React Native Boilerplate',
tagline: 'Ready to use react native architecture based on Separation of Concerns.',
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');

/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'The React Native Boilerplate',
tagline: 'Simple, Lightweight and Scalable.',
url: 'https://thecodingmachine.github.io',
baseUrl: '/react-native-boilerplate/',
onBrokenLinks: 'warn',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.png',
organizationName: 'thecodingmachine',
projectName: 'react-native-boilerplate',
themeConfig: {
algolia: {
apiKey: '870ae81ec981530781f32849c55a593f',
indexName: 'rnboilerplate',
contextualSearch: true,
},
navbar: {
title: 'RNBoilerplate',
logo: {
alt: 'React Native Boilerplate',
src: 'img/TOM-small.png',
},
items: [
{
to: 'docs/Introduction',
activeBasePath: 'docs',
label: 'Docs',
position: 'left',
},
{
to: '/blog',
label: 'Blog',
position: 'left'
},
{
href: 'https://github.com/thecodingmachine/react-native-boilerplate',
label: 'GitHub',
position: 'right',
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
plugins: [
async function myPlugin() {
return {
name: 'docusaurus-tailwindcss',
configurePostCss(postcssOptions) {
// eslint-disable-next-line global-require
postcssOptions.plugins.push(require('tailwindcss'));
// eslint-disable-next-line global-require
postcssOptions.plugins.push(require('autoprefixer'));
return postcssOptions;
},
],
},
footer: {
style: 'dark',
logo: {
alt: 'Facebook Open Source Logo',
src: 'img/TOM.png',
},
copyright: `Copyright © ${new Date().getFullYear()} TheCodingMachine, Inc. Built with Docusaurus.`,
};
},
},
],
presets: [
[
'@docusaurus/preset-classic',
{
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
editUrl:
'https://github.com/thecodingmachine/react-native-boilerplate/edit/master/website-documentation/docs',
},
blog: {
showReadingTime: true,
// Please change this to your repo.
editUrl:
'https://github.com/thecodingmachine/react-native-boilerplate/edit/master/website-documentation/blog',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
},
}),
],
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
algolia: {
appId: '9PEYN0H12D',
indexName: 'rnboilerplate',
apiKey: '870ae81ec981530781f32849c55a593f',
contextualSearch: true,
},
colorMode: {
respectPrefersColorScheme: true,
},
navbar: {
title: 'React Native Boilerplate',
logo: {
alt: 'React Native Boilerplate',
src: 'img/TOM-small.png',
},
items: [
{
type: 'doc',
docId: 'Introduction',
position: 'left',
label: 'Docs',
},
{ to: '/blog', label: 'Blog', position: 'left' },
{
href: 'https://github.com/thecodingmachine/react-native-boilerplate',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Installation',
to: '/docs/Installation',
},
{
label: 'Theme',
to: '/docs/Theme',
},
{
label: 'Loading data at startup',
to: '/docs/SplashScreenLoadingData',
},
{
label: 'Redux toolkit',
to: '/docs/ReduxStore',
},
{
label: 'Internationalization',
to: '/docs/AddALangTranslation',
},
],
},
{
title: 'More',
items: [
{
label: 'Blog',
to: '/blog',
},
{
label: 'GitHub',
href: 'https://github.com/thecodingmachine/react-native-boilerplate',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} React Native Boilerplate, by TheCodingMachine. Built with Docusaurus.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
};

module.exports = config;
32 changes: 26 additions & 6 deletions documentation/package.json
Original file line number Diff line number Diff line change
@@ -8,17 +8,37 @@
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids"
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.14",
"@docusaurus/preset-classic": "2.0.0-beta.14",
"@mdx-js/react": "^1.6.21",
"@docusaurus/core": "2.0.0-beta.20",
"@docusaurus/preset-classic": "2.0.0-beta.20",
"@mdx-js/react": "^1.6.22",
"autoprefixer": "^10.4.7",
"clsx": "^1.1.1",
"react": "^17.0.1",
"react-dom": "^17.0.1"
"postcss": "^8.4.14",
"prism-react-renderer": "^1.3.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"tailwindcss": "^3.0.24"
},
"devDependencies": {
"@docusaurus/eslint-plugin": "^2.0.0-beta.21",
"@docusaurus/module-type-aliases": "2.0.0-beta.20",
"@tsconfig/docusaurus": "^1.0.5",
"@typescript-eslint/eslint-plugin": "^5.27.0",
"@typescript-eslint/parser": "^5.27.0",
"eslint": "^7.32.0 || ^8.2.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"typescript": "^4.6.4"
},
"browserslist": {
"production": [
Loading

0 comments on commit b4f7cc7

Please sign in to comment.