@nan0web/release 1.0.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/.datasets/README.dataset.jsonl +19 -0
- package/.editorconfig +20 -0
- package/CHANGELOG.md +6 -0
- package/CONTRIBUTING.md +42 -0
- package/LICENSE +15 -0
- package/README.md +284 -0
- package/bin/commands/InitCommand.js +10 -0
- package/bin/lib/functions.js +240 -0
- package/bin/lib/functions.test.js +138 -0
- package/bin/lib/temp/pnpm-lock.yaml +0 -0
- package/bin/nan0release.js +57 -0
- package/bin/release.js +12 -0
- package/bin/release.test.js +73 -0
- package/bin/temp/package.json +1 -0
- package/docs/system.uk.md +413 -0
- package/docs/uk/README.md +284 -0
- package/legacy/PrepareCommand.js +154 -0
- package/legacy/PrepareCommand.test.js +189 -0
- package/legacy/changelog.js +446 -0
- package/package.json +43 -0
- package/releases/1/0/v1.0.0/models/Person.js +26 -0
- package/releases/1/0/v1.0.0/models/Person.test.js +44 -0
- package/releases/1/0/v1.0.0/models/company.js +11 -0
- package/releases/1/0/v1.0.0/models/members.js +14 -0
- package/releases/1/0/v1.0.0/models/members.test.js +21 -0
- package/releases/1/0/v1.0.0/models/teams/DevTeam.js +6 -0
- package/releases/1/0/v1.0.0/models/teams/DevTeam.test.js +15 -0
- package/releases/1/0/v1.0.0/models/teams/index.js +5 -0
- package/releases/1/0/v1.0.0/release.js +12 -0
- package/releases/1/0/v1.0.0/release.md +121 -0
- package/releases/1/0/v1.0.0/release.test.js +36 -0
- package/releases/1/0/v1.0.0/test/YaRaSLove/git-native.test.js +14 -0
- package/releases/current.js +3 -0
- package/releases/index.js +11 -0
- package/src/README.md.js +468 -0
- package/src/Release/Document.js +110 -0
- package/src/Release/MarkdownToTest.js +137 -0
- package/src/Release/MarkdownToTest.test.js +60 -0
- package/src/Release/Person.js +29 -0
- package/src/Release.js +132 -0
- package/src/ReleaseCLI.js +122 -0
- package/src/Team.js +35 -0
- package/src/architecture/ProjectManagementAsCode.js +264 -0
- package/src/architecture/ProjectManagementAsCode.test.js +128 -0
- package/src/co/AppCommandMessage.js +22 -0
- package/src/co/AppCommandOptions.js +27 -0
- package/src/commands/ChatCommand.js +56 -0
- package/src/commands/HostCommand.js +63 -0
- package/src/commands/InitCommand.js +65 -0
- package/src/commands/ListCommand.js +56 -0
- package/src/commands/PublishCommand.js +144 -0
- package/src/commands/SealCommand.js +51 -0
- package/src/commands/ServeCommand.js +53 -0
- package/src/commands/ShowCommand.js +58 -0
- package/src/commands/SubCommand.js +21 -0
- package/src/commands/ValidateCommand.js +66 -0
- package/src/db/ReleaseDB.js +54 -0
- package/system.md +571 -0
- package/tsconfig.json +23 -0
- package/types/Release/Document.d.ts +31 -0
- package/types/Release/MarkdownToTest.d.ts +47 -0
- package/types/Release/Person.d.ts +17 -0
- package/types/Release.d.ts +89 -0
- package/types/ReleaseCLI.d.ts +33 -0
- package/types/Team.d.ts +27 -0
- package/types/architecture/ProjectManagementAsCode.d.ts +159 -0
- package/types/co/AppCommandMessage.d.ts +12 -0
- package/types/co/AppCommandOptions.d.ts +23 -0
- package/types/commands/ChatCommand.d.ts +20 -0
- package/types/commands/HostCommand.d.ts +16 -0
- package/types/commands/InitCommand.d.ts +20 -0
- package/types/commands/ListCommand.d.ts +21 -0
- package/types/commands/PublishCommand.d.ts +49 -0
- package/types/commands/SealCommand.d.ts +21 -0
- package/types/commands/ServeCommand.d.ts +17 -0
- package/types/commands/ShowCommand.d.ts +19 -0
- package/types/commands/SubCommand.d.ts +8 -0
- package/types/commands/ValidateCommand.d.ts +19 -0
- package/types/db/ReleaseDB.d.ts +30 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export default Release;
|
|
2
|
+
export type ReleaseConfig = {
|
|
3
|
+
/**
|
|
4
|
+
* - Release version
|
|
5
|
+
*/
|
|
6
|
+
version?: string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* -
|
|
9
|
+
*/
|
|
10
|
+
createdAt?: string | number | Date | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* -
|
|
13
|
+
*/
|
|
14
|
+
startAt?: string | number | Date | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* -
|
|
17
|
+
*/
|
|
18
|
+
planAt?: string | number | Date | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* -
|
|
21
|
+
*/
|
|
22
|
+
completeAt?: string | number | Date | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* -
|
|
25
|
+
*/
|
|
26
|
+
document?: string | ReleaseDocument | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* - Task map with test functions
|
|
29
|
+
*/
|
|
30
|
+
tasks?: Map<string, Function> | undefined;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* @typedef {Object} ReleaseConfig
|
|
34
|
+
* @property {string} [version] - Release version
|
|
35
|
+
* @property {string | number | Date | undefined} [createdAt] -
|
|
36
|
+
* @property {string | number | Date | undefined} [startAt] -
|
|
37
|
+
* @property {string | number | Date | undefined} [planAt] -
|
|
38
|
+
* @property {string | number | Date | undefined} [completeAt] -
|
|
39
|
+
* @property {string | ReleaseDocument} [document] -
|
|
40
|
+
* @property {Map<string, Function>} [tasks] - Task map with test functions
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* Release management class that coordinates task validation and release execution
|
|
44
|
+
*/
|
|
45
|
+
declare class Release {
|
|
46
|
+
/**
|
|
47
|
+
* Creates a Release instance
|
|
48
|
+
* @param {ReleaseConfig} config - Release configuration
|
|
49
|
+
*/
|
|
50
|
+
constructor(config?: ReleaseConfig);
|
|
51
|
+
/** @type {string} */
|
|
52
|
+
version: string;
|
|
53
|
+
/** @type {Date} */
|
|
54
|
+
createdAt: Date;
|
|
55
|
+
/** @type {Date?} */
|
|
56
|
+
startAt: Date | null;
|
|
57
|
+
/** @type {Date?} */
|
|
58
|
+
planAt: Date | null;
|
|
59
|
+
/** @type {Date?} */
|
|
60
|
+
completeAt: Date | null;
|
|
61
|
+
/** @type {Map<string, Function>} */
|
|
62
|
+
tasks: Map<string, Function>;
|
|
63
|
+
/** @type {ReleaseDocument} */
|
|
64
|
+
document: ReleaseDocument;
|
|
65
|
+
/** @type {Logger} */
|
|
66
|
+
logger: Logger;
|
|
67
|
+
get path(): string;
|
|
68
|
+
/**
|
|
69
|
+
* Validate release by running all task tests
|
|
70
|
+
* @returns {Promise<Object>} Validation results
|
|
71
|
+
*/
|
|
72
|
+
validate(): Promise<any>;
|
|
73
|
+
/**
|
|
74
|
+
* Execute release process
|
|
75
|
+
* @param {Object} options - Release options
|
|
76
|
+
* @param {boolean} [options.ignoreFailTests=false] - Ignore failed tests
|
|
77
|
+
* @returns {Promise<boolean>} Release success status
|
|
78
|
+
*/
|
|
79
|
+
execute(options?: {
|
|
80
|
+
ignoreFailTests?: boolean | undefined;
|
|
81
|
+
}): Promise<boolean>;
|
|
82
|
+
/**
|
|
83
|
+
* Get release progress statistics
|
|
84
|
+
* @returns {Promise<Object>} Progress statistics
|
|
85
|
+
*/
|
|
86
|
+
getProgress(): Promise<any>;
|
|
87
|
+
}
|
|
88
|
+
import ReleaseDocument from "./Release/Document.js";
|
|
89
|
+
import Logger from '@nan0web/log';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* CLI application for release management
|
|
4
|
+
*/
|
|
5
|
+
export default class ReleaseCLI extends Command {
|
|
6
|
+
static Message: typeof AppCommandMessage;
|
|
7
|
+
constructor();
|
|
8
|
+
/** @type {DB?} */
|
|
9
|
+
db: DB | null;
|
|
10
|
+
/** @type {FS} */
|
|
11
|
+
fs: FS;
|
|
12
|
+
/** @type {Record<string, Release>} */
|
|
13
|
+
releases: Record<string, Release>;
|
|
14
|
+
/** @type {Release?} */
|
|
15
|
+
current: Release | null;
|
|
16
|
+
/**
|
|
17
|
+
* @param {string[] | string} argv
|
|
18
|
+
* @returns {AppCommandMessage}
|
|
19
|
+
*/
|
|
20
|
+
parse(argv?: string[] | string): AppCommandMessage;
|
|
21
|
+
/**
|
|
22
|
+
* Run CLI application
|
|
23
|
+
* @param {string[]} argv - Command line arguments
|
|
24
|
+
* @returns {Promise<void>}
|
|
25
|
+
*/
|
|
26
|
+
run(argv: string[]): Promise<void>;
|
|
27
|
+
loadReleaseFiles(): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
import { Command } from '@nan0web/co';
|
|
30
|
+
import DB from "./db/ReleaseDB.js";
|
|
31
|
+
import FS from "@nan0web/db-fs";
|
|
32
|
+
import Release from './Release.js';
|
|
33
|
+
import AppCommandMessage from './co/AppCommandMessage.js';
|
package/types/Team.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default Company;
|
|
2
|
+
declare class Company {
|
|
3
|
+
static name: string;
|
|
4
|
+
static c: typeof CLevelTeam;
|
|
5
|
+
static ux: typeof UXTeam;
|
|
6
|
+
}
|
|
7
|
+
declare class CLevelTeam {
|
|
8
|
+
static name: string;
|
|
9
|
+
static ceo: Person;
|
|
10
|
+
static cfo: Person;
|
|
11
|
+
}
|
|
12
|
+
declare class UXTeam {
|
|
13
|
+
static name: string;
|
|
14
|
+
static designer: Person;
|
|
15
|
+
}
|
|
16
|
+
declare class Person {
|
|
17
|
+
constructor(name: any);
|
|
18
|
+
/** @type {HumanName} */
|
|
19
|
+
name: HumanName;
|
|
20
|
+
/** @type {HumanGender} */
|
|
21
|
+
gender: HumanGender;
|
|
22
|
+
/** @type {HumanContact[]} */
|
|
23
|
+
contacts: HumanContact[];
|
|
24
|
+
}
|
|
25
|
+
import { HumanName } from "@nan0web/verse";
|
|
26
|
+
import { HumanGender } from "@nan0web/verse";
|
|
27
|
+
import { HumanContact } from "@nan0web/verse";
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task management through node:test infrastructure
|
|
3
|
+
* @class ProjectManagement
|
|
4
|
+
*/
|
|
5
|
+
export class ProjectManagement {
|
|
6
|
+
/**
|
|
7
|
+
* Initialize project management system
|
|
8
|
+
* @param {Object} [config] - Configuration options
|
|
9
|
+
* @param {string} [config.projectPath] - Path to project root
|
|
10
|
+
* @param {boolean} [config.autoTrack] - Enable automatic status tracking
|
|
11
|
+
*/
|
|
12
|
+
constructor(config?: {
|
|
13
|
+
projectPath?: string | undefined;
|
|
14
|
+
autoTrack?: boolean | undefined;
|
|
15
|
+
});
|
|
16
|
+
/** @type {string} */
|
|
17
|
+
projectPath: string;
|
|
18
|
+
/** @type {boolean} */
|
|
19
|
+
autoTrack: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Task registry mapping task IDs to their test files
|
|
22
|
+
* @type {Map<string, string>}
|
|
23
|
+
*/
|
|
24
|
+
tasks: Map<string, string>;
|
|
25
|
+
/**
|
|
26
|
+
* Register a task with its validation test
|
|
27
|
+
* @param {string} taskId - Unique task identifier
|
|
28
|
+
* @param {string} testFilePath - Path to the test file
|
|
29
|
+
*/
|
|
30
|
+
registerTask(taskId: string, testFilePath: string): void;
|
|
31
|
+
/**
|
|
32
|
+
* Run all registered task tests to determine project status
|
|
33
|
+
* @returns {Promise<Object>} Test results summary
|
|
34
|
+
*/
|
|
35
|
+
validateProjectState(): Promise<any>;
|
|
36
|
+
/**
|
|
37
|
+
* Execute individual task test
|
|
38
|
+
* @param {string} testPath - Path to test file
|
|
39
|
+
* @returns {Promise<Object>} Test execution result
|
|
40
|
+
*/
|
|
41
|
+
runTaskTest(testPath: string): Promise<any>;
|
|
42
|
+
/**
|
|
43
|
+
* Generate release readiness report
|
|
44
|
+
* @param {string} version - Target version for release
|
|
45
|
+
* @returns {Promise<Object>} Release validation status
|
|
46
|
+
*/
|
|
47
|
+
validateRelease(version: string): Promise<any>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Release management system that coordinates task validation
|
|
51
|
+
* @class ReleaseManager
|
|
52
|
+
*/
|
|
53
|
+
export class ReleaseManager {
|
|
54
|
+
/**
|
|
55
|
+
* Initialize release manager
|
|
56
|
+
* @param {ProjectManagement} projectManager - Project management instance
|
|
57
|
+
*/
|
|
58
|
+
constructor(projectManager: ProjectManagement);
|
|
59
|
+
/**
|
|
60
|
+
* @type {ProjectManagement}
|
|
61
|
+
*/
|
|
62
|
+
projectManager: ProjectManagement;
|
|
63
|
+
/**
|
|
64
|
+
* Execute release process with task validation
|
|
65
|
+
* @param {string} type - Release type (patch, minor, major)
|
|
66
|
+
* @param {Object} options - Release options
|
|
67
|
+
* @returns {Promise<Object>} Release execution result
|
|
68
|
+
*/
|
|
69
|
+
executeRelease(type: string, options?: any): Promise<any>;
|
|
70
|
+
/**
|
|
71
|
+
* Calculate next version based on release type
|
|
72
|
+
* @param {string} type - Release type
|
|
73
|
+
* @returns {string} Next version string
|
|
74
|
+
*/
|
|
75
|
+
calculateVersion(type: string): string;
|
|
76
|
+
/**
|
|
77
|
+
* Publish release to package registry
|
|
78
|
+
* @param {string} version - Version to publish
|
|
79
|
+
* @param {Object} options - Publish options
|
|
80
|
+
* @returns {Promise<boolean>} Publish success status
|
|
81
|
+
*/
|
|
82
|
+
publish(version: string, options: any): Promise<boolean>;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Task test suite definition following node:test format
|
|
86
|
+
* @extends TestSuite
|
|
87
|
+
*/
|
|
88
|
+
export class TaskTestSuite extends TestSuite {
|
|
89
|
+
/**
|
|
90
|
+
* Initialize task test suite
|
|
91
|
+
* @param {string} taskId - Unique task identifier
|
|
92
|
+
* @param {string} description - Human-readable task description
|
|
93
|
+
* @param {Function} testFunction - Test implementation function
|
|
94
|
+
*/
|
|
95
|
+
constructor(taskId: string, description: string, testFunction: Function);
|
|
96
|
+
/**
|
|
97
|
+
* Task ID this test suite validates
|
|
98
|
+
* @type {string}
|
|
99
|
+
*/
|
|
100
|
+
taskId: string;
|
|
101
|
+
/**
|
|
102
|
+
* Task description for human understanding
|
|
103
|
+
* @type {string}
|
|
104
|
+
*/
|
|
105
|
+
description: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Changelog-based task management for LLM-assisted development
|
|
109
|
+
* @class ChangelogTaskManager
|
|
110
|
+
*/
|
|
111
|
+
export class ChangelogTaskManager {
|
|
112
|
+
/**
|
|
113
|
+
* Parse changelog to extract tasks and their statuses
|
|
114
|
+
* @param {string} changelogContent - Raw changelog markdown
|
|
115
|
+
* @returns {Array<Object>} Array of task objects
|
|
116
|
+
*/
|
|
117
|
+
parseChangelog(changelogContent: string): Array<any>;
|
|
118
|
+
/**
|
|
119
|
+
* Generate task test files from changelog entries
|
|
120
|
+
* @param {Array<Object>} tasks - Array of task objects
|
|
121
|
+
* @returns {Promise<void>}
|
|
122
|
+
*/
|
|
123
|
+
generateTaskTests(tasks: Array<any>): Promise<void>;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* # Project Management as Code Architecture
|
|
127
|
+
*
|
|
128
|
+
* This architecture implements project management through automated testing,
|
|
129
|
+
* where each task is represented as a test case that validates system behavior.
|
|
130
|
+
*
|
|
131
|
+
* ## Core Concepts
|
|
132
|
+
*
|
|
133
|
+
* 1. **Tasks as Tests**: Each project task becomes a test suite that validates
|
|
134
|
+
* implementation correctness
|
|
135
|
+
* 2. **Status Tracking**: Task status moves automatically through CI/CD pipeline
|
|
136
|
+
* when tests pass/fail
|
|
137
|
+
* 3. **Release Validation**: Releases are validated by running task tests as
|
|
138
|
+
* part of the release process
|
|
139
|
+
*
|
|
140
|
+
* ## Implementation Details
|
|
141
|
+
*/
|
|
142
|
+
/**
|
|
143
|
+
* Base TestSuite class for task management
|
|
144
|
+
*/
|
|
145
|
+
declare class TestSuite {
|
|
146
|
+
/**
|
|
147
|
+
* @param {string} name - Suite name
|
|
148
|
+
* @param {Function} fn - Test function
|
|
149
|
+
*/
|
|
150
|
+
constructor(name: string, fn: Function);
|
|
151
|
+
name: string;
|
|
152
|
+
fn: Function;
|
|
153
|
+
/**
|
|
154
|
+
* Run the test suite
|
|
155
|
+
* @returns {Promise<Object>}
|
|
156
|
+
*/
|
|
157
|
+
run(): Promise<any>;
|
|
158
|
+
}
|
|
159
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default class AppCommandMessage extends CommandMessage {
|
|
2
|
+
/**
|
|
3
|
+
* @param {*} input
|
|
4
|
+
* @returns {AppCommandMessage}
|
|
5
|
+
*/
|
|
6
|
+
static from(input: any): AppCommandMessage;
|
|
7
|
+
set opts(value: AppCommandOptions);
|
|
8
|
+
/** @returns {AppCommandOptions} */
|
|
9
|
+
get opts(): AppCommandOptions;
|
|
10
|
+
}
|
|
11
|
+
import { CommandMessage } from "@nan0web/co";
|
|
12
|
+
import AppCommandOptions from "./AppCommandOptions.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export default AppCommandOptions;
|
|
2
|
+
declare class AppCommandOptions {
|
|
3
|
+
/**
|
|
4
|
+
* @param {Object} input
|
|
5
|
+
*/
|
|
6
|
+
constructor(input?: any);
|
|
7
|
+
/** @type {boolean} */
|
|
8
|
+
webui: boolean;
|
|
9
|
+
/** @type {boolean} */
|
|
10
|
+
json: boolean;
|
|
11
|
+
/** @type {boolean} */
|
|
12
|
+
quiet: boolean;
|
|
13
|
+
/** @type {string} */
|
|
14
|
+
releaseDir: string;
|
|
15
|
+
/** @type {boolean} */
|
|
16
|
+
write: boolean;
|
|
17
|
+
/** @type {string} */
|
|
18
|
+
user: string;
|
|
19
|
+
/** @type {boolean} */
|
|
20
|
+
ignoreFailTests: boolean;
|
|
21
|
+
/** @type {boolean} */
|
|
22
|
+
full: boolean;
|
|
23
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default ChatCommand;
|
|
2
|
+
/**
|
|
3
|
+
* ChatCommand – writes a message to the release‑wide chat (chat/…/timestamp.username.md)
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* release chat write "your message"
|
|
7
|
+
*
|
|
8
|
+
* Options:
|
|
9
|
+
* --user <string> – username to embed in the filename (defaults to "anonymous")
|
|
10
|
+
*/
|
|
11
|
+
declare class ChatCommand extends SubCommand {
|
|
12
|
+
/**
|
|
13
|
+
* Run the chat command.
|
|
14
|
+
*
|
|
15
|
+
* @param {AppCommandMessage} ctx – command context (contains args and opts)
|
|
16
|
+
*/
|
|
17
|
+
run(ctx: AppCommandMessage): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
import SubCommand from "./SubCommand.js";
|
|
20
|
+
import AppCommandMessage from "../co/AppCommandMessage.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HostCommand – starts a minimal HTTP server that serves the current
|
|
3
|
+
* release markdown and a tiny JSON status endpoint.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* release host [--port <number>] [--webui]
|
|
7
|
+
*/
|
|
8
|
+
export default class HostCommand extends SubCommand {
|
|
9
|
+
/**
|
|
10
|
+
* Run the host server.
|
|
11
|
+
*
|
|
12
|
+
* @param {Object} ctx – command context
|
|
13
|
+
*/
|
|
14
|
+
run(ctx: any): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
import SubCommand from "./SubCommand.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default InitCommand;
|
|
2
|
+
/**
|
|
3
|
+
* InitCommand – scaffolds a new release directory with the minimal set of
|
|
4
|
+
* files required for a functional release (release.js, release.md and a
|
|
5
|
+
* placeholder task folder). The command is deliberately tiny – it only
|
|
6
|
+
* creates the filesystem layout and writes a tiny starter release object.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* release init v1.0.0
|
|
10
|
+
*/
|
|
11
|
+
declare class InitCommand extends SubCommand {
|
|
12
|
+
/**
|
|
13
|
+
* Run the init process.
|
|
14
|
+
*
|
|
15
|
+
* @param {AppCommandMessage} msg – command context (contains parsed options)
|
|
16
|
+
*/
|
|
17
|
+
run(msg: AppCommandMessage): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
import SubCommand from "./SubCommand.js";
|
|
20
|
+
import AppCommandMessage from "../co/AppCommandMessage.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ListCommand – prints a concise list of releases found in the current
|
|
3
|
+
* working directory. It works against the {@link ReleaseDB} instance
|
|
4
|
+
* passed through the `db` option of the parent CLI.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* release list
|
|
8
|
+
*
|
|
9
|
+
* Options:
|
|
10
|
+
* --json – output JSON instead of a human‑readable list
|
|
11
|
+
*/
|
|
12
|
+
export default class ListCommand extends SubCommand {
|
|
13
|
+
/**
|
|
14
|
+
* Execute the command.
|
|
15
|
+
*
|
|
16
|
+
* @param {Object} ctx – command context (contains parsed args)
|
|
17
|
+
* @returns {Promise<void>}
|
|
18
|
+
*/
|
|
19
|
+
run(ctx: any): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
import SubCommand from "./SubCommand.js";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export class PublishCommandOptions {
|
|
2
|
+
/**
|
|
3
|
+
* @param {any} input
|
|
4
|
+
* @returns {PublishCommandOptions}
|
|
5
|
+
*/
|
|
6
|
+
static from(input: any): PublishCommandOptions;
|
|
7
|
+
constructor(input?: {});
|
|
8
|
+
/** @type {string} */
|
|
9
|
+
tag: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @extends {CommandMessage}
|
|
13
|
+
*/
|
|
14
|
+
export class PublishCommandMessage extends CommandMessage {
|
|
15
|
+
constructor(input?: {});
|
|
16
|
+
set opts(value: PublishCommandOptions);
|
|
17
|
+
/** @returns {PublishCommandOptions} */
|
|
18
|
+
get opts(): PublishCommandOptions;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @extends {Command}
|
|
22
|
+
*/
|
|
23
|
+
export default class PublishCommand extends Command {
|
|
24
|
+
static Message: typeof PublishCommandMessage;
|
|
25
|
+
constructor(input?: {});
|
|
26
|
+
/**
|
|
27
|
+
* @docs
|
|
28
|
+
* # `nan0release publish`
|
|
29
|
+
*
|
|
30
|
+
* Publishes current package to NPM and creates Git tags.
|
|
31
|
+
*
|
|
32
|
+
* Steps performed:
|
|
33
|
+
* - Verifies no uncommitted changes
|
|
34
|
+
* - Pulls latest changes
|
|
35
|
+
* - Runs build and test scripts
|
|
36
|
+
* - Creates Git tag if not exists
|
|
37
|
+
* - Publishes to NPM registry
|
|
38
|
+
* - Pushes changes and tags
|
|
39
|
+
*
|
|
40
|
+
* ```bash
|
|
41
|
+
* nan0release publish
|
|
42
|
+
* ```
|
|
43
|
+
* @param {PublishCommandMessage} msg
|
|
44
|
+
*/
|
|
45
|
+
run(msg: PublishCommandMessage): Promise<void>;
|
|
46
|
+
#private;
|
|
47
|
+
}
|
|
48
|
+
import { CommandMessage } from "@nan0web/co";
|
|
49
|
+
import { Command } from "@nan0web/co";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SealCommand – finalises a release by writing a `retro.md` file
|
|
3
|
+
* and making the release directory read‑only. This is a *light* implementation
|
|
4
|
+
* that merely creates a placeholder retro file; a real implementation would
|
|
5
|
+
* also set file system permissions and maybe create a Git tag.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* release seal [--message <text>]
|
|
9
|
+
*
|
|
10
|
+
* Options:
|
|
11
|
+
* --message – optional retro‑reflection text
|
|
12
|
+
*/
|
|
13
|
+
export default class SealCommand extends SubCommand {
|
|
14
|
+
/**
|
|
15
|
+
* Seal the current release.
|
|
16
|
+
*
|
|
17
|
+
* @param {Object} ctx – command context
|
|
18
|
+
*/
|
|
19
|
+
run(ctx: any): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
import SubCommand from "./SubCommand.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ServeCommand – runs a tiny static file server that serves all files
|
|
3
|
+
* inside the current release folder. It is useful for quick local
|
|
4
|
+
* inspection of assets, markdown, and generated test files.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* release serve [--port <number>]
|
|
8
|
+
*/
|
|
9
|
+
export default class ServeCommand extends SubCommand {
|
|
10
|
+
/**
|
|
11
|
+
* Start the static server.
|
|
12
|
+
*
|
|
13
|
+
* @param {Object} ctx – command context
|
|
14
|
+
*/
|
|
15
|
+
run(ctx: any): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
import SubCommand from "./SubCommand.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ShowCommand – prints basic information about the current release
|
|
3
|
+
* (version, creation date, and a short excerpt of the markdown notes).
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* release show
|
|
7
|
+
*
|
|
8
|
+
* Options:
|
|
9
|
+
* --full – dump the whole release.md file
|
|
10
|
+
*/
|
|
11
|
+
export default class ShowCommand extends SubCommand {
|
|
12
|
+
/**
|
|
13
|
+
* Render the release information.
|
|
14
|
+
*
|
|
15
|
+
* @param {Object} ctx – command context
|
|
16
|
+
*/
|
|
17
|
+
run(ctx: any): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
import SubCommand from "./SubCommand.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ValidateCommand – runs the {@link Release.validate} method for the
|
|
3
|
+
* currently checked‑out release and prints a short summary.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* release validate
|
|
7
|
+
*
|
|
8
|
+
* Options:
|
|
9
|
+
* --ignore-fail – do not treat failed tasks as a validation error
|
|
10
|
+
*/
|
|
11
|
+
export default class ValidateCommand extends SubCommand {
|
|
12
|
+
/**
|
|
13
|
+
* Execute validation.
|
|
14
|
+
*
|
|
15
|
+
* @param {Object} ctx – command context
|
|
16
|
+
*/
|
|
17
|
+
run(ctx: any): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
import SubCommand from "./SubCommand.js";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export default ReleaseDB;
|
|
2
|
+
/**
|
|
3
|
+
* ReleaseDB – thin wrapper around DBFS that adds a convenient `releases`
|
|
4
|
+
* getter returning all release directories discovered under the root.
|
|
5
|
+
*
|
|
6
|
+
* The underlying DBFS stores a `Map` called `data` where each key is a
|
|
7
|
+
* relative file path (e.g. "1/0/v1.0.0/release.js").
|
|
8
|
+
*/
|
|
9
|
+
declare class ReleaseDB extends DBFS {
|
|
10
|
+
/**
|
|
11
|
+
* @param {object} input
|
|
12
|
+
* @returns {ReleaseDB}
|
|
13
|
+
*/
|
|
14
|
+
static from(input: object): ReleaseDB;
|
|
15
|
+
/**
|
|
16
|
+
* @param {string} uri
|
|
17
|
+
* @returns {ReleaseDB}
|
|
18
|
+
*/
|
|
19
|
+
extract(uri: string): ReleaseDB;
|
|
20
|
+
/**
|
|
21
|
+
* @param {string} version
|
|
22
|
+
* @returns {ReleaseDB}
|
|
23
|
+
*/
|
|
24
|
+
extractVersion(version: string): ReleaseDB;
|
|
25
|
+
/**
|
|
26
|
+
* @returns {Array<string>} List of discovered release root paths
|
|
27
|
+
*/
|
|
28
|
+
get releases(): Array<string>;
|
|
29
|
+
}
|
|
30
|
+
import DBFS from "@nan0web/db-fs";
|