@lark-apaas/fullstack-cli 1.1.71-alpha.20261105083242 → 1.1.71-alpha.20261105121733
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/README.md +3 -0
- package/dist/index.js +68 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -165,6 +165,8 @@ fullstack-cli capability validate --plugin @office/feishu-bitable --form-value @
|
|
|
165
165
|
# 写入实例:先跑同样的两段检查,有 error 不写盘;输出含 affectedFilePaths 供精确 git add
|
|
166
166
|
fullstack-cli capability create --plugin @office/feishu-bitable --id bitable_tasks_1 --name 任务表 --form-value @./form.json
|
|
167
167
|
fullstack-cli capability update --id bitable_tasks_1 --form-value @./form.json
|
|
168
|
+
# 删除实例:只删实例文件;同一插件没有其他实例时 hint 提示 action-plugin remove
|
|
169
|
+
fullstack-cli capability delete --id bitable_tasks_1
|
|
168
170
|
```
|
|
169
171
|
|
|
170
172
|
写入目录:环境变量 `CAPABILITIES_DIR` 优先,否则 `shared/capabilities`(存在时)或 `server/capabilities`。
|
|
@@ -305,6 +307,7 @@ fullstack-cli capability get --id <id>
|
|
|
305
307
|
fullstack-cli capability validate --plugin <key> --form-value <json|@f|-> [--id <id>] [--params-schema <json|@f|->] [--timeout <ms>]
|
|
306
308
|
fullstack-cli capability create --plugin <key> --id <id> --name <name> --form-value <json|@f|->
|
|
307
309
|
fullstack-cli capability update --id <id> --form-value <json|@f|-> [--name <name>]
|
|
310
|
+
fullstack-cli capability delete --id <id>
|
|
308
311
|
fullstack-cli capability migration --dry-run
|
|
309
312
|
|
|
310
313
|
# 构建工具
|
package/dist/index.js
CHANGED
|
@@ -6226,6 +6226,49 @@ async function runUpdate(options) {
|
|
|
6226
6226
|
});
|
|
6227
6227
|
return successOutput(options.id, filePath, check2);
|
|
6228
6228
|
}
|
|
6229
|
+
function readPluginKeyOf(filePath) {
|
|
6230
|
+
try {
|
|
6231
|
+
const parsed = JSON.parse(fs20.readFileSync(filePath, "utf-8"));
|
|
6232
|
+
return typeof parsed?.pluginKey === "string" && parsed.pluginKey ? parsed.pluginKey : void 0;
|
|
6233
|
+
} catch {
|
|
6234
|
+
return void 0;
|
|
6235
|
+
}
|
|
6236
|
+
}
|
|
6237
|
+
function runDelete(options) {
|
|
6238
|
+
assertValidId(options.id);
|
|
6239
|
+
const filePath = capabilityFilePath(options.id);
|
|
6240
|
+
const relative = toProjectRelative(filePath);
|
|
6241
|
+
const notFound = () => new FormCliError(
|
|
6242
|
+
FormCliErrorCode.INSTANCE_NOT_FOUND,
|
|
6243
|
+
`Capability ${options.id} not found at ${relative}`,
|
|
6244
|
+
{
|
|
6245
|
+
hint: 'Check the id with "fullstack-cli capability list --summary".'
|
|
6246
|
+
}
|
|
6247
|
+
);
|
|
6248
|
+
if (!fs20.existsSync(filePath)) {
|
|
6249
|
+
throw notFound();
|
|
6250
|
+
}
|
|
6251
|
+
const pluginKey = readPluginKeyOf(filePath);
|
|
6252
|
+
try {
|
|
6253
|
+
fs20.unlinkSync(filePath);
|
|
6254
|
+
} catch (error) {
|
|
6255
|
+
if (error.code === "ENOENT") {
|
|
6256
|
+
throw notFound();
|
|
6257
|
+
}
|
|
6258
|
+
throw error;
|
|
6259
|
+
}
|
|
6260
|
+
const output = {
|
|
6261
|
+
ok: true,
|
|
6262
|
+
id: options.id,
|
|
6263
|
+
path: relative,
|
|
6264
|
+
...pluginKey ? { pluginKey } : {},
|
|
6265
|
+
affectedFilePaths: [relative]
|
|
6266
|
+
};
|
|
6267
|
+
if (pluginKey && !readAllCapabilities().some((c) => c.pluginKey === pluginKey)) {
|
|
6268
|
+
output.hint = `No other capability uses ${pluginKey}; if the plugin is no longer needed, run "fullstack-cli action-plugin remove ${pluginKey}".`;
|
|
6269
|
+
}
|
|
6270
|
+
return output;
|
|
6271
|
+
}
|
|
6229
6272
|
async function finish(run8) {
|
|
6230
6273
|
try {
|
|
6231
6274
|
const output = await run8();
|
|
@@ -6243,6 +6286,9 @@ async function create(options) {
|
|
|
6243
6286
|
async function update2(options) {
|
|
6244
6287
|
await finish(() => runUpdate(options));
|
|
6245
6288
|
}
|
|
6289
|
+
async function remove2(options) {
|
|
6290
|
+
await finish(async () => runDelete(options));
|
|
6291
|
+
}
|
|
6246
6292
|
|
|
6247
6293
|
// src/commands/capability/index.ts
|
|
6248
6294
|
var JSON_ARG_HINT2 = "inline JSON, @<file>, or - for stdin";
|
|
@@ -6355,6 +6401,26 @@ Example:
|
|
|
6355
6401
|
});
|
|
6356
6402
|
}
|
|
6357
6403
|
};
|
|
6404
|
+
var deleteCommand = {
|
|
6405
|
+
name: "delete",
|
|
6406
|
+
description: "Delete a capability instance file. Does not uninstall the plugin or touch code that calls it",
|
|
6407
|
+
register(program) {
|
|
6408
|
+
outputParseErrorsAsJson(program.command(this.name)).description(this.description).requiredOption("--id <id>", "(required) Existing capability ID").addHelpText(
|
|
6409
|
+
"after",
|
|
6410
|
+
`
|
|
6411
|
+
Removes <CAPABILITIES_DIR>/<id>.json. Fails with INSTANCE_NOT_FOUND when the id does not exist.
|
|
6412
|
+
Output: {ok, id, path, pluginKey, affectedFilePaths, hint?} (exit 0); hint is set when no other
|
|
6413
|
+
capability uses the same plugin, suggesting "action-plugin remove".
|
|
6414
|
+
Code that still calls this capability fails at runtime with "Capability not found"; remove those
|
|
6415
|
+
calls as well.
|
|
6416
|
+
|
|
6417
|
+
Example:
|
|
6418
|
+
fullstack-cli capability delete --id bitable_tasks`
|
|
6419
|
+
).action(async (options) => {
|
|
6420
|
+
await remove2(options);
|
|
6421
|
+
});
|
|
6422
|
+
}
|
|
6423
|
+
};
|
|
6358
6424
|
var capabilityCommandGroup = {
|
|
6359
6425
|
name: "capability",
|
|
6360
6426
|
description: "Manage capability configurations",
|
|
@@ -6363,7 +6429,8 @@ var capabilityCommandGroup = {
|
|
|
6363
6429
|
getCommand,
|
|
6364
6430
|
validateCommand,
|
|
6365
6431
|
createCommand,
|
|
6366
|
-
updateCommand2
|
|
6432
|
+
updateCommand2,
|
|
6433
|
+
deleteCommand
|
|
6367
6434
|
]
|
|
6368
6435
|
};
|
|
6369
6436
|
|