@bitrise/bitkit-v2 0.3.206 → 0.3.207
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 +14 -0
- package/package.json +7 -4
- package/scripts/postinstall.cjs +38 -0
package/README.md
CHANGED
|
@@ -27,6 +27,20 @@ Chakra UI and Emotion are included as regular runtime dependencies of this packa
|
|
|
27
27
|
- React 18+ (peer dependency)
|
|
28
28
|
- React DOM 18+ (peer dependency)
|
|
29
29
|
|
|
30
|
+
### Theme typings
|
|
31
|
+
|
|
32
|
+
Bitkit ships a Chakra UI v3 theme with custom recipes, semantic tokens, and design tokens. For TypeScript autocompletion to recognize bitkit-specific values (e.g. `<BitkitButton variant="ai-primary">`, `colors.purple.60`), Chakra's typegen must run in your project's `node_modules` after install.
|
|
33
|
+
|
|
34
|
+
This happens automatically via a `postinstall` hook bundled with the package — no setup is required for standard npm installs.
|
|
35
|
+
|
|
36
|
+
If the postinstall is skipped (e.g. you ran `npm install --ignore-scripts`, or a CI runner blocks lifecycle scripts), regenerate the typings manually:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx chakra typegen node_modules/@bitrise/bitkit-v2/dist/theme/index.js
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
You can verify it worked by checking that `<BitkitButton variant="ai-primary" />` type-checks in your editor while `<BitkitButton variant="solid" />` errors.
|
|
43
|
+
|
|
30
44
|
## Quick Start
|
|
31
45
|
|
|
32
46
|
```tsx
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitrise/bitkit-v2",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.207",
|
|
5
5
|
"description": "Bitrise Design System Components built with Chakra UI V3",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"react",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"type": "module",
|
|
14
14
|
"files": [
|
|
15
15
|
"dist",
|
|
16
|
+
"scripts/postinstall.cjs",
|
|
16
17
|
"README.md",
|
|
17
18
|
"package.json"
|
|
18
19
|
],
|
|
@@ -47,7 +48,9 @@
|
|
|
47
48
|
"pregenerate:icons": "figma-export use-config",
|
|
48
49
|
"generate:icons": "tsx ./scripts/generateIconComponents.ts",
|
|
49
50
|
"postgenerate:icons": "eslint ./lib/icons --fix",
|
|
50
|
-
"prepare": "npm run theme:generate-types"
|
|
51
|
+
"prepare": "npm run theme:generate-types",
|
|
52
|
+
"prepublishOnly": "npm run build",
|
|
53
|
+
"postinstall": "node ./scripts/postinstall.cjs"
|
|
51
54
|
},
|
|
52
55
|
"peerDependencies": {
|
|
53
56
|
"react": ">=18",
|
|
@@ -55,7 +58,6 @@
|
|
|
55
58
|
},
|
|
56
59
|
"devDependencies": {
|
|
57
60
|
"@bitrise/eslint-plugin": "^4.1.0",
|
|
58
|
-
"@chakra-ui/cli": "^3.35.0",
|
|
59
61
|
"@figma-export/cli": "^6.4.0",
|
|
60
62
|
"@figma-export/output-components-as-svg": "^6.4.0",
|
|
61
63
|
"@figma-export/transform-svg-with-svgo": "^6.4.0",
|
|
@@ -68,7 +70,6 @@
|
|
|
68
70
|
"@types/react": "^18.3.28",
|
|
69
71
|
"@types/react-dom": "^18.3.7",
|
|
70
72
|
"@vitejs/plugin-react": "^6.0.1",
|
|
71
|
-
"es-toolkit": "^1.46.0",
|
|
72
73
|
"react": "^18.3.1",
|
|
73
74
|
"react-dom": "^18.3.1",
|
|
74
75
|
"release-it": "^20.0.1",
|
|
@@ -80,11 +81,13 @@
|
|
|
80
81
|
"vite-plugin-svgr": "^5.2.0"
|
|
81
82
|
},
|
|
82
83
|
"dependencies": {
|
|
84
|
+
"@chakra-ui/cli": "^3.35.0",
|
|
83
85
|
"@chakra-ui/react": "^3.35.0",
|
|
84
86
|
"@emotion/react": "^11.14.0",
|
|
85
87
|
"@emotion/styled": "^11.14.1",
|
|
86
88
|
"@fontsource-variable/figtree": "^5.2.10",
|
|
87
89
|
"@fontsource-variable/source-code-pro": "^5.2.7",
|
|
90
|
+
"es-toolkit": "^1.46.0",
|
|
88
91
|
"react-markdown": "^10.1.0"
|
|
89
92
|
},
|
|
90
93
|
"overrides": {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require('node:child_process');
|
|
4
|
+
const { existsSync } = require('node:fs');
|
|
5
|
+
const { dirname, resolve } = require('node:path');
|
|
6
|
+
|
|
7
|
+
const packageRoot = resolve(__dirname, '..');
|
|
8
|
+
const themeEntry = resolve(packageRoot, 'dist/theme/index.js');
|
|
9
|
+
|
|
10
|
+
if (!existsSync(themeEntry)) {
|
|
11
|
+
process.exit(0);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let cliBin;
|
|
15
|
+
try {
|
|
16
|
+
const cliPkg = require.resolve('@chakra-ui/cli/package.json');
|
|
17
|
+
cliBin = resolve(dirname(cliPkg), 'bin/index.js');
|
|
18
|
+
} catch {
|
|
19
|
+
console.warn(
|
|
20
|
+
'[@bitrise/bitkit-v2] @chakra-ui/cli not found — Chakra theme typings will not be generated. ' +
|
|
21
|
+
'Run `npx chakra typegen node_modules/@bitrise/bitkit-v2/dist/theme/index.js` manually.',
|
|
22
|
+
);
|
|
23
|
+
process.exit(0);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const result = spawnSync(process.execPath, [cliBin, 'typegen', themeEntry], {
|
|
27
|
+
cwd: packageRoot,
|
|
28
|
+
stdio: 'inherit',
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
if (result.status !== 0) {
|
|
32
|
+
console.warn(
|
|
33
|
+
'[@bitrise/bitkit-v2] Chakra typegen failed — bitkit-specific theme types are unavailable. ' +
|
|
34
|
+
'You can retry manually with `npx chakra typegen node_modules/@bitrise/bitkit-v2/dist/theme/index.js`.',
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
process.exit(0);
|