opsfuse-ui 0.1.24 → 0.1.26
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/.claude/skills/brief-to-tasks/SKILL.md +74 -74
- package/.claude/skills/design-brief/SKILL.md +120 -120
- package/.claude/skills/design-flow/SKILL.md +124 -124
- package/.claude/skills/design-review/SKILL.md +249 -249
- package/.claude/skills/design-tokens/SKILL.md +198 -198
- package/.claude/skills/frontend-design/SKILL.md +144 -144
- package/.claude/skills/grill-me/SKILL.md +21 -21
- package/.claude/skills/information-architecture/SKILL.md +111 -111
- package/.claude/skills/opsfuse-color-theme/SKILL.md +257 -257
- package/.claude/skills/opsfuse-components/SKILL.md +1494 -1494
- package/.claude/skills/opsfuse-setup/SKILL.md +169 -169
- package/.claude/skills/opsfuse-ui-consistency/SKILL.md +169 -169
- package/LICENSE +17 -17
- package/README.md +214 -214
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/core.js +2 -2
- package/dist/extended.js +2 -2
- package/dist/index.js +3 -3
- package/dist/{input-group-DsOYhBRV.js → input-group-BFEABA03.js} +16 -0
- package/dist/{input-otp-B3Ht2pOf.js → input-otp-kzcY4B1V.js} +1 -1
- package/dist/style.css +256 -253
- package/dist/{toggle-group-BLGOVp8G.js → toggle-group-qup4FMjO.js} +1 -1
- package/package.json +151 -151
- package/scripts/postinstall.mjs +66 -66
- package/scripts/unwrap-css-layers.mjs +36 -36
- package/theme.css +253 -250
- package/.claude/settings.local.json +0 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { B as e, D as t, F as n, L as r, M as i, N as a, O as o, P as s, _ as c, b as l, c as u, f as d, g as f, h as p, l as m, m as h, p as g, u as _, x as v } from "./input-group-
|
|
2
|
+
import { B as e, D as t, F as n, L as r, M as i, N as a, O as o, P as s, _ as c, b as l, c as u, f as d, g as f, h as p, l as m, m as h, p as g, u as _, x as v } from "./input-group-BFEABA03.js";
|
|
3
3
|
import { CheckIcon as y, ChevronDownIcon as b, ChevronLeftIcon as x, ChevronRightIcon as S, ChevronUpIcon as ee, MoreHorizontalIcon as te, PanelLeftIcon as ne, SparklesIcon as C, XIcon as w } from "lucide-react";
|
|
4
4
|
import * as T from "react";
|
|
5
5
|
import E, { useId as re, useMemo as ie } from "react";
|
package/package.json
CHANGED
|
@@ -1,151 +1,151 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "opsfuse-ui",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"main": "./dist/index.js",
|
|
6
|
-
"module": "./dist/index.js",
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
|
-
"typings": "./dist/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"import": "./dist/index.js",
|
|
13
|
-
"require": "./dist/index.js",
|
|
14
|
-
"default": "./dist/index.js"
|
|
15
|
-
},
|
|
16
|
-
"./core": {
|
|
17
|
-
"types": "./dist/core.d.ts",
|
|
18
|
-
"import": "./dist/core.js",
|
|
19
|
-
"default": "./dist/core.js"
|
|
20
|
-
},
|
|
21
|
-
"./extended": {
|
|
22
|
-
"types": "./dist/extended.d.ts",
|
|
23
|
-
"import": "./dist/extended.js",
|
|
24
|
-
"default": "./dist/extended.js"
|
|
25
|
-
},
|
|
26
|
-
"./recharts": {
|
|
27
|
-
"types": "./dist/recharts.d.ts",
|
|
28
|
-
"import": "./dist/recharts.js",
|
|
29
|
-
"default": "./dist/recharts.js"
|
|
30
|
-
},
|
|
31
|
-
"./icons": {
|
|
32
|
-
"types": "./dist/icons.d.ts",
|
|
33
|
-
"import": "./dist/icons.js",
|
|
34
|
-
"default": "./dist/icons.js"
|
|
35
|
-
},
|
|
36
|
-
"./date-fns": {
|
|
37
|
-
"types": "./dist/date-fns.d.ts",
|
|
38
|
-
"import": "./dist/date-fns.js",
|
|
39
|
-
"default": "./dist/date-fns.js"
|
|
40
|
-
},
|
|
41
|
-
"./date-fns/locale": {
|
|
42
|
-
"types": "./dist/date-fns-locale.d.ts",
|
|
43
|
-
"import": "./dist/date-fns-locale.js",
|
|
44
|
-
"default": "./dist/date-fns-locale.js"
|
|
45
|
-
},
|
|
46
|
-
"./styles.css": "./dist/style.css",
|
|
47
|
-
"./theme.css": "./theme.css",
|
|
48
|
-
"./package.json": "./package.json"
|
|
49
|
-
},
|
|
50
|
-
"sideEffects": [
|
|
51
|
-
"./dist/style.css",
|
|
52
|
-
"**/*.css"
|
|
53
|
-
],
|
|
54
|
-
"files": [
|
|
55
|
-
"dist",
|
|
56
|
-
"scripts",
|
|
57
|
-
"theme.css",
|
|
58
|
-
".claude",
|
|
59
|
-
"LICENSE",
|
|
60
|
-
"README.md"
|
|
61
|
-
],
|
|
62
|
-
"scripts": {
|
|
63
|
-
"dev": "vite",
|
|
64
|
-
"build": "tsc -b && vite build",
|
|
65
|
-
"build:lib": "vite build --config vite.lib.config.ts",
|
|
66
|
-
"prepare": "npm run build:lib",
|
|
67
|
-
"postinstall": "node scripts/postinstall.mjs",
|
|
68
|
-
"prepublishOnly": "npm run build:lib",
|
|
69
|
-
"lint": "eslint .",
|
|
70
|
-
"preview": "vite preview",
|
|
71
|
-
"storybook": "storybook dev -p 6006",
|
|
72
|
-
"build-storybook": "storybook build",
|
|
73
|
-
"test": "npm run build:lib && vitest run",
|
|
74
|
-
"test:unit": "vitest run",
|
|
75
|
-
"test:watch": "vitest"
|
|
76
|
-
},
|
|
77
|
-
"peerDependencies": {
|
|
78
|
-
"react": "^19.0.0",
|
|
79
|
-
"react-dom": "^19.0.0",
|
|
80
|
-
"tailwindcss": "^4.0.0"
|
|
81
|
-
},
|
|
82
|
-
"dependencies": {
|
|
83
|
-
"@base-ui/react": "^1.4.0",
|
|
84
|
-
"@tanstack/react-form": "^1.29.0",
|
|
85
|
-
"class-variance-authority": "^0.7.1",
|
|
86
|
-
"clsx": "^2.1.1",
|
|
87
|
-
"cmdk": "^1.1.1",
|
|
88
|
-
"date-fns": "^4.1.0",
|
|
89
|
-
"embla-carousel-react": "^8.6.0",
|
|
90
|
-
"input-otp": "^1.4.2",
|
|
91
|
-
"lucide-react": "^1.8.0",
|
|
92
|
-
"radix-ui": "^1.4.3",
|
|
93
|
-
"react-day-picker": "^9.14.0",
|
|
94
|
-
"react-is": "^19.2.5",
|
|
95
|
-
"react-resizable-panels": "^4.10.0",
|
|
96
|
-
"recharts": "^3.8.1",
|
|
97
|
-
"sonner": "^2.0.7",
|
|
98
|
-
"tailwind-merge": "^3.5.0",
|
|
99
|
-
"use-sync-external-store": "^1.6.0",
|
|
100
|
-
"vaul": "^1.1.2"
|
|
101
|
-
},
|
|
102
|
-
"devDependencies": {
|
|
103
|
-
"@eslint/js": "^10.0.1",
|
|
104
|
-
"@storybook/addon-a11y": "^10.5.5",
|
|
105
|
-
"@storybook/addon-docs": "^10.5.5",
|
|
106
|
-
"@storybook/addon-themes": "^10.5.5",
|
|
107
|
-
"@storybook/react": "^10.5.5",
|
|
108
|
-
"@storybook/react-vite": "^10.5.5",
|
|
109
|
-
"@tailwindcss/vite": "^4.2.2",
|
|
110
|
-
"@testing-library/jest-dom": "^7.0.0",
|
|
111
|
-
"@testing-library/react": "^16.3.2",
|
|
112
|
-
"@types/node": "^25.6.0",
|
|
113
|
-
"@types/react": "^19.2.14",
|
|
114
|
-
"@types/react-dom": "^19.2.3",
|
|
115
|
-
"@vitejs/plugin-react": "^6.0.1",
|
|
116
|
-
"acorn": "^8.18.0",
|
|
117
|
-
"ajv": "^8.18.0",
|
|
118
|
-
"eslint": "^10.2.0",
|
|
119
|
-
"eslint-plugin-react-hooks": "^7.0.1",
|
|
120
|
-
"eslint-plugin-react-refresh": "^0.5.2",
|
|
121
|
-
"globals": "^17.5.0",
|
|
122
|
-
"jsdom": "^29.1.1",
|
|
123
|
-
"postcss": "^8.5.10",
|
|
124
|
-
"react": "^19.2.5",
|
|
125
|
-
"react-dom": "^19.2.5",
|
|
126
|
-
"shadcn": "^4.2.0",
|
|
127
|
-
"storybook": "^10.5.5",
|
|
128
|
-
"tailwindcss": "^4.2.2",
|
|
129
|
-
"tw-animate-css": "^1.4.0",
|
|
130
|
-
"typescript": "~6.0.2",
|
|
131
|
-
"typescript-eslint": "^8.58.2",
|
|
132
|
-
"vite": "^8.0.8",
|
|
133
|
-
"vite-plugin-dts": "^4.5.4",
|
|
134
|
-
"vitest": "^4.1.10"
|
|
135
|
-
},
|
|
136
|
-
"peerDependenciesMeta": {
|
|
137
|
-
"tailwindcss": {
|
|
138
|
-
"optional": true
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
"license": "UNLICENSED",
|
|
142
|
-
"author": "OpsFuse",
|
|
143
|
-
"description": "OpsFuse design system: React 19 + Tailwind v4 component library with four brand themes.",
|
|
144
|
-
"repository": {
|
|
145
|
-
"type": "git",
|
|
146
|
-
"url": "git+https://code.opsfuse.com/mockinterview/opsfuse-ui.git"
|
|
147
|
-
},
|
|
148
|
-
"engines": {
|
|
149
|
-
"node": "^20.19.0 || >=22.12.0"
|
|
150
|
-
}
|
|
151
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "opsfuse-ui",
|
|
3
|
+
"version": "0.1.26",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"typings": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.js",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./core": {
|
|
17
|
+
"types": "./dist/core.d.ts",
|
|
18
|
+
"import": "./dist/core.js",
|
|
19
|
+
"default": "./dist/core.js"
|
|
20
|
+
},
|
|
21
|
+
"./extended": {
|
|
22
|
+
"types": "./dist/extended.d.ts",
|
|
23
|
+
"import": "./dist/extended.js",
|
|
24
|
+
"default": "./dist/extended.js"
|
|
25
|
+
},
|
|
26
|
+
"./recharts": {
|
|
27
|
+
"types": "./dist/recharts.d.ts",
|
|
28
|
+
"import": "./dist/recharts.js",
|
|
29
|
+
"default": "./dist/recharts.js"
|
|
30
|
+
},
|
|
31
|
+
"./icons": {
|
|
32
|
+
"types": "./dist/icons.d.ts",
|
|
33
|
+
"import": "./dist/icons.js",
|
|
34
|
+
"default": "./dist/icons.js"
|
|
35
|
+
},
|
|
36
|
+
"./date-fns": {
|
|
37
|
+
"types": "./dist/date-fns.d.ts",
|
|
38
|
+
"import": "./dist/date-fns.js",
|
|
39
|
+
"default": "./dist/date-fns.js"
|
|
40
|
+
},
|
|
41
|
+
"./date-fns/locale": {
|
|
42
|
+
"types": "./dist/date-fns-locale.d.ts",
|
|
43
|
+
"import": "./dist/date-fns-locale.js",
|
|
44
|
+
"default": "./dist/date-fns-locale.js"
|
|
45
|
+
},
|
|
46
|
+
"./styles.css": "./dist/style.css",
|
|
47
|
+
"./theme.css": "./theme.css",
|
|
48
|
+
"./package.json": "./package.json"
|
|
49
|
+
},
|
|
50
|
+
"sideEffects": [
|
|
51
|
+
"./dist/style.css",
|
|
52
|
+
"**/*.css"
|
|
53
|
+
],
|
|
54
|
+
"files": [
|
|
55
|
+
"dist",
|
|
56
|
+
"scripts",
|
|
57
|
+
"theme.css",
|
|
58
|
+
".claude",
|
|
59
|
+
"LICENSE",
|
|
60
|
+
"README.md"
|
|
61
|
+
],
|
|
62
|
+
"scripts": {
|
|
63
|
+
"dev": "vite",
|
|
64
|
+
"build": "tsc -b && vite build",
|
|
65
|
+
"build:lib": "vite build --config vite.lib.config.ts",
|
|
66
|
+
"prepare": "npm run build:lib",
|
|
67
|
+
"postinstall": "node scripts/postinstall.mjs",
|
|
68
|
+
"prepublishOnly": "npm run build:lib",
|
|
69
|
+
"lint": "eslint .",
|
|
70
|
+
"preview": "vite preview",
|
|
71
|
+
"storybook": "storybook dev -p 6006",
|
|
72
|
+
"build-storybook": "storybook build",
|
|
73
|
+
"test": "npm run build:lib && vitest run",
|
|
74
|
+
"test:unit": "vitest run",
|
|
75
|
+
"test:watch": "vitest"
|
|
76
|
+
},
|
|
77
|
+
"peerDependencies": {
|
|
78
|
+
"react": "^19.0.0",
|
|
79
|
+
"react-dom": "^19.0.0",
|
|
80
|
+
"tailwindcss": "^4.0.0"
|
|
81
|
+
},
|
|
82
|
+
"dependencies": {
|
|
83
|
+
"@base-ui/react": "^1.4.0",
|
|
84
|
+
"@tanstack/react-form": "^1.29.0",
|
|
85
|
+
"class-variance-authority": "^0.7.1",
|
|
86
|
+
"clsx": "^2.1.1",
|
|
87
|
+
"cmdk": "^1.1.1",
|
|
88
|
+
"date-fns": "^4.1.0",
|
|
89
|
+
"embla-carousel-react": "^8.6.0",
|
|
90
|
+
"input-otp": "^1.4.2",
|
|
91
|
+
"lucide-react": "^1.8.0",
|
|
92
|
+
"radix-ui": "^1.4.3",
|
|
93
|
+
"react-day-picker": "^9.14.0",
|
|
94
|
+
"react-is": "^19.2.5",
|
|
95
|
+
"react-resizable-panels": "^4.10.0",
|
|
96
|
+
"recharts": "^3.8.1",
|
|
97
|
+
"sonner": "^2.0.7",
|
|
98
|
+
"tailwind-merge": "^3.5.0",
|
|
99
|
+
"use-sync-external-store": "^1.6.0",
|
|
100
|
+
"vaul": "^1.1.2"
|
|
101
|
+
},
|
|
102
|
+
"devDependencies": {
|
|
103
|
+
"@eslint/js": "^10.0.1",
|
|
104
|
+
"@storybook/addon-a11y": "^10.5.5",
|
|
105
|
+
"@storybook/addon-docs": "^10.5.5",
|
|
106
|
+
"@storybook/addon-themes": "^10.5.5",
|
|
107
|
+
"@storybook/react": "^10.5.5",
|
|
108
|
+
"@storybook/react-vite": "^10.5.5",
|
|
109
|
+
"@tailwindcss/vite": "^4.2.2",
|
|
110
|
+
"@testing-library/jest-dom": "^7.0.0",
|
|
111
|
+
"@testing-library/react": "^16.3.2",
|
|
112
|
+
"@types/node": "^25.6.0",
|
|
113
|
+
"@types/react": "^19.2.14",
|
|
114
|
+
"@types/react-dom": "^19.2.3",
|
|
115
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
116
|
+
"acorn": "^8.18.0",
|
|
117
|
+
"ajv": "^8.18.0",
|
|
118
|
+
"eslint": "^10.2.0",
|
|
119
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
120
|
+
"eslint-plugin-react-refresh": "^0.5.2",
|
|
121
|
+
"globals": "^17.5.0",
|
|
122
|
+
"jsdom": "^29.1.1",
|
|
123
|
+
"postcss": "^8.5.10",
|
|
124
|
+
"react": "^19.2.5",
|
|
125
|
+
"react-dom": "^19.2.5",
|
|
126
|
+
"shadcn": "^4.2.0",
|
|
127
|
+
"storybook": "^10.5.5",
|
|
128
|
+
"tailwindcss": "^4.2.2",
|
|
129
|
+
"tw-animate-css": "^1.4.0",
|
|
130
|
+
"typescript": "~6.0.2",
|
|
131
|
+
"typescript-eslint": "^8.58.2",
|
|
132
|
+
"vite": "^8.0.8",
|
|
133
|
+
"vite-plugin-dts": "^4.5.4",
|
|
134
|
+
"vitest": "^4.1.10"
|
|
135
|
+
},
|
|
136
|
+
"peerDependenciesMeta": {
|
|
137
|
+
"tailwindcss": {
|
|
138
|
+
"optional": true
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"license": "UNLICENSED",
|
|
142
|
+
"author": "OpsFuse",
|
|
143
|
+
"description": "OpsFuse design system: React 19 + Tailwind v4 component library with four brand themes.",
|
|
144
|
+
"repository": {
|
|
145
|
+
"type": "git",
|
|
146
|
+
"url": "git+https://code.opsfuse.com/mockinterview/opsfuse-ui.git"
|
|
147
|
+
},
|
|
148
|
+
"engines": {
|
|
149
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
150
|
+
}
|
|
151
|
+
}
|
package/scripts/postinstall.mjs
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* postinstall.mjs
|
|
4
|
-
*
|
|
5
|
-
* Copies OpsFuse Claude Code skills into the host project's .claude/skills/
|
|
6
|
-
* directory so developers get component, color-theme, ui-consistency, and
|
|
7
|
-
* setup guidance in their Claude Code sessions immediately after installing.
|
|
8
|
-
*
|
|
9
|
-
* Runs only when the package is installed as a dependency (i.e. the resolved
|
|
10
|
-
* path contains "node_modules"). Does nothing during development of the lib
|
|
11
|
-
* itself.
|
|
12
|
-
*
|
|
13
|
-
* NOTE: process.cwd() inside a postinstall script resolves to the package
|
|
14
|
-
* directory, NOT the host project root. We derive the host root by walking
|
|
15
|
-
* two levels up from packageRoot (node_modules/opsfuse-ui → node_modules → host).
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import { existsSync, mkdirSync, cpSync } from "fs";
|
|
19
|
-
import { join, dirname } from "path";
|
|
20
|
-
import { fileURLToPath } from "url";
|
|
21
|
-
|
|
22
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
23
|
-
// e.g. /host/node_modules/opsfuse-ui (when installed as dep)
|
|
24
|
-
// e.g. /opsfuse-ui (when developing the lib itself)
|
|
25
|
-
const packageRoot = join(__dirname, "..");
|
|
26
|
-
|
|
27
|
-
// Guard: only run when we are inside node_modules of a host project.
|
|
28
|
-
if (!packageRoot.includes("node_modules")) {
|
|
29
|
-
process.exit(0);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// Walk up: node_modules/opsfuse-ui -> node_modules -> host project root
|
|
33
|
-
const hostRoot = join(packageRoot, "..", "..");
|
|
34
|
-
const skillsSource = join(packageRoot, ".claude", "skills");
|
|
35
|
-
const skillsDest = join(hostRoot, ".claude", "skills");
|
|
36
|
-
const OPSFUSE_SKILLS = [
|
|
37
|
-
"opsfuse-components",
|
|
38
|
-
"opsfuse-color-theme",
|
|
39
|
-
"opsfuse-ui-consistency",
|
|
40
|
-
"opsfuse-setup",
|
|
41
|
-
];
|
|
42
|
-
|
|
43
|
-
if (!existsSync(skillsSource)) {
|
|
44
|
-
console.warn("[opsfuse-ui] Skills source not found — skipping Claude skill install.");
|
|
45
|
-
process.exit(0);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
let copied = 0;
|
|
49
|
-
|
|
50
|
-
for (const skill of OPSFUSE_SKILLS) {
|
|
51
|
-
const src = join(skillsSource, skill);
|
|
52
|
-
if (!existsSync(src)) continue;
|
|
53
|
-
|
|
54
|
-
const dest = join(skillsDest, skill);
|
|
55
|
-
mkdirSync(dest, { recursive: true });
|
|
56
|
-
cpSync(src, dest, { recursive: true, force: true });
|
|
57
|
-
copied++;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (copied > 0) {
|
|
61
|
-
const skillNames = OPSFUSE_SKILLS.slice(0, copied).map((s) => `/${s.replace("opsfuse-", "")}`).join(", ");
|
|
62
|
-
console.log(
|
|
63
|
-
`\n[opsfuse-ui] Installed ${copied} Claude Code skill(s) → .claude/skills/\n` +
|
|
64
|
-
` Available slash commands: ${skillNames}\n`
|
|
65
|
-
);
|
|
66
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* postinstall.mjs
|
|
4
|
+
*
|
|
5
|
+
* Copies OpsFuse Claude Code skills into the host project's .claude/skills/
|
|
6
|
+
* directory so developers get component, color-theme, ui-consistency, and
|
|
7
|
+
* setup guidance in their Claude Code sessions immediately after installing.
|
|
8
|
+
*
|
|
9
|
+
* Runs only when the package is installed as a dependency (i.e. the resolved
|
|
10
|
+
* path contains "node_modules"). Does nothing during development of the lib
|
|
11
|
+
* itself.
|
|
12
|
+
*
|
|
13
|
+
* NOTE: process.cwd() inside a postinstall script resolves to the package
|
|
14
|
+
* directory, NOT the host project root. We derive the host root by walking
|
|
15
|
+
* two levels up from packageRoot (node_modules/opsfuse-ui → node_modules → host).
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { existsSync, mkdirSync, cpSync } from "fs";
|
|
19
|
+
import { join, dirname } from "path";
|
|
20
|
+
import { fileURLToPath } from "url";
|
|
21
|
+
|
|
22
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
23
|
+
// e.g. /host/node_modules/opsfuse-ui (when installed as dep)
|
|
24
|
+
// e.g. /opsfuse-ui (when developing the lib itself)
|
|
25
|
+
const packageRoot = join(__dirname, "..");
|
|
26
|
+
|
|
27
|
+
// Guard: only run when we are inside node_modules of a host project.
|
|
28
|
+
if (!packageRoot.includes("node_modules")) {
|
|
29
|
+
process.exit(0);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Walk up: node_modules/opsfuse-ui -> node_modules -> host project root
|
|
33
|
+
const hostRoot = join(packageRoot, "..", "..");
|
|
34
|
+
const skillsSource = join(packageRoot, ".claude", "skills");
|
|
35
|
+
const skillsDest = join(hostRoot, ".claude", "skills");
|
|
36
|
+
const OPSFUSE_SKILLS = [
|
|
37
|
+
"opsfuse-components",
|
|
38
|
+
"opsfuse-color-theme",
|
|
39
|
+
"opsfuse-ui-consistency",
|
|
40
|
+
"opsfuse-setup",
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
if (!existsSync(skillsSource)) {
|
|
44
|
+
console.warn("[opsfuse-ui] Skills source not found — skipping Claude skill install.");
|
|
45
|
+
process.exit(0);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
let copied = 0;
|
|
49
|
+
|
|
50
|
+
for (const skill of OPSFUSE_SKILLS) {
|
|
51
|
+
const src = join(skillsSource, skill);
|
|
52
|
+
if (!existsSync(src)) continue;
|
|
53
|
+
|
|
54
|
+
const dest = join(skillsDest, skill);
|
|
55
|
+
mkdirSync(dest, { recursive: true });
|
|
56
|
+
cpSync(src, dest, { recursive: true, force: true });
|
|
57
|
+
copied++;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (copied > 0) {
|
|
61
|
+
const skillNames = OPSFUSE_SKILLS.slice(0, copied).map((s) => `/${s.replace("opsfuse-", "")}`).join(", ");
|
|
62
|
+
console.log(
|
|
63
|
+
`\n[opsfuse-ui] Installed ${copied} Claude Code skill(s) → .claude/skills/\n` +
|
|
64
|
+
` Available slash commands: ${skillNames}\n`
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tailwind v4 emits @layer { ... } in compiled CSS. When consumers (e.g. Next.js)
|
|
3
|
-
* run PostCSS/Tailwind on that file again, it errors: "@layer base is used but no
|
|
4
|
-
* matching @tailwind base directive is present." Unwrapping layers yields plain CSS
|
|
5
|
-
* that downstream tooling can treat as a finished stylesheet.
|
|
6
|
-
*/
|
|
7
|
-
import fs from "node:fs";
|
|
8
|
-
import path from "node:path";
|
|
9
|
-
import { fileURLToPath } from "node:url";
|
|
10
|
-
|
|
11
|
-
import postcss from "postcss";
|
|
12
|
-
|
|
13
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
14
|
-
const stylePath = path.resolve(__dirname, "../dist/style.css");
|
|
15
|
-
|
|
16
|
-
const css = fs.readFileSync(stylePath, "utf8");
|
|
17
|
-
|
|
18
|
-
const unwrapLayers = () => ({
|
|
19
|
-
postcssPlugin: "unwrap-tailwind-layers",
|
|
20
|
-
Once(root) {
|
|
21
|
-
const layers = [];
|
|
22
|
-
root.walkAtRules("layer", (atRule) => {
|
|
23
|
-
layers.push(atRule);
|
|
24
|
-
});
|
|
25
|
-
for (const atRule of layers.reverse()) {
|
|
26
|
-
const nodes = [...atRule.nodes];
|
|
27
|
-
atRule.replaceWith(...nodes);
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
unwrapLayers.postcss = true;
|
|
33
|
-
|
|
34
|
-
const result = await postcss([unwrapLayers]).process(css, { from: stylePath });
|
|
35
|
-
|
|
36
|
-
fs.writeFileSync(stylePath, result.css);
|
|
1
|
+
/**
|
|
2
|
+
* Tailwind v4 emits @layer { ... } in compiled CSS. When consumers (e.g. Next.js)
|
|
3
|
+
* run PostCSS/Tailwind on that file again, it errors: "@layer base is used but no
|
|
4
|
+
* matching @tailwind base directive is present." Unwrapping layers yields plain CSS
|
|
5
|
+
* that downstream tooling can treat as a finished stylesheet.
|
|
6
|
+
*/
|
|
7
|
+
import fs from "node:fs";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
|
|
11
|
+
import postcss from "postcss";
|
|
12
|
+
|
|
13
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
const stylePath = path.resolve(__dirname, "../dist/style.css");
|
|
15
|
+
|
|
16
|
+
const css = fs.readFileSync(stylePath, "utf8");
|
|
17
|
+
|
|
18
|
+
const unwrapLayers = () => ({
|
|
19
|
+
postcssPlugin: "unwrap-tailwind-layers",
|
|
20
|
+
Once(root) {
|
|
21
|
+
const layers = [];
|
|
22
|
+
root.walkAtRules("layer", (atRule) => {
|
|
23
|
+
layers.push(atRule);
|
|
24
|
+
});
|
|
25
|
+
for (const atRule of layers.reverse()) {
|
|
26
|
+
const nodes = [...atRule.nodes];
|
|
27
|
+
atRule.replaceWith(...nodes);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
unwrapLayers.postcss = true;
|
|
33
|
+
|
|
34
|
+
const result = await postcss([unwrapLayers]).process(css, { from: stylePath });
|
|
35
|
+
|
|
36
|
+
fs.writeFileSync(stylePath, result.css);
|