Skip to content
This repository has been archived by the owner on Apr 7, 2024. It is now read-only.

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
morewings committed Nov 29, 2023
1 parent 51a48e1 commit 460c27e
Show file tree
Hide file tree
Showing 7 changed files with 171 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Run tasks
run: |
pnpm install
pnpm run lint:js --quiet
pnpm run lint:code --quiet
pnpm run lint:style --quiet
pnpm run test --silent
pnpm run start --smoke-test
Expand Down
41 changes: 24 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,21 @@
[![Node.js CI](https://github.com/morewings/cra-template-npm-library/actions/workflows/merge-jobs.yml/badge.svg)](https://github.com/morewings/cra-template-npm-library/actions/workflows/merge-jobs.yml)
[![types included](https://img.shields.io/github/package-json/types/morewings/cra-template-npm-library)](https://github.com/morewings/cra-template-npm-library)
[![npm version](https://badge.fury.io/js/cra-template-npm-library.svg)](https://www.npmjs.com/package/cra-template-npm-library)
[![npm](https://img.shields.io/npm/dm/cra-template-npm-library)](http://npm-stats.org/#/cra-template-npm-library)

# NPM library Create React App template

[Create React App](https://github.com/facebook/create-react-app) (CRA) template to build and publish NPM libraries with **rollup**, **eslint** and **stylelint** configurations. See [full documentation](https://morewings.github.io/cra-template-npm-library).
[Create React App](https://github.com/facebook/create-react-app) (CRA) template to build and publish NPM libraries with **rollup**, **eslint** and **stylelint** configurations.

## Usage
🎁👌🤓 **NEW!** Now with **Typescript** support.

```shell script
npx create-react-app %PROJECT_NAME% --template npm-library
```
Or
```shell script
yarn create react-app %PROJECT_NAME% --template npm-library
```
Read [full documentation](https://github.com/morewings/cra-template-npm-library/wiki).

Then

```shell script
cd %PROJECT_NAME%
yarn start
```
Visit [Storybook Demo](https://morewings.github.io/cra-template-npm-library).

## Features

- Handles all modern JS features.
- Supports **Typescript** and **Javascript**.
- Bundles `commonjs` and `es` module formats.
- [Husky](https://github.com/typicode/husky) for git hooks.
- [Eslint](https://eslint.org/) and [stylelint](https://stylelint.io/).
Expand All @@ -34,7 +24,24 @@ yarn start
- [Jest](https://jestjs.io/) and [react-testing-library](https://testing-library.com/docs/react-testing-library/intro) for testing.
- Supports CSS modules, SASS/SCSS and PostCSS.
- [Storybook](https://storybook.js.org/) for documentation and demo.
- And [much more](https://cra-template-npm-library.netlify.com/).
- And [much more](https://github.com/morewings/cra-template-npm-library/wiki).

## Quickstart

```shell script
npx create-react-app %PROJECT_NAME% --template npm-library
yarn create react-app %PROJECT_NAME% --template npm-library
pnpm create react-app %PROJECT_NAME% --template npm-library
```

Then

```shell script
cd %PROJECT_NAME%
npm run prepare
yarn run prepare
pnpm run prepare
```

## Contributors

Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"engines": {
"node": ">=14"
},
"description": "Create React App template to build and publish NPM libraries with rollup, eslint and stylelint",
"main": "template.json",
"keywords": [
"react",
"create-react-app",
Expand All @@ -23,6 +21,11 @@
"publish",
"create-react-library"
],
"description": "Create React App template to build and publish NPM libraries with rollup, eslint and stylelint",
"main": "template.json",
"module": "dist/index.esm.js",
"style": "dist/style.css",
"types": "dist/types.d.ts",
"files": [
"template",
"template.json"
Expand Down Expand Up @@ -57,6 +60,7 @@
"@types/node": "16.7.13",
"@types/react": "18.0.0",
"@types/react-dom": "18.0.0",
"@typescript-eslint/eslint-plugin": "6.13.1",
"@typescript-eslint/parser": "6.12.0",
"@yelo/rollup-node-external": "1.0.1",
"autoprefixer": "9.8.8",
Expand Down
140 changes: 133 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion templateFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
'.eslintrc.cjs',
'.lintstagedrc',
'.nvmrc',
// '.storybook',
'.storybook',
'.stylelintrc',
'.husky',
// 'docs',
Expand Down
5 changes: 1 addition & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react",
"jsx": "react-jsx",
"baseUrl": "src",
"paths": {
"@/*": ["./src/*"]
},
"target": "esnext",
"declaration": false,
"outDir": "./dist",
Expand Down
Loading

0 comments on commit 460c27e

Please sign in to comment.