@nodii/dev 0.6.98 → 0.6.100
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/dist/core.js +1 -1
- package/dist/runtime-launcher.js +20 -0
- package/dist/surface.js +11 -2
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -4,7 +4,7 @@ import { chmod, mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
|
4
4
|
import { homedir, platform } from "node:os";
|
|
5
5
|
import { dirname, join } from "node:path";
|
|
6
6
|
|
|
7
|
-
export const VERSION = "0.6.
|
|
7
|
+
export const VERSION = "0.6.100";
|
|
8
8
|
export const configPath = () =>
|
|
9
9
|
process.env.NODII_DEV_CONFIG_PATH ??
|
|
10
10
|
join(homedir(), ".config/nodii-dev/config.json");
|
package/dist/runtime-launcher.js
CHANGED
|
@@ -90,6 +90,25 @@ function profileVariable(runtime, profileHome, home) {
|
|
|
90
90
|
: { CLAUDE_CONFIG_DIR: profileHome };
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
// The Freeze is a snapshot from the lane's last gather, so an amendment since is
|
|
94
|
+
// not in it (hub-289: lanes relaunched on stale rules until told directly).
|
|
95
|
+
function amendmentsSinceFreeze(lane, freeze) {
|
|
96
|
+
const notes = freeze?.objective?.laneNotes ?? [];
|
|
97
|
+
const inFreeze = notes.reduce((highest, note) => {
|
|
98
|
+
const version = Number(/^(?:Scope|Rules) \(amendment (\d+)\): /.exec(note)?.[1] ?? 0);
|
|
99
|
+
return Math.max(highest, version);
|
|
100
|
+
}, 0);
|
|
101
|
+
const later = (lane?.amendments ?? [])
|
|
102
|
+
.filter((amendment) => amendment.version > inFreeze)
|
|
103
|
+
.sort((a, b) => a.version - b.version);
|
|
104
|
+
if (!later.length) return [];
|
|
105
|
+
return [
|
|
106
|
+
"Amendments since that Freeze. They change the lane, and where they disagree with it or each other the newest wins:",
|
|
107
|
+
...later.map(({ version, reason, change }) => `v${version}${reason ? ` (${reason})` : ""}: ${printable(change)}`),
|
|
108
|
+
"",
|
|
109
|
+
];
|
|
110
|
+
}
|
|
111
|
+
|
|
93
112
|
/** Build the complete recovery message passed to the fresh runtime over stdin. */
|
|
94
113
|
export function buildRecoveryPrompt(data) {
|
|
95
114
|
const { runId, laneKey } = validateData(data);
|
|
@@ -103,6 +122,7 @@ export function buildRecoveryPrompt(data) {
|
|
|
103
122
|
"",
|
|
104
123
|
`Freeze:\n${printable(data.recovery?.freeze)}`,
|
|
105
124
|
"",
|
|
125
|
+
...amendmentsSinceFreeze(data.lane, data.recovery?.freeze),
|
|
106
126
|
`Dead run log tail:\n${printable(data.recovery?.logTail)}`,
|
|
107
127
|
"",
|
|
108
128
|
].join("\n");
|
package/dist/surface.js
CHANGED
|
@@ -460,7 +460,7 @@ const JS_LITERALS = new Set(["true", "false", "null", "undefined", "this"]);
|
|
|
460
460
|
|
|
461
461
|
function dataProps(views) {
|
|
462
462
|
const data = new Map();
|
|
463
|
-
const entry = (name) => data.get(name) ?? data.set(name, { attrs: new Set(), child: false, members: new Map() }).get(name);
|
|
463
|
+
const entry = (name) => data.get(name) ?? data.set(name, { attrs: new Set(), child: false, nested: false, members: new Map() }).get(name);
|
|
464
464
|
for (const view of views) {
|
|
465
465
|
view.uses = new Set();
|
|
466
466
|
const body = view.body;
|
|
@@ -479,6 +479,14 @@ function dataProps(views) {
|
|
|
479
479
|
entry(m[2]).child = true;
|
|
480
480
|
view.uses.add(m[2]);
|
|
481
481
|
}
|
|
482
|
+
// A value inside an object prop (`chip={{ label: chipLabel }}`, `points: series1Points`).
|
|
483
|
+
// Strings go first, so a colon in text or a class name is never read as one.
|
|
484
|
+
const noStrings = body.replace(/"(?:[^"\\\n]|\\.)*"|`[^`]*`/g, '""');
|
|
485
|
+
for (const m of noStrings.matchAll(/\b[A-Za-z_]\w*:\s*([a-z][A-Za-z0-9]*)(?=\s*[,}\]])/g)) {
|
|
486
|
+
if (JS_LITERALS.has(m[1])) continue;
|
|
487
|
+
entry(m[1]).nested = true;
|
|
488
|
+
view.uses.add(m[1]);
|
|
489
|
+
}
|
|
482
490
|
}
|
|
483
491
|
return data;
|
|
484
492
|
}
|
|
@@ -497,7 +505,8 @@ function openingTag(body, at) {
|
|
|
497
505
|
}
|
|
498
506
|
|
|
499
507
|
const propType = (d) => {
|
|
500
|
-
|
|
508
|
+
// A value nested in an object prop has no ComponentProps path the generator can name.
|
|
509
|
+
const parts = [...d.attrs, ...(d.child ? ["ReactNode"] : []), ...(d.nested ? ["any"] : [])];
|
|
501
510
|
if (d.members.size) parts.push(`{ ${[...d.members.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([k, refs]) => `${k}: ${[...refs].join(" & ")}`).join("; ")} }`);
|
|
502
511
|
return parts.join(" & ");
|
|
503
512
|
};
|