Skip to content

Commit fff1105

Browse files
committed
refactor: use rollup instead of vite
1 parent 8ee0525 commit fff1105

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+794
-7410
lines changed

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
7+
[*.{js,cjs,mjs,json,ts,cjs,mts,jsx,tsx}]
8+
charset = utf-8
9+
indent_style = tab
10+
indent_size = 2
11+
trim_trailing_whitespace = true

.eslintrc.cjs

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
11
module.exports = {
2-
root: true,
3-
env: {
4-
browser: true,
5-
es2020: true
2+
root: true,
3+
env: {
4+
browser: true,
5+
es2020: true,
6+
},
7+
parser: '@typescript-eslint/parser',
8+
parserOptions: {
9+
ecmaVersion: 2022,
10+
sourceType: 'module',
11+
tsConfigRootDir: __dirname,
12+
project: ['./tsconfig.json'],
613
},
7-
parserOptions: {
8-
ecmaVersion: 'latest',
9-
sourceType: 'module',
10-
project: ['./tsconfig.json', './tsconfig.node.json'],
11-
tsconfigRootDir: __dirname,
12-
},
13-
extends: [
14-
'eslint:recommended',
15-
`plugin:@typescript-eslint/strict-type-checked`,
16-
'plugin:react-hooks/recommended',
17-
'plugin:storybook/recommended',
18-
`plugin:react/recommended`,
19-
`plugin:react/jsx-runtime`
20-
],
21-
settings: {
14+
plugins: [
15+
'@typescript-eslint',
16+
'prettier',
17+
'react-refresh'
18+
],
19+
extends: [
20+
'eslint:recommended',
21+
'plugin:@typescript-eslint/strict-type-checked',
22+
'plugin:react/recommended',
23+
'plugin:react/jsx-runtime',
24+
'plugin:react-hooks/recommended',
25+
],
26+
settings: {
2227
react: {
2328
version: 'detect'
2429
},
2530
},
26-
ignorePatterns: ['dist', '.eslintrc.cjs'],
27-
parser: '@typescript-eslint/parser',
28-
plugins: ['react-refresh'],
29-
rules: {
30-
'react-refresh/only-export-components': ['warn', {
31-
allowConstantExport: true
32-
}]
33-
}
34-
};
31+
ignorePatterns: [
32+
'.eslintrc.cjs',
33+
'dist/**/*',
34+
'node_modules/**/*',
35+
]
36+
}

.gitignore

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Caches & Artifacts
22
dist/
33
node_modules/
4-
storybook-static/
54

6-
# Logs
7-
logs
8-
*.log
9-
npm-debug.log*
10-
pnpm-debug.log*
5+
# Lockfiles
6+
pnpm-lock.yaml

.prettierrc.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const config = {
2+
semi: false,
3+
singleQuote: true,
4+
parser: 'typescript',
5+
trailingComma: 'all',
6+
options: {
7+
editorconfig: true
8+
},
9+
}
10+
11+
export default config

.storybook/main.ts

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

.storybook/preview.ts

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

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Andres Correa Casablanca
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

package.json

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,54 @@
11
{
22
"name": "beautiful-tree",
3-
"private": false,
43
"version": "0.0.1",
5-
"type": "module",
6-
"files": [
7-
"dist"
8-
],
9-
"main": "./dist/beautiful-tree.umd.cjs",
10-
"module": "./dist/beautiful-tree.js",
4+
"author": "Andres Correa Casablanca <castarco@coderspirit.xyz>",
5+
"license": "MIT",
116
"exports": {
127
".": {
13-
"import": "./dist/beautiful-tree.js",
14-
"require": "./dist/beautiful-tree.umd.cjs",
15-
"types": "./dist/beautiful-tree.d.ts"
8+
"import": "./dist/beautiful-tree.mjs",
9+
"require": "./dist/beautiful-tree.cjs",
10+
"browser": "./dist/beautiful-tree.iife.js",
11+
"types": "./dist/beautiful-tree.d.ts",
12+
"default": "./dist/beautiful-tree.umd.js"
13+
},
14+
"./min": {
15+
"import": "./dist/beautiful-tree.min.mjs",
16+
"require": "./dist/beautiful-tree.min.cjs",
17+
"browser": "./dist/beautiful-tree.min.iife.js",
18+
"default": "./dist/beautiful-tree.min.umd.js"
1619
}
1720
},
1821
"scripts": {
19-
"dev": "vite",
20-
"build": "tsc && vite build",
21-
"lint": "eslint . --ext ts,mts,tsx --report-unused-disable-directives --max-warnings 0",
22-
"preview": "vite preview",
23-
"storybook": "storybook dev -p 6006",
24-
"build-storybook": "storybook build"
25-
},
26-
"dependencies": {
27-
"react": "^18.2.0",
28-
"react-dom": "^18.2.0"
22+
"lint": "tsc && eslint . --ext ts,mts,tsx --report-unused-disable-directives --max-warnings 0",
23+
"lint:eslint": "eslint . --ext ts,mts,tsx --report-unused-disable-directives --max-warnings 0",
24+
"lint:tsc": "tsc",
25+
"build": "rollup --config rollup.config.prod.mjs"
2926
},
3027
"devDependencies": {
31-
"@storybook/addon-essentials": "^7.1.1",
32-
"@storybook/addon-interactions": "^7.1.1",
33-
"@storybook/addon-links": "^7.1.1",
34-
"@storybook/addon-onboarding": "^1.0.8",
35-
"@storybook/blocks": "^7.1.1",
36-
"@storybook/react": "^7.1.1",
37-
"@storybook/react-vite": "^7.1.1",
38-
"@storybook/testing-library": "^0.2.0",
39-
"@types/node": "^20.4.4",
40-
"@types/react": "^18.2.16",
28+
"@rollup/plugin-commonjs": "^25.0.3",
29+
"@rollup/plugin-node-resolve": "^15.1.0",
30+
"@rollup/plugin-terser": "^0.4.3",
31+
"@rollup/plugin-typescript": "^11.1.2",
32+
"@types/node": "^20.4.5",
33+
"@types/react": "^18.2.17",
4134
"@types/react-dom": "^18.2.7",
4235
"@typescript-eslint/eslint-plugin": "^6.2.0",
4336
"@typescript-eslint/parser": "^6.2.0",
44-
"@vitejs/plugin-react": "^4.0.3",
4537
"eslint": "^8.45.0",
38+
"eslint-config-prettier": "^8.8.0",
39+
"eslint-plugin-prettier": "^5.0.0",
4640
"eslint-plugin-react": "^7.33.0",
4741
"eslint-plugin-react-hooks": "^4.6.0",
4842
"eslint-plugin-react-refresh": "^0.4.3",
49-
"eslint-plugin-storybook": "^0.6.13",
50-
"storybook": "^7.1.1",
51-
"typescript": "^5.1.6",
52-
"vite": "^4.4.7",
53-
"vite-plugin-dts": "^3.3.1"
43+
"prettier": "^3.0.0",
44+
"react": "^18.2.0",
45+
"react-dom": "^18.2.0",
46+
"rollup": "^3.26.3",
47+
"rollup-plugin-dts": "^5.3.0",
48+
"typescript": "^5.1.6"
49+
},
50+
"peerDependencies": {
51+
"react": "^18.2.0",
52+
"react-dom": "^18.2.0"
5453
}
5554
}

0 commit comments

Comments
 (0)