🚀. Socket Launch Week Day 3:Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions.Learn more
Sign In

react-ts-npm-boilerplate

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-ts-npm-boilerplate

A template for a React + TypeScript + npm package

latest
Source
npmnpm
Version
1.1.9
Version published
Maintainers
1
Created
Source

React-ts-npm-boilerplate

GitHub Actions Badge

Demo:

  • storybook: https://andy770921.github.io/react-ts-npm-boilerplate/demo

  • npm package: https://www.npmjs.com/package/react-ts-npm-boilerplate

Features:

  • Deploy your own React-Component package to npmjs.com easily

  • Fix format error automatically on save

  • Generate static storybook files and host storybook website automatically via GitHub Actions

Installation:

  • npm install

  • Install VSCode extensions: ESLint, Prettier

Usage:

  • npm run start: start running dev-server for local development

  • npm run storybook: start running storybook server for previewing demo page

  • npm run build: build index.js and index.d.ts file from src folder

  • npm run build-storybook: build index.html in demo folder for static hosting

  • chagne setting in package.json

  • use npm login and npm publish for publishing to https://www.npmjs.com/

  • npm run watch: start typescript watch mode

  • npm run lint: use ESLint for manually checking files inside src folder

Usage for third-party import:

  • npm i react-ts-npm-boilerplate

  • import library

// TypsScript
import React, { FC } from 'react';
import { MyButton } from 'react-ts-npm-boilerplate';

const MyComponent: FC = () => (
    <div>
        <MyButton>My Button</MyButton>
    </div>
);

export default MyComponent;

Folder Structure

┌── .github/workflows          # Settings for GitHub Actions
├── .storybook                 # Storybook settings
├── .vscode                    # VSCode settings for ESLint auto-fix function
├── demo                       # Storybook static file
├── dist                       # Bundled JS and TS declaration file for deployed npm package
├── src                        # All source code
│    ├── components            # React components
│    │    └── button           # Component folder
│    │          ├── MyButton.tsx           # Component for npm package
│    │          └── MyButton.stories.tsx   # Component displayed in storybook
│    ├── index.dev.tsx         # Development entry that uses ReactDOM.redner for local development
│    └── index.tsx             # Production entry that exports all components
├── .gitignore                 # Excluded files for ignoring Git version control
├── .eslintrc.js               # ESLint settings
├── index.html                 # HTML for local development
├── README.md                  # README
├── package-lock.json          # Package settings that locked the version of dependencies packages
├── package.json               # Package settings that listed dependencies packages, npm scripts, project name etc.
├── webpack.config.common.js   # Webpack settings in both development and production mode
├── webpack.config.dev.js      # Webpack settings in development mode
├── webpack.config.prod.js     # Webpack settings in production mode
└── tsconfig.json              # TypeScript settings

Keywords

react

FAQs

Package last updated on 08 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts