@naseej/blox 1.6.3 → 1.8.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/run.d.ts +2 -0
- package/dist/run.js +485 -241
- package/dist/sdk.d.ts +59 -0
- package/dist/sdk.js +262 -0
- package/package.json +88 -83
- package/readme.md +36 -33
package/dist/sdk.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { SelectOptions, ConfirmOptions, TextOptions, MultiSelectOptions } from '@clack/prompts';
|
|
2
|
+
import { CopyOptions as CopyOptions$1 } from 'fs-extra';
|
|
3
|
+
|
|
4
|
+
declare const select: <Value>(opts: SelectOptions<Value>) => Promise<Value>;
|
|
5
|
+
declare const confirm: (opts: ConfirmOptions) => Promise<boolean>;
|
|
6
|
+
|
|
7
|
+
type InputOptions = TextOptions;
|
|
8
|
+
type ConfirmPromptOptions = ConfirmOptions;
|
|
9
|
+
type SelectPromptOptions<Value> = SelectOptions<Value>;
|
|
10
|
+
type MultiSelectPromptOptions<Value> = MultiSelectOptions<Value>;
|
|
11
|
+
interface WriteJsonOptions {
|
|
12
|
+
spaces?: number;
|
|
13
|
+
}
|
|
14
|
+
interface CopyOptions {
|
|
15
|
+
overwrite?: CopyOptions$1['overwrite'];
|
|
16
|
+
filter?: CopyOptions$1['filter'];
|
|
17
|
+
}
|
|
18
|
+
type JsonUpdater<T> = (current: T) => T | void | Promise<T | void>;
|
|
19
|
+
interface ExecOptions {
|
|
20
|
+
cwd?: string;
|
|
21
|
+
shell?: boolean;
|
|
22
|
+
onStdout?: (data: string) => void;
|
|
23
|
+
}
|
|
24
|
+
interface ExecResult {
|
|
25
|
+
code: number | null;
|
|
26
|
+
stdout: string;
|
|
27
|
+
stderr: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
declare const input: (opts: InputOptions) => Promise<string>;
|
|
31
|
+
declare const multiSelect: <Value>(opts: MultiSelectPromptOptions<Value>) => Promise<Value[]>;
|
|
32
|
+
|
|
33
|
+
declare const log: {
|
|
34
|
+
info: (message: string) => void;
|
|
35
|
+
success: (message: string) => void;
|
|
36
|
+
warn: (message: string) => void;
|
|
37
|
+
error: (message: string) => void;
|
|
38
|
+
};
|
|
39
|
+
declare const spinner: () => {
|
|
40
|
+
start: (msg?: string) => void;
|
|
41
|
+
stop: (msg?: string, code?: number) => void;
|
|
42
|
+
success: (msg?: string) => void;
|
|
43
|
+
fail: (msg?: string, code?: number) => void;
|
|
44
|
+
finish: (msg?: string) => void;
|
|
45
|
+
message: (msg: string) => void;
|
|
46
|
+
};
|
|
47
|
+
declare const exists: (targetPath: string) => Promise<boolean>;
|
|
48
|
+
declare const readJson: <T = unknown>(targetPath: string) => Promise<T>;
|
|
49
|
+
declare const writeJson: (targetPath: string, data: unknown, options?: WriteJsonOptions) => Promise<void>;
|
|
50
|
+
declare const mkdir: (targetPath: string) => Promise<void>;
|
|
51
|
+
declare const copy: (sourcePath: string, destinationPath: string, options?: CopyOptions) => Promise<void>;
|
|
52
|
+
declare const remove: (targetPath: string) => Promise<void>;
|
|
53
|
+
declare const move: (sourcePath: string, destinationPath: string) => Promise<void>;
|
|
54
|
+
declare const updateJson: <T = unknown>(targetPath: string, updater: JsonUpdater<T>) => Promise<void>;
|
|
55
|
+
declare const exec: (command: string, args?: string[], options?: ExecOptions) => Promise<ExecResult>;
|
|
56
|
+
declare const join: (...segments: string[]) => string;
|
|
57
|
+
declare const resolve: (...segments: string[]) => string;
|
|
58
|
+
|
|
59
|
+
export { type ConfirmPromptOptions, type CopyOptions, type ExecOptions, type ExecResult, type InputOptions, type JsonUpdater, type MultiSelectPromptOptions, type SelectPromptOptions, type WriteJsonOptions, confirm, copy, exec, exists, input, join, log, mkdir, move, multiSelect, readJson, remove, resolve, select, spinner, updateJson, writeJson };
|
package/dist/sdk.js
ADDED
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/sdk/index.ts
|
|
31
|
+
var sdk_exports = {};
|
|
32
|
+
__export(sdk_exports, {
|
|
33
|
+
confirm: () => confirm,
|
|
34
|
+
copy: () => copy,
|
|
35
|
+
exec: () => exec,
|
|
36
|
+
exists: () => exists,
|
|
37
|
+
input: () => input,
|
|
38
|
+
join: () => join,
|
|
39
|
+
log: () => log5,
|
|
40
|
+
mkdir: () => mkdir,
|
|
41
|
+
move: () => move,
|
|
42
|
+
multiSelect: () => multiSelect,
|
|
43
|
+
readJson: () => readJson,
|
|
44
|
+
remove: () => remove,
|
|
45
|
+
resolve: () => resolve,
|
|
46
|
+
select: () => select,
|
|
47
|
+
spinner: () => spinner2,
|
|
48
|
+
updateJson: () => updateJson,
|
|
49
|
+
writeJson: () => writeJson
|
|
50
|
+
});
|
|
51
|
+
module.exports = __toCommonJS(sdk_exports);
|
|
52
|
+
var import_node_path = __toESM(require("path"));
|
|
53
|
+
var import_prompts5 = require("@clack/prompts");
|
|
54
|
+
var import_fs_extra = __toESM(require("fs-extra"));
|
|
55
|
+
|
|
56
|
+
// src/services/shell.ts
|
|
57
|
+
var import_cross_spawn = __toESM(require("cross-spawn"));
|
|
58
|
+
|
|
59
|
+
// src/shared/logger.ts
|
|
60
|
+
var console = __toESM(require("console"));
|
|
61
|
+
var import_prompts = require("@clack/prompts");
|
|
62
|
+
|
|
63
|
+
// src/shared/command/index.ts
|
|
64
|
+
var import_extra_typings = require("@commander-js/extra-typings");
|
|
65
|
+
var import_extra_typings2 = require("@commander-js/extra-typings");
|
|
66
|
+
|
|
67
|
+
// src/config/runtime.ts
|
|
68
|
+
var isDebugMode = () => !!import_extra_typings2.program.opts()?.debug;
|
|
69
|
+
var isMinimalMode = () => !!import_extra_typings2.program.opts()?.minimal;
|
|
70
|
+
|
|
71
|
+
// src/shared/terminal/index.ts
|
|
72
|
+
var import_ansis = __toESM(require("ansis"));
|
|
73
|
+
var fmt = import_ansis.default;
|
|
74
|
+
|
|
75
|
+
// src/shared/logger.ts
|
|
76
|
+
var import_prompts2 = require("@clack/prompts");
|
|
77
|
+
var debug = (message) => {
|
|
78
|
+
if (!isDebugMode()) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (typeof message === "string") {
|
|
82
|
+
import_prompts.log.warn(message.trim());
|
|
83
|
+
} else {
|
|
84
|
+
console.log(JSON.stringify(message));
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// src/services/shell.ts
|
|
89
|
+
var $ = async (bin, options = [], { cwd, onStdout, shell = false } = {}) => {
|
|
90
|
+
debug(`Command executed: "${bin} ${options.join(" ")}" with cwd = ${cwd}`);
|
|
91
|
+
return new Promise(function(resolve2, reject) {
|
|
92
|
+
const child = (0, import_cross_spawn.default)(bin, options, { cwd, shell, stdio: ["pipe", "pipe", "pipe"] });
|
|
93
|
+
let stdout = "";
|
|
94
|
+
let stderr = "";
|
|
95
|
+
child.stdout?.on("data", (data) => {
|
|
96
|
+
const str = data.toString();
|
|
97
|
+
stdout += str;
|
|
98
|
+
try {
|
|
99
|
+
onStdout && onStdout(str);
|
|
100
|
+
} catch (e) {
|
|
101
|
+
reject(e);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
child.stderr?.on("data", (data) => {
|
|
105
|
+
stderr += data.toString();
|
|
106
|
+
});
|
|
107
|
+
child.on("close", function(code) {
|
|
108
|
+
if (code) {
|
|
109
|
+
const combined = (stdout + "\n" + stderr).trim();
|
|
110
|
+
const msg = `Command "${bin} ${options.join(" ")}" failed (code ${code}).
|
|
111
|
+
${combined}`;
|
|
112
|
+
const err = new Error(msg);
|
|
113
|
+
err.code = code;
|
|
114
|
+
err.stdout = stdout;
|
|
115
|
+
err.stderr = stderr;
|
|
116
|
+
err.combined = combined;
|
|
117
|
+
reject(err);
|
|
118
|
+
} else {
|
|
119
|
+
resolve2({ code, stdout, stderr });
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
child.on("error", function(err) {
|
|
123
|
+
reject(err);
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
// src/shared/prompts/index.ts
|
|
129
|
+
var import_prompts3 = require("@clack/prompts");
|
|
130
|
+
var checkIfCanceled = (value) => {
|
|
131
|
+
if ((0, import_prompts3.isCancel)(value)) {
|
|
132
|
+
(0, import_prompts3.cancel)();
|
|
133
|
+
process.exit(0);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
var select = async (opts) => {
|
|
137
|
+
const value = await (0, import_prompts3.select)(opts);
|
|
138
|
+
checkIfCanceled(value);
|
|
139
|
+
return value;
|
|
140
|
+
};
|
|
141
|
+
var text = async (opts) => {
|
|
142
|
+
const value = await (0, import_prompts3.text)(opts);
|
|
143
|
+
checkIfCanceled(value);
|
|
144
|
+
return value;
|
|
145
|
+
};
|
|
146
|
+
var confirm = async (opts) => {
|
|
147
|
+
const value = await (0, import_prompts3.confirm)(opts);
|
|
148
|
+
checkIfCanceled(value);
|
|
149
|
+
return value;
|
|
150
|
+
};
|
|
151
|
+
var multiselect = async (opts) => {
|
|
152
|
+
const value = await (0, import_prompts3.multiselect)(opts);
|
|
153
|
+
checkIfCanceled(value);
|
|
154
|
+
return value;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// src/shared/spinner.ts
|
|
158
|
+
var import_prompts4 = require("@clack/prompts");
|
|
159
|
+
var spinner = () => {
|
|
160
|
+
const s = (0, import_prompts4.spinner)();
|
|
161
|
+
const minimal = isMinimalMode() || isDebugMode();
|
|
162
|
+
const stop = (msg = "error", code) => {
|
|
163
|
+
minimal ? code ? import_prompts2.log.error(msg) : import_prompts2.log.step(msg || "success") : s.stop(code ? fmt.red(msg) : fmt.green(msg), code);
|
|
164
|
+
};
|
|
165
|
+
return {
|
|
166
|
+
start: (msg) => {
|
|
167
|
+
minimal ? import_prompts2.log.step(`${msg || "start"}...`) : s.start(msg);
|
|
168
|
+
},
|
|
169
|
+
stop,
|
|
170
|
+
success: (msg = "success") => {
|
|
171
|
+
stop(msg, 0);
|
|
172
|
+
},
|
|
173
|
+
fail: (msg = "error", code = 1) => {
|
|
174
|
+
stop(msg, code);
|
|
175
|
+
},
|
|
176
|
+
finish: (msg = "success") => {
|
|
177
|
+
stop(msg, 0);
|
|
178
|
+
},
|
|
179
|
+
message: (msg) => {
|
|
180
|
+
minimal ? import_prompts2.log.message(msg) : s.message(msg);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
// src/sdk/index.ts
|
|
186
|
+
var input = (opts) => text(opts);
|
|
187
|
+
var multiSelect = (opts) => {
|
|
188
|
+
return multiselect(opts);
|
|
189
|
+
};
|
|
190
|
+
var log5 = {
|
|
191
|
+
info: import_prompts5.log.info,
|
|
192
|
+
success: import_prompts5.log.success,
|
|
193
|
+
warn: import_prompts5.log.warn,
|
|
194
|
+
error: import_prompts5.log.error
|
|
195
|
+
};
|
|
196
|
+
var spinner2 = () => spinner();
|
|
197
|
+
var exists = async (targetPath) => {
|
|
198
|
+
return import_fs_extra.default.pathExists(targetPath);
|
|
199
|
+
};
|
|
200
|
+
var readJson = async (targetPath) => {
|
|
201
|
+
return import_fs_extra.default.readJson(targetPath);
|
|
202
|
+
};
|
|
203
|
+
var writeJson = async (targetPath, data, options = {}) => {
|
|
204
|
+
const { spaces = 2 } = options;
|
|
205
|
+
await import_fs_extra.default.outputJson(targetPath, data, { spaces });
|
|
206
|
+
};
|
|
207
|
+
var mkdir = async (targetPath) => {
|
|
208
|
+
await import_fs_extra.default.ensureDir(targetPath);
|
|
209
|
+
};
|
|
210
|
+
var copy = async (sourcePath, destinationPath, options = {}) => {
|
|
211
|
+
const { overwrite = true, filter } = options;
|
|
212
|
+
await import_fs_extra.default.copy(sourcePath, destinationPath, {
|
|
213
|
+
overwrite,
|
|
214
|
+
errorOnExist: false,
|
|
215
|
+
...filter ? { filter } : {}
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
var remove = async (targetPath) => {
|
|
219
|
+
await import_fs_extra.default.remove(targetPath);
|
|
220
|
+
};
|
|
221
|
+
var move = async (sourcePath, destinationPath) => {
|
|
222
|
+
await import_fs_extra.default.move(sourcePath, destinationPath);
|
|
223
|
+
};
|
|
224
|
+
var updateJson = async (targetPath, updater) => {
|
|
225
|
+
const current = await readJson(targetPath);
|
|
226
|
+
const updated = await updater(current);
|
|
227
|
+
await writeJson(targetPath, updated === void 0 ? current : updated);
|
|
228
|
+
};
|
|
229
|
+
var exec = async (command, args = [], options = {}) => {
|
|
230
|
+
const result = await $(command, args, options);
|
|
231
|
+
return {
|
|
232
|
+
code: result.code,
|
|
233
|
+
stdout: result.stdout,
|
|
234
|
+
stderr: result.stderr
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
var join = (...segments) => {
|
|
238
|
+
return import_node_path.default.join(...segments);
|
|
239
|
+
};
|
|
240
|
+
var resolve = (...segments) => {
|
|
241
|
+
return import_node_path.default.resolve(...segments);
|
|
242
|
+
};
|
|
243
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
244
|
+
0 && (module.exports = {
|
|
245
|
+
confirm,
|
|
246
|
+
copy,
|
|
247
|
+
exec,
|
|
248
|
+
exists,
|
|
249
|
+
input,
|
|
250
|
+
join,
|
|
251
|
+
log,
|
|
252
|
+
mkdir,
|
|
253
|
+
move,
|
|
254
|
+
multiSelect,
|
|
255
|
+
readJson,
|
|
256
|
+
remove,
|
|
257
|
+
resolve,
|
|
258
|
+
select,
|
|
259
|
+
spinner,
|
|
260
|
+
updateJson,
|
|
261
|
+
writeJson
|
|
262
|
+
});
|
package/package.json
CHANGED
|
@@ -1,85 +1,90 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
2
|
+
"name": "@naseej/blox",
|
|
3
|
+
"version": "1.8.0",
|
|
4
|
+
"description": "blox cli",
|
|
5
|
+
"exports": {
|
|
6
|
+
"./sdk": {
|
|
7
|
+
"types": "./dist/sdk.d.ts",
|
|
8
|
+
"default": "./dist/sdk.js"
|
|
9
|
+
},
|
|
10
|
+
"./package.json": "./package.json"
|
|
11
|
+
},
|
|
12
|
+
"bin": {
|
|
13
|
+
"blox": "./bin/run"
|
|
14
|
+
},
|
|
15
|
+
"directories": {
|
|
16
|
+
"lib": "src",
|
|
17
|
+
"bin": "bin"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"bin"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsup-node",
|
|
25
|
+
"build:watch": "tsup-node --watch",
|
|
26
|
+
"clean": "rm -rf dist",
|
|
27
|
+
"commitlint": "commitlint --edit",
|
|
28
|
+
"compile": "tsc",
|
|
29
|
+
"start": "tsx ./bin/run.ts",
|
|
30
|
+
"start:node": "node ./bin/run",
|
|
31
|
+
"test": "tsx --tsconfig tsconfig.scripts.json scripts/run-tests.ts",
|
|
32
|
+
"test:watch": "playwright test --ui",
|
|
33
|
+
"lint": "oxlint",
|
|
34
|
+
"lint:fix": "oxlint --fix",
|
|
35
|
+
"lint:stage": "oxlint",
|
|
36
|
+
"format": "oxfmt",
|
|
37
|
+
"format:check": "oxfmt --check",
|
|
38
|
+
"watch": "tsc --watch",
|
|
39
|
+
"type-check": "tsc --noEmit",
|
|
40
|
+
"generate:schema": "tsx --tsconfig tsconfig.scripts.json scripts/generate-schema.ts",
|
|
41
|
+
"check:schema": "tsx --tsconfig tsconfig.scripts.json scripts/check-schema.ts",
|
|
42
|
+
"prepare": "husky",
|
|
43
|
+
"postinstall": "patch-package"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@playwright/test": "^1.59.1",
|
|
47
|
+
"@tsconfig/node20": "^20.1.4",
|
|
48
|
+
"@types/cross-spawn": "^6.0.6",
|
|
49
|
+
"@types/ejs": "3.1.5",
|
|
50
|
+
"@types/fs-extra": "11.0.4",
|
|
51
|
+
"@types/klaw": "^3.0.6",
|
|
52
|
+
"@types/lodash": "4.17.20",
|
|
53
|
+
"@types/ms": "0.7.34",
|
|
54
|
+
"@types/node": "^20.12.12",
|
|
55
|
+
"@types/prompts": "^2.4.9",
|
|
56
|
+
"@types/semver": "^7.7.1",
|
|
57
|
+
"@types/signale": "^1.4.7",
|
|
58
|
+
"@types/yargs": "^17.0.32",
|
|
59
|
+
"cli-docs-generator": "^1.0.7",
|
|
60
|
+
"execa": "^9.6.1",
|
|
61
|
+
"husky": "^9.1.7",
|
|
62
|
+
"node-pty": "^1.1.0",
|
|
63
|
+
"oxfmt": "^0.68.0",
|
|
64
|
+
"oxlint": "^1.83.0",
|
|
65
|
+
"patch-package": "^8.0.0",
|
|
66
|
+
"tsup": "^8.0.2",
|
|
67
|
+
"tsx": "4.19.2",
|
|
68
|
+
"typescript": "^5.7.2",
|
|
69
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
70
|
+
"vitest": "2.1.8"
|
|
71
|
+
},
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"@clack/prompts": "^0.8.2",
|
|
74
|
+
"@commander-js/extra-typings": "12.1.0",
|
|
75
|
+
"ansis": "3.3.2",
|
|
76
|
+
"commander": "12.1.0",
|
|
77
|
+
"cross-spawn": "^7.0.6",
|
|
78
|
+
"dayjs": "1.11.13",
|
|
79
|
+
"ejs": "^3.1.10",
|
|
80
|
+
"env-paths": "^2.2.1",
|
|
81
|
+
"fs-extra": "^11.2.0",
|
|
82
|
+
"ignore": "^7.0.5",
|
|
83
|
+
"json-schema-to-typescript": "^15.0.4",
|
|
84
|
+
"klaw": "^4.1.0",
|
|
85
|
+
"lodash": "^4.17.21",
|
|
86
|
+
"ms": "2.1.3",
|
|
87
|
+
"semver": "^7.7.4",
|
|
88
|
+
"zod": "^4.4.3"
|
|
89
|
+
}
|
|
85
90
|
}
|
package/readme.md
CHANGED
|
@@ -4,32 +4,7 @@ BLOX CLI helps you bootstrap, manage, update, and contribute BLOX-based apps and
|
|
|
4
4
|
|
|
5
5
|
## Content
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- [Content](#content)
|
|
9
|
-
- [Installation](#installation)
|
|
10
|
-
- [Quick Start](#quick-start)
|
|
11
|
-
- [Commands](#commands)
|
|
12
|
-
- [init](#init)
|
|
13
|
-
- [add](#add)
|
|
14
|
-
- [remove](#remove)
|
|
15
|
-
- [update](#update)
|
|
16
|
-
- [contribute](#contribute)
|
|
17
|
-
- [conf](#conf)
|
|
18
|
-
- [upgrade](#upgrade)
|
|
19
|
-
- [migrate](#migrate)
|
|
20
|
-
- [skills](#skills)
|
|
21
|
-
- [Features](#features)
|
|
22
|
-
- [Ignore Policy](#ignore-policy)
|
|
23
|
-
- [Lifecycle Hooks](#lifecycle-hooks)
|
|
24
|
-
- [Skills](#skills-1)
|
|
25
|
-
- [Installing Skills](#installing-skills)
|
|
26
|
-
- [CLI Compatibility](#cli-compatibility)
|
|
27
|
-
- [Common Commands](#common-commands)
|
|
28
|
-
- [Compatibility](#compatibility)
|
|
29
|
-
- [Create new template](#create-new-template)
|
|
30
|
-
- [1 - Initialize from an existing template](#1---initialize-from-an-existing-template)
|
|
31
|
-
- [2 - Update `.blox` configuration](#2---update-blox-configuration)
|
|
32
|
-
- [3 - Publish and register the template](#3---publish-and-register-the-template)
|
|
7
|
+
[[_TOC_]]
|
|
33
8
|
|
|
34
9
|
## Installation
|
|
35
10
|
|
|
@@ -216,7 +191,7 @@ blox skills <command> [options]
|
|
|
216
191
|
|
|
217
192
|
Important notes:
|
|
218
193
|
|
|
219
|
-
- BLOX
|
|
194
|
+
- BLOX passes the BLOX content URL directly to Skills CLI for `add` flows.
|
|
220
195
|
- No repository URL is required.
|
|
221
196
|
|
|
222
197
|
## Features
|
|
@@ -248,10 +223,10 @@ Example root `.blox` configuration:
|
|
|
248
223
|
How ignore sources are combined:
|
|
249
224
|
|
|
250
225
|
- `blox update` combines patterns from:
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
226
|
+
- remote template ignore (`definition.ignore`)
|
|
227
|
+
- local project ignore (`project.ignore` in local `.blox`)
|
|
228
|
+
- local `.gitignore`
|
|
229
|
+
- command option `--ignore` (when provided)
|
|
255
230
|
- `blox contribute` also respects local `project.ignore`.
|
|
256
231
|
- Local `project.ignore` is project-owned and is not replaced by remote template ignore during update.
|
|
257
232
|
|
|
@@ -280,6 +255,34 @@ When hooks run:
|
|
|
280
255
|
| `update` | Runs after `blox update` when the root template, a base, or a block remote actually advanced (new commit applied). | Runs only when that block's remote actually advanced (new commit). Skipped if already up to date. |
|
|
281
256
|
| `remove` | Runs after `blox remove` actually removed a block in that run. | Runs before the block is deleted, while its files still exist. |
|
|
282
257
|
|
|
258
|
+
### Blox SDK
|
|
259
|
+
|
|
260
|
+
Use the SDK when a template needs custom interactive behavior and you can run it inside lifecycle hooks.
|
|
261
|
+
|
|
262
|
+
Install in the template project:
|
|
263
|
+
|
|
264
|
+
```sh
|
|
265
|
+
npm install -D @naseej/blox
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Import only from the SDK subpath:
|
|
269
|
+
|
|
270
|
+
```ts
|
|
271
|
+
import { input } from '@naseej/blox/sdk';
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
SDK API reference:
|
|
275
|
+
|
|
276
|
+
| Category | API | Notes |
|
|
277
|
+
| --------------- | --------------------------------------------------------- | ----------------------------------------------------- |
|
|
278
|
+
| Prompts | `input`, `confirm`, `select`, `multiSelect` | Interactive CLI prompts. |
|
|
279
|
+
| Logging | `log.info`, `log.success`, `log.warn`, `log.error` | Consistent BLOX output formatting. |
|
|
280
|
+
| Spinner | `spinner().start`, `spinner().message`, `spinner().stop` | Existing spinner API remains stable. |
|
|
281
|
+
| Spinner aliases | `spinner().success`, `spinner().fail`, `spinner().finish` | Semantic aliases for completion states. |
|
|
282
|
+
| Filesystem | `exists`, `mkdir`, `copy`, `move`, `remove` | Thin cross-platform file helpers. |
|
|
283
|
+
| JSON | `readJson`, `writeJson`, `updateJson` | Stable JSON read/write plus read-modify-write helper. |
|
|
284
|
+
| Process/path | `exec`, `join`, `resolve` | Shell execution and path helpers. |
|
|
285
|
+
|
|
283
286
|
### Skills
|
|
284
287
|
|
|
285
288
|
#### Installing Skills
|
|
@@ -289,7 +292,7 @@ Use `blox skills` to run the Skills CLI against the BLOX CLI skills repository.
|
|
|
289
292
|
Behavior:
|
|
290
293
|
|
|
291
294
|
- BLOX executes `npx skills` with all arguments passed after `skills`.
|
|
292
|
-
- BLOX
|
|
295
|
+
- BLOX uses the BLOX content URL directly as the skills source .
|
|
293
296
|
|
|
294
297
|
#### CLI Compatibility
|
|
295
298
|
|
|
@@ -314,7 +317,7 @@ blox skills list
|
|
|
314
317
|
|
|
315
318
|
Skills are not tied to a specific editor or product. They work across tools that support skill-style instructions, and metadata marks agents as `generic` for broad use.
|
|
316
319
|
|
|
317
|
-
|
|
320
|
+
## Create new template
|
|
318
321
|
|
|
319
322
|
Create a new template by starting from an existing one, updating its metadata, then publishing it.
|
|
320
323
|
|