diff --git a/.browserslistrc b/.browserslistrc index 5372580b..426ba935 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -3,4 +3,3 @@ defaults not ie > 1 not ie_mob > 1 -maintained node versions diff --git a/.env.dist b/.env.dist new file mode 100644 index 00000000..32e724a2 --- /dev/null +++ b/.env.dist @@ -0,0 +1,6 @@ +# Host system port where the live documentation is to be made accessible +COMPOSE_START_PORT=8000 + +# Ownership of the files created in the container +COMPOSE_UID=1000 +COMPOSE_GID=1000 diff --git a/.eslintrc b/.eslintrc index 51c183ea..f1c81fc4 100644 --- a/.eslintrc +++ b/.eslintrc @@ -6,6 +6,7 @@ "browser": true, "jest": true }, + "ignorePatterns": ["src/docs/_assets/generated"], "overrides": [ { "files": ["**/*.md", "**/*.mdx"], diff --git a/.github/workflows/release-management.yml b/.github/workflows/release-management.yml index 043fdf74..2c3763ff 100644 --- a/.github/workflows/release-management.yml +++ b/.github/workflows/release-management.yml @@ -24,7 +24,7 @@ jobs: run: npm ci - name: Build - run: npm run build + run: docker compose run --rm node_build_site && docker compose run --rm mkdocs_build_site - name: Test run: npm test @@ -45,7 +45,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: docs - path: docs + path: site update_release_draft: name: Update release draft diff --git a/.gitignore b/.gitignore index 374ad226..56070843 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ -/.docz /dist -/docs /node_modules -lib-stats.development.html -lib-stats.html +/site +/src/docs/_assets/generated/* +.env +!.gitkeep diff --git a/.markdownlint.jsonc b/.markdownlint.jsonc index de6a2ad6..230ac13f 100644 --- a/.markdownlint.jsonc +++ b/.markdownlint.jsonc @@ -2,9 +2,11 @@ { "default": true, + "MD033": false, // Allow inline JSX. + "MD024": false, // Allow duplicate headings "line-length": { "code_block_line_length": 120, - "tables": false - }, - "no-inline-html": false // Allow inline JSX. + "tables": false, + "code_blocks": false + } } diff --git a/.npmignore b/.npmignore index e1629866..8f059baa 100644 --- a/.npmignore +++ b/.npmignore @@ -1,10 +1,10 @@ -/.docz /.github /.idea -/docs +/docker /node_modules +/public +/site /src/docs/ -/src/gatsby-theme-docz/ /src/**/__tests__ /tests .browserslistrc @@ -13,13 +13,12 @@ .gitignore .markdownlint.jsonc babel.config.js -doczrc.js -gatsby-config.js +CONTRIBUTING.md +docker-compose.yml jest.config.js -lib-stats.development.html -lib-stats.html +mkdocs.yml package-lock.json postcss.config.js RELEASING.md stylelint.config.js -webpack.config.js +webpack.config.babel.js diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dc8a5a24..23e2b144 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,24 +1,83 @@ ---- -name: General Guidelines -route: /contribute/guidelines -menu: Contribute ---- - # Contributing In the first place, thank you for your interest in contributing! πŸ™ ## Development -To build the project: +Working on the site requires: + +* [Docker] +* [Docker Compose] + +This allows running the documentation site which serves as a development platform. + +### Configure Docker Compose + +Review the default env variable values in the `docker-compose.yml` file. +The defaults should work for most systems, but can be changed if needed. + +To change them: + +1. Create a `.env` file from the template: + + ```bash + cp .env.dist .env + ``` + +2. Edit the new `.env` file as needed + +### Use Docker Compose + +#### Node shell + +All npm commands such as `npm ci`, `npm test`, `npm run eslint` and others you +need to run them within the `node_shell` docker container. + +To log into the container, run: + +```bash +docker compose run --rm node_shell +``` + +#### Run the Dev Server + +1. Install dependencies (run within `node_shell`): + + ```bash + npm ci + ``` + +2. Run development server (run on host): + + ```bash + docker compose up node_dev_server mkdocs_dev_server + ``` + +#### Build the Project + +1. Make sure the dev server is not running (run on host): + + ```bash + docker compose down + ``` -1. Install local npm packages: `npm install` -2. Run the build: `npm run build` +2. Install dependencies (run within `node_shell`): -To run the dev server: + ```bash + npm ci + ``` -1. Install local npm packages: `npm install` -2. Run the dev server (usually on `http://localhost:3000`): `npm start` +3. Build JS (run on host): + + ```bash + docker compose run --rm node_build_site + ``` + +4. Build mkDocs (run on host): + + ```bash + docker compose run --rm mkdocs_build_site + ``` ## Git Workflow @@ -33,13 +92,13 @@ Actions), please follow these guidelines: 3. **Name your branches according to nature of change.** Choose one of: - - `bc/*` for breaking changes - - `feature/*` for features - - `bugfix/*` for bugfixes - - `refactoring/*` for refactoring of the library - - `docs/*` or `documentation/*` for changes in docs - - `maintenance/*` for maintenance (builds, dependencies, automation, etc.) - - `release/*` for [releases](/contribute/releasing) (administrators only) + * `bc/*` for breaking changes + * `feature/*` for features + * `bugfix/*` for bugfixes + * `refactoring/*` for refactoring of the library + * `docs/*` or `documentation/*` for changes in docs + * `maintenance/*` for maintenance (builds, dependencies, automation, etc.) + * `release/*` for releases (administrators only) 4. **Write clear, helpful and descriptive commit messages.** @@ -82,9 +141,8 @@ application with `npm link` so you can see it in action. 1. In React UI repository, run `npm link` 2. In your application, run `npm link @react-ui-org/react-ui` -To prevent -[Invalid Hook Call Warning](https://reactjs.org/warnings/invalid-hook-call-warning.html#duplicate-react) -when React UI is linked, add the following code to your app's Webpack config: +To prevent [Invalid Hook Call Warning][react-invalid-hook] when React UI is +linked, add the following code to your app's Webpack config: ```js const path = require('path'); @@ -108,30 +166,13 @@ To keep React UI consistent and predictable the following guidelines should be o ## Documenting -We use [Docz](https://docz.site) (powered by [Gatsby](https://www.gatsbyjs.com)) -as the documentation platform. The documentation itself is written in -[MDX](https://mdxjs.com) format β€” a human-readable blend of the popular Markdown -and JSX syntax. - -Run `npm start` to run the docs in development mode, and open -`http://localhost:3000` in your browser to see the docs in live-reload mode. - -A few things to note: - -- In order to get component props parsed and rendered by Docz, it's crucial to - **import the component into an MDX file right from its source file** β€” parsing - a re-exported component (typically via `index.js`) isn't currently supported. - -- If you don't want Gatsby to collect **anonymous statistics**, you may want to - disable [Gatsby telemetry](https://www.gatsbyjs.com/docs/telemetry/) by - running `npx gatsby telemetry --disable`. +We use combination of [Material for MkDocs][mkdocs-material] and [Docoff] as +the documentation platform. -- If you see the Not found page after having **changed the configuration of Docz - or Gatsby in the live-reload mode,** you may either restart the Docz - development server (`ctrl + c` and `npm start`), or try to edit an MDX file - which makes the Docz rebuild, too. +Do see their respective documentation for details. -- To **make your authoring experience better,** we recommend to make sure your - IDE understands the MDX syntax and is able to help you wrap lines in MD and - MDX files automatically (Jetbrains IDE's and VSCode support both features - out-of-the-box or through a plugin). +[Docker]: https://www.docker.com +[Docker Compose]: https://docs.docker.com/compose/ +[react-invalid-hook]: https://reactjs.org/warnings/invalid-hook-call-warning.html#duplicate-react +[mkdocs-material]: https://squidfunk.github.io/mkdocs-material/ +[Docoff]: https://github.com/react-ui-org/docoff diff --git a/README.md b/README.md index 8bfd64e2..c5b242bc 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ React UI is a themeable, performant, responsive UI library for React apps. Use it simply with no configuration or have full control over your design by tweaking some of the hundreds theming options available. -**[Explore React UI docs β†’](https://react-ui.io)** +**[Explore React UI docs β†’][rui-docs]** ## Key Concepts @@ -38,7 +38,7 @@ these requirements:

> Development of React UI is largely supported by -> [RACOM](https://www.racom.eu)β€”one of the leading global players in wireless +> [RACOM]β€”one of the leading global players in wireless > Critical Infrastructure. ## Quick Start Guide @@ -81,8 +81,7 @@ To install React UI in your app: