Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update readme #17

Merged
merged 2 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 5 additions & 17 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ module.exports = {
sourceType: 'module',
project: './tsconfig.linter.json',
},
settings: {
react: {
version: 'detect'
},
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
Expand Down Expand Up @@ -118,23 +123,6 @@ module.exports = {
],
},
},
/* Disable `environment` directory imports for library files */
{
files: ['./src/lib/**/*.*'],
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{
"group": ['**/environment/**'],
"message": "Imports from environment directory are forbidden in the library files."
}
],
},
]
}
}
],
};

38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
# React Library Template

With React Template Repository, you can focus on developing your React components and libraries without worrying about the configuration and setup.
With React Library Template Repository, you can focus on developing your React components and libraries without worrying about the configuration and setup.

Read [full documentation](https://github.com/morewings/cra-template-npm-library/wiki).

Visit [Demo Storybook](https://morewings.github.io/cra-template-npm-library).

## Features

- Supports **Typescript** and **Javascript**.
- Bundles `commonjs` and `es` module formats.
- [pnpm](https://pnpm.io/) for blazing fast package management.
- [Vite](https://vitejs.dev/) for speedy bundling
- [Husky](https://github.com/typicode/husky) for git hooks.
- [Eslint](https://eslint.org/) and [stylelint](https://stylelint.io/).
- [Rollup](https://rollupjs.org/guide/en/) for bundling.
- [Jest](https://jestjs.io/) and [react-testing-library](https://testing-library.com/docs/react-testing-library/intro) for testing.
- [Storybook](https://storybook.js.org/) for documentation and demo.
- And [much more](https://github.com/morewings/cra-template-npm-library/wiki).

## Quickstart

### Prerequisites

1. Install **Node** >= 18.x.
2. Install **pnpm**. E.g. `corepack prepare pnpm@latest --activate`.


### Installation

Manually clone repo or use `degit`.

```shell script
npx degit https://github.com/morewings/react-library-template my-library
cd ./my-library
pnpm i
```

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"clean:lib": "rm -rf dist",
"build:lib": "vite build",
"build": "run-s clean:lib build:lib",
"lint:code": "eslint . --ext ts,tsx --report-unused-disable-directives",
"lint:code": "eslint ./src/ --ext ts,tsx --report-unused-disable-directives",
"fix:code": "run-s 'lint:code --fix'",
"lint:types": "tsc --pretty --noEmit",
"lint:style": "stylelint ./src/**/*.css",
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.linter.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends" : "./tsconfig.json",
"include": ["**/*.stories.tsx", "**/*.stories.ts", "vite.config.ts", "src"],
"exclude": []
"include": ["**/*.stories.tsx", "**/*.stories.ts", "*.config.ts", "src"],
"exclude": ["./dist/**"]
}
Loading