Skip to content

Commit 4ad2247

Browse files
committed
removed test
0 parents  commit 4ad2247

18 files changed

+14674
-0
lines changed

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build/
2+
dist/
3+
node_modules/
4+
.snapshots/
5+
*.min.js

.eslintrc

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"extends": [
4+
"standard",
5+
"standard-react",
6+
"plugin:prettier/recommended",
7+
"prettier/standard",
8+
"prettier/react",
9+
"plugin:@typescript-eslint/eslint-recommended"
10+
],
11+
"env": {
12+
"node": true
13+
},
14+
"parserOptions": {
15+
"ecmaVersion": 2020,
16+
"ecmaFeatures": {
17+
"legacyDecorators": true,
18+
"jsx": true
19+
}
20+
},
21+
"settings": {
22+
"react": {
23+
"version": "16"
24+
}
25+
},
26+
"rules": {
27+
"space-before-function-paren": 0,
28+
"react/prop-types": 0,
29+
"react/jsx-handler-names": 0,
30+
"react/jsx-fragments": 0,
31+
"react/no-unused-prop-types": 0,
32+
"import/export": 0
33+
}
34+
}

.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
build/
2+
dist/
3+
demo/
4+
node_modules/
5+
**/node_modules/
6+
.snapshots/
7+
*.min.js
8+
.idea/
9+
.vscode/
10+
.vs/
11+
**/.DS_Store
12+
13+
# testing
14+
/coverage
15+
16+
# production
17+
/build
18+
19+
# misc
20+
.DS_Store
21+
.env.local
22+
.env.development.local
23+
.env.test.local
24+
.env.production.local
25+
26+
npm-debug.log*
27+
yarn-debug.log*
28+
yarn-error.log*
29+
30+
**/.DS_Store
31+
32+
.idea/
33+
.vscode/
34+
.vs/

.prettierrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"singleQuote": true,
3+
"jsxSingleQuote": true,
4+
"semi": true,
5+
"tabWidth": 2,
6+
"bracketSpacing": true,
7+
"jsxBracketSameLine": false,
8+
"arrowParens": "always",
9+
"trailingComma": "none"
10+
}

.storybook/main.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
stories: ['../src/**/*.stories.js', '../src/**/*.stories.tsx'],
3+
addons: [
4+
'@storybook/preset-create-react-app',
5+
'@storybook/addon-actions',
6+
'@storybook/addon-links'
7+
]
8+
};

.travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
language: node_js
2+
node_js:
3+
- 12
4+
- 10

README.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# vant-react
2+
3+
> Lightweight Mobile UI Components built in React & Typescript, inspired by Vant: https://youzan.github.io/vant
4+
5+
[![NPM](https://img.shields.io/npm/v/vant-react.svg)](https://www.npmjs.com/package/vant-react) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
6+
7+
## Install
8+
9+
```bash
10+
npm install --save vant-react
11+
```
12+
13+
## Usage
14+
15+
```tsx
16+
import React, { Component } from 'react'
17+
18+
import MyComponent from 'vant-react'
19+
import 'vant-react/dist/index.css'
20+
21+
class Example extends Component {
22+
render() {
23+
return <MyComponent />
24+
}
25+
}
26+
```
27+
28+
## License
29+
30+
MIT © [mxdi9i7](https://github.com/mxdi9i7)

package.json

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
"name": "vant-react",
3+
"version": "1.0.0",
4+
"description": "Lightweight Mobile UI Components built in React &amp; Typescript, inspired by Vant: https://youzan.github.io/vant",
5+
"author": "mxdi9i7",
6+
"license": "MIT",
7+
"repository": "mxdi9i7/vant-react",
8+
"main": "dist/index.js",
9+
"module": "dist/index.modern.js",
10+
"source": "src/index.tsx",
11+
"engines": {
12+
"node": ">=10"
13+
},
14+
"scripts": {
15+
"build": "microbundle-crl --no-compress --format modern,cjs",
16+
"start": "microbundle-crl watch --no-compress --format modern,cjs",
17+
"prepublish": "run-s build",
18+
"test": "run-s test:unit test:lint test:build",
19+
"test:build": "run-s build",
20+
"test:lint": "eslint .",
21+
"test:unit": "cross-env CI=1 react-scripts test --env=jsdom",
22+
"test:watch": "react-scripts test --env=jsdom",
23+
"predeploy": "cd example && yarn install && yarn run build",
24+
"deploy": "gh-pages -d example/build",
25+
"lint": "eslint --ext .tsx ./src",
26+
"lint:watch": "esw --watch --fix --ext .tsx ./src --no-ignore",
27+
"storybook": "start-storybook -p 9009",
28+
"build-storybook": "build-storybook"
29+
},
30+
"peerDependencies": {
31+
"react": "^16.0.0"
32+
},
33+
"devDependencies": {
34+
"@storybook/addon-actions": "^5.3.18",
35+
"@storybook/addon-links": "^5.3.18",
36+
"@storybook/addons": "^5.3.18",
37+
"@storybook/preset-create-react-app": "^3.0.0",
38+
"@storybook/react": "^5.3.18",
39+
"@types/jest": "^25.1.4",
40+
"@types/react": "^16.9.27",
41+
"@typescript-eslint/eslint-plugin": "^2.26.0",
42+
"@typescript-eslint/parser": "^2.26.0",
43+
"babel-eslint": "^10.0.3",
44+
"cross-env": "^7.0.2",
45+
"eslint": "^6.8.0",
46+
"eslint-config-prettier": "^6.7.0",
47+
"eslint-config-standard": "^14.1.0",
48+
"eslint-config-standard-react": "^9.2.0",
49+
"eslint-plugin-import": "^2.18.2",
50+
"eslint-plugin-node": "^11.0.0",
51+
"eslint-plugin-prettier": "^3.1.1",
52+
"eslint-plugin-promise": "^4.2.1",
53+
"eslint-plugin-react": "^7.17.0",
54+
"eslint-plugin-standard": "^4.0.1",
55+
"eslint-watch": "^6.0.1",
56+
"gh-pages": "^2.2.0",
57+
"husky": "^4.2.3",
58+
"microbundle-crl": "^0.13.10",
59+
"npm-run-all": "^4.1.5",
60+
"prettier": "^2.0.4",
61+
"react": "^16.13.1",
62+
"react-dom": "^16.13.1",
63+
"react-scripts": "^3.4.1",
64+
"serve": "^11.3.0"
65+
},
66+
"files": [
67+
"dist"
68+
],
69+
"eslintConfig": {
70+
"extends": "react-app"
71+
},
72+
"husky": {
73+
"hooks": {
74+
"pre-commit": "npm run lint",
75+
"pre-push": "npm run lint"
76+
}
77+
},
78+
"browserslist": {
79+
"production": [
80+
">0.2%",
81+
"not dead",
82+
"not op_mini all"
83+
],
84+
"development": [
85+
"last 1 chrome version",
86+
"last 1 firefox version",
87+
"last 1 safari version"
88+
]
89+
},
90+
"dependencies": {}
91+
}

src/.eslintrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"env": {
3+
"jest": true
4+
}
5+
}
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from 'react';
2+
import Button from './';
3+
4+
export default {
5+
title: 'Button',
6+
component: Button
7+
};
8+
9+
export const DefaultButton = () => <Button>Default Button</Button>;
10+
11+
export const Text = () => <Button>Default Button</Button>;
12+
13+
export const Emoji = () => <Button text='😀 😎 👍 💯' />;

src/components/Button/index.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react';
2+
3+
interface Props {
4+
text?: String;
5+
children?: String;
6+
}
7+
8+
export default function Button({ text, children }: Props) {
9+
return <button>{text || children}</button>;
10+
}

src/index.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Button from './components/Button';
2+
3+
export { default as Button } from './components/Button';
4+
5+
const Vant = {
6+
Button
7+
};
8+
9+
export default Vant;

src/styles.module.css

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* add css module styles here (optional) */
2+
3+
.test {
4+
margin: 2em;
5+
padding: 0.5em;
6+
border: 2px solid #000;
7+
font-size: 2em;
8+
text-align: center;
9+
}

src/typings.d.ts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Default CSS definition for typescript,
3+
* will be overridden with file-specific definitions by rollup
4+
*/
5+
declare module '*.css' {
6+
const content: { [className: string]: string };
7+
export default content;
8+
}
9+
10+
interface SvgrComponent extends React.StatelessComponent<React.SVGAttributes<SVGElement>> {}
11+
12+
declare module '*.svg' {
13+
const svgUrl: string;
14+
const svgComponent: SvgrComponent;
15+
export default svgUrl;
16+
export { svgComponent as ReactComponent }
17+
}

tsconfig.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"compilerOptions": {
3+
"outDir": "dist",
4+
"module": "esnext",
5+
"lib": ["dom", "esnext"],
6+
"moduleResolution": "node",
7+
"jsx": "react",
8+
"sourceMap": true,
9+
"declaration": true,
10+
"esModuleInterop": true,
11+
"noImplicitReturns": true,
12+
"noImplicitThis": true,
13+
"noImplicitAny": true,
14+
"strictNullChecks": true,
15+
"suppressImplicitAnyIndexErrors": true,
16+
"noUnusedLocals": true,
17+
"noUnusedParameters": true,
18+
"allowSyntheticDefaultImports": true
19+
},
20+
"include": ["src"],
21+
"exclude": ["node_modules", "dist", "example"]
22+
}

tsconfig.test.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"module": "commonjs"
5+
}
6+
}

0 commit comments

Comments
 (0)