Skip to content

Commit f62b323

Browse files
committed
feat: add boilerplate app
1 parent 3e937d2 commit f62b323

Some content is hidden

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

64 files changed

+26121
-10236
lines changed

.eslintrc.js

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module.exports = {
1515
plugins: ["react", "import", "jest"],
1616
rules: {
1717
"import/no-extraneous-dependencies": "off",
18+
"import/prefer-default-export": "off",
1819
"react/function-component-definition": "off", // see https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md
1920
"react/jsx-props-no-spreading": "off", // see https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md
2021
"react/style-prop-object": [
@@ -58,6 +59,7 @@ module.exports = {
5859
rules: {
5960
"import/no-unresolved": "error",
6061
"import/no-extraneous-dependencies": "off",
62+
"import/prefer-default-export": "off",
6163
"react/function-component-definition": "off", // see https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md
6264
"react/jsx-props-no-spreading": "off", // see https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md
6365
"react/require-default-props": "off", // Typescript will set undefined for the default value (see https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/require-default-props.md)

.github/workflows/chromatic.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# .github/workflows/chromatic.yml
2+
3+
name: "Chromatic"
4+
5+
on: push
6+
7+
jobs:
8+
chromatic:
9+
name: Run Chromatic
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 20
19+
- name: Install dependencies
20+
# ⚠️ See your package manager's documentation for the correct command to install dependencies in a CI environment.
21+
run: npm ci
22+
- name: Run Chromatic
23+
uses: chromaui/action@latest
24+
with:
25+
# ⚠️ Make sure to configure a `CHROMATIC_PROJECT_TOKEN` repository secret
26+
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

.github/workflows/npm-publish.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v4
1515
- uses: actions/setup-node@v3
1616
with:
17-
node-version: 16
17+
node-version: 20
1818
- run: npm ci
1919
- run: npm test
2020

@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/checkout@v4
2626
- uses: actions/setup-node@v3
2727
with:
28-
node-version: 16
28+
node-version: 20
2929
registry-url: https://registry.npmjs.org/
3030
- run: npm ci
3131
- run: npm publish

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ storybook-static
88
.vscode
99

1010
*.log
11+
12+
*storybook.log

CODE_OF_CONDUCT.md

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
2+
# Contributor Covenant Code of Conduct
3+
4+
## Our Pledge
5+
6+
In the interest of fostering an open and welcoming environment, we as
7+
contributors and maintainers pledge to make participation in our project and
8+
our community a harassment-free experience for everyone, regardless of age, body
9+
size, disability, ethnicity, sex characteristics, gender identity and expression,
10+
level of experience, education, socio-economic status, nationality, personal
11+
appearance, race, religion, or sexual identity and orientation.
12+
13+
## Our Standards
14+
15+
Examples of behavior that contributes to creating a positive environment
16+
include:
17+
18+
* Using welcoming and inclusive language
19+
* Being respectful of differing viewpoints and experiences
20+
* Gracefully accepting constructive criticism
21+
* Focusing on what is best for the community
22+
* Showing empathy towards other community members
23+
24+
Examples of unacceptable behavior by participants include:
25+
26+
* The use of sexualized language or imagery and unwelcome sexual attention or
27+
advances
28+
* Trolling, insulting/derogatory comments, and personal or political attacks
29+
* Public or private harassment
30+
* Publishing others' private information, such as a physical or electronic
31+
address, without explicit permission
32+
* Other conduct which could reasonably be considered inappropriate in a
33+
professional setting
34+
35+
## Our Responsibilities
36+
37+
Project maintainers are responsible for clarifying the standards of acceptable
38+
behavior and are expected to take appropriate and fair corrective action in
39+
response to any instances of unacceptable behavior.
40+
41+
Project maintainers have the right and responsibility to remove, edit, or
42+
reject comments, commits, code, wiki edits, issues, and other contributions
43+
that are not aligned to this Code of Conduct, or to ban temporarily or
44+
permanently any contributor for other behaviors that they deem inappropriate,
45+
threatening, offensive, or harmful.
46+
47+
## Scope
48+
49+
This Code of Conduct applies within all project spaces, and it also applies when
50+
an individual is representing the project or its community in public spaces.
51+
Examples of representing a project or community include using an official
52+
project e-mail address, posting via an official social media account, or acting
53+
as an appointed representative at an online or offline event. Representation of
54+
a project may be further defined and clarified by project maintainers.
55+
56+
## Enforcement
57+
58+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
59+
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
60+
complaints will be reviewed and investigated and will result in a response that
61+
is deemed necessary and appropriate to the circumstances. The project team is
62+
obligated to maintain confidentiality with regard to the reporter of an incident.
63+
Further details of specific enforcement policies may be posted separately.
64+
65+
Project maintainers who do not follow or enforce the Code of Conduct in good
66+
faith may face temporary or permanent repercussions as determined by other
67+
members of the project's leadership.
68+
69+
## Attribution
70+
71+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
72+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
73+
74+
[homepage]: https://www.contributor-covenant.org
75+
76+
For answers to common questions about this code of conduct, see
77+
https://www.contributor-covenant.org/faq

README.md

+35-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,41 @@
1-
# Fluidus UI - fluid UI components for modern web applications
1+
<h1>Fluidus UI</h1>
22

3-
[![Code Coverage][coverage-badge]][coverage]
3+
<p>Fluid UI components for modern React applications.</p>
4+
5+
<hr>
6+
7+
[![version][version-badge]][package]
8+
[![MIT License][license-badge]][license]
9+
[![downloads][downloads-badge]][npmtrends]
10+
[![Storybook][storybook]](link to site)
11+
[![PRs Welcome][prs-badge]][prs]
12+
[![Code of Conduct][coc-badge]][coc]
413

514
## Quick Start
615

7-
```
8-
npm i
9-
```
16+
## Development
17+
18+
*Fluidus UI* is organized as a monorepo. There are a number of useful scripts:
19+
20+
```npm start``` - start Storybook
21+
22+
```npm run start:boilerplate``` - build and run Boilerplate application
23+
24+
```npm run lint``` - will lint all source files
25+
26+
```npm run test``` - will test all source files
27+
28+
```npm run build``` - will build all packages (*Fluidus Core*, *Fluidus Tokens*, *Fluidus React*)
1029

11-
```
12-
npm start
13-
```
30+
[version-badge]: https://img.shields.io/npm/v/@fluidus-ui/react?style=flat-square
31+
[package]: https://www.npmjs.com/package/@fluidus-ui/react
32+
[downloads-badge]: https://img.shields.io/npm/dm/@fluidus-ui/react.svg?style=flat-square
33+
[npmtrends]: http://www.npmtrends.com/@fluidus-ui/react
34+
[license-badge]: https://img.shields.io/npm/l/@fluidus-ui/react.svg?style=flat-square
35+
[license]: https://github.com/dklemmt/fluidus-ui/blob/main/LICENSE
36+
[storybook]: https://cdn.jsdelivr.net/gh/storybookjs/brand@main/badge/badge-storybook.svg
37+
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
38+
[prs]: http://makeapullrequest.com
39+
[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square
40+
[coc]: https://github.com/dklemmt/@fluidus-ui/blob/main/CODE_OF_CONDUCT.md
1441

15-
Afterwards the Storybook documentation will pop up.

apps/boilerplate/.eslintrc.js

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
module.exports = {
2+
root: true, // don't use monorepos configuration
3+
env: {
4+
browser: true,
5+
es2021: true, // includes setting of 'parserOptions.ecmaVersion' to 12
6+
},
7+
extends: [
8+
"airbnb",
9+
"airbnb/hooks",
10+
"eslint:recommended",
11+
"plugin:react/recommended",
12+
"plugin:react/jsx-runtime",
13+
"plugin:react-hooks/recommended",
14+
"prettier",
15+
],
16+
plugins: ["react", "import", "jest"],
17+
rules: {
18+
"import/no-extraneous-dependencies": "off",
19+
"import/prefer-default-export": "off",
20+
"react/function-component-definition": "off", // see https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md
21+
"react/jsx-props-no-spreading": "off", // see https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md
22+
"react/style-prop-object": [
23+
"error",
24+
{
25+
allow: ["FormattedNumber"], // allow 'style' property for react-intl component as it isn't CSS 'styles' property
26+
},
27+
],
28+
},
29+
overrides: [
30+
{
31+
// typescript settings
32+
files: ["**/*.ts", "**/*.tsx"],
33+
extends: [
34+
"airbnb",
35+
"airbnb-typescript",
36+
"airbnb/hooks",
37+
"plugin:@typescript-eslint/recommended-type-checked",
38+
// "plugin:@typescript-eslint/strict-type-checked",
39+
"plugin:@typescript-eslint/stylistic-type-checked",
40+
"plugin:react/recommended",
41+
"plugin:react/jsx-runtime",
42+
"plugin:react-hooks/recommended",
43+
"plugin:import/recommended",
44+
"plugin:import/typescript",
45+
"prettier",
46+
],
47+
parser: "@typescript-eslint/parser",
48+
parserOptions: {
49+
// project: true,
50+
project: ["./tsconfig.eslint.json", "./tsconfig.json"],
51+
ecmaFeatures: {
52+
jsx: true,
53+
},
54+
},
55+
plugins: ["@typescript-eslint", "react", "react-hooks", "import"],
56+
rules: {
57+
"import/no-unresolved": "error",
58+
"import/no-extraneous-dependencies": "off",
59+
"import/prefer-default-export": "off",
60+
"react/function-component-definition": "off", // see https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md
61+
"react/jsx-props-no-spreading": "off", // see https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md
62+
"react/require-default-props": "off", // Typescript will set undefined for the default value (see https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/require-default-props.md)
63+
},
64+
settings: {
65+
// see https://github.com/import-js/eslint-import-resolver-typescript#configuration
66+
"import/parsers": {
67+
"@typescript-eslint/parser": [".ts", ".tsx"],
68+
},
69+
"import/resolver": {
70+
typescript: { alwaysTryTypes: true }, // this loads <rootdir>/tsconfig.json to eslint
71+
},
72+
},
73+
},
74+
{
75+
extends: ["plugin:@typescript-eslint/disable-type-checked"],
76+
files: ["./**/*.stories.ts"],
77+
},
78+
{
79+
// turn off nasty warnings/errors for non app files
80+
files: [
81+
"**/*.stories.{js,jsx,ts,tsx}",
82+
"**/*.config.{js,jsx,ts,tsx}",
83+
"**/*.test.{js,jsx,ts,tsx}",
84+
],
85+
rules: {
86+
"import/no-extraneous-dependencies": "off",
87+
"no-console": "off",
88+
},
89+
},
90+
],
91+
};

0 commit comments

Comments
 (0)