Skip to content

Commit f333052

Browse files
committed
Refactor
1 parent a679dcb commit f333052

28 files changed

+38
-14600
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ yarn-error.log*
2121

2222
package-lock.json
2323

24-
/supports/javascript/node_modules
25-
/supports/javascript/package-lock.json
2624
/supports/create-react-app/node_modules
2725
/supports/create-react-app/package-lock.json
26+
2827
/supports/create-next-app/node_modules
28+
/supports/create-next-app/.next
2929
/supports/create-next-app/package-lock.json

CHANGELOG.md

-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +0,0 @@
1-
## 0.1.0 (2021-08-15)
2-
3-
### ✨ Features
4-
5-
* Add useExcelDownloader
6-
7-
Credits
8-
9-
* [Bunlong](https://github.com/Bunlong)

LICENSE

+2-9
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@ Copyright (c) 2021 Bunlong
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

7-
The above copyright notice and this permission notice shall be included in
8-
all copies or substantial portions of the Software.
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
98

10-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
14-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
15-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
16-
THE SOFTWARE.
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

jest.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
},
66
globals: {
77
'ts-jest': {
8-
tsconfig: 'tsconfig.jest.json',
8+
tsConfig: 'tsconfig.jest.json',
99
},
1010
},
1111
testMatch: ['**/?(*.)+(spec|test).ts?(x)'],

package.json

+18-32
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,7 @@
1111
"bugs": {
1212
"url": "https://github.com/Bunlong/react-xls.git/issues"
1313
},
14-
"keywords": [
15-
"react",
16-
"react-xls",
17-
"excel",
18-
"xls",
19-
"xlsx",
20-
"xlsb",
21-
"xlsm",
22-
"spreadsheet",
23-
"react-excel-downloader",
24-
"excel-downloader"
25-
],
14+
"keywords": [],
2615
"homepage": "https://github.com/Bunlong/react-xls",
2716
"main": "dist/react-xls.js",
2817
"module": "dist/react-xls.es.js",
@@ -34,13 +23,12 @@
3423
"npm": ">=5"
3524
},
3625
"scripts": {
26+
"@test": "jest --runInBand",
3727
"build": "rollup -c",
38-
"@comment prettier": "prettier --write './src/*.ts' './src/*.tsx' --config ./.prettierrc",
39-
"prettier": "prettier --write './src/*.ts' './src/*.tsx' --config ./.prettierrc",
28+
"prettier": "prettier --write './src/*.ts' './src/*.tsx' './demo/*js' --config ./.prettierrc",
4029
"lint:check": "eslint ./src --ext .tsx,.ts --report-unused-disable-directives",
4130
"bundlesize": "npm run build && bundlesize",
4231
"dev": "rollup -c -w",
43-
"@test": "jest --runInBand",
4432
"prepare": "npm run build",
4533
"predeploy": "cd docs && npm install && npm run build",
4634
"deploy": "gh-pages -d docs/build"
@@ -52,48 +40,46 @@
5240
"@rollup/plugin-babel": "^5.3.0",
5341
"@rollup/plugin-commonjs": "^20.0.0",
5442
"@rollup/plugin-node-resolve": "^13.0.4",
55-
"@types/react": "^17.0.17",
43+
"@types/react": "^17.0.15",
5644
"@types/react-dom": "^17.0.9",
57-
"@typescript-eslint/eslint-plugin": "^4.29.1",
58-
"@typescript-eslint/parser": "^4.29.1",
45+
"@types/react-test-renderer": "^17.0.1",
46+
"@typescript-eslint/eslint-plugin": "^4.29.0",
47+
"@typescript-eslint/parser": "^4.29.0",
5948
"bundlesize": "^0.18.1",
6049
"eslint": "^7.32.0",
6150
"eslint-plugin-react": "^7.24.0",
6251
"eslint-plugin-react-hooks": "^4.2.0",
63-
"jest": "^27.0.6",
52+
"jest": "^27.0.4",
6453
"mutationobserver-shim": "^0.3.7",
6554
"prettier": "^2.3.2",
6655
"react": "^17.0.2",
6756
"react-dom": "^17.0.2",
68-
"rollup": "^2.56.2",
69-
"rollup-plugin-peer-deps-external": "^2.2.4",
57+
"react-scripts": "^4.0.3",
58+
"react-test-renderer": "^17.0.2",
59+
"rollup": "^2.56.0",
7060
"rollup-plugin-terser": "^7.0.2",
7161
"rollup-plugin-typescript2": "^0.30.0",
7262
"ts-jest": "^27.0.4",
73-
"tslib": "^2.3.1",
74-
"typescript": "^4.3.5"
63+
"tslib": "^2.3.0",
64+
"typescript": "^4.3.5",
65+
"xlsx": "^0.17.1"
7566
},
7667
"files": [
7768
"dist"
7869
],
7970
"bundlesize": [
8071
{
8172
"path": "./dist/*.js",
82-
"maxSize": "500 kB"
73+
"maxSize": "21 kB"
8374
},
8475
{
8576
"path": "./dist/*.ts",
86-
"maxSize": "500 kB"
77+
"maxSize": "750 B"
8778
}
8879
],
8980
"peerDependencies": {
9081
"react": "^17.0.2",
91-
"react-dom": "^17.0.2"
92-
},
93-
"browser": {
94-
"fs": false
95-
},
96-
"dependencies": {
97-
"xlsx": "^0.17.0"
82+
"react-dom": "^17.0.2",
83+
"react-scripts": "^4.0.3"
9884
}
9985
}

