finance-shared 0.0.1
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/README.md +104 -0
- package/dist/finance-shared-library.es.js +44051 -0
- package/dist/finance-shared-library.es.js.map +1 -0
- package/dist/finance-shared-library.umd.js +155 -0
- package/dist/finance-shared-library.umd.js.map +1 -0
- package/dist/finance-shared.css +1 -0
- package/dist/vite.svg +1 -0
- package/package.json +85 -0
package/README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
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
|
+
## How to Update and Use This Library in Another Project
|
|
11
|
+
|
|
12
|
+
### When Making Changes to This Library:
|
|
13
|
+
|
|
14
|
+
1. **Make your changes** to the library code
|
|
15
|
+
|
|
16
|
+
2. **Build the library**
|
|
17
|
+
```bash
|
|
18
|
+
npm run build
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
3. **Update version in package.json**
|
|
22
|
+
```bash
|
|
23
|
+
# Edit package.json and increment version (e.g., from 0.0.44 to 0.0.45)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
4. **Pack the library**
|
|
27
|
+
```bash
|
|
28
|
+
npm pack
|
|
29
|
+
```
|
|
30
|
+
This creates a `.tgz` file like `finance-shared-library-v0.0.45.tgz`
|
|
31
|
+
|
|
32
|
+
5. **Copy the full path** of the generated `.tgz` file
|
|
33
|
+
|
|
34
|
+
### In Your Main Project:
|
|
35
|
+
|
|
36
|
+
1. **Remove the old version**
|
|
37
|
+
```bash
|
|
38
|
+
npm uninstall finance-shared-library
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
2. **Install the new version using the copied path**
|
|
42
|
+
```bash
|
|
43
|
+
npm install /full/path/to/finance-shared-library-v0.0.45.tgz
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Example Complete Workflow:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# In library project
|
|
50
|
+
npm run build
|
|
51
|
+
# Edit package.json: change version from "0.0.44" to "0.0.45"
|
|
52
|
+
npm pack
|
|
53
|
+
# Copy path: /Users/username/finance-library/common-library/finance-shared-library-v0.0.45.tgz
|
|
54
|
+
|
|
55
|
+
# In main project
|
|
56
|
+
npm uninstall finance-shared-library
|
|
57
|
+
npm install /Users/username/finance-library/common-library/finance-shared-library-v0.0.45.tgz
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Expanding the ESLint configuration
|
|
61
|
+
|
|
62
|
+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
63
|
+
|
|
64
|
+
```js
|
|
65
|
+
export default tseslint.config({
|
|
66
|
+
extends: [
|
|
67
|
+
// Remove ...tseslint.configs.recommended and replace with this
|
|
68
|
+
...tseslint.configs.recommendedTypeChecked,
|
|
69
|
+
// Alternatively, use this for stricter rules
|
|
70
|
+
...tseslint.configs.strictTypeChecked,
|
|
71
|
+
// Optionally, add this for stylistic rules
|
|
72
|
+
...tseslint.configs.stylisticTypeChecked,
|
|
73
|
+
],
|
|
74
|
+
languageOptions: {
|
|
75
|
+
// other options...
|
|
76
|
+
parserOptions: {
|
|
77
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
78
|
+
tsconfigRootDir: import.meta.dirname,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
})
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
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:
|
|
85
|
+
|
|
86
|
+
```js
|
|
87
|
+
// eslint.config.js
|
|
88
|
+
import reactX from 'eslint-plugin-react-x'
|
|
89
|
+
import reactDom from 'eslint-plugin-react-dom'
|
|
90
|
+
|
|
91
|
+
export default tseslint.config({
|
|
92
|
+
plugins: {
|
|
93
|
+
// Add the react-x and react-dom plugins
|
|
94
|
+
'react-x': reactX,
|
|
95
|
+
'react-dom': reactDom,
|
|
96
|
+
},
|
|
97
|
+
rules: {
|
|
98
|
+
// other rules...
|
|
99
|
+
// Enable its recommended typescript rules
|
|
100
|
+
...reactX.configs['recommended-typescript'].rules,
|
|
101
|
+
...reactDom.configs.recommended.rules,
|
|
102
|
+
},
|
|
103
|
+
})
|
|
104
|
+
```
|