Topxue / npm-react

react-npm-template

Home Page:https://react-npm-template.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

README

Features

  • πŸ’» React suport >=16.8.0
  • ✈️ Project init with vite
  • πŸ“¦ Support cjs & esm

how to use

replace custom-package-name with your package name

Directory structure

Project
β”œβ”€β”€ __tests__           # Unit Testing
β”œβ”€β”€ babel.config.js     # babel config
β”œβ”€β”€ package.json
β”œβ”€β”€ playground          # dev environment folder (can use source code)
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ public
β”‚   β”œβ”€β”€ src
β”‚   β”œβ”€β”€ tsconfig.json
β”‚   β”œβ”€β”€ vite-env.d.ts
β”‚   └── vite.config.ts
β”œβ”€β”€ postcss.config.js  # build styles with postcss
β”œβ”€β”€ src                # Package source code
β”‚   β”œβ”€β”€ index.ts       # Package source entry
β”‚   β”œβ”€β”€ stories        # storybook for building UI components and pages
β”‚   β”œβ”€β”€ styles         # styles for Package
β”‚   └── types.ts       # ts type declaration for Package
β”œβ”€β”€ tsconfig.json      # ts config
└── tsup.config.ts     # build package with tsup

How to add GITHUB_TOKEN

How to add NPM_TOKEN

  1. create npm auth token

  2. then copy npm token, add to github project settings

    • project -> settings -> secrets -> actions -> create new token with name:NPM_TOKEN

How to add NETLIFY_TOKEN

  1. create netlify auth token

  2. then copy netlify token, add to github project settings

    • project -> settings -> secrets -> actions -> create new token with name:NETLIFY_TOKEN
  3. create a site on netlify

  4. copy the site_id from your netlify site settings, add it to github project settings

    • project -> settings -> secrets -> actions -> create new token with name:NETLIFY_SITE_ID
  5. Stop Build from Build settings of site

How to generate VERCEL_ORG_ID / VERCEL_PROJECT_ID

  1. run npx vercel in project root folder

  2. open .vercel/project.json

  3. copy orgId & projectId, add it to github project settings

    • project -> settings -> secrets -> actions -> create new token with name:VERCEL_ORG_ID & VERCEL_PROJECT_ID
  4. create vercel token, add it to github project settings

    • project -> settings -> secrets -> actions -> create new token with name:VERCEL_TOKEN
  5. change project build setting

    setting

About

react-npm-template

https://react-npm-template.netlify.app

License:MIT License


Languages

Language:JavaScript 47.6%Language:TypeScript 44.6%Language:CSS 3.6%Language:HTML 3.0%Language:Shell 1.0%Language:SCSS 0.3%