@forgehive/forge-cli 0.3.18 → 0.5.1
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/runner.js +68 -0
- package/dist/tasks/auth/add.d.ts +2 -2
- package/dist/tasks/auth/add.js +4 -4
- package/dist/tasks/auth/clear.d.ts +3 -3
- package/dist/tasks/auth/list.d.ts +3 -3
- package/dist/tasks/auth/load.d.ts +1 -1
- package/dist/tasks/auth/loadCurrent.d.ts +3 -3
- package/dist/tasks/auth/remove.d.ts +2 -2
- package/dist/tasks/auth/remove.js +1 -1
- package/dist/tasks/auth/switch.d.ts +2 -2
- package/dist/tasks/auth/switch.js +1 -1
- package/dist/tasks/bundle/create.d.ts +2 -2
- package/dist/tasks/bundle/create.js +2 -2
- package/dist/tasks/bundle/fingerprint.d.ts +2 -2
- package/dist/tasks/bundle/fingerprint.js +2 -2
- package/dist/tasks/bundle/load.js +1 -1
- package/dist/tasks/bundle/zip.js +4 -4
- package/dist/tasks/conf/info.d.ts +5 -5
- package/dist/tasks/conf/load.d.ts +1 -1
- package/dist/tasks/docs/download.js +2 -2
- package/dist/tasks/fixture/download.d.ts +4 -4
- package/dist/tasks/fixture/download.js +1 -1
- package/dist/tasks/init.js +1 -1
- package/dist/tasks/project/create.d.ts +4 -4
- package/dist/tasks/project/create.js +2 -2
- package/dist/tasks/project/link.d.ts +4 -4
- package/dist/tasks/project/link.js +1 -1
- package/dist/tasks/project/sync.d.ts +5 -5
- package/dist/tasks/project/unlink.d.ts +3 -3
- package/dist/tasks/runner/bundle.d.ts +2 -2
- package/dist/tasks/runner/bundle.js +2 -2
- package/dist/tasks/runner/create.d.ts +2 -2
- package/dist/tasks/runner/create.js +1 -1
- package/dist/tasks/runner/remove.d.ts +2 -2
- package/dist/tasks/runner/remove.js +1 -1
- package/dist/tasks/task/createTask.d.ts +4 -4
- package/dist/tasks/task/createTask.js +3 -2
- package/dist/tasks/task/describe.d.ts +2 -2
- package/dist/tasks/task/describe.js +1 -1
- package/dist/tasks/task/download.d.ts +4 -4
- package/dist/tasks/task/download.js +2 -2
- package/dist/tasks/task/fingerprint.d.ts +2 -2
- package/dist/tasks/task/fingerprint.js +1 -1
- package/dist/tasks/task/invoke.d.ts +4 -4
- package/dist/tasks/task/invoke.js +2 -2
- package/dist/tasks/task/list.d.ts +3 -3
- package/dist/tasks/task/publish.d.ts +4 -4
- package/dist/tasks/task/publish.js +1 -1
- package/dist/tasks/task/remove.d.ts +2 -2
- package/dist/tasks/task/remove.js +1 -1
- package/dist/tasks/task/replay.d.ts +5 -5
- package/dist/tasks/task/replay.js +3 -3
- package/dist/tasks/task/run.d.ts +4 -4
- package/dist/tasks/task/run.js +2 -2
- package/dist/test/tasks/create.test.js +3 -2
- package/dist/utils/taskAnalysis.d.ts +6 -0
- package/dist/utils/taskAnalysis.js +82 -41
- package/package.json +11 -11
- package/pnpm-workspace.yaml +2 -0
- package/src/runner.ts +77 -0
- package/src/tasks/auth/add.ts +4 -4
- package/src/tasks/auth/remove.ts +1 -1
- package/src/tasks/auth/switch.ts +1 -1
- package/src/tasks/bundle/create.ts +2 -2
- package/src/tasks/bundle/fingerprint.ts +2 -2
- package/src/tasks/bundle/load.ts +1 -1
- package/src/tasks/bundle/zip.ts +4 -4
- package/src/tasks/docs/download.ts +2 -2
- package/src/tasks/fixture/download.ts +1 -1
- package/src/tasks/init.ts +1 -1
- package/src/tasks/project/create.ts +2 -2
- package/src/tasks/project/link.ts +1 -1
- package/src/tasks/runner/bundle.ts +2 -2
- package/src/tasks/runner/create.ts +1 -1
- package/src/tasks/runner/remove.ts +1 -1
- package/src/tasks/task/createTask.ts +3 -2
- package/src/tasks/task/describe.ts +1 -1
- package/src/tasks/task/download.ts +2 -2
- package/src/tasks/task/fingerprint.ts +1 -1
- package/src/tasks/task/invoke.ts +2 -2
- package/src/tasks/task/publish.ts +1 -1
- package/src/tasks/task/remove.ts +1 -1
- package/src/tasks/task/replay.ts +3 -3
- package/src/tasks/task/run.ts +2 -2
- package/src/test/tasks/create.test.ts +3 -2
- package/src/utils/taskAnalysis.ts +90 -41
- package/logs/bundle:fingerprint.log +0 -1
- package/logs/task:fingerprint.log +0 -10
- package/logs/task:list.log +0 -1
- package/logs/test:guidance.log +0 -1
- package/logs/test:uuid.log +0 -1
- package/logs/test:uuidCheck.log +0 -1
package/dist/runner.js
CHANGED
|
@@ -75,10 +75,78 @@ runner.load('project:create', create_2.create);
|
|
|
75
75
|
runner.load('project:link', link_1.link);
|
|
76
76
|
runner.load('project:unlink', unlink_1.unlink);
|
|
77
77
|
runner.load('project:sync', sync_1.sync);
|
|
78
|
+
function printAllHelp() {
|
|
79
|
+
const tasks = runner.describe();
|
|
80
|
+
console.log('Usage: forge <command> [options]');
|
|
81
|
+
console.log('');
|
|
82
|
+
console.log('Commands:');
|
|
83
|
+
const groups = {};
|
|
84
|
+
for (const name of Object.keys(tasks).sort()) {
|
|
85
|
+
const group = name.includes(':') ? name.split(':')[0] : name;
|
|
86
|
+
if (!groups[group]) {
|
|
87
|
+
groups[group] = [];
|
|
88
|
+
}
|
|
89
|
+
groups[group].push(name);
|
|
90
|
+
}
|
|
91
|
+
for (const [group, commands] of Object.entries(groups)) {
|
|
92
|
+
console.log(`\n ${group}:`);
|
|
93
|
+
for (const cmd of commands) {
|
|
94
|
+
const desc = tasks[cmd].description || '';
|
|
95
|
+
console.log(` ${cmd.padEnd(26)} ${desc}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
console.log('');
|
|
99
|
+
console.log('Run "forge <command> --help" for more information on a specific command.');
|
|
100
|
+
}
|
|
101
|
+
function printTaskHelp(taskName) {
|
|
102
|
+
const task = runner.getTask(taskName);
|
|
103
|
+
if (!task) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
// `describe()` returns JSON Schema: fields live under `properties`, optionality
|
|
107
|
+
// is the absence from `required`, and `description` carries the help text.
|
|
108
|
+
const schema = task.describe();
|
|
109
|
+
const properties = (schema.properties ?? {});
|
|
110
|
+
const required = new Set((schema.required ?? []));
|
|
111
|
+
const keys = Object.keys(properties);
|
|
112
|
+
console.log(`Usage: forge ${taskName}${keys.length > 0 ? ' [options]' : ''}`);
|
|
113
|
+
console.log('');
|
|
114
|
+
const desc = task.getDescription();
|
|
115
|
+
if (desc) {
|
|
116
|
+
console.log(desc);
|
|
117
|
+
console.log('');
|
|
118
|
+
}
|
|
119
|
+
if (keys.length > 0) {
|
|
120
|
+
console.log('Options:');
|
|
121
|
+
for (const key of keys) {
|
|
122
|
+
const field = properties[key];
|
|
123
|
+
const type = field.format ?? field.type ?? 'unknown';
|
|
124
|
+
const optional = required.has(key) ? '' : ' (optional)';
|
|
125
|
+
const description = field.description ? ` - ${field.description}` : '';
|
|
126
|
+
console.log(` --${key.padEnd(20)} ${`${type}${optional}`.padEnd(20)}${description}`);
|
|
127
|
+
}
|
|
128
|
+
console.log('');
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
console.log('This command takes no options.');
|
|
132
|
+
console.log('');
|
|
133
|
+
}
|
|
134
|
+
}
|
|
78
135
|
// Set handler
|
|
79
136
|
runner.setHandler(async (data) => {
|
|
80
137
|
const parsedArgs = runner.parseArguments(data);
|
|
81
138
|
const { taskName, action, args } = parsedArgs;
|
|
139
|
+
const helpRequested = args?.help === true;
|
|
140
|
+
if (helpRequested || taskName === 'undefined' || !taskName) {
|
|
141
|
+
if (helpRequested && runner.getTask(taskName)) {
|
|
142
|
+
printTaskHelp(taskName);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
printAllHelp();
|
|
146
|
+
}
|
|
147
|
+
setTimeout(() => { process.exit(0); }, 100);
|
|
148
|
+
return { silent: true, outcome: 'Success', taskName, result: null };
|
|
149
|
+
}
|
|
82
150
|
console.log('===============================================');
|
|
83
151
|
console.log(`Running: ${taskName} ${action ? action : ''} ${JSON.stringify(args)}`);
|
|
84
152
|
console.log('===============================================');
|
package/dist/tasks/auth/add.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const add: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
|
5
5
|
apiSecret: string;
|
|
6
6
|
url: string;
|
|
7
7
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
8
|
-
loadProfiles: (args:
|
|
8
|
+
loadProfiles: (args: Record<string, unknown>) => Promise<Promise<Profiles>>;
|
|
9
9
|
persistProfiles: (profiles: Profiles) => Promise<void>;
|
|
10
10
|
fetchMeInfo: (apiKey: string, apiSecret: string, url: string) => Promise<{
|
|
11
11
|
success: boolean;
|
|
@@ -20,7 +20,7 @@ export declare const add: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
|
20
20
|
teamName: string | undefined;
|
|
21
21
|
userName: string | undefined;
|
|
22
22
|
}>, {
|
|
23
|
-
loadProfiles: (args:
|
|
23
|
+
loadProfiles: (args: Record<string, unknown>) => Promise<Promise<Profiles>>;
|
|
24
24
|
persistProfiles: (profiles: Profiles) => Promise<void>;
|
|
25
25
|
fetchMeInfo: (apiKey: string, apiSecret: string, url: string) => Promise<{
|
|
26
26
|
success: boolean;
|
package/dist/tasks/auth/add.js
CHANGED
|
@@ -14,10 +14,10 @@ const promises_1 = __importDefault(require("fs/promises"));
|
|
|
14
14
|
const os_1 = __importDefault(require("os"));
|
|
15
15
|
const load_1 = require("./load");
|
|
16
16
|
const schema = new schema_1.Schema({
|
|
17
|
-
name: schema_1.Schema.string(),
|
|
18
|
-
apiKey: schema_1.Schema.string(),
|
|
19
|
-
apiSecret: schema_1.Schema.string(),
|
|
20
|
-
url: schema_1.Schema.string()
|
|
17
|
+
name: schema_1.Schema.string().describe('The name of the profile'),
|
|
18
|
+
apiKey: schema_1.Schema.string().describe('The API key for the profile'),
|
|
19
|
+
apiSecret: schema_1.Schema.string().describe('The API secret for the profile'),
|
|
20
|
+
url: schema_1.Schema.string().describe('The URL for the profile')
|
|
21
21
|
});
|
|
22
22
|
const boundaries = {
|
|
23
23
|
loadProfiles: load_1.load.asBoundary(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Profiles } from '../types';
|
|
2
|
-
export declare const clear: import("@forgehive/task").TaskInstanceType<(argv:
|
|
3
|
-
loadProfiles: (args:
|
|
2
|
+
export declare const clear: import("@forgehive/task").TaskInstanceType<(argv: Record<string, unknown>, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
3
|
+
loadProfiles: (args: Record<string, unknown>) => Promise<Promise<Profiles>>;
|
|
4
4
|
clearProfiles: () => Promise<void>;
|
|
5
5
|
}>) => Promise<{
|
|
6
6
|
status: string;
|
|
@@ -11,6 +11,6 @@ export declare const clear: import("@forgehive/task").TaskInstanceType<(argv: {}
|
|
|
11
11
|
message: string;
|
|
12
12
|
clearedCount: number;
|
|
13
13
|
}>, {
|
|
14
|
-
loadProfiles: (args:
|
|
14
|
+
loadProfiles: (args: Record<string, unknown>) => Promise<Promise<Profiles>>;
|
|
15
15
|
clearProfiles: () => Promise<void>;
|
|
16
16
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Profiles } from '../types';
|
|
2
|
-
export declare const list: import("@forgehive/task").TaskInstanceType<(argv:
|
|
3
|
-
loadProfiles: (args:
|
|
2
|
+
export declare const list: import("@forgehive/task").TaskInstanceType<(argv: Record<string, unknown>, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
3
|
+
loadProfiles: (args: Record<string, unknown>) => Promise<Promise<Profiles>>;
|
|
4
4
|
}>) => Promise<{
|
|
5
5
|
status: string;
|
|
6
6
|
profiles: never[];
|
|
@@ -16,5 +16,5 @@ export declare const list: import("@forgehive/task").TaskInstanceType<(argv: {},
|
|
|
16
16
|
}[];
|
|
17
17
|
status?: undefined;
|
|
18
18
|
}>, {
|
|
19
|
-
loadProfiles: (args:
|
|
19
|
+
loadProfiles: (args: Record<string, unknown>) => Promise<Promise<Profiles>>;
|
|
20
20
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Profiles } from '../types';
|
|
2
|
-
export declare const load: import("@forgehive/task").TaskInstanceType<(argv:
|
|
2
|
+
export declare const load: import("@forgehive/task").TaskInstanceType<(argv: Record<string, unknown>, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
3
3
|
ensureBuildsFolder: () => Promise<string>;
|
|
4
4
|
}>) => Promise<Profiles>, {
|
|
5
5
|
ensureBuildsFolder: () => Promise<string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Profile } from '../types';
|
|
2
|
-
export declare const loadCurrent: import("@forgehive/task").TaskInstanceType<(argv:
|
|
3
|
-
loadProfiles: (args:
|
|
2
|
+
export declare const loadCurrent: import("@forgehive/task").TaskInstanceType<(argv: Record<string, unknown>, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
3
|
+
loadProfiles: (args: Record<string, unknown>) => Promise<Promise<import("../types").Profiles>>;
|
|
4
4
|
}>) => Promise<Profile>, {
|
|
5
|
-
loadProfiles: (args:
|
|
5
|
+
loadProfiles: (args: Record<string, unknown>) => Promise<Promise<import("../types").Profiles>>;
|
|
6
6
|
}>;
|
|
@@ -2,12 +2,12 @@ import { type Profiles } from '../types';
|
|
|
2
2
|
export declare const remove: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
3
3
|
profileName: string;
|
|
4
4
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
5
|
-
loadProfiles: (args:
|
|
5
|
+
loadProfiles: (args: Record<string, unknown>) => Promise<Promise<Profiles>>;
|
|
6
6
|
persistProfiles: (profiles: Profiles) => Promise<void>;
|
|
7
7
|
}>) => Promise<{
|
|
8
8
|
status: string;
|
|
9
9
|
message: string;
|
|
10
10
|
}>, {
|
|
11
|
-
loadProfiles: (args:
|
|
11
|
+
loadProfiles: (args: Record<string, unknown>) => Promise<Promise<Profiles>>;
|
|
12
12
|
persistProfiles: (profiles: Profiles) => Promise<void>;
|
|
13
13
|
}>;
|
|
@@ -14,7 +14,7 @@ const promises_1 = __importDefault(require("fs/promises"));
|
|
|
14
14
|
const os_1 = __importDefault(require("os"));
|
|
15
15
|
const load_1 = require("./load");
|
|
16
16
|
const schema = new schema_1.Schema({
|
|
17
|
-
profileName: schema_1.Schema.string()
|
|
17
|
+
profileName: schema_1.Schema.string().describe('The name of the auth profile to remove')
|
|
18
18
|
});
|
|
19
19
|
const boundaries = {
|
|
20
20
|
loadProfiles: load_1.load.asBoundary(),
|
|
@@ -2,11 +2,11 @@ import { type Profiles } from '../types';
|
|
|
2
2
|
export declare const switchProfile: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
3
3
|
profileName: string;
|
|
4
4
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
5
|
-
loadProfiles: (args:
|
|
5
|
+
loadProfiles: (args: Record<string, unknown>) => Promise<Promise<Profiles>>;
|
|
6
6
|
persistProfiles: (profiles: Profiles) => Promise<void>;
|
|
7
7
|
}>) => Promise<{
|
|
8
8
|
default: string;
|
|
9
9
|
}>, {
|
|
10
|
-
loadProfiles: (args:
|
|
10
|
+
loadProfiles: (args: Record<string, unknown>) => Promise<Promise<Profiles>>;
|
|
11
11
|
persistProfiles: (profiles: Profiles) => Promise<void>;
|
|
12
12
|
}>;
|
|
@@ -14,7 +14,7 @@ const promises_1 = __importDefault(require("fs/promises"));
|
|
|
14
14
|
const os_1 = __importDefault(require("os"));
|
|
15
15
|
const load_1 = require("./load");
|
|
16
16
|
const schema = new schema_1.Schema({
|
|
17
|
-
profileName: schema_1.Schema.string()
|
|
17
|
+
profileName: schema_1.Schema.string().describe('The name of the auth profile to switch to')
|
|
18
18
|
});
|
|
19
19
|
const boundaries = {
|
|
20
20
|
loadProfiles: load_1.load.asBoundary(),
|
|
@@ -3,9 +3,9 @@ export declare const create: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
|
3
3
|
entryPoint: string;
|
|
4
4
|
outputFile: string;
|
|
5
5
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
6
|
-
loadConf: (args:
|
|
6
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
7
7
|
}>) => Promise<{
|
|
8
8
|
outputFile: string;
|
|
9
9
|
}>, {
|
|
10
|
-
loadConf: (args:
|
|
10
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
11
11
|
}>;
|
|
@@ -12,8 +12,8 @@ const schema_1 = require("@forgehive/schema");
|
|
|
12
12
|
const esbuild_1 = __importDefault(require("esbuild"));
|
|
13
13
|
const load_1 = require("../conf/load");
|
|
14
14
|
const schema = new schema_1.Schema({
|
|
15
|
-
entryPoint: schema_1.Schema.string(),
|
|
16
|
-
outputFile: schema_1.Schema.string()
|
|
15
|
+
entryPoint: schema_1.Schema.string().describe('Path to the task entry point file'),
|
|
16
|
+
outputFile: schema_1.Schema.string().describe('Path for the bundled output file')
|
|
17
17
|
});
|
|
18
18
|
const boundaries = {
|
|
19
19
|
loadConf: load_1.load.asBoundary()
|
|
@@ -4,7 +4,7 @@ export declare const fingerprint: import("@forgehive/task").TaskInstanceType<(ar
|
|
|
4
4
|
filePath?: string | undefined;
|
|
5
5
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
6
6
|
getCwd: () => Promise<string>;
|
|
7
|
-
loadConf: (args:
|
|
7
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<import("../types").ForgeConf>>;
|
|
8
8
|
readFile: (filePath: string) => Promise<string>;
|
|
9
9
|
writeFile: (filePath: string, content: string) => Promise<void>;
|
|
10
10
|
ensureFingerprintsFolder: (cwd: string, conf: {
|
|
@@ -35,7 +35,7 @@ export declare const fingerprint: import("@forgehive/task").TaskInstanceType<(ar
|
|
|
35
35
|
fingerprintFile?: undefined;
|
|
36
36
|
}>, {
|
|
37
37
|
getCwd: () => Promise<string>;
|
|
38
|
-
loadConf: (args:
|
|
38
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<import("../types").ForgeConf>>;
|
|
39
39
|
readFile: (filePath: string) => Promise<string>;
|
|
40
40
|
writeFile: (filePath: string, content: string) => Promise<void>;
|
|
41
41
|
ensureFingerprintsFolder: (cwd: string, conf: {
|
|
@@ -16,8 +16,8 @@ const load_1 = require("../conf/load");
|
|
|
16
16
|
const taskAnalysis_1 = require("../../utils/taskAnalysis");
|
|
17
17
|
const description = 'Generate task bundle with comprehensive fingerprinting and type extraction';
|
|
18
18
|
const schema = new schema_1.Schema({
|
|
19
|
-
descriptorName: schema_1.Schema.string(),
|
|
20
|
-
filePath: schema_1.Schema.string().optional()
|
|
19
|
+
descriptorName: schema_1.Schema.string().describe('The task descriptor name (e.g. domain:taskName)'),
|
|
20
|
+
filePath: schema_1.Schema.string().describe('Optional path to the task source file').optional()
|
|
21
21
|
});
|
|
22
22
|
const boundaries = {
|
|
23
23
|
getCwd: async () => {
|
|
@@ -40,7 +40,7 @@ exports.load = void 0;
|
|
|
40
40
|
const task_1 = require("@forgehive/task");
|
|
41
41
|
const schema_1 = require("@forgehive/schema");
|
|
42
42
|
const schema = new schema_1.Schema({
|
|
43
|
-
bundlePath: schema_1.Schema.string()
|
|
43
|
+
bundlePath: schema_1.Schema.string().describe('Path to the bundle file to load')
|
|
44
44
|
});
|
|
45
45
|
const boundaries = {};
|
|
46
46
|
exports.load = (0, task_1.createTask)({
|
package/dist/tasks/bundle/zip.js
CHANGED
|
@@ -14,10 +14,10 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
14
14
|
const path_1 = __importDefault(require("path"));
|
|
15
15
|
const description = 'Zip a bundle file for distribution';
|
|
16
16
|
const schema = new schema_1.Schema({
|
|
17
|
-
dir: schema_1.Schema.string(),
|
|
18
|
-
input: schema_1.Schema.string(),
|
|
19
|
-
output: schema_1.Schema.string(),
|
|
20
|
-
forgeJsonPath: schema_1.Schema.string().optional() // Optional path to forge.json - if provided, it will be included
|
|
17
|
+
dir: schema_1.Schema.string().describe('Directory that will contain the generated zip'),
|
|
18
|
+
input: schema_1.Schema.string().describe('Path to the file or folder to add to the zip'),
|
|
19
|
+
output: schema_1.Schema.string().describe('Output path for the generated zip file'),
|
|
20
|
+
forgeJsonPath: schema_1.Schema.string().describe('Optional path to forge.json to include in the bundle').optional() // Optional path to forge.json - if provided, it will be included
|
|
21
21
|
});
|
|
22
22
|
const boundaries = {
|
|
23
23
|
createWriteStream: async (outputPath) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const info: import("@forgehive/task").TaskInstanceType<(argv:
|
|
1
|
+
export declare const info: import("@forgehive/task").TaskInstanceType<(argv: Record<string, unknown>, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
2
2
|
readFile: (filePath: string) => Promise<string>;
|
|
3
|
-
loadConfig: (args:
|
|
4
|
-
loadCurrentProfile: (args:
|
|
3
|
+
loadConfig: (args: Record<string, unknown>) => Promise<Promise<import("../types").ForgeConf>>;
|
|
4
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<import("../types").Profile>>;
|
|
5
5
|
}>) => Promise<{
|
|
6
6
|
version: any;
|
|
7
7
|
profile: null;
|
|
@@ -22,6 +22,6 @@ export declare const info: import("@forgehive/task").TaskInstanceType<(argv: {},
|
|
|
22
22
|
error?: undefined;
|
|
23
23
|
}>, {
|
|
24
24
|
readFile: (filePath: string) => Promise<string>;
|
|
25
|
-
loadConfig: (args:
|
|
26
|
-
loadCurrentProfile: (args:
|
|
25
|
+
loadConfig: (args: Record<string, unknown>) => Promise<Promise<import("../types").ForgeConf>>;
|
|
26
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<import("../types").Profile>>;
|
|
27
27
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ForgeConf } from '../types';
|
|
2
|
-
export declare const load: import("@forgehive/task").TaskInstanceType<(argv:
|
|
2
|
+
export declare const load: import("@forgehive/task").TaskInstanceType<(argv: Record<string, unknown>, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
3
3
|
readFile: (filePath: string) => Promise<string>;
|
|
4
4
|
}>) => Promise<ForgeConf>, {
|
|
5
5
|
readFile: (filePath: string) => Promise<string>;
|
|
@@ -51,8 +51,8 @@ const description = 'Download ForgeHive LLM guides from GitHub to local project'
|
|
|
51
51
|
const LLM_GUIDE_URL = 'https://raw.githubusercontent.com/forge-and-hive/forge-mono-repo/refs/heads/main/docs/llm.md';
|
|
52
52
|
const LLM_HIVE_LOGGING_URL = 'https://raw.githubusercontent.com/forge-and-hive/forge-mono-repo/refs/heads/main/docs/llm-hive-logging.md';
|
|
53
53
|
const schema = new schema_1.Schema({
|
|
54
|
-
path: schema_1.Schema.string().optional(),
|
|
55
|
-
logs: schema_1.Schema.boolean().optional()
|
|
54
|
+
path: schema_1.Schema.string().describe('Optional output path for the downloaded docs').optional(),
|
|
55
|
+
logs: schema_1.Schema.boolean().describe('Include execution logs in the downloaded docs').optional()
|
|
56
56
|
});
|
|
57
57
|
const boundaries = {
|
|
58
58
|
fetchFile: async (url) => {
|
|
@@ -11,8 +11,8 @@ interface FixtureResponse {
|
|
|
11
11
|
export declare const download: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
12
12
|
uuid: string;
|
|
13
13
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
14
|
-
loadCurrentProfile: (args:
|
|
15
|
-
loadConf: (args:
|
|
14
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<Profile>>;
|
|
15
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<import("../types").ForgeConf>>;
|
|
16
16
|
downloadFixture: (uuid: string, profile: Profile) => Promise<FixtureResponse>;
|
|
17
17
|
getCwd: () => Promise<string>;
|
|
18
18
|
persistFixture: (filePath: string, data: FixtureData) => Promise<{
|
|
@@ -23,8 +23,8 @@ export declare const download: import("@forgehive/task").TaskInstanceType<(argv:
|
|
|
23
23
|
path: string;
|
|
24
24
|
shortPath: string;
|
|
25
25
|
}>, {
|
|
26
|
-
loadCurrentProfile: (args:
|
|
27
|
-
loadConf: (args:
|
|
26
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<Profile>>;
|
|
27
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<import("../types").ForgeConf>>;
|
|
28
28
|
downloadFixture: (uuid: string, profile: Profile) => Promise<FixtureResponse>;
|
|
29
29
|
getCwd: () => Promise<string>;
|
|
30
30
|
persistFixture: (filePath: string, data: FixtureData) => Promise<{
|
|
@@ -16,7 +16,7 @@ const loadCurrent_1 = require("../auth/loadCurrent");
|
|
|
16
16
|
const load_1 = require("../conf/load");
|
|
17
17
|
const description = 'Download a fixture by UUID to a path based on task descriptor returned from API';
|
|
18
18
|
const schema = new schema_1.Schema({
|
|
19
|
-
uuid: schema_1.Schema.string()
|
|
19
|
+
uuid: schema_1.Schema.string().describe('The UUID of the fixture to download')
|
|
20
20
|
});
|
|
21
21
|
const boundaries = {
|
|
22
22
|
loadCurrentProfile: loadCurrent_1.loadCurrent.asBoundary(),
|
package/dist/tasks/init.js
CHANGED
|
@@ -9,7 +9,7 @@ const promises_1 = __importDefault(require("fs/promises"));
|
|
|
9
9
|
const task_1 = require("@forgehive/task");
|
|
10
10
|
const schema_1 = require("@forgehive/schema");
|
|
11
11
|
const schema = new schema_1.Schema({
|
|
12
|
-
dryRun: schema_1.Schema.boolean().optional()
|
|
12
|
+
dryRun: schema_1.Schema.boolean().describe('Preview the changes without writing any files').optional()
|
|
13
13
|
});
|
|
14
14
|
const boundaries = {
|
|
15
15
|
saveFile: async (path, content) => {
|
|
@@ -3,8 +3,8 @@ export declare const create: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
|
3
3
|
name: string;
|
|
4
4
|
description?: string | undefined;
|
|
5
5
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
6
|
-
loadConf: (args:
|
|
7
|
-
loadCurrentProfile: (args:
|
|
6
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
7
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<Profile>>;
|
|
8
8
|
writeFile: (filePath: string, content: string) => Promise<void>;
|
|
9
9
|
createProject: (profile: Profile, payload: {
|
|
10
10
|
projectName: string;
|
|
@@ -16,8 +16,8 @@ export declare const create: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
|
16
16
|
project: any;
|
|
17
17
|
localUuid: string;
|
|
18
18
|
}>, {
|
|
19
|
-
loadConf: (args:
|
|
20
|
-
loadCurrentProfile: (args:
|
|
19
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
20
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<Profile>>;
|
|
21
21
|
writeFile: (filePath: string, content: string) => Promise<void>;
|
|
22
22
|
createProject: (profile: Profile, payload: {
|
|
23
23
|
projectName: string;
|
|
@@ -17,8 +17,8 @@ const loadCurrent_1 = require("../auth/loadCurrent");
|
|
|
17
17
|
const taskName = 'project:create';
|
|
18
18
|
const taskDescription = 'Create a new project in ForgeHive';
|
|
19
19
|
const schema = new schema_1.Schema({
|
|
20
|
-
name: schema_1.Schema.string(),
|
|
21
|
-
description: schema_1.Schema.string().optional()
|
|
20
|
+
name: schema_1.Schema.string().describe('The name of the project'),
|
|
21
|
+
description: schema_1.Schema.string().describe('Optional description of the project').optional()
|
|
22
22
|
});
|
|
23
23
|
const boundaries = {
|
|
24
24
|
loadConf: load_1.load.asBoundary(),
|
|
@@ -2,8 +2,8 @@ import { type ForgeConf, type Profile } from '../types';
|
|
|
2
2
|
export declare const link: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
3
3
|
uuid: string;
|
|
4
4
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
5
|
-
loadConf: (args:
|
|
6
|
-
loadCurrentProfile: (args:
|
|
5
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
6
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<Profile>>;
|
|
7
7
|
writeFile: (filePath: string, content: string) => Promise<void>;
|
|
8
8
|
fetchProject: (profile: Profile, uuid: string) => Promise<Response>;
|
|
9
9
|
}>) => Promise<{
|
|
@@ -15,8 +15,8 @@ export declare const link: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
|
15
15
|
tasksCount: any;
|
|
16
16
|
};
|
|
17
17
|
}>, {
|
|
18
|
-
loadConf: (args:
|
|
19
|
-
loadCurrentProfile: (args:
|
|
18
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
19
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<Profile>>;
|
|
20
20
|
writeFile: (filePath: string, content: string) => Promise<void>;
|
|
21
21
|
fetchProject: (profile: Profile, uuid: string) => Promise<Response>;
|
|
22
22
|
}>;
|
|
@@ -16,7 +16,7 @@ const loadCurrent_1 = require("../auth/loadCurrent");
|
|
|
16
16
|
const name = 'project:link';
|
|
17
17
|
const description = 'Link an existing remote project to the local project by UUID';
|
|
18
18
|
const schema = new schema_1.Schema({
|
|
19
|
-
uuid: schema_1.Schema.string()
|
|
19
|
+
uuid: schema_1.Schema.string().describe('The UUID of the project to link')
|
|
20
20
|
});
|
|
21
21
|
const boundaries = {
|
|
22
22
|
loadConf: load_1.load.asBoundary(),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ForgeConf } from '../types';
|
|
2
|
-
export declare const sync: import("@forgehive/task").TaskInstanceType<(argv:
|
|
3
|
-
loadConf: (args:
|
|
4
|
-
loadCurrentProfile: (args:
|
|
2
|
+
export declare const sync: import("@forgehive/task").TaskInstanceType<(argv: Record<string, unknown>, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
3
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
4
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<import("../types").Profile>>;
|
|
5
5
|
getCwd: () => Promise<string>;
|
|
6
6
|
persistConf: (forge: ForgeConf, cwd: string) => Promise<void>;
|
|
7
7
|
syncTasksToHive: (projectUuid: string, projectName: string, projectDescription: string | undefined, tasks: Array<{
|
|
@@ -74,8 +74,8 @@ export declare const sync: import("@forgehive/task").TaskInstanceType<(argv: {},
|
|
|
74
74
|
projectUrl: string;
|
|
75
75
|
message?: undefined;
|
|
76
76
|
}>, {
|
|
77
|
-
loadConf: (args:
|
|
78
|
-
loadCurrentProfile: (args:
|
|
77
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
78
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<import("../types").Profile>>;
|
|
79
79
|
getCwd: () => Promise<string>;
|
|
80
80
|
persistConf: (forge: ForgeConf, cwd: string) => Promise<void>;
|
|
81
81
|
syncTasksToHive: (projectUuid: string, projectName: string, projectDescription: string | undefined, tasks: Array<{
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type ForgeConf } from '../types';
|
|
2
|
-
export declare const unlink: import("@forgehive/task").TaskInstanceType<(argv:
|
|
3
|
-
loadConf: (args:
|
|
2
|
+
export declare const unlink: import("@forgehive/task").TaskInstanceType<(argv: Record<string, unknown>, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
3
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
4
4
|
writeFile: (filePath: string, content: string) => Promise<void>;
|
|
5
5
|
}>) => Promise<{
|
|
6
6
|
success: boolean;
|
|
7
7
|
unlinkedUuid: string;
|
|
8
8
|
}>, {
|
|
9
|
-
loadConf: (args:
|
|
9
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
10
10
|
writeFile: (filePath: string, content: string) => Promise<void>;
|
|
11
11
|
}>;
|
|
@@ -3,7 +3,7 @@ export declare const bundle: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
|
3
3
|
runnerName: string;
|
|
4
4
|
targetPath: string;
|
|
5
5
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
6
|
-
loadConf: (args:
|
|
6
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
7
7
|
getCwd: () => Promise<string>;
|
|
8
8
|
ensureDir: (dirPath: string) => Promise<void>;
|
|
9
9
|
}>) => Promise<{
|
|
@@ -12,7 +12,7 @@ export declare const bundle: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
|
12
12
|
entryPoint: string;
|
|
13
13
|
outputFile: string;
|
|
14
14
|
}>, {
|
|
15
|
-
loadConf: (args:
|
|
15
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
16
16
|
getCwd: () => Promise<string>;
|
|
17
17
|
ensureDir: (dirPath: string) => Promise<void>;
|
|
18
18
|
}>;
|
|
@@ -14,8 +14,8 @@ const path_1 = __importDefault(require("path"));
|
|
|
14
14
|
const promises_1 = __importDefault(require("fs/promises"));
|
|
15
15
|
const load_1 = require("../conf/load");
|
|
16
16
|
const schema = new schema_1.Schema({
|
|
17
|
-
runnerName: schema_1.Schema.string(),
|
|
18
|
-
targetPath: schema_1.Schema.string()
|
|
17
|
+
runnerName: schema_1.Schema.string().describe('The name of the runner to bundle'),
|
|
18
|
+
targetPath: schema_1.Schema.string().describe('Target path for the bundled runner')
|
|
19
19
|
});
|
|
20
20
|
const boundaries = {
|
|
21
21
|
loadConf: load_1.load.asBoundary(),
|
|
@@ -2,7 +2,7 @@ import { type ForgeConf } from '../types';
|
|
|
2
2
|
export declare const create: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
3
3
|
runnerName: string;
|
|
4
4
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
5
|
-
loadConf: (args:
|
|
5
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
6
6
|
getCwd: () => Promise<string>;
|
|
7
7
|
persistRunner: (runnerPath: string, runnerName: string, content: string) => Promise<{
|
|
8
8
|
path: string;
|
|
@@ -12,7 +12,7 @@ export declare const create: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
|
12
12
|
runnerPath: string;
|
|
13
13
|
runnerName: string;
|
|
14
14
|
}>, {
|
|
15
|
-
loadConf: (args:
|
|
15
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
16
16
|
getCwd: () => Promise<string>;
|
|
17
17
|
persistRunner: (runnerPath: string, runnerName: string, content: string) => Promise<{
|
|
18
18
|
path: string;
|
|
@@ -30,7 +30,7 @@ const {{ runnerName }}Runner = new Runner()
|
|
|
30
30
|
export { {{ runnerName }}Runner }
|
|
31
31
|
`;
|
|
32
32
|
const schema = new schema_1.Schema({
|
|
33
|
-
runnerName: schema_1.Schema.string()
|
|
33
|
+
runnerName: schema_1.Schema.string().describe('The name of the runner to create')
|
|
34
34
|
});
|
|
35
35
|
const boundaries = {
|
|
36
36
|
// Load boundaries
|
|
@@ -2,7 +2,7 @@ import { type ForgeConf } from '../types';
|
|
|
2
2
|
export declare const remove: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
3
3
|
runnerName: string;
|
|
4
4
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
5
|
-
loadConf: (args:
|
|
5
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
6
6
|
getCwd: () => Promise<string>;
|
|
7
7
|
removeRunner: (runnerPath: string) => Promise<void>;
|
|
8
8
|
persistConf: (forge: ForgeConf, cwd: string) => Promise<void>;
|
|
@@ -11,7 +11,7 @@ export declare const remove: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
|
11
11
|
message: string;
|
|
12
12
|
runnerName: string;
|
|
13
13
|
}>, {
|
|
14
|
-
loadConf: (args:
|
|
14
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
15
15
|
getCwd: () => Promise<string>;
|
|
16
16
|
removeRunner: (runnerPath: string) => Promise<void>;
|
|
17
17
|
persistConf: (forge: ForgeConf, cwd: string) => Promise<void>;
|
|
@@ -14,7 +14,7 @@ const promises_1 = __importDefault(require("fs/promises"));
|
|
|
14
14
|
const camelCase_1 = require("../../utils/camelCase");
|
|
15
15
|
const load_1 = require("../conf/load");
|
|
16
16
|
const schema = new schema_1.Schema({
|
|
17
|
-
runnerName: schema_1.Schema.string()
|
|
17
|
+
runnerName: schema_1.Schema.string().describe('The name of the runner to remove')
|
|
18
18
|
});
|
|
19
19
|
const boundaries = {
|
|
20
20
|
// Load boundaries
|
|
@@ -2,8 +2,8 @@ import { type TaskName, type ForgeConf } from '../types';
|
|
|
2
2
|
export declare const createTaskCommand: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
3
3
|
descriptorName: string;
|
|
4
4
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
5
|
-
loadConf: (args:
|
|
6
|
-
loadCurrentProfile: (args:
|
|
5
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
6
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<import("../types").Profile>>;
|
|
7
7
|
loadTemplate: () => Promise<string>;
|
|
8
8
|
getCwd: () => Promise<string>;
|
|
9
9
|
parseTaskName: (taskDescriptor: string) => Promise<TaskName>;
|
|
@@ -20,8 +20,8 @@ export declare const createTaskCommand: import("@forgehive/task").TaskInstanceTy
|
|
|
20
20
|
taskPath: string;
|
|
21
21
|
fileName: string;
|
|
22
22
|
}>, {
|
|
23
|
-
loadConf: (args:
|
|
24
|
-
loadCurrentProfile: (args:
|
|
23
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
24
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<import("../types").Profile>>;
|
|
25
25
|
loadTemplate: () => Promise<string>;
|
|
26
26
|
getCwd: () => Promise<string>;
|
|
27
27
|
parseTaskName: (taskDescriptor: string) => Promise<TaskName>;
|
|
@@ -26,8 +26,9 @@ const name = '{{ taskDescriptor }}'
|
|
|
26
26
|
const description = 'Add task description here'
|
|
27
27
|
|
|
28
28
|
const schema = new Schema({
|
|
29
|
-
// Add your schema definitions here
|
|
30
|
-
//
|
|
29
|
+
// Add your schema definitions here.
|
|
30
|
+
// Use .describe() so the field shows up in \`forge {{ taskDescriptor }} --help\`.
|
|
31
|
+
// example: myParam: Schema.string().describe('What this parameter is for')
|
|
31
32
|
})
|
|
32
33
|
|
|
33
34
|
const boundaries = {
|