rahman-resources 1.14.0 → 1.14.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.
- package/bin/cli.js +5 -1
- package/bin/compose-state.mjs +4 -2
- package/bin/migrate-load.mjs +4 -1
- package/lib/dna.mjs +2 -1
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -167,6 +167,10 @@ ${kleur.dim("Consumer's components/ui/ + lib/utils.ts (shadcn) are never touched
|
|
|
167
167
|
|
|
168
168
|
// ─── flag parsing ─────────────────────────────────────────────────────────
|
|
169
169
|
|
|
170
|
+
// Flags that take a value (`--flag x`). Anything else is boolean, so a boolean
|
|
171
|
+
// flag placed before a positional no longer swallows that positional.
|
|
172
|
+
const VALUE_FLAGS = new Set(["target", "template", "category", "at", "skills", "features"]);
|
|
173
|
+
|
|
170
174
|
function parseFlags(rest) {
|
|
171
175
|
const positional = [];
|
|
172
176
|
const flags = {};
|
|
@@ -175,7 +179,7 @@ function parseFlags(rest) {
|
|
|
175
179
|
if (a.startsWith("--")) {
|
|
176
180
|
const key = a.slice(2);
|
|
177
181
|
const next = rest[i + 1];
|
|
178
|
-
if (next && !next.startsWith("--")) { flags[key] = next; i++; }
|
|
182
|
+
if (VALUE_FLAGS.has(key) && next && !next.startsWith("--")) { flags[key] = next; i++; }
|
|
179
183
|
else flags[key] = true;
|
|
180
184
|
} else {
|
|
181
185
|
positional.push(a);
|
package/bin/compose-state.mjs
CHANGED
|
@@ -50,9 +50,11 @@ export function readStateFromRr(rrPath) {
|
|
|
50
50
|
};
|
|
51
51
|
const auth = provider ? authMap[provider] ?? undefined : undefined;
|
|
52
52
|
|
|
53
|
+
const slicesArr = Array.isArray(raw?.slices) ? raw.slices : [];
|
|
54
|
+
const featuresArr = Array.isArray(raw?.features) ? raw.features : [];
|
|
53
55
|
const slicesInstalled = [
|
|
54
|
-
...
|
|
55
|
-
...
|
|
56
|
+
...slicesArr.map((s) => s?.slug).filter(Boolean),
|
|
57
|
+
...featuresArr.map((f) => f?.slug).filter(Boolean),
|
|
56
58
|
];
|
|
57
59
|
|
|
58
60
|
return {
|
package/bin/migrate-load.mjs
CHANGED
|
@@ -10,6 +10,9 @@ import { spawnSync } from "node:child_process";
|
|
|
10
10
|
import path from "node:path";
|
|
11
11
|
import { loadSliceContract } from "../lib/load-contract.mjs";
|
|
12
12
|
|
|
13
|
+
// Flags that take a value; anything else is boolean (mirrors cli.js parseFlags).
|
|
14
|
+
const VALUE_FLAGS = new Set(["from", "to", "repo-root"]);
|
|
15
|
+
|
|
13
16
|
export function parseFlags(rest) {
|
|
14
17
|
const positional = [];
|
|
15
18
|
const flags = {};
|
|
@@ -18,7 +21,7 @@ export function parseFlags(rest) {
|
|
|
18
21
|
if (a.startsWith("--")) {
|
|
19
22
|
const key = a.slice(2);
|
|
20
23
|
const next = rest[i + 1];
|
|
21
|
-
if (next && !next.startsWith("--")) {
|
|
24
|
+
if (VALUE_FLAGS.has(key) && next && !next.startsWith("--")) {
|
|
22
25
|
flags[key] = next;
|
|
23
26
|
i++;
|
|
24
27
|
} else {
|
package/lib/dna.mjs
CHANGED
|
@@ -132,7 +132,8 @@ export function listAllDNA() {
|
|
|
132
132
|
const out = [];
|
|
133
133
|
for (const f of files) {
|
|
134
134
|
const slug = f.replace(/\.dna\.json$/, "");
|
|
135
|
-
|
|
135
|
+
let dna = null;
|
|
136
|
+
try { dna = readDNA(slug); } catch { /* skip corrupt/oddly-named lineage file, don't crash the listing */ }
|
|
136
137
|
if (dna) out.push(dna);
|
|
137
138
|
}
|
|
138
139
|
// Stable ordering — alphabetical by slug.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rahman-resources",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.2",
|
|
4
4
|
"description": "Rahman Resources (rr) — shadcn-style installer for vertical slices. `npx resources add <slug>` copies slice into your project's `slices/<slug>/`. You own the files.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|