🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

cfship

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cfship - npm Package Compare versions

Comparing version
0.1.0
to
0.2.0
+1
-0
dist/index.js

@@ -16,2 +16,3 @@ // import React from 'react';

// serviceWorker.unregister();
//
export { default as Button } from './components/Button';
+19
-8
{
"name": "cfship",
"version": "0.1.0",
"version": "0.2.0",
"private": false,

@@ -27,4 +27,4 @@ "license": "MIT",

"peerDependencies": {
"react":">=16.8.3",
"react-dom":">=16.8.3"
"react": ">=16.8.3",
"react-dom": ">=16.8.3"
},

@@ -35,4 +35,6 @@ "scripts": {

"clean": "rimraf ./dist",
"lint": "eslint --ext js,ts,tsx src --max-warnings 5",
"builds": "npm run clean && npm run build-ts && npm run build-css ",
"test": "react-scripts test",
"test:nowatch": "cross-env CI=true react-scripts test",
"eject": "react-scripts eject",

@@ -43,3 +45,3 @@ "build-ts": "tsc -p tsconfig.build.json",

"build-storybook": "build-storybook -s public",
"prepublish": "npm run builds"
"prepublishOnly": "npm run test:nowatch && npm run lint && npm run builds"
},

@@ -61,2 +63,9 @@ "eslintConfig": {

},
"husky": {
"hooks": {
"pre-commit": "npm run test:nowatch && npm run lint",
"pre-push": "",
"...": "..."
}
},
"devDependencies": {

@@ -69,7 +78,6 @@ "@storybook/addon-actions": "^5.3.19",

"@storybook/react": "^5.3.19",
"@types/classnames": "^2.2.10",
"@types/storybook__addon-info": "^5.2.1",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"@types/classnames": "^2.2.10",
"@types/jest": "^24.9.1",

@@ -79,8 +87,11 @@ "@types/node": "^12.12.44",

"@types/react-dom": "^16.9.8",
"@types/storybook__addon-info": "^5.2.1",
"cross-env": "^7.0.2",
"husky": "^4.2.5",
"node-sass": "^4.14.1",
"rimraf": "^3.0.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.1",
"react": "^16.13.1"
"rimraf": "^3.0.2"
}
}
+31
-30

@@ -1,44 +0,45 @@

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## cfship component library
## 使用 React+typescript 从零到一打造一套你自己的组件库
## Available Scripts
[![Build Status](https://api.travis-ci.com/yanyunchangfeng/cfship.svg?branch=master&status=passed)](https://travis-ci.com/yanyunchangfeng/cfship)
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
### 安装最后已经发布的组件库来试试
The page will reload if you make edits.<br />
You will also see any lint errors in the console.
~~~javascript
npm install cfship --save
~~~
### `npm test`
### 使用
Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
~~~javascript
// 加载样式
import 'cfship/dist/index.css'
// 引入组件
import { Button } from 'cfship'
~~~
### `npm run build`
### 课程亮点
Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.
* 🔥typescript with React Hooks
* ⛑️使用 react-testing-library 完成单元测试
* 📚使用 storybook 本地调试和生成文档页面
* 🌹样式(Sass)文件从零开始,掌握大型应用的 CSS 组织方法
* 🎉涉及全部流程,包括最后的 npm publish,husky提交发布前验证,travis CI/CD 集成,发布文档站点等
The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!
### 一些本地开发命令
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
~~~bash
//启动本地环境
npm run stroybook
### `npm run eject`
//跑单元测试
npm test
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
//build可发布静态文件
npm run builds
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
//发布到 npm
npm run publish
~~~