Skip to content

Commit 2cea4e4

Browse files
authored
change to rollup (#37)
1 parent f723cf3 commit 2cea4e4

7 files changed

Lines changed: 4094 additions & 4187 deletions

File tree

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.eslintrc.cjs
2+
rollup.config.mjs

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- Changed from `microbundle` to `rollup` for building the package
13+
- Updated all the dependencies to the latest possible version
14+
1015
### Fixed
1116

1217
- Display predefined filter in filter row

package.json

Lines changed: 45 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,54 @@
99
},
1010
"license": "MIT",
1111
"author": "Neolution",
12+
"sideEffects": false,
13+
"exports": {
14+
"./package.json": "./package.json",
15+
".": {
16+
"types": "./dist/index.d.ts",
17+
"import": "./dist/index.modern.js",
18+
"require": "./dist/index.cjs"
19+
}
20+
},
1221
"main": "dist/index.js",
22+
"umd:main": "dist/index.umd.js",
23+
"jsdelivr": "dist/index.umd.js",
24+
"unpkg": "dist/index.umd.js",
1325
"module": "dist/index.modern.js",
1426
"source": "src/index.ts",
27+
"jsnext:main": "dist/index.modern.js",
28+
"types": "dist/index.d.ts",
1529
"files": [
1630
"dist"
1731
],
1832
"scripts": {
19-
"build": "shx rm -rf dist && microbundle --jsx React.createElement --jsxFragment React.Fragment --jsxImportSource react --globals react/jsx-runtime=jsx --no-compress --tsconfig ./tsconfig.microbundle.json",
20-
"build-storybook": "cross-env NODE_OPTIONS=--openssl-legacy-provider build-storybook",
33+
"build": "rollup -c",
34+
"build-storybook": "build-storybook",
2135
"lint": "eslint \"**/*.{ts,tsx}\" --cache --max-warnings 0",
2236
"prepack": "yarn build",
2337
"prepare-pr": "yarn prettier . --write && yarn lint && yarn build && yarn test\"",
2438
"prettier-check": "prettier --check .",
2539
"prettier-write": "prettier --write .",
26-
"start": "microbundle watch --jsx React.createElement --jsxFragment React.Fragment --jsxImportSource react --globals react/jsx-runtime=jsx --no-compress --tsconfig ./tsconfig.microbundle.json",
40+
"start": "rollup -c -w",
2741
"start-all": "concurrently \"yarn start\" \"yarn start-yalc\"",
2842
"start-yalc": "yarn nodemon --watch dist -x \"yarn yalc push\"",
2943
"storybook": "start-storybook -p 6006",
3044
"test": "cross-env DEBUG_PRINT_LIMIT=100 jest",
3145
"tsc": "tsc"
3246
},
33-
"dependencies": {},
47+
"dependencies": {
48+
"rollup-plugin-import-css": "^3.2.1"
49+
},
3450
"devDependencies": {
35-
"@babel/core": "^7.17.9",
51+
"@babel/core": "^7.21.8",
3652
"@fortawesome/fontawesome-svg-core": "^6.1.1",
3753
"@fortawesome/free-solid-svg-icons": "^6.1.1",
3854
"@fortawesome/react-fontawesome": "^0.1.18",
3955
"@neolution-ch/react-pattern-ui": "^2.0.1",
4056
"@release-it/keep-a-changelog": "^3.1.0",
57+
"@rollup/plugin-commonjs": "^24.1.0",
58+
"@rollup/plugin-node-resolve": "^15.0.2",
59+
"@rollup/plugin-terser": "^0.4.1",
4160
"@storybook/addon-actions": "^6.4.22",
4261
"@storybook/addon-essentials": "^6.4.22",
4362
"@storybook/addon-interactions": "^6.4.22",
@@ -49,33 +68,35 @@
4968
"@testing-library/react": "^12.1.2",
5069
"@testing-library/user-event": "^14.0.4",
5170
"@types/jest": "^27.4.1",
52-
"@types/node": "^17.0.23",
53-
"@types/react": "^17.0.43",
54-
"@types/react-dom": "^17.0.14",
71+
"@types/node": "^18.16.3",
72+
"@types/react": "^18.2.5",
73+
"@types/react-dom": "^18.2.3",
5574
"@types/reactstrap": "^8.7.2",
56-
"@typescript-eslint/eslint-plugin": "^5.18.0",
57-
"@typescript-eslint/parser": "^5.18.0",
58-
"babel-loader": "^8.2.4",
75+
"@typescript-eslint/eslint-plugin": "^5.59.2",
76+
"@typescript-eslint/parser": "^5.59.2",
5977
"bootstrap": "^4.0.0",
60-
"concurrently": "^7.6.0",
78+
"concurrently": "^8.0.1",
6179
"cross-env": "^7.0.3",
62-
"eslint": "^8.12.0",
63-
"eslint-config-prettier": "^8.5.0",
64-
"eslint-import-resolver-typescript": "^2.7.1",
65-
"eslint-plugin-import": "^2.26.0",
66-
"eslint-plugin-storybook": "^0.5.8",
67-
"gh-pages": "^3.2.3",
80+
"eslint": "^8.39.0",
81+
"eslint-config-prettier": "^8.8.0",
82+
"eslint-import-resolver-typescript": "^3.5.5",
83+
"eslint-plugin-import": "^2.27.5",
84+
"eslint-plugin-storybook": "^0.6.12",
85+
"gh-pages": "^5.0.0",
6886
"jest": "^27.5.1",
69-
"microbundle": "^0.14.2",
70-
"nodemon": "^2.0.20",
71-
"prettier": "^2.6.2",
87+
"nodemon": "^2.0.22",
88+
"prettier": "^2.8.8",
7289
"react": "^17.0.2",
7390
"react-dom": "^17.0.2",
74-
"reactstrap": "^8.9.0",
75-
"release-it": "^15.7.0",
91+
"reactstrap": "^8.10.1",
92+
"release-it": "^15.10.3",
93+
"rollup": "^3.21.4",
94+
"rollup-plugin-peer-deps-external": "^2.2.4",
95+
"rollup-plugin-typescript2": "^0.34.1",
7696
"shx": "^0.3.4",
7797
"ts-jest": "^27.1.4",
78-
"typescript": "^4.6.3",
98+
"typescript": "^5.0.4",
99+
"webpack": "^5.82.0",
79100
"yalc": "^1.0.0-pre.53"
80101
},
81102
"peerDependencies": {

rollup.config.mjs

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import commonjs from "@rollup/plugin-commonjs";
2+
import nodeResolve from "@rollup/plugin-node-resolve";
3+
import external from "rollup-plugin-peer-deps-external";
4+
import terser from "@rollup/plugin-terser";
5+
import typescript from "rollup-plugin-typescript2";
6+
import css from "rollup-plugin-import-css";
7+
8+
const input = "src/index.ts";
9+
10+
const plugins = [
11+
css({
12+
output: "dist/index.css",
13+
}),
14+
external({
15+
includeDependencies: true,
16+
}),
17+
typescript({
18+
clean: true,
19+
exclude: ["**/__tests__", "**/*.test.ts", "**/stories/**/*"],
20+
}),
21+
commonjs({
22+
include: /\/node_modules\//,
23+
}),
24+
nodeResolve(),
25+
terser({
26+
output: { comments: false },
27+
compress: {
28+
drop_console: true,
29+
},
30+
}),
31+
];
32+
33+
export default [
34+
{
35+
input,
36+
output: {
37+
file: "dist/index.js",
38+
format: "cjs",
39+
name: "ReactDataTable",
40+
sourcemap: true,
41+
globals: { react: "React" },
42+
exports: "named",
43+
sourcemap: true,
44+
interop: "auto",
45+
},
46+
plugins,
47+
},
48+
{
49+
input,
50+
output: {
51+
file: "dist/index.modern.js",
52+
format: "esm",
53+
name: "ReactDataTable",
54+
sourcemap: true,
55+
globals: { react: "React" },
56+
exports: "named",
57+
sourcemap: true,
58+
},
59+
plugins,
60+
},
61+
{
62+
input,
63+
output: {
64+
file: "dist/index.umd.js",
65+
format: "umd",
66+
name: "ReactDataTable",
67+
sourcemap: true,
68+
globals: { react: "React" },
69+
exports: "named",
70+
sourcemap: true,
71+
},
72+
plugins,
73+
},
74+
];

tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"noImplicitThis": true,
1414
"noImplicitAny": true,
1515
"strictNullChecks": true,
16-
"suppressImplicitAnyIndexErrors": true,
1716
"noUnusedLocals": true,
1817
"noUnusedParameters": true,
1918
"allowSyntheticDefaultImports": true,

tsconfig.microbundle.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)