rollup.config.js

+7-16
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ import typescript from 'rollup-plugin-typescript2';
22
import babel from '@rollup/plugin-babel';
33
import commonjs from '@rollup/plugin-commonjs';
44
import resolve from '@rollup/plugin-node-resolve';
5-
import { terser } from "rollup-plugin-terser";
6-
import pkg from './package.json';
7-
8-
// import external from 'rollup-plugin-peer-deps-external';
95
// import builtins from 'builtin-modules'
6+
import { terser } from 'rollup-plugin-terser';
7+
import pkg from './package.json';
108

119
export default {
1210
input: 'src/react-xls.ts',
@@ -23,16 +21,9 @@ export default {
2321
},
2422
],
2523
// external: builtins,
26-
external: [
27-
'react',
28-
'react-dom',
29-
'fs',
30-
'util',
31-
'stream',
32-
'buffer',
33-
'zlib',
34-
'assert'
35-
],
24+
// To use hook in development
25+
// https://reactjs.org/warnings/invalid-hook-call-warning.html
26+
external: ['react', 'react-dom'],
3627
plugins: [
3728
typescript({
3829
tsconfig: './tsconfig.json',
@@ -42,11 +33,11 @@ export default {
4233
exclude: 'node_modules/**',
4334
}),
4435
resolve({
45-
preferBuiltins: true
36+
preferBuiltins: true,
4637
}),
4738
commonjs({
4839
extensions: ['.js', '.ts', '.tsx'],
4940
}),
50-
terser()
41+
terser(),
5142
],
5243
};

supports/create-next-app/.gitignore

-34
This file was deleted.

supports/create-next-app/README.md

-34
This file was deleted.

supports/create-next-app/next-env.d.ts

-6
This file was deleted.

supports/create-next-app/package.json

-20
This file was deleted.

supports/create-next-app/pages/_app.tsx

-7
This file was deleted.

supports/create-next-app/pages/api/hello.ts

-10
This file was deleted.

supports/create-next-app/pages/index.tsx

-35
This file was deleted.
-14.7 KB
Binary file not shown.

supports/create-next-app/public/vercel.svg

-4
This file was deleted.

0 commit comments

Comments
 (0)