@cocoar/vue-ui 3.2.0-beta.6 → 3.2.0-beta.7

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/bin/cli.mjs ADDED
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env node
2
+ // `npx @cocoar/vue-ui skill` — install the Agent Skill that ships in this package.
3
+ //
4
+ // The skill sits in skills/cocoar-vue-ui/ at the package root. The skills CLI (npx skills,
5
+ // https://github.com/vercel-labs/skills) installs skills from git repos and local folders but
6
+ // has no npm source, so the plain command would be `npx skills add ./node_modules/@cocoar/vue-ui`.
7
+ // This bin resolves that path for the caller and hands everything else — agent detection,
8
+ // install directories, lockfile, `npx skills update` — to the skills CLI. Extra arguments pass
9
+ // through (`-g`, `-a claude-code`, `--copy`, `-y`, …).
10
+
11
+ import { spawnSync } from 'node:child_process';
12
+ import { existsSync } from 'node:fs';
13
+ import path from 'node:path';
14
+ import { fileURLToPath } from 'node:url';
15
+
16
+ const packageDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
17
+ const skillDir = path.join(packageDir, 'skills', 'cocoar-vue-ui');
18
+ const [command, ...rest] = process.argv.slice(2);
19
+
20
+ if (command !== 'skill' || rest.includes('--help') || rest.includes('-h')) {
21
+ console.log(`Usage: npx @cocoar/vue-ui skill [skills-cli options]
22
+
23
+ Installs the Cocoar UI Vue Agent Skill for Claude Code, Cursor, Codex, Copilot and other
24
+ agents via the skills CLI (npx skills add). Options are passed through, for example:
25
+
26
+ npx @cocoar/vue-ui skill interactive: pick agents
27
+ npx @cocoar/vue-ui skill -y accept defaults
28
+ npx @cocoar/vue-ui skill -g install user-wide instead of into the project
29
+ npx @cocoar/vue-ui skill -a claude-code target one agent
30
+
31
+ Skill source: ${skillDir}`);
32
+ process.exit(command === 'skill' ? 0 : 1);
33
+ }
34
+
35
+ if (!existsSync(path.join(skillDir, 'SKILL.md'))) {
36
+ console.error(`No skill found at ${skillDir} — this build of @cocoar/vue-ui does not ship one.`);
37
+ process.exit(1);
38
+ }
39
+
40
+ // npx is a .cmd shim on Windows, which Node only runs through a shell; quote the path for it.
41
+ const windows = process.platform === 'win32';
42
+ const quote = (arg) => (windows && /[\s"]/.test(arg) ? `"${arg.replace(/"/g, '\\"')}"` : arg);
43
+ const result = spawnSync('npx', ['--yes', 'skills', 'add', packageDir, ...rest].map(quote), {
44
+ stdio: 'inherit',
45
+ shell: windows,
46
+ });
47
+
48
+ if (result.error) {
49
+ console.error(`Could not run the skills CLI (${result.error.message}).`);
50
+ console.error(`Install it by hand instead: npx skills add ${packageDir}`);
51
+ process.exit(1);
52
+ }
53
+ process.exit(result.status ?? 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocoar/vue-ui",
3
- "version": "3.2.0-beta.6",
3
+ "version": "3.2.0-beta.7",
4
4
  "description": "Cocoar Design System — a touch-first Vue 3 component library with 30+ accessible, themeable components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -38,7 +38,11 @@
38
38
  "types": "./dist/fonts.d.ts"
39
39
  }
40
40
  },
41
+ "bin": {
42
+ "cocoar-vue-ui": "./bin/cli.mjs"
43
+ },
41
44
  "files": [
45
+ "bin",
42
46
  "dist",
43
47
  "styles",
44
48
  "skills"
@@ -51,7 +55,7 @@
51
55
  "typecheck": "vue-tsc --noEmit"
52
56
  },
53
57
  "dependencies": {
54
- "@cocoar/vue-localization": "3.2.0-beta.6",
58
+ "@cocoar/vue-localization": "3.2.0-beta.7",
55
59
  "@fontsource/cascadia-code": "^5.2.3",
56
60
  "@fontsource/inter": "^5.2.8",
57
61
  "@fontsource/poppins": "^5.2.7",
@@ -91,26 +91,23 @@ in your project knows the library's API and the mistakes it would otherwise make
91
91
  `skills/` folder at the package root and takes no part in your build: nothing is loaded unless you
92
92
  install it.
93
93
 
94
- With the [skills CLI](https://github.com/vercel-labs/skills) (no extra tooling; Claude Code,
95
- Cursor, Codex, Copilot and others):
94
+ Once `@cocoar/vue-ui` is installed, one command installs the skill of exactly that version:
96
95
 
97
96
  ```bash
98
- # From the installed package — matches the version you use
99
- npx skills add ./node_modules/@cocoar/vue-ui
100
-
101
- # Or straight from GitHub — the latest docs
102
- npx skills add cocoar-dev/cocoar-ui-vue
97
+ npx @cocoar/vue-ui skill
103
98
  ```
104
99
 
105
- With [agentskills-cli](https://mysticmind.github.io/agentskills-cli/) (a .NET tool that also
106
- reads npm packages):
100
+ It hands the package's skill folder to the [skills CLI](https://github.com/vercel-labs/skills),
101
+ which detects the agents in your project (Claude Code, Cursor, Codex, Copilot and others) and
102
+ asks where to install. Its options pass through: `-y` accepts the defaults, `-g` installs
103
+ user-wide instead of into the project, `-a claude-code` targets one agent.
107
104
 
108
- ```bash
109
- agentskills-cli add @cocoar/vue-ui
110
- ```
105
+ Two alternatives: `npx skills add cocoar-dev/cocoar-ui-vue` takes the latest docs straight from
106
+ GitHub, and [agentskills-cli](https://mysticmind.github.io/agentskills-cli/) (a .NET tool that
107
+ also reads npm packages) installs it with `agentskills-cli add @cocoar/vue-ui`.
111
108
 
112
109
  Either places the skill in `.claude/skills/` for Claude Code and `.agents/skills/` for the
113
- agents that read the standard; `-g` installs it globally instead. Without a tool, copy
110
+ agents that read the standard. Without a tool, copy
114
111
  `node_modules/@cocoar/vue-ui/skills/cocoar-vue-ui/` into the same folder by hand.
115
112
 
116
113
  The skill is generated from these docs, so it says what the docs say for the version you