opsfuse-ui 0.1.0
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/settings.local.json +8 -0
- package/.claude/skills/brief-to-tasks/SKILL.md +74 -0
- package/.claude/skills/design-brief/SKILL.md +120 -0
- package/.claude/skills/design-flow/SKILL.md +124 -0
- package/.claude/skills/design-review/SKILL.md +249 -0
- package/.claude/skills/design-tokens/SKILL.md +198 -0
- package/.claude/skills/frontend-design/SKILL.md +144 -0
- package/.claude/skills/grill-me/SKILL.md +21 -0
- package/.claude/skills/information-architecture/SKILL.md +111 -0
- package/.claude/skills/opsfuse-color-theme/SKILL.md +251 -0
- package/.claude/skills/opsfuse-components/SKILL.md +1439 -0
- package/.claude/skills/opsfuse-setup/SKILL.md +548 -0
- package/.claude/skills/opsfuse-ui-consistency/SKILL.md +160 -0
- package/README.md +356 -0
- package/dist/chunk-BdsCSvBP.js +20 -0
- package/dist/clsx-D7D_XZ_-.js +16 -0
- package/dist/components/logo/LogoMaker.d.ts +43 -0
- package/dist/components/logo/LogoMaker.d.ts.map +1 -0
- package/dist/components/logo/RecruitSmartly.d.ts +4 -0
- package/dist/components/logo/RecruitSmartly.d.ts.map +1 -0
- package/dist/components/logo/SkillReady.d.ts +4 -0
- package/dist/components/logo/SkillReady.d.ts.map +1 -0
- package/dist/components/logo/TalentScan.d.ts +4 -0
- package/dist/components/logo/TalentScan.d.ts.map +1 -0
- package/dist/components/logo/Verity.d.ts +4 -0
- package/dist/components/logo/Verity.d.ts.map +1 -0
- package/dist/components/logo/WorkLog.d.ts +4 -0
- package/dist/components/logo/WorkLog.d.ts.map +1 -0
- package/dist/components/opsfuse-root.d.ts +7 -0
- package/dist/components/opsfuse-root.d.ts.map +1 -0
- package/dist/components/opsfuse-theme-provider.d.ts +15 -0
- package/dist/components/opsfuse-theme-provider.d.ts.map +1 -0
- package/dist/components/ui/Header.d.ts +17 -0
- package/dist/components/ui/Header.d.ts.map +1 -0
- package/dist/components/ui/accordion.d.ts +20 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +15 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert.d.ts +26 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.d.ts +4 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/autocomplete.d.ts +24 -0
- package/dist/components/ui/autocomplete.d.ts.map +1 -0
- package/dist/components/ui/avatar.d.ts +9 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +12 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/button-group.d.ts +12 -0
- package/dist/components/ui/button-group.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +14 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/calendar.d.ts +11 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/card.d.ts +14 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/carousel.d.ts +29 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/chart.d.ts +45 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/checkbox.d.ts +10 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/combobox.d.ts +40 -0
- package/dist/components/ui/combobox.d.ts.map +1 -0
- package/dist/components/ui/command.d.ts +19 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/context-menu.d.ts +32 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/dialog.d.ts +30 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/direction.d.ts +8 -0
- package/dist/components/ui/direction.d.ts.map +1 -0
- package/dist/components/ui/drawer.d.ts +14 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +30 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/empty.d.ts +12 -0
- package/dist/components/ui/empty.d.ts.map +1 -0
- package/dist/components/ui/field.d.ts +25 -0
- package/dist/components/ui/field.d.ts.map +1 -0
- package/dist/components/ui/form.d.ts +27 -0
- package/dist/components/ui/form.d.ts.map +1 -0
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/input-group.d.ts +18 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input-otp.d.ts +12 -0
- package/dist/components/ui/input-otp.d.ts.map +1 -0
- package/dist/components/ui/input.d.ts +12 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/item.d.ts +24 -0
- package/dist/components/ui/item.d.ts.map +1 -0
- package/dist/components/ui/kbd.d.ts +4 -0
- package/dist/components/ui/kbd.d.ts.map +1 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/menubar.d.ts +31 -0
- package/dist/components/ui/menubar.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +15 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/pagination.d.ts +15 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/popover.d.ts +11 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/progress.d.ts +19 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/radio-group.d.ts +11 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/resizable.d.ts +8 -0
- package/dist/components/ui/resizable.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +6 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/select.d.ts +27 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/shadcn/shadcn-accordion.d.ts +8 -0
- package/dist/components/ui/shadcn/shadcn-accordion.d.ts.map +1 -0
- package/dist/components/ui/shadcn/shadcn-alert-dialog.d.ts +19 -0
- package/dist/components/ui/shadcn/shadcn-alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/shadcn/shadcn-avatar.d.ts +12 -0
- package/dist/components/ui/shadcn/shadcn-avatar.d.ts.map +1 -0
- package/dist/components/ui/shadcn/shadcn-combobox.d.ts +33 -0
- package/dist/components/ui/shadcn/shadcn-combobox.d.ts.map +1 -0
- package/dist/components/ui/shadcn/shadcn-dropdown-menu.d.ts +30 -0
- package/dist/components/ui/shadcn/shadcn-dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/shadcn/shadcn-empty.d.ts +12 -0
- package/dist/components/ui/shadcn/shadcn-empty.d.ts.map +1 -0
- package/dist/components/ui/shadcn/shadcn-pagination.d.ts +18 -0
- package/dist/components/ui/shadcn/shadcn-pagination.d.ts.map +1 -0
- package/dist/components/ui/shadcn/shadcn-select.d.ts +24 -0
- package/dist/components/ui/shadcn/shadcn-select.d.ts.map +1 -0
- package/dist/components/ui/shadcn/shadcn-tabs.d.ts +12 -0
- package/dist/components/ui/shadcn/shadcn-tabs.d.ts.map +1 -0
- package/dist/components/ui/shadcn/shadcn-tooltip.d.ts +11 -0
- package/dist/components/ui/shadcn/shadcn-tooltip.d.ts.map +1 -0
- package/dist/components/ui/sheet.d.ts +28 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sidebar.d.ts +70 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/slider.d.ts +22 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/sonner.d.ts +5 -0
- package/dist/components/ui/sonner.d.ts.map +1 -0
- package/dist/components/ui/spinner.d.ts +3 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/switch.d.ts +12 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/table.d.ts +11 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/tabs.d.ts +22 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/textarea.d.ts +9 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +11 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle.d.ts +10 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/tooltip.d.ts +15 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/core.d.ts +2 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +3 -0
- package/dist/es6-D-3xKXBT.js +24045 -0
- package/dist/extended.d.ts +2 -0
- package/dist/extended.d.ts.map +1 -0
- package/dist/extended.js +3 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2194 -0
- package/dist/input-group-DIfVGMYe.js +5196 -0
- package/dist/input-otp-DwLGFwVo.js +11879 -0
- package/dist/lib/brand-theme.d.ts +4 -0
- package/dist/lib/brand-theme.d.ts.map +1 -0
- package/dist/lib/document-dark-mode.d.ts +8 -0
- package/dist/lib/document-dark-mode.d.ts.map +1 -0
- package/dist/lib/opsfuse-portal-theme.d.ts +21 -0
- package/dist/lib/opsfuse-portal-theme.d.ts.map +1 -0
- package/dist/lib/theme-scope.d.ts +3 -0
- package/dist/lib/theme-scope.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lucide-react-DLVJK_zM.js +38405 -0
- package/dist/public-api-core.d.ts +61 -0
- package/dist/public-api-core.d.ts.map +1 -0
- package/dist/public-api-extended.d.ts +9 -0
- package/dist/public-api-extended.d.ts.map +1 -0
- package/dist/public-api.d.ts +73 -0
- package/dist/public-api.d.ts.map +1 -0
- package/dist/recharts.d.ts +2 -0
- package/dist/recharts.d.ts.map +1 -0
- package/dist/recharts.js +2 -0
- package/dist/style.css +3 -0
- package/dist/style.layered.css +3 -0
- package/dist/toggle-group-D21Ul2kd.js +10171 -0
- package/package.json +113 -0
- package/scripts/postinstall.mjs +67 -0
- package/scripts/unwrap-css-layers.mjs +36 -0
package/package.json
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "opsfuse-ui",
|
|
3
|
+
"version": "0.1.0",
|
|
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
|
+
"./styles.css": "./dist/style.css",
|
|
37
|
+
"./styles.layered.css": "./dist/style.layered.css",
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
"sideEffects": [
|
|
41
|
+
"./dist/style.css",
|
|
42
|
+
"**/*.css"
|
|
43
|
+
],
|
|
44
|
+
"files": [
|
|
45
|
+
"dist",
|
|
46
|
+
"scripts",
|
|
47
|
+
".claude"
|
|
48
|
+
],
|
|
49
|
+
"scripts": {
|
|
50
|
+
"dev": "vite",
|
|
51
|
+
"build": "tsc -b && vite build",
|
|
52
|
+
"build:lib": "vite build --config vite.lib.config.ts",
|
|
53
|
+
"prepare": "npm run build:lib",
|
|
54
|
+
"postinstall": "node scripts/postinstall.mjs",
|
|
55
|
+
"prepublishOnly": "npm run build:lib",
|
|
56
|
+
"lint": "eslint .",
|
|
57
|
+
"preview": "vite preview",
|
|
58
|
+
"storybook": "storybook dev -p 6006",
|
|
59
|
+
"build-storybook": "storybook build"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"react": "^19.0.0",
|
|
63
|
+
"react-dom": "^19.0.0"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"@base-ui/react": "^1.4.0",
|
|
67
|
+
"@tailwindcss/vite": "^4.2.2",
|
|
68
|
+
"@tanstack/react-form": "^1.29.0",
|
|
69
|
+
"class-variance-authority": "^0.7.1",
|
|
70
|
+
"clsx": "^2.1.1",
|
|
71
|
+
"cmdk": "^1.1.1",
|
|
72
|
+
"date-fns": "^4.1.0",
|
|
73
|
+
"embla-carousel-react": "^8.6.0",
|
|
74
|
+
"input-otp": "^1.4.2",
|
|
75
|
+
"lucide-react": "^1.8.0",
|
|
76
|
+
"radix-ui": "^1.4.3",
|
|
77
|
+
"react-day-picker": "^9.14.0",
|
|
78
|
+
"react-is": "^19.2.5",
|
|
79
|
+
"react-resizable-panels": "^4.10.0",
|
|
80
|
+
"recharts": "^3.8.1",
|
|
81
|
+
"shadcn": "^4.2.0",
|
|
82
|
+
"sonner": "^2.0.7",
|
|
83
|
+
"tailwind-merge": "^3.5.0",
|
|
84
|
+
"tailwindcss": "^4.2.2",
|
|
85
|
+
"tw-animate-css": "^1.4.0",
|
|
86
|
+
"use-sync-external-store": "^1.6.0",
|
|
87
|
+
"vaul": "^1.1.2"
|
|
88
|
+
},
|
|
89
|
+
"devDependencies": {
|
|
90
|
+
"@eslint/js": "^10.0.1",
|
|
91
|
+
"@storybook/addon-docs": "^10.3.5",
|
|
92
|
+
"@storybook/addon-themes": "^10.3.5",
|
|
93
|
+
"@storybook/react": "^10.3.5",
|
|
94
|
+
"@storybook/react-vite": "^10.3.5",
|
|
95
|
+
"@types/node": "^25.6.0",
|
|
96
|
+
"@types/react": "^19.2.14",
|
|
97
|
+
"@types/react-dom": "^19.2.3",
|
|
98
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
99
|
+
"ajv": "^8.18.0",
|
|
100
|
+
"eslint": "^10.2.0",
|
|
101
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
102
|
+
"eslint-plugin-react-refresh": "^0.5.2",
|
|
103
|
+
"globals": "^17.5.0",
|
|
104
|
+
"postcss": "^8.5.10",
|
|
105
|
+
"react": "^19.2.5",
|
|
106
|
+
"react-dom": "^19.2.5",
|
|
107
|
+
"storybook": "^10.3.5",
|
|
108
|
+
"typescript": "~6.0.2",
|
|
109
|
+
"typescript-eslint": "^8.58.2",
|
|
110
|
+
"vite": "^8.0.8",
|
|
111
|
+
"vite-plugin-dts": "^4.5.4"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
|
|
37
|
+
const OPSFUSE_SKILLS = [
|
|
38
|
+
"opsfuse-components",
|
|
39
|
+
"opsfuse-color-theme",
|
|
40
|
+
"opsfuse-ui-consistency",
|
|
41
|
+
"opsfuse-setup",
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
if (!existsSync(skillsSource)) {
|
|
45
|
+
console.warn("[opsfuse-ui] Skills source not found — skipping Claude skill install.");
|
|
46
|
+
process.exit(0);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
let copied = 0;
|
|
50
|
+
|
|
51
|
+
for (const skill of OPSFUSE_SKILLS) {
|
|
52
|
+
const src = join(skillsSource, skill);
|
|
53
|
+
if (!existsSync(src)) continue;
|
|
54
|
+
|
|
55
|
+
const dest = join(skillsDest, skill);
|
|
56
|
+
mkdirSync(dest, { recursive: true });
|
|
57
|
+
cpSync(src, dest, { recursive: true, force: true });
|
|
58
|
+
copied++;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (copied > 0) {
|
|
62
|
+
const skillNames = OPSFUSE_SKILLS.slice(0, copied).map((s) => `/${s.replace("opsfuse-", "")}`).join(", ");
|
|
63
|
+
console.log(
|
|
64
|
+
`\n[opsfuse-ui] Installed ${copied} Claude Code skill(s) → .claude/skills/\n` +
|
|
65
|
+
` Available slash commands: ${skillNames}\n`
|
|
66
|
+
);
|
|
67
|
+
}
|
|
@@ -0,0 +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);
|