@adep/cli 0.1.6 → 0.1.7

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.
Files changed (2) hide show
  1. package/dist/index.js +27 -11
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -6708,6 +6708,15 @@ async function projectsCreate(paths, options) {
6708
6708
  const name = options.name ?? slug;
6709
6709
  const body = { slug, name };
6710
6710
  if (options.spaceId !== void 0) body.spaceId = options.spaceId;
6711
+ if (options.gitRepoUrl !== void 0 && options.gitBranch !== void 0) {
6712
+ body.git = {
6713
+ repoUrl: options.gitRepoUrl,
6714
+ branch: options.gitBranch,
6715
+ ...options.gitFunctionRoot === void 0 ? {} : { functionRoot: options.gitFunctionRoot },
6716
+ ...options.gitUsername === void 0 ? {} : { authUsername: options.gitUsername },
6717
+ ...options.gitToken === void 0 ? {} : { authToken: options.gitToken }
6718
+ };
6719
+ }
6711
6720
  const created = await client.request(
6712
6721
  "/api/v1/projects",
6713
6722
  { body },
@@ -9263,18 +9272,25 @@ function registerMcp(program2, ctx) {
9263
9272
  // packages/cli/src/commands/projects.ts
9264
9273
  function registerProjects(program2, ctx) {
9265
9274
  const projects = program2.command("projects").description("\u9879\u76EE\uFF1A\u521B\u5EFA / \u5217\u51FA / \u67E5\u770B\uFF08\u5B50\u57DF\u5730\u5740\u7531\u5E73\u53F0\u56DE\u663E\uFF0C\u4E0D\u5728 CLI \u4FA7\u62FC\uFF09");
9266
- projects.command("create").description("\u521B\u5EFA\u9879\u76EE\u5E76\u8F93\u51FA\u5B50\u57DF\u5730\u5740").argument("<slug>", "\u9879\u76EE slug\uFF08\u5168\u5C40\u552F\u4E00\uFF0C\u5373\u5B50\u57DF\u540D\uFF09").option("-n, --name <name>", "\u9879\u76EE\u5C55\u793A\u540D\uFF08\u7F3A\u7701\u53D6 slug\uFF09").option("--space <spaceId>", "\u5F52\u5C5E\u7A7A\u95F4\uFF08\u7F3A\u7701\u4E2A\u4EBA\u7A7A\u95F4\uFF09").action(async (slug, flags) => {
9267
- const command = ctx.io("projects create");
9268
- await command.run(async () => {
9269
- const { projectsCreate: projectsCreate2 } = await Promise.resolve().then(() => (init_projects(), projects_exports));
9270
- const created = await projectsCreate2(ctx.paths, {
9271
- slug,
9272
- ...flags.name === void 0 ? {} : { name: flags.name },
9273
- ...flags.space === void 0 ? {} : { spaceId: flags.space }
9275
+ projects.command("create").description("\u521B\u5EFA\u9879\u76EE\u5E76\u8F93\u51FA\u5B50\u57DF\u5730\u5740").argument("<slug>", "\u9879\u76EE slug\uFF08\u5168\u5C40\u552F\u4E00\uFF0C\u5373\u5B50\u57DF\u540D\uFF09").option("-n, --name <name>", "\u9879\u76EE\u5C55\u793A\u540D\uFF08\u7F3A\u7701\u53D6 slug\uFF09").option("--space <spaceId>", "\u5F52\u5C5E\u7A7A\u95F4\uFF08\u7F3A\u7701\u4E2A\u4EBA\u7A7A\u95F4\uFF09").option("--git <repoUrl>", "\u4ECE Git \u4ED3\u5E93\u521B\u5EFA\uFF08\u521B\u5EFA\u540E\u7ED1\u5B9A + \u9996\u6B21\u540C\u6B65/\u90E8\u7F72\uFF09").option("-b, --branch <branch>", "Git \u5206\u652F\uFF08\u914D\u5408 --git\uFF0C\u7F3A\u7701 main\uFF09").option("--username <username>", "Git \u79C1\u6709\u4ED3\u5E93\u7528\u6237\u540D\uFF08\u914D\u5408 --git\uFF09").option("--token <token>", "Git \u79C1\u6709\u4ED3\u5E93\u8BBF\u95EE\u4EE4\u724C\uFF08\u914D\u5408 --git\uFF0C\u5E73\u53F0\u52A0\u5BC6\u843D\u5E93\uFF09").option("--function-root <root>", "legacy \u5E03\u5C40\u51FD\u6570\u6839\u76EE\u5F55\uFF08\u914D\u5408 --git\uFF0C\u7F3A\u7701\u5E94\u7528\u5E03\u5C40\u81EA\u52A8\u63A2\u6D4B\uFF09").action(
9276
+ async (slug, flags) => {
9277
+ const command = ctx.io("projects create");
9278
+ await command.run(async () => {
9279
+ const { projectsCreate: projectsCreate2 } = await Promise.resolve().then(() => (init_projects(), projects_exports));
9280
+ const created = await projectsCreate2(ctx.paths, {
9281
+ slug,
9282
+ ...flags.name === void 0 ? {} : { name: flags.name },
9283
+ ...flags.space === void 0 ? {} : { spaceId: flags.space },
9284
+ ...flags.git === void 0 ? {} : { gitRepoUrl: flags.git },
9285
+ ...flags.git === void 0 ? {} : { gitBranch: flags.branch ?? "main" },
9286
+ ...flags.username === void 0 ? {} : { gitUsername: flags.username },
9287
+ ...flags.token === void 0 ? {} : { gitToken: flags.token },
9288
+ ...flags.functionRoot === void 0 ? {} : { gitFunctionRoot: flags.functionRoot }
9289
+ });
9290
+ command.ok(created, (data) => `\u2713 Project created \xB7 ${data.url}`);
9274
9291
  });
9275
- command.ok(created, (data) => `\u2713 Project created \xB7 ${data.url}`);
9276
- });
9277
- });
9292
+ }
9293
+ );
9278
9294
  projects.command("list").description("\u5217\u51FA\u5F53\u524D\u7528\u6237\u53EF\u8BBF\u95EE\u7684\u9879\u76EE").action(async () => {
9279
9295
  const command = ctx.io("projects list");
9280
9296
  await command.run(async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adep/cli",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "type": "module",
5
5
  "description": "`adep` 命令行工具包位:登录 / 初始化 / 本地调试 / 部署 / 数据库维护 / 云存储 / 静态托管 / 微前端组件(widget),实现见任务单 CLI-001 ~ CLI-003 与 FE-002;子路径 `@adep/cli/vite` 提供云函数 vite 插件(CLI-014)",
6
6
  "bin": {
@@ -20,8 +20,8 @@
20
20
  "dependencies": {
21
21
  "commander": "14.0.2",
22
22
  "esbuild": "0.25.12",
23
- "@adep/cf-compat": "0.1.1",
24
- "@adep/vite-plugin": "0.1.2"
23
+ "@adep/vite-plugin": "0.1.2",
24
+ "@adep/cf-compat": "0.1.1"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@adep/runtime": "0.2.2",