pack-to-ui-pro 0.0.1 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/vite-project/src/App.d.ts +3 -0
- package/dist/vite-project/src/main.d.ts +1 -0
- package/dist/vite-project/vite.config.d.ts +2 -0
- package/package.json +1 -1
- package/rollup.config.js +1 -1
- package/src/components/Button.tsx +2 -2
- package/vite-project/README.md +54 -0
- package/vite-project/eslint.config.js +28 -0
- package/vite-project/index.html +13 -0
- package/vite-project/package-lock.json +3629 -0
- package/vite-project/package.json +30 -0
- package/vite-project/public/vite.svg +1 -0
- package/vite-project/src/App.css +42 -0
- package/vite-project/src/App.tsx +16 -0
- package/vite-project/src/assets/react.svg +1 -0
- package/vite-project/src/index.css +68 -0
- package/vite-project/src/main.tsx +10 -0
- package/vite-project/src/vite-env.d.ts +1 -0
- package/vite-project/tsconfig.app.json +27 -0
- package/vite-project/tsconfig.json +7 -0
- package/vite-project/tsconfig.node.json +25 -0
- package/vite-project/vite.config.ts +7 -0
- /package/dist/{components → src/components}/Button.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/counter.d.ts +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
package/dist/index.js
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
import './index.css';
|
package/package.json
CHANGED
package/rollup.config.js
CHANGED
@@ -14,7 +14,7 @@ const Button = ({ children, onClick }: PropsType) => {
|
|
14
14
|
fontSize: "1.2em",
|
15
15
|
borderRadius: "5px",
|
16
16
|
cursor: "pointer",
|
17
|
-
backgroundColor: "
|
17
|
+
backgroundColor: "red",
|
18
18
|
color: "white",
|
19
19
|
border: "none",
|
20
20
|
}}
|
@@ -24,4 +24,4 @@ const Button = ({ children, onClick }: PropsType) => {
|
|
24
24
|
);
|
25
25
|
};
|
26
26
|
|
27
|
-
export { Button };
|
27
|
+
export { Button };
|
@@ -0,0 +1,54 @@
|
|
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) uses [Babel](https://babeljs.io/) for Fast Refresh
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/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
|
+
```js
|
15
|
+
export default tseslint.config({
|
16
|
+
extends: [
|
17
|
+
// Remove ...tseslint.configs.recommended and replace with this
|
18
|
+
...tseslint.configs.recommendedTypeChecked,
|
19
|
+
// Alternatively, use this for stricter rules
|
20
|
+
...tseslint.configs.strictTypeChecked,
|
21
|
+
// Optionally, add this for stylistic rules
|
22
|
+
...tseslint.configs.stylisticTypeChecked,
|
23
|
+
],
|
24
|
+
languageOptions: {
|
25
|
+
// other options...
|
26
|
+
parserOptions: {
|
27
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
28
|
+
tsconfigRootDir: import.meta.dirname,
|
29
|
+
},
|
30
|
+
},
|
31
|
+
})
|
32
|
+
```
|
33
|
+
|
34
|
+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
35
|
+
|
36
|
+
```js
|
37
|
+
// eslint.config.js
|
38
|
+
import reactX from 'eslint-plugin-react-x'
|
39
|
+
import reactDom from 'eslint-plugin-react-dom'
|
40
|
+
|
41
|
+
export default tseslint.config({
|
42
|
+
plugins: {
|
43
|
+
// Add the react-x and react-dom plugins
|
44
|
+
'react-x': reactX,
|
45
|
+
'react-dom': reactDom,
|
46
|
+
},
|
47
|
+
rules: {
|
48
|
+
// other rules...
|
49
|
+
// Enable its recommended typescript rules
|
50
|
+
...reactX.configs['recommended-typescript'].rules,
|
51
|
+
...reactDom.configs.recommended.rules,
|
52
|
+
},
|
53
|
+
})
|
54
|
+
```
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import js from '@eslint/js'
|
2
|
+
import globals from 'globals'
|
3
|
+
import reactHooks from 'eslint-plugin-react-hooks'
|
4
|
+
import reactRefresh from 'eslint-plugin-react-refresh'
|
5
|
+
import tseslint from 'typescript-eslint'
|
6
|
+
|
7
|
+
export default tseslint.config(
|
8
|
+
{ ignores: ['dist'] },
|
9
|
+
{
|
10
|
+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
11
|
+
files: ['**/*.{ts,tsx}'],
|
12
|
+
languageOptions: {
|
13
|
+
ecmaVersion: 2020,
|
14
|
+
globals: globals.browser,
|
15
|
+
},
|
16
|
+
plugins: {
|
17
|
+
'react-hooks': reactHooks,
|
18
|
+
'react-refresh': reactRefresh,
|
19
|
+
},
|
20
|
+
rules: {
|
21
|
+
...reactHooks.configs.recommended.rules,
|
22
|
+
'react-refresh/only-export-components': [
|
23
|
+
'warn',
|
24
|
+
{ allowConstantExport: true },
|
25
|
+
],
|
26
|
+
},
|
27
|
+
},
|
28
|
+
)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8" />
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
7
|
+
<title>Vite + React + TS</title>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<div id="root"></div>
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
12
|
+
</body>
|
13
|
+
</html>
|