Skip to content

Commit 7876056

Browse files
committed
chore: prepare repository
0 parents  commit 7876056

37 files changed

+9279
-0
lines changed

.eslintrc.cjs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
es2020: true
6+
},
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: {
22+
react: {
23+
version: 'detect'
24+
},
25+
},
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+
};

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Caches & Artifacts
2+
dist/
3+
node_modules/
4+
storybook-static/
5+
6+
# Logs
7+
logs
8+
*.log
9+
npm-debug.log*
10+
pnpm-debug.log*

.storybook/main.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type { StorybookConfig } from "@storybook/react-vite";
2+
3+
const config: StorybookConfig = {
4+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
5+
addons: [
6+
"@storybook/addon-links",
7+
"@storybook/addon-essentials",
8+
"@storybook/addon-onboarding",
9+
"@storybook/addon-interactions",
10+
],
11+
framework: {
12+
name: "@storybook/react-vite",
13+
options: {},
14+
},
15+
docs: {
16+
autodocs: "tag",
17+
},
18+
};
19+
export default config;

.storybook/preview.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { Preview } from "@storybook/react";
2+
3+
const preview: Preview = {
4+
parameters: {
5+
actions: { argTypesRegex: "^on[A-Z].*" },
6+
controls: {
7+
matchers: {
8+
color: /(background|color)$/i,
9+
date: /Date$/,
10+
},
11+
},
12+
},
13+
};
14+
15+
export default preview;

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# React + TypeScript + Vite
2+
3+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4+
5+
Currently, two official plugins are available:
6+
7+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9+
10+
## Expanding the ESLint configuration
11+
12+
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
13+
14+
- Configure the top-level `parserOptions` property like this:
15+
16+
```js
17+
parserOptions: {
18+
ecmaVersion: 'latest',
19+
sourceType: 'module',
20+
project: ['./tsconfig.json', './tsconfig.node.json'],
21+
tsconfigRootDir: __dirname,
22+
},
23+
```
24+
25+
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
26+
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
27+
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list

package.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"name": "beautiful-tree",
3+
"private": false,
4+
"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",
11+
"exports": {
12+
".": {
13+
"import": "./dist/beautiful-tree.js",
14+
"require": "./dist/beautiful-tree.umd.cjs",
15+
"types": "./dist/beautiful-tree.d.ts"
16+
}
17+
},
18+
"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"
29+
},
30+
"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",
41+
"@types/react-dom": "^18.2.7",
42+
"@typescript-eslint/eslint-plugin": "^6.2.0",
43+
"@typescript-eslint/parser": "^6.2.0",
44+
"@vitejs/plugin-react": "^4.0.3",
45+
"eslint": "^8.45.0",
46+
"eslint-plugin-react": "^7.33.0",
47+
"eslint-plugin-react-hooks": "^4.6.0",
48+
"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"
54+
}
55+
}

0 commit comments

Comments
 (0)