@caspeco/casper-ui-library 0.0.4 → 0.0.5
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 +65 -67
- package/package.json +62 -62
package/README.md
CHANGED
|
@@ -1,67 +1,65 @@
|
|
|
1
|
-
# @caspeco/casper-ui-library
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@caspeco/casper-ui-library)
|
|
4
|
-
|
|
5
|
-
Caspeco's UI component library, built on top of on top of [Chakra UI](https://v2.chakra-ui.com/).
|
|
6
|
-
|
|
7
|
-
👉 **The usage documentation can be found at (TODO_INSERT_LINK).**
|
|
8
|
-
|
|
9
|
-
## Local development
|
|
10
|
-
|
|
11
|
-
To build this project you need to have [Node.js](https://nodejs.org/en) installed.
|
|
12
|
-
|
|
13
|
-
### Commands
|
|
14
|
-
|
|
15
|
-
All commands are run from the root of the project, from a terminal.
|
|
16
|
-
|
|
17
|
-
<!-- prettier-ignore -->
|
|
18
|
-
| Command | Description |
|
|
19
|
-
| ------- | ----------- |
|
|
20
|
-
| `npm install` | Install dependencies. |
|
|
21
|
-
| `npm run dev` | Build a local development version of the entire library, compiled into a single .js file for improved HMR. Automatically rebuilds when the file contents change. |
|
|
22
|
-
| `npm run build` | Build the library as it will be shipped on npm. Does not automatically rebuild when files change, but you can still use this build output to verify your changes in the documentation website or in another project. |
|
|
23
|
-
| `cd ../docs && npm run dev` | Starts the documentation website. Usually you want to run this alongside the library in dev mode, so open a new terminal for this. See [/docs](../docs) for more info. |
|
|
24
|
-
| `npm run test` | Run tests. |
|
|
25
|
-
| `npm run lint` | Run linting with [@caspeco/eslint-config](https://github.com/Caspeco/eslint-config). If you use the recommended [ESLint VSCode extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) you can see your eslint errors directly in your editor without having to run this. |
|
|
26
|
-
| `npm run prettier:fix` | Reformat all files with [@caspeco/prettier-config](https://github.com/Caspeco/prettier-config). If you use the recommended [Prettier VSCode extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) you can have your files automatically formatted on file save. |
|
|
27
|
-
|
|
28
|
-
### Preview locally in another project
|
|
29
|
-
|
|
30
|
-
1. Build local development version (see above).
|
|
31
|
-
2. In the consuming app, run `npm install --no-save ./relative/path/to/this/directory` (no trailing slash).
|
|
32
|
-
- For example: `npm install --no-save ../../casper-ui-library/packages/casper-ui-library`
|
|
33
|
-
|
|
34
|
-
Now when you make a change in the component library, it should rebuild automatically and the consuming app's HMR should kick in and reload the page (preserving state is not possible as the entire library is rebuilt).
|
|
35
|
-
|
|
36
|
-
To unlink again you just need to run `npm install` in the consuming app. If it fails, you may need to delete `node_modules` first.
|
|
37
|
-
|
|
38
|
-
If you get an error about duplicate react versions, make sure this is in the `vite.config.ts` in the consuming app:
|
|
39
|
-
|
|
40
|
-
```ts
|
|
41
|
-
import path from "node:path";
|
|
42
|
-
|
|
43
|
-
export default defineConfig({
|
|
44
|
-
// ...
|
|
45
|
-
resolve: {
|
|
46
|
-
alias: {
|
|
47
|
-
react: path.resolve("./node_modules/react"),
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Contributing
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
When you have made our changes, open a pull request using the template provided when opened and assign a reviewer.
|
|
1
|
+
# @caspeco/casper-ui-library
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@caspeco/casper-ui-library)
|
|
4
|
+
|
|
5
|
+
Caspeco's UI component library, built on top of on top of [Chakra UI](https://v2.chakra-ui.com/).
|
|
6
|
+
|
|
7
|
+
👉 **The usage documentation can be found at (TODO_INSERT_LINK).**
|
|
8
|
+
|
|
9
|
+
## Local development
|
|
10
|
+
|
|
11
|
+
To build this project you need to have [Node.js](https://nodejs.org/en) installed.
|
|
12
|
+
|
|
13
|
+
### Commands
|
|
14
|
+
|
|
15
|
+
All commands are run from the root of the project, from a terminal.
|
|
16
|
+
|
|
17
|
+
<!-- prettier-ignore -->
|
|
18
|
+
| Command | Description |
|
|
19
|
+
| ------- | ----------- |
|
|
20
|
+
| `npm install` | Install dependencies. |
|
|
21
|
+
| `npm run dev` | Build a local development version of the entire library, compiled into a single .js file for improved HMR. Automatically rebuilds when the file contents change. |
|
|
22
|
+
| `npm run build` | Build the library as it will be shipped on npm. Does not automatically rebuild when files change, but you can still use this build output to verify your changes in the documentation website or in another project. |
|
|
23
|
+
| `cd ../docs && npm run dev` | Starts the documentation website. Usually you want to run this alongside the library in dev mode, so open a new terminal for this. See [/docs](../docs) for more info. |
|
|
24
|
+
| `npm run test` | Run tests. |
|
|
25
|
+
| `npm run lint` | Run linting with [@caspeco/eslint-config](https://github.com/Caspeco/eslint-config). If you use the recommended [ESLint VSCode extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) you can see your eslint errors directly in your editor without having to run this. |
|
|
26
|
+
| `npm run prettier:fix` | Reformat all files with [@caspeco/prettier-config](https://github.com/Caspeco/prettier-config). If you use the recommended [Prettier VSCode extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) you can have your files automatically formatted on file save. |
|
|
27
|
+
|
|
28
|
+
### Preview locally in another project
|
|
29
|
+
|
|
30
|
+
1. Build local development version (see above).
|
|
31
|
+
2. In the consuming app, run `npm install --no-save ./relative/path/to/this/directory` (no trailing slash).
|
|
32
|
+
- For example: `npm install --no-save ../../casper-ui-library/packages/casper-ui-library`
|
|
33
|
+
|
|
34
|
+
Now when you make a change in the component library, it should rebuild automatically and the consuming app's HMR should kick in and reload the page (preserving state is not possible as the entire library is rebuilt).
|
|
35
|
+
|
|
36
|
+
To unlink again you just need to run `npm install` in the consuming app. If it fails, you may need to delete `node_modules` first.
|
|
37
|
+
|
|
38
|
+
If you get an error about duplicate react versions, make sure this is in the `vite.config.ts` in the consuming app:
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
import path from "node:path";
|
|
42
|
+
|
|
43
|
+
export default defineConfig({
|
|
44
|
+
// ...
|
|
45
|
+
resolve: {
|
|
46
|
+
alias: {
|
|
47
|
+
react: path.resolve("./node_modules/react"),
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Contributing
|
|
54
|
+
|
|
55
|
+
1. Make sure your repository is up to date.
|
|
56
|
+
```bash
|
|
57
|
+
git pull
|
|
58
|
+
```
|
|
59
|
+
2. Create a new branch and make your changes there. Preferrably use a branch name that includes any related Jira issue and some short descriptive name.
|
|
60
|
+
```bash
|
|
61
|
+
git checkout -b UTF-837-add-checkbox-component
|
|
62
|
+
```
|
|
63
|
+
3. Make your changes.
|
|
64
|
+
4. Bump the `version` field in `package.json` (following [Semantic versioning](https://semver.org/)) and run `npm install`.
|
|
65
|
+
5. Open a [pull request](https://github.com/Caspeco/casper-ui-library/pulls) using the template and assign a reviewer.
|
package/package.json
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@caspeco/casper-ui-library",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"prettier": "@caspeco/prettier-config",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"sideEffects": false,
|
|
7
|
-
"files": [
|
|
8
|
-
"dist"
|
|
9
|
-
],
|
|
10
|
-
"main": "dist/index.js",
|
|
11
|
-
"module": "dist/index.js",
|
|
12
|
-
"types": "dist/index.d.ts",
|
|
13
|
-
"scripts": {
|
|
14
|
-
"dev": "vite build --watch --mode dev",
|
|
15
|
-
"build": "vite build --mode prod",
|
|
16
|
-
"tsc": "tsc --project tsconfig.app.json",
|
|
17
|
-
"test": "vitest run",
|
|
18
|
-
"prettier": "prettier --check .",
|
|
19
|
-
"prettier:fix": "prettier --write .",
|
|
20
|
-
"check:types": "attw --pack . --ignore-rules=cjs-resolves-to-esm",
|
|
21
|
-
"lint": "eslint .",
|
|
22
|
-
"preview": "vite preview"
|
|
23
|
-
},
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"@arethetypeswrong/cli": "^0.18.2",
|
|
26
|
-
"@caspeco/eslint-config": "^4.0.4",
|
|
27
|
-
"@caspeco/prettier-config": "^1.0.6",
|
|
28
|
-
"@eslint/js": "^9.32.0",
|
|
29
|
-
"@testing-library/jest-dom": "^6.6.4",
|
|
30
|
-
"@testing-library/react": "^16.3.0",
|
|
31
|
-
"@types/jest": "^30.0.0",
|
|
32
|
-
"@types/node": "^24.1.0",
|
|
33
|
-
"@types/react": "^18.3.12",
|
|
34
|
-
"@types/react-dom": "^18.3.1",
|
|
35
|
-
"@vitejs/plugin-react-swc": "^3.11.0",
|
|
36
|
-
"eslint": "^9.32.0",
|
|
37
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
38
|
-
"eslint-plugin-react-refresh": "^0.4.20",
|
|
39
|
-
"globals": "^16.3.0",
|
|
40
|
-
"jsdom": "^26.1.0",
|
|
41
|
-
"tsc-alias": "^1.8.16",
|
|
42
|
-
"typescript": "~5.8.3",
|
|
43
|
-
"typescript-eslint": "^8.38.0",
|
|
44
|
-
"vite": "^6.3.5",
|
|
45
|
-
"vite-plugin-dts": "^4.5.4",
|
|
46
|
-
"vite-tsconfig-paths": "^5.1.4",
|
|
47
|
-
"vitest": "^3.2.4"
|
|
48
|
-
},
|
|
49
|
-
"peerDependencies": {
|
|
50
|
-
"@chakra-ui/react": "^2.8.2",
|
|
51
|
-
"framer-motion": "^12.23.12",
|
|
52
|
-
"react": "^18.3.1",
|
|
53
|
-
"react-dom": "^18.3.1"
|
|
54
|
-
},
|
|
55
|
-
"dependencies": {
|
|
56
|
-
"@chakra-ui/anatomy": "^2.2.2",
|
|
57
|
-
"@floating-ui/dom": "^1.7.2",
|
|
58
|
-
"@tanstack/react-table": "^8.21.3",
|
|
59
|
-
"csstype": "^3.1.3",
|
|
60
|
-
"date-fns": "^4.1.0"
|
|
61
|
-
}
|
|
62
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@caspeco/casper-ui-library",
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"prettier": "@caspeco/prettier-config",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"main": "dist/index.js",
|
|
11
|
+
"module": "dist/index.js",
|
|
12
|
+
"types": "dist/index.d.ts",
|
|
13
|
+
"scripts": {
|
|
14
|
+
"dev": "vite build --watch --mode dev",
|
|
15
|
+
"build": "vite build --mode prod",
|
|
16
|
+
"tsc": "tsc --project tsconfig.app.json",
|
|
17
|
+
"test": "vitest run",
|
|
18
|
+
"prettier": "prettier --check .",
|
|
19
|
+
"prettier:fix": "prettier --write .",
|
|
20
|
+
"check:types": "attw --pack . --ignore-rules=cjs-resolves-to-esm",
|
|
21
|
+
"lint": "eslint .",
|
|
22
|
+
"preview": "vite preview"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@arethetypeswrong/cli": "^0.18.2",
|
|
26
|
+
"@caspeco/eslint-config": "^4.0.4",
|
|
27
|
+
"@caspeco/prettier-config": "^1.0.6",
|
|
28
|
+
"@eslint/js": "^9.32.0",
|
|
29
|
+
"@testing-library/jest-dom": "^6.6.4",
|
|
30
|
+
"@testing-library/react": "^16.3.0",
|
|
31
|
+
"@types/jest": "^30.0.0",
|
|
32
|
+
"@types/node": "^24.1.0",
|
|
33
|
+
"@types/react": "^18.3.12",
|
|
34
|
+
"@types/react-dom": "^18.3.1",
|
|
35
|
+
"@vitejs/plugin-react-swc": "^3.11.0",
|
|
36
|
+
"eslint": "^9.32.0",
|
|
37
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
38
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
39
|
+
"globals": "^16.3.0",
|
|
40
|
+
"jsdom": "^26.1.0",
|
|
41
|
+
"tsc-alias": "^1.8.16",
|
|
42
|
+
"typescript": "~5.8.3",
|
|
43
|
+
"typescript-eslint": "^8.38.0",
|
|
44
|
+
"vite": "^6.3.5",
|
|
45
|
+
"vite-plugin-dts": "^4.5.4",
|
|
46
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
47
|
+
"vitest": "^3.2.4"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"@chakra-ui/react": "^2.8.2",
|
|
51
|
+
"framer-motion": "^12.23.12",
|
|
52
|
+
"react": "^18.3.1",
|
|
53
|
+
"react-dom": "^18.3.1"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@chakra-ui/anatomy": "^2.2.2",
|
|
57
|
+
"@floating-ui/dom": "^1.7.2",
|
|
58
|
+
"@tanstack/react-table": "^8.21.3",
|
|
59
|
+
"csstype": "^3.1.3",
|
|
60
|
+
"date-fns": "^4.1.0"
|
|
61
|
+
}
|
|
62
|
+
}
|