@lyda/kilo-ui 0.1.0 → 0.1.1

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 CHANGED
@@ -8,21 +8,17 @@ This package does **not** work like a normal UI runtime dependency. It works lik
8
8
 
9
9
  From any Vue project:
10
10
 
11
- ```bash
12
- npm install -D "C:\UI Library"
13
- npx kilo-ui init
14
- npx kilo-ui add data-table app-navbar activity-log
15
- ```
16
-
17
- After you **publish** this project to npm, install the **exact** `name` from its `package.json` (for example `@ui-library/kilo-ui`).
11
+ After you **publish** this project to npm, install the **exact** `name` from its `package.json` (for example `@lyda/kilo-ui`).
18
12
  **Do not** run `npm install -D kilo-ui` expecting this Vue CLI — the public npm name `kilo-ui` is already used by a different project.
19
13
 
20
14
  ```bash
21
- npm install -D @ui-library/kilo-ui
15
+ npm install -D @lyda/kilo-ui
22
16
  npx kilo-ui init
23
17
  npx kilo-ui add data-table
24
18
  ```
25
19
 
20
+ If the package was published with an installer hook, `npm install -D ...` will run `kilo-ui init` automatically once. If you use `--ignore-scripts`, run `npx kilo-ui init` manually.
21
+
26
22
  **Note:** The public npm name `kilo-ui` may point to a different project (not this Vue CLI). If `npm install -D kilo-ui` pulls SvelteKit or other wrong peers, use a scoped name or install from `file:` / Git. See [Installation](docs/docs/installation.md) in the docs site.
27
23
 
28
24
  ## What `init` Creates
@@ -159,7 +155,7 @@ Editing a component? Update the file in `registry/`. The CLI and docs both pick
159
155
  5. Consumers install with:
160
156
 
161
157
  ```bash
162
- npm install -D @ui-library/kilo-ui
158
+ npm install -D @lyda/kilo-ui
163
159
  npx kilo-ui init
164
160
  npx kilo-ui add data-table
165
161
  ```
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync } from 'node:fs'
3
+ import { dirname, join, resolve } from 'node:path'
4
+ import { fileURLToPath } from 'node:url'
5
+ import { spawnSync } from 'node:child_process'
6
+
7
+ const __dirname = dirname(fileURLToPath(import.meta.url))
8
+ const packageRoot = resolve(__dirname, '..')
9
+
10
+ const initCwd = process.env.INIT_CWD
11
+ if (!initCwd) process.exit(0)
12
+
13
+ // Avoid running when installing this repo itself.
14
+ if (resolve(initCwd) === packageRoot) process.exit(0)
15
+
16
+ // Only run once; if the user already initialized, do nothing.
17
+ if (existsSync(join(initCwd, 'components.json'))) process.exit(0)
18
+
19
+ const cliEntry = join(packageRoot, 'bin', 'kilo-ui.mjs')
20
+
21
+ const result = spawnSync(process.execPath, [cliEntry, 'init'], {
22
+ cwd: initCwd,
23
+ stdio: 'inherit',
24
+ })
25
+
26
+ process.exit(result.status ?? 1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyda/kilo-ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "shadcn-style Vue component registry for team CRUD apps",
5
5
  "type": "module",
6
6
  "repository": {
@@ -23,6 +23,7 @@
23
23
  "README.md"
24
24
  ],
25
25
  "scripts": {
26
+ "postinstall": "node bin/postinstall.mjs",
26
27
  "docs:dev": "vitepress dev docs",
27
28
  "docs:build": "vitepress build docs",
28
29
  "docs:preview": "vitepress preview docs",