@wildorder/nightshift 0.4.0 → 0.6.0
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/author.d.ts +3 -0
- package/dist/author.d.ts.map +1 -1
- package/dist/author.js +169 -18
- package/dist/author.js.map +1 -1
- package/dist/ci-init.d.ts +51 -0
- package/dist/ci-init.d.ts.map +1 -0
- package/dist/ci-init.js +274 -0
- package/dist/ci-init.js.map +1 -0
- package/dist/cli.js +99 -11
- package/dist/cli.js.map +1 -1
- package/dist/decide.d.ts.map +1 -1
- package/dist/decide.js +1 -1
- package/dist/decide.js.map +1 -1
- package/dist/exit-codes.d.ts +44 -0
- package/dist/exit-codes.d.ts.map +1 -0
- package/dist/exit-codes.js +49 -0
- package/dist/exit-codes.js.map +1 -0
- package/dist/findings.d.ts +3 -21
- package/dist/findings.d.ts.map +1 -1
- package/dist/findings.js +0 -7
- package/dist/findings.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/program-branch.d.ts +65 -0
- package/dist/program-branch.d.ts.map +1 -0
- package/dist/program-branch.js +123 -0
- package/dist/program-branch.js.map +1 -0
- package/dist/publish.d.ts +105 -0
- package/dist/publish.d.ts.map +1 -0
- package/dist/publish.js +549 -0
- package/dist/publish.js.map +1 -0
- package/dist/report-path.d.ts +7 -0
- package/dist/report-path.d.ts.map +1 -0
- package/dist/report-path.js +10 -0
- package/dist/report-path.js.map +1 -0
- package/dist/review-pass.d.ts +64 -0
- package/dist/review-pass.d.ts.map +1 -0
- package/dist/review-pass.js +370 -0
- package/dist/review-pass.js.map +1 -0
- package/dist/run-program.d.ts +18 -0
- package/dist/run-program.d.ts.map +1 -1
- package/dist/run-program.js +369 -28
- package/dist/run-program.js.map +1 -1
- package/dist/run-publish.d.ts +41 -0
- package/dist/run-publish.d.ts.map +1 -0
- package/dist/run-publish.js +33 -0
- package/dist/run-publish.js.map +1 -0
- package/package.json +4 -3
- package/skills/plan-program/SKILL.md +14 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type RunProgramOptions, type RunProgramResult } from "./run-program.js";
|
|
2
|
+
import { type PublishResult } from "./publish.js";
|
|
3
|
+
/** What happened to the optional publish step, for the CLI to print. */
|
|
4
|
+
export type PublishOutcome = {
|
|
5
|
+
status: "skipped";
|
|
6
|
+
} | {
|
|
7
|
+
status: "published";
|
|
8
|
+
result: PublishResult;
|
|
9
|
+
} | {
|
|
10
|
+
status: "failed";
|
|
11
|
+
error: Error;
|
|
12
|
+
};
|
|
13
|
+
export interface RunAndPublishOptions extends RunProgramOptions {
|
|
14
|
+
/** Whether `--publish` was passed. */
|
|
15
|
+
publish: boolean;
|
|
16
|
+
/** Injected for tests; default is the real WS-03 publish. */
|
|
17
|
+
publishProgram?: (options: {
|
|
18
|
+
cwd: string;
|
|
19
|
+
programId: string;
|
|
20
|
+
}) => Promise<PublishResult>;
|
|
21
|
+
/** Injected for tests; default is the real runner. */
|
|
22
|
+
runProgram?: (options: RunProgramOptions) => Promise<RunProgramResult>;
|
|
23
|
+
}
|
|
24
|
+
export interface RunAndPublishOutcome {
|
|
25
|
+
result: RunProgramResult;
|
|
26
|
+
publish: PublishOutcome;
|
|
27
|
+
/** The process exit code the CLI should set. Never applied here. */
|
|
28
|
+
exitCode: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Runs a program, then — only when `--publish` was passed — awaits the same
|
|
32
|
+
* `publish` path the standalone command calls, before returning. A
|
|
33
|
+
* could-not-start throw from `runProgram` propagates untouched: publish is
|
|
34
|
+
* never reached, so a run that never began publishes nothing. A publish
|
|
35
|
+
* failure is caught and reported, never allowed to overwrite the run's own
|
|
36
|
+
* exit code (a partial build stays 2, a complete run stays 0). Sets neither
|
|
37
|
+
* `process.exitCode` nor calls `process.exit` — the caller applies the
|
|
38
|
+
* returned code.
|
|
39
|
+
*/
|
|
40
|
+
export declare function runAndPublish(options: RunAndPublishOptions): Promise<RunAndPublishOutcome>;
|
|
41
|
+
//# sourceMappingURL=run-publish.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-publish.d.ts","sourceRoot":"","sources":["../src/run-publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC7F,OAAO,EAA6B,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7E,wEAAwE;AACxE,MAAM,MAAM,cAAc,GACtB;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GACrB;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,GAC9C;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC;AAEvC,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D,sCAAsC;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,6DAA6D;IAC7D,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IACzF,sDAAsD;IACtD,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACxE;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,gBAAgB,CAAC;IACzB,OAAO,EAAE,cAAc,CAAC;IACxB,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,CAoB/B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { runProgram } from "./run-program.js";
|
|
2
|
+
import { publish as publishProgram } from "./publish.js";
|
|
3
|
+
import { exitCodeForResult } from "./exit-codes.js";
|
|
4
|
+
/**
|
|
5
|
+
* Runs a program, then — only when `--publish` was passed — awaits the same
|
|
6
|
+
* `publish` path the standalone command calls, before returning. A
|
|
7
|
+
* could-not-start throw from `runProgram` propagates untouched: publish is
|
|
8
|
+
* never reached, so a run that never began publishes nothing. A publish
|
|
9
|
+
* failure is caught and reported, never allowed to overwrite the run's own
|
|
10
|
+
* exit code (a partial build stays 2, a complete run stays 0). Sets neither
|
|
11
|
+
* `process.exitCode` nor calls `process.exit` — the caller applies the
|
|
12
|
+
* returned code.
|
|
13
|
+
*/
|
|
14
|
+
export async function runAndPublish(options) {
|
|
15
|
+
const run = options.runProgram ?? runProgram;
|
|
16
|
+
const doPublish = options.publishProgram ?? publishProgram;
|
|
17
|
+
const result = await run(options);
|
|
18
|
+
const exitCode = exitCodeForResult(result);
|
|
19
|
+
if (!options.publish) {
|
|
20
|
+
return { result, publish: { status: "skipped" }, exitCode };
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
const published = await doPublish({
|
|
24
|
+
cwd: options.cwd,
|
|
25
|
+
programId: options.programId,
|
|
26
|
+
});
|
|
27
|
+
return { result, publish: { status: "published", result: published }, exitCode };
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
return { result, publish: { status: "failed", error: error }, exitCode };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=run-publish.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-publish.js","sourceRoot":"","sources":["../src/run-publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiD,MAAM,kBAAkB,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,cAAc,EAAsB,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAwBpD;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAA6B;IAE7B,MAAM,GAAG,GAAG,OAAO,CAAC,UAAU,IAAI,UAAU,CAAC;IAC7C,MAAM,SAAS,GAAG,OAAO,CAAC,cAAc,IAAI,cAAc,CAAC;IAE3D,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC;IAClC,MAAM,QAAQ,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAE3C,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACrB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC;IAC9D,CAAC;IAED,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,MAAM,SAAS,CAAC;YAChC,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,SAAS,EAAE,OAAO,CAAC,SAAS;SAC7B,CAAC,CAAC;QACH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC;IACnF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAc,EAAE,EAAE,QAAQ,EAAE,CAAC;IACpF,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildorder/nightshift",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "The crew that builds while you're gone: walk-away, CI-dispatched engineering programs with a decision ledger instead of gates",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -57,10 +57,11 @@
|
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@eslint/js": "^10.0.1",
|
|
59
59
|
"@types/node": "^26.1.2",
|
|
60
|
-
"@wildorder/nightshift": "^0.
|
|
60
|
+
"@wildorder/nightshift": "^0.5.0",
|
|
61
61
|
"eslint": "^10.8.0",
|
|
62
62
|
"typescript": "^6.0.3",
|
|
63
63
|
"typescript-eslint": "^8.66.0",
|
|
64
|
-
"vitest": "^4.1.10"
|
|
64
|
+
"vitest": "^4.1.10",
|
|
65
|
+
"yaml": "^2.9.0"
|
|
65
66
|
}
|
|
66
67
|
}
|
|
@@ -74,6 +74,20 @@ workstream covering the entire program, with no dependencies and task file
|
|
|
74
74
|
`tasks/{program-id}/implementation.md`. In orchestrated mode use the
|
|
75
75
|
decomposition and checkpoint rules below.
|
|
76
76
|
|
|
77
|
+
## 2.5. Create the program's branch
|
|
78
|
+
|
|
79
|
+
A program is planned on its own branch, created now — before either
|
|
80
|
+
artifact is written — so the program document and manifest are authored on
|
|
81
|
+
it directly and never have to be moved. Run exactly this command and nothing
|
|
82
|
+
else:
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
npx --yes @wildorder/nightshift branch "{program-id}"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
This skill composes no git of its own — the command above owns branch
|
|
89
|
+
selection, and the packaged runner owns every commit that follows.
|
|
90
|
+
|
|
77
91
|
## 3. Draft the program document
|
|
78
92
|
|
|
79
93
|
Inspect `docs/programs/` for an existing `*-program.md`. Match its structure
|