@ui8kit/uxdx 0.1.1 → 0.1.2

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 +90 -14
  2. package/dist/uxdx.mjs +35 -12
  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
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
16
+ ```
17
+
18
+ Same via npm:
19
+
20
+ ```bash
9
21
  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]
22
+ npx @ui8kit/uxdx -p
23
+ npx @ui8kit/uxdx -s --level light
12
24
  ```
13
25
 
14
- Same via Bun: `bunx @ui8kit/uxdx --help`.
26
+ `npx` may print `DEP0040` / `punycode`. That comes from npm’s Node, not this
27
+ CLI. The command still runs if you then see `uxdx: project init` or
28
+ `uxdx: sdlc …`.
15
29
 
16
- The binary is still `uxdx`. After a local or global install you can call it
17
- without the scope:
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,6 +1,3 @@
1
- import { createRequire } from "node:module";
2
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
3
-
4
1
  // packages/cli/src/parse.ts
5
2
  var LEVELS = new Set(["light", "core", "full"]);
6
3
  function takeFlag(rest, name) {
@@ -91,7 +88,7 @@ Usage:
91
88
  uxdx project | p | -p | --project [init] [--dir <path>] [--rules] [--force]
92
89
  uxdx sdlc | s | -s | --sdlc [init] [--dir <path>] --level light|core|full [--force] [--no-install]
93
90
 
94
- -p / --project Scaffold README, ignores, and .manual/
91
+ -p / --project Scaffold README, ignores, and .manual/.gitkeep if missing
95
92
  -s / --sdlc Install an SDLC harness pack into .sdlc/
96
93
 
97
94
  Run uxdx project --help or uxdx sdlc --help for command flags.
@@ -141,6 +138,35 @@ function writeIfMissing(file, body, force) {
141
138
  return;
142
139
  writeFileSync(file, body);
143
140
  }
141
+ function ensureManualGitignore(file) {
142
+ const block = `.manual/*
143
+ !.manual/.gitkeep
144
+ `;
145
+ if (!existsSync(file)) {
146
+ writeFileSync(file, block);
147
+ return;
148
+ }
149
+ const cur = readFileSync(file, "utf8");
150
+ const lines = cur.split(/\r?\n/);
151
+ if (lines.some((l) => l.trim() === ".manual/*")) {
152
+ ensureLine(file, "!.manual/.gitkeep", false);
153
+ return;
154
+ }
155
+ const withoutFull = lines.filter((l) => l.trim() !== ".manual/");
156
+ const next = withoutFull.join(`
157
+ `);
158
+ const nl = next.endsWith(`
159
+ `) || next.length === 0 ? "" : `
160
+ `;
161
+ writeFileSync(file, `${next}${nl}${block}`);
162
+ }
163
+ function ensureManualDir(root) {
164
+ const dir = join(root, ".manual");
165
+ if (existsSync(dir))
166
+ return;
167
+ mkdirSync(dir, { recursive: true });
168
+ writeFileSync(join(dir, ".gitkeep"), "");
169
+ }
144
170
  function initProject(opts) {
145
171
  const root = opts.dir;
146
172
  mkdirSync(root, { recursive: true });
@@ -150,7 +176,7 @@ function initProject(opts) {
150
176
  writeIfMissing(readme, `# ${name}
151
177
  `, opts.force);
152
178
  done.push("README.md");
153
- ensureLine(join(root, ".gitignore"), ".manual/", opts.force);
179
+ ensureManualGitignore(join(root, ".gitignore"));
154
180
  done.push(".gitignore");
155
181
  ensureLine(join(root, ".cursorignore"), ".manual/", opts.force);
156
182
  done.push(".cursorignore");
@@ -161,7 +187,7 @@ function initProject(opts) {
161
187
  Operator notes for this repository. See \`intent.md\` when present.
162
188
  `, opts.force);
163
189
  done.push(".project/");
164
- mkdirSync(join(root, ".manual"), { recursive: true });
190
+ ensureManualDir(root);
165
191
  done.push(".manual/");
166
192
  if (opts.rules) {
167
193
  const rulesDir = join(root, ".cursor", "rules");
@@ -288,9 +314,6 @@ function run(argv) {
288
314
  return 1;
289
315
  }
290
316
  }
291
- if (__require.main == __require.module) {
292
- process.exit(run(process.argv));
293
- }
294
- export {
295
- run
296
- };
317
+
318
+ // packages/cli/src/bin.ts
319
+ 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.2",
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",