Skip to content

Commit a59bdf1

Browse files
committed
chore: update
1 parent 999f6d3 commit a59bdf1

21 files changed

+10600
-82
lines changed

.babelrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"presets": [["env", { "modules": false }], "react", "stage-2"],
3+
"env": {
4+
"test": {
5+
"presets": ["env", "stage-2"]
6+
}
7+
}
8+
}

.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+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.gitignore

+12-60
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,13 @@
1-
# Logs
2-
logs
1+
/node_modules
2+
coverage/
33
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
8-
# Runtime data
9-
pids
10-
*.pid
11-
*.seed
12-
*.pid.lock
13-
14-
# Directory for instrumented libs generated by jscoverage/JSCover
15-
lib-cov
16-
17-
# Coverage directory used by tools like istanbul
18-
coverage
19-
20-
# nyc test coverage
21-
.nyc_output
22-
23-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24-
.grunt
25-
26-
# Bower dependency directory (https://bower.io/)
27-
bower_components
28-
29-
# node-waf configuration
30-
.lock-wscript
31-
32-
# Compiled binary addons (https://nodejs.org/api/addons.html)
33-
build/Release
34-
35-
# Dependency directories
36-
node_modules/
37-
jspm_packages/
38-
39-
# TypeScript v1 declaration files
40-
typings/
41-
42-
# Optional npm cache directory
43-
.npm
44-
45-
# Optional eslint cache
46-
.eslintcache
47-
48-
# Optional REPL history
49-
.node_repl_history
50-
51-
# Output of 'npm pack'
52-
*.tgz
53-
54-
# Yarn Integrity file
55-
.yarn-integrity
56-
57-
# dotenv environment variables file
58-
.env
59-
60-
# next.js build output
61-
.next
4+
npm-debug.log
5+
.logs/
6+
logs/
7+
run/
8+
.idea/
9+
.DS_Store
10+
.tmp/
11+
.vscode/
12+
/public/assets/
13+
/dist

.npmignore

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.git
2+
CVS
3+
.svn
4+
.hg
5+
.lock-wscript
6+
.wafpickle-N
7+
.*.swp
8+
.DS_Store
9+
._*
10+
npm-debug.log
11+
.npmrc
12+
node_modules
13+
config.gypi
14+
*.orig
15+
example
16+
public
17+
config
18+
yarn.lock
19+
package-lock.json
20+
src
21+
tools

.prettierrc

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"singleQuote": true,
3+
"indent": 2,
4+
"trailingComma": "all",
5+
"printWidth": 100,
6+
"overrides": [
7+
{
8+
"files": ".prettierrc",
9+
"options": {
10+
"parser": "json"
11+
}
12+
}
13+
]
14+
}

.tslintignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build/*.js
2+
dist/*.js
3+
temp/*.js
4+
examples/*.js
5+
rollup.config.*.js

CHANGELOG.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4+
5+
<a name="0.2.0"></a>
6+
# [0.2.0]() (2018-03-12)
7+
8+
9+
### Features
10+
11+
* 项目初始化
12+
* 提供 logo 和 title
13+
14+
15+
<a name="0.1.0"></a>
16+
# [0.2.1]() (2018-03-13)
17+
18+
19+
### Features
20+
21+
* 本地开发打包优化

LICENSE

-21
This file was deleted.

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
# react-css-tooltip
1+
## react-cc-tooltip
2+

__test__/index.test.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import YourLibraryName from '..';
2+
3+
describe('Group One', () => {
4+
test('case-1', () => {
5+
expect(YourLibraryName.foo(1)).toBe(3.14);
6+
});
7+
});

example/index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
8+
<title>Example</title>
9+
</head>
10+
<body>
11+
<div id="app"></div>
12+
</body>
13+
</html>

example/index.tsx

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from 'react';
2+
import ReactDom from 'react-dom';
3+
import AReactComponent from '../src';
4+
5+
class App extends React.Component<any> {
6+
public render() {
7+
return (
8+
<div>
9+
<AReactComponent hello="hello" />
10+
</div>
11+
);
12+
}
13+
}
14+
15+
ReactDom.render(<App />, document.getElementById('app'));

package.json

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"name": "react-css-tooltip",
3+
"version": "0.0.1",
4+
"main": "dist/index.cjs.js",
5+
"module": "dist/index.esm.js",
6+
"unpkg": "dist/index.min.js",
7+
"keywords": [
8+
"rollup",
9+
"babel",
10+
"starter"
11+
],
12+
"scripts": {
13+
"clean": "rimraf dist",
14+
"start": "webpack-dev-server --hot --inline --config scripts/webpack.dev.js",
15+
"build": "yarn run clean && cross-env NODE_ENV=production rollup -c scripts/rollup.config.prod.js",
16+
"test": "jest",
17+
"release": "standard-version",
18+
"mypublish": "npm run build && npm publish"
19+
},
20+
"husky": {
21+
"hooks": {
22+
"pre-commit": "lint-staged"
23+
}
24+
},
25+
"lint-staged": {
26+
"*.tsx": [
27+
"prettier --write",
28+
"tslint --fix",
29+
"git add"
30+
]
31+
},
32+
"author": "sunyongjian",
33+
"peerDependencies": {
34+
"@types/react": "^16.8.13",
35+
"@types/react-dom": "^16.8.3",
36+
"prop-types": "^15.5.4",
37+
"react": "^15.0.0 || ^16.0.0",
38+
"react-dom": "^15.0.0 || ^16.0.0"
39+
},
40+
"devDependencies": {
41+
"@types/react": "^16.8.13",
42+
"@types/react-dom": "^16.8.3",
43+
"awesome-typescript-loader": "^5.2.1",
44+
"babel-core": "^6.26.0",
45+
"babel-loader": "^7.0.0",
46+
"babel-plugin-react": "^1.0.0",
47+
"babel-preset-env": "^1.6.1",
48+
"babel-preset-react": "6.24.1",
49+
"babel-preset-stage-2": "^6.24.1",
50+
"commitizen": "^2.9.6",
51+
"cross-env": "^5.1.3",
52+
"css-loader": "^2.1.1",
53+
"html-webpack-plugin": "^3.2.0",
54+
"husky": "^0.15.0-beta.16",
55+
"jest": "^22.0.4",
56+
"less": "^3.9.0",
57+
"less-loader": "^4.1.0",
58+
"lint-staged": "^8.1.5",
59+
"open-browser-webpack-plugin": "^0.0.5",
60+
"prettier": "^1.17.0",
61+
"react": "^16.3.2",
62+
"react-dom": "^16.3.2",
63+
"rimraf": "^2.6.2",
64+
"rollup": "^1.1.0",
65+
"rollup-plugin-alias": "^1.4.0",
66+
"rollup-plugin-babel": "^3.0.7",
67+
"rollup-plugin-commonjs": "^9.2.0",
68+
"rollup-plugin-filesize": "^2.0.0",
69+
"rollup-plugin-node-resolve": "^3.3.0",
70+
"rollup-plugin-peer-deps-external": "^2.2.0",
71+
"rollup-plugin-postcss": "^1.6.2",
72+
"rollup-plugin-replace": "^2.0.0",
73+
"rollup-plugin-serve": "^0.4.2",
74+
"rollup-plugin-typescript": "^1.0.1",
75+
"serve": "^10.0.2",
76+
"source-map-loader": "^0.2.4",
77+
"standard-version": "^4.3.0",
78+
"style-loader": "^0.23.1",
79+
"tslib": "^1.9.3",
80+
"tslint": "^5.15.0",
81+
"tslint-config-prettier": "^1.17.0",
82+
"tslint-eslint-rules": "^5.4.0",
83+
"tslint-loader": "^3.5.4",
84+
"tslint-react": "^3.6.0",
85+
"typescript": "^3.4.3",
86+
"webpack": "^4.29.6",
87+
"webpack-cli": "^3.2.3",
88+
"webpack-dev-server": "^3.2.1"
89+
}
90+
}

scripts/rollup.config.base.js

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import alias from 'rollup-plugin-alias';
2+
// import eslint from 'rollup-plugin-eslint';
3+
import resolve from 'rollup-plugin-node-resolve';
4+
import commonjs from 'rollup-plugin-commonjs';
5+
import babel from 'rollup-plugin-babel';
6+
import replace from 'rollup-plugin-replace';
7+
import postcss from 'rollup-plugin-postcss';
8+
import typescript from 'rollup-plugin-typescript';
9+
10+
const isProd = process.env.NODE_ENV === 'production';
11+
12+
export default {
13+
input: 'src/index.tsx',
14+
plugins: [
15+
alias({
16+
resolve: ['.tsx']
17+
}),
18+
postcss({
19+
extract: isProd,
20+
extensions: ['less', 'css'],
21+
use: [
22+
['less', {
23+
javascriptEnabled: true
24+
}]
25+
],
26+
}),
27+
replace({
28+
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development')
29+
}),
30+
// eslint({
31+
// include: ['src/**/*.js']
32+
// }),
33+
typescript(),
34+
babel({
35+
exclude: 'node_modules/**', // only transpile our source code
36+
}),
37+
resolve(),
38+
commonjs({
39+
include: /node_modules/,
40+
}),
41+
]
42+
}

0 commit comments

Comments
 (0)