@grunnverk/commands-publish 1.5.1 → 1.5.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.
- package/dist/index.js +693 -64
- package/dist/index.js.map +1 -1
- package/dist/src/commands/check-development.d.ts +6 -0
- package/dist/src/commands/check-development.d.ts.map +1 -0
- package/dist/src/commands/development.d.ts.map +1 -1
- package/dist/src/commands/publish.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/utils/checkpoints.d.ts +92 -0
- package/dist/src/utils/checkpoints.d.ts.map +1 -0
- package/package.json +10 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-development.d.ts","sourceRoot":"","sources":["../../../src/commands/check-development.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG;AAEH,OAAO,EAAE,MAAM,EAAa,MAAM,iBAAiB,CAAC;AAkBpD;;GAEG;AACH,wBAAsB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAmZ7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"development.d.ts","sourceRoot":"","sources":["../../../src/commands/development.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAmB,MAAM,EAAiH,MAAM,iBAAiB,CAAC;AAoGzK;;GAEG;AACH,eAAO,MAAM,OAAO,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"development.d.ts","sourceRoot":"","sources":["../../../src/commands/development.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAmB,MAAM,EAAiH,MAAM,iBAAiB,CAAC;AAoGzK;;GAEG;AACH,eAAO,MAAM,OAAO,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,MAAM,CA0d/D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../src/commands/publish.ts"],"names":[],"mappings":"AAMA,OAAO,EAA8B,MAAM,EAAgM,MAAM,iBAAiB,CAAC;AAolBnQ,eAAO,MAAM,OAAO,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../src/commands/publish.ts"],"names":[],"mappings":"AAMA,OAAO,EAA8B,MAAM,EAAgM,MAAM,iBAAiB,CAAC;AAolBnQ,eAAO,MAAM,OAAO,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,IAAI,CAklC7D,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { execute as development } from './commands/development';
|
|
2
|
+
export { execute as checkDevelopment } from './commands/check-development';
|
|
2
3
|
export { execute as publish } from './commands/publish';
|
|
3
4
|
export { execute as release } from './commands/release';
|
|
4
5
|
export * from './commands/validation';
|
|
5
6
|
export * from './commands/dryRunReporter';
|
|
7
|
+
export * from './utils/checkpoints';
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAG1C,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checkpoint System for Publish Recovery
|
|
3
|
+
*
|
|
4
|
+
* Saves state at critical points during publish to enable recovery from failures.
|
|
5
|
+
* Checkpoints are saved locally and help determine the appropriate recovery strategy.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Phases of the publish workflow
|
|
9
|
+
*/
|
|
10
|
+
export type PublishPhase = 'initialized' | 'validated' | 'pr-created' | 'pr-merged' | 'tagged' | 'npm-publishing' | 'npm-published' | 'completed' | 'failed';
|
|
11
|
+
/**
|
|
12
|
+
* Checkpoint data structure
|
|
13
|
+
*/
|
|
14
|
+
export interface PublishCheckpoint {
|
|
15
|
+
/** Current phase of the publish workflow */
|
|
16
|
+
phase: PublishPhase;
|
|
17
|
+
/** Timestamp when checkpoint was created */
|
|
18
|
+
timestamp: string;
|
|
19
|
+
/** Package name */
|
|
20
|
+
packageName: string;
|
|
21
|
+
/** Target version being published */
|
|
22
|
+
version: string;
|
|
23
|
+
/** Current git branch */
|
|
24
|
+
branch: string;
|
|
25
|
+
/** Working directory */
|
|
26
|
+
workingDirectory: string;
|
|
27
|
+
/** Pull request number (if created) */
|
|
28
|
+
prNumber?: number;
|
|
29
|
+
/** Pull request URL (if created) */
|
|
30
|
+
prUrl?: string;
|
|
31
|
+
/** Git tags created during this publish */
|
|
32
|
+
tags: string[];
|
|
33
|
+
/** Whether npm publish completed successfully */
|
|
34
|
+
npmPublished: boolean;
|
|
35
|
+
/** GitHub workflow run ID (if available) */
|
|
36
|
+
workflowRunId?: string;
|
|
37
|
+
/** GitHub workflow run URL (if available) */
|
|
38
|
+
workflowRunUrl?: string;
|
|
39
|
+
/** Error message if failed */
|
|
40
|
+
error?: string;
|
|
41
|
+
/** Additional metadata */
|
|
42
|
+
metadata?: {
|
|
43
|
+
targetBranch?: string;
|
|
44
|
+
fromBranch?: string;
|
|
45
|
+
commitSha?: string;
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Save a checkpoint
|
|
51
|
+
*/
|
|
52
|
+
export declare function saveCheckpoint(checkpoint: PublishCheckpoint): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Load the most recent checkpoint
|
|
55
|
+
*/
|
|
56
|
+
export declare function loadCheckpoint(workingDirectory: string): Promise<PublishCheckpoint | null>;
|
|
57
|
+
/**
|
|
58
|
+
* Delete checkpoint (cleanup after successful publish)
|
|
59
|
+
*/
|
|
60
|
+
export declare function deleteCheckpoint(workingDirectory: string): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Update an existing checkpoint with new data
|
|
63
|
+
*/
|
|
64
|
+
export declare function updateCheckpoint(workingDirectory: string, updates: Partial<PublishCheckpoint>): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Analyze checkpoint to determine recovery strategy
|
|
67
|
+
*/
|
|
68
|
+
export interface RecoveryStrategy {
|
|
69
|
+
/** Can this publish be recovered? */
|
|
70
|
+
recoverable: boolean;
|
|
71
|
+
/** Recommended recovery action */
|
|
72
|
+
action: 'rollback' | 'fix-forward' | 'reset' | 'continue' | 'none';
|
|
73
|
+
/** Human-readable explanation */
|
|
74
|
+
explanation: string;
|
|
75
|
+
/** Detailed recovery steps */
|
|
76
|
+
steps: string[];
|
|
77
|
+
/** Risks of the recovery action */
|
|
78
|
+
risks: string[];
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Determine the appropriate recovery strategy based on checkpoint
|
|
82
|
+
*/
|
|
83
|
+
export declare function analyzeRecoveryStrategy(checkpoint: PublishCheckpoint): RecoveryStrategy;
|
|
84
|
+
/**
|
|
85
|
+
* Get a human-readable summary of the checkpoint
|
|
86
|
+
*/
|
|
87
|
+
export declare function getCheckpointSummary(checkpoint: PublishCheckpoint): string;
|
|
88
|
+
/**
|
|
89
|
+
* Check if a checkpoint indicates a failed publish
|
|
90
|
+
*/
|
|
91
|
+
export declare function isFailedPublish(checkpoint: PublishCheckpoint): boolean;
|
|
92
|
+
//# sourceMappingURL=checkpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkpoints.d.ts","sourceRoot":"","sources":["../../../src/utils/checkpoints.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH;;GAEG;AACH,MAAM,MAAM,YAAY,GAClB,aAAa,GACb,WAAW,GACX,YAAY,GACZ,WAAW,GACX,QAAQ,GACR,gBAAgB,GAChB,eAAe,GACf,WAAW,GACX,QAAQ,CAAC;AAEf;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,4CAA4C;IAC5C,KAAK,EAAE,YAAY,CAAC;IAEpB,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;IAElB,mBAAmB;IACnB,WAAW,EAAE,MAAM,CAAC;IAEpB,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAEhB,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IAEf,wBAAwB;IACxB,gBAAgB,EAAE,MAAM,CAAC;IAEzB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,2CAA2C;IAC3C,IAAI,EAAE,MAAM,EAAE,CAAC;IAEf,iDAAiD;IACjD,YAAY,EAAE,OAAO,CAAC;IAEtB,4CAA4C;IAC5C,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB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C,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAKtE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grunnverk/commands-publish",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"description": "Publishing workflow commands for kodrdriv (development, publish, release)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"build": "npm run lint && tsc --noEmit && vite build",
|
|
23
23
|
"dev": "vite",
|
|
24
24
|
"watch": "vite build --watch",
|
|
25
|
-
"test": "vitest run --coverage",
|
|
25
|
+
"test": "rm -rf coverage && vitest run --coverage",
|
|
26
26
|
"lint": "eslint . --ext .ts",
|
|
27
27
|
"lint:fix": "eslint . --ext .ts --fix",
|
|
28
28
|
"clean": "rm -rf dist",
|
|
@@ -43,13 +43,14 @@
|
|
|
43
43
|
"node": ">=24.0.0"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@grunnverk/ai-service": "^1.5.
|
|
47
|
-
"@grunnverk/commands-git": "^1.5.
|
|
48
|
-
"@grunnverk/commands-tree": "^1.5.
|
|
49
|
-
"@grunnverk/core": "^1.5.
|
|
50
|
-
"@grunnverk/git-tools": "^1.5.
|
|
51
|
-
"@grunnverk/github-tools": "^1.5.
|
|
52
|
-
"@grunnverk/shared": "^1.5.
|
|
46
|
+
"@grunnverk/ai-service": "^1.5.3",
|
|
47
|
+
"@grunnverk/commands-git": "^1.5.5",
|
|
48
|
+
"@grunnverk/commands-tree": "^1.5.3",
|
|
49
|
+
"@grunnverk/core": "^1.5.5",
|
|
50
|
+
"@grunnverk/git-tools": "^1.5.4",
|
|
51
|
+
"@grunnverk/github-tools": "^1.5.4",
|
|
52
|
+
"@grunnverk/shared": "^1.5.4",
|
|
53
|
+
"@grunnverk/tree-core": "^1.5.2",
|
|
53
54
|
"@riotprompt/riotprompt": "^0.0.21",
|
|
54
55
|
"dotenv": "^17.2.1",
|
|
55
56
|
"openai": "^6.3.0",
|