@ui8kit/uxdx 0.1.1 → 0.1.3

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.
Files changed (3) hide show
  1. package/README.md +91 -15
  2. package/dist/uxdx.mjs +36 -11
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -1,20 +1,33 @@
1
1
  # UXDX
2
2
 
3
- CLI to accumulate operator and developer experience packs. One binary, two
4
- commands. Package name: [`@ui8kit/uxdx`](https://www.npmjs.com/package/@ui8kit/uxdx).
3
+ CLI for operator files and SDLC harness packs. One binary (`uxdx`), two
4
+ commands. Package: [`@ui8kit/uxdx`](https://www.npmjs.com/package/@ui8kit/uxdx).
5
5
 
6
- Homepage: [github.com/ui8kit/uxdx](https://github.com/ui8kit/uxdx)
6
+ Repo: [github.com/ui8kit/uxdx](https://github.com/ui8kit/uxdx)
7
7
 
8
- ```text
9
- npx @ui8kit/uxdx --help
10
- npx @ui8kit/uxdx project | p | -p | --project [init] [--dir <path>] [--rules] [--force]
11
- npx @ui8kit/uxdx sdlc | s | -s | --sdlc [init] [--dir <path>] --level light|core|full [--force] [--no-install]
8
+ ## Run
9
+
10
+ Prefer Bun (no Node `punycode` warning from `npx`):
11
+
12
+ ```bash
13
+ bunx @ui8kit/uxdx --help
14
+ bunx @ui8kit/uxdx -p
15
+ bunx @ui8kit/uxdx -s --level light
12
16
  ```
13
17
 
14
- Same via Bun: `bunx @ui8kit/uxdx --help`.
18
+ Same via npm (`@ui8kit/uxdx@0.1.3` or later; `0.1.2` shims do not run Node):
15
19
 
16
- The binary is still `uxdx`. After a local or global install you can call it
17
- without the scope:
20
+ ```bash
21
+ npx @ui8kit/uxdx@latest --help
22
+ npx @ui8kit/uxdx@latest -- -p
23
+ npx @ui8kit/uxdx@latest -- -s --level light
24
+ ```
25
+
26
+ `npx` may print `DEP0040` / `punycode`. That comes from npm’s Node, not this
27
+ CLI. `--` keeps flags for `uxdx` (`npx` also has `-p`). Success still requires
28
+ `uxdx: project init` or `uxdx: sdlc …` after the warning.
29
+
30
+ After a local or global install the binary is unscoped:
18
31
 
19
32
  ```bash
20
33
  npm i -g @ui8kit/uxdx
@@ -24,15 +37,78 @@ npm i -D @ui8kit/uxdx
24
37
  npx uxdx --help
25
38
  ```
26
39
 
27
- - `project` writes `README.md`, `.gitignore`, `.cursorignore`, and `.manual/`.
28
- - `sdlc` copies a vendored harness pack into `.sdlc/`. `--level` is required.
29
- - After copy, `sdlc` runs `.sdlc/sdlc.sh install` unless `--no-install`.
40
+ ## Commands
41
+
42
+ Aliases are equivalent. `init` is the default and may be omitted.
43
+
44
+ ```text
45
+ uxdx [--help]
46
+ uxdx project | p | -p | --project [init] [--dir <path>] [--rules] [--force]
47
+ uxdx sdlc | s | -s | --sdlc [init] [--dir <path>] --level light|core|full [--force] [--no-install]
48
+ ```
49
+
50
+ | Flag | Command | Meaning |
51
+ | --- | --- | --- |
52
+ | `--dir <path>` | both | Target repo (default: cwd) |
53
+ | `--force` | both | Overwrite files this tool owns |
54
+ | `--rules` | `project` | Stub `.cursor/rules/uxdx.mdc` if missing |
55
+ | `--level` | `sdlc` | Required: `light`, `core`, or `full` |
56
+ | `--no-install` | `sdlc` | Copy `.sdlc/` only; skip `sdlc.sh install` |
57
+
58
+ ### `project` (`-p`)
59
+
60
+ Writes the default operator layout. Existing filled files are left alone
61
+ unless `--force`. If `.manual/` already exists, it is not touched.
62
+
63
+ ```bash
64
+ bunx @ui8kit/uxdx -p
65
+ bunx @ui8kit/uxdx -p --dir ./my-repo --rules
66
+ ```
67
+
68
+ Creates or updates:
69
+
70
+ - `README.md` (only if missing)
71
+ - `.gitignore` (`.manual/*` + `!.manual/.gitkeep`)
72
+ - `.cursorignore` (`.manual/`)
73
+ - `.project/README.md` stub
74
+ - `.manual/.gitkeep` (only if `.manual/` is missing)
30
75
 
31
- ## Local
76
+ Success:
77
+
78
+ ```text
79
+ uxdx: project init in <dir>
80
+ README.md
81
+ .gitignore
82
+ .cursorignore
83
+ .project/
84
+ .manual/
85
+ ```
86
+
87
+ ### `sdlc` (`-s`)
88
+
89
+ Copies one vendored pack into `.sdlc/`. `--level` is required (no silent
90
+ `full`). Then runs `.sdlc/sdlc.sh install` unless `--no-install`.
91
+
92
+ ```bash
93
+ bunx @ui8kit/uxdx -s --level light
94
+ bunx @ui8kit/uxdx -s --level core --dir ./my-repo
95
+ bunx @ui8kit/uxdx -s --level full --no-install
96
+ ```
97
+
98
+ Do not stack two levels in one repo. Use `--force` only to replace a
99
+ different level.
100
+
101
+ Pack source: `packages/sdlc/harness/`.
102
+
103
+ ## This checkout
32
104
 
33
105
  ```bash
34
106
  bun install
35
107
  bun test
36
- bun run uxdx -- --help
37
108
  bun run build
109
+ bun run uxdx -- --help
110
+ bun run uxdx -- -p --help
111
+ bun run uxdx -- -s --help
38
112
  ```
113
+
114
+ `--` after `bun run uxdx` is required so flags go to the CLI, not to Bun.
package/dist/uxdx.mjs CHANGED
@@ -1,5 +1,4 @@
1
- import { createRequire } from "node:module";
2
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
1
+ #!/usr/bin/env node
3
2
 
4
3
  // packages/cli/src/parse.ts
5
4
  var LEVELS = new Set(["light", "core", "full"]);
@@ -91,7 +90,7 @@ Usage:
91
90
  uxdx project | p | -p | --project [init] [--dir <path>] [--rules] [--force]
92
91
  uxdx sdlc | s | -s | --sdlc [init] [--dir <path>] --level light|core|full [--force] [--no-install]
93
92
 
94
- -p / --project Scaffold README, ignores, and .manual/
93
+ -p / --project Scaffold README, ignores, and .manual/.gitkeep if missing
95
94
  -s / --sdlc Install an SDLC harness pack into .sdlc/
96
95
 
97
96
  Run uxdx project --help or uxdx sdlc --help for command flags.
@@ -141,6 +140,35 @@ function writeIfMissing(file, body, force) {
141
140
  return;
142
141
  writeFileSync(file, body);
143
142
  }
143
+ function ensureManualGitignore(file) {
144
+ const block = `.manual/*
145
+ !.manual/.gitkeep
146
+ `;
147
+ if (!existsSync(file)) {
148
+ writeFileSync(file, block);
149
+ return;
150
+ }
151
+ const cur = readFileSync(file, "utf8");
152
+ const lines = cur.split(/\r?\n/);
153
+ if (lines.some((l) => l.trim() === ".manual/*")) {
154
+ ensureLine(file, "!.manual/.gitkeep", false);
155
+ return;
156
+ }
157
+ const withoutFull = lines.filter((l) => l.trim() !== ".manual/");
158
+ const next = withoutFull.join(`
159
+ `);
160
+ const nl = next.endsWith(`
161
+ `) || next.length === 0 ? "" : `
162
+ `;
163
+ writeFileSync(file, `${next}${nl}${block}`);
164
+ }
165
+ function ensureManualDir(root) {
166
+ const dir = join(root, ".manual");
167
+ if (existsSync(dir))
168
+ return;
169
+ mkdirSync(dir, { recursive: true });
170
+ writeFileSync(join(dir, ".gitkeep"), "");
171
+ }
144
172
  function initProject(opts) {
145
173
  const root = opts.dir;
146
174
  mkdirSync(root, { recursive: true });
@@ -150,7 +178,7 @@ function initProject(opts) {
150
178
  writeIfMissing(readme, `# ${name}
151
179
  `, opts.force);
152
180
  done.push("README.md");
153
- ensureLine(join(root, ".gitignore"), ".manual/", opts.force);
181
+ ensureManualGitignore(join(root, ".gitignore"));
154
182
  done.push(".gitignore");
155
183
  ensureLine(join(root, ".cursorignore"), ".manual/", opts.force);
156
184
  done.push(".cursorignore");
@@ -161,7 +189,7 @@ function initProject(opts) {
161
189
  Operator notes for this repository. See \`intent.md\` when present.
162
190
  `, opts.force);
163
191
  done.push(".project/");
164
- mkdirSync(join(root, ".manual"), { recursive: true });
192
+ ensureManualDir(root);
165
193
  done.push(".manual/");
166
194
  if (opts.rules) {
167
195
  const rulesDir = join(root, ".cursor", "rules");
@@ -288,9 +316,6 @@ function run(argv) {
288
316
  return 1;
289
317
  }
290
318
  }
291
- if (__require.main == __require.module) {
292
- process.exit(run(process.argv));
293
- }
294
- export {
295
- run
296
- };
319
+
320
+ // packages/cli/src/bin.ts
321
+ process.exit(run(process.argv));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui8kit/uxdx",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "CLI to accumulate operator and developer experience packs",
5
5
  "type": "module",
6
6
  "bin": {
@@ -37,8 +37,8 @@
37
37
  "license": "MIT",
38
38
  "homepage": "https://github.com/ui8kit/uxdx",
39
39
  "scripts": {
40
- "build": "bun build packages/cli/src/main.ts --outfile dist/uxdx.mjs --target node",
41
- "uxdx": "bun packages/cli/src/main.ts",
40
+ "build": "bun build packages/cli/src/bin.ts --outfile dist/uxdx.mjs --target node",
41
+ "uxdx": "bun packages/cli/src/bin.ts",
42
42
  "test": "bun test",
43
43
  "prepack": "bun run build",
44
44
  "prepublishOnly": "bun test && bun run build",