handoff-app 2.0.0-4 → 2.0.0-5

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 (209) hide show
  1. package/AGENTS.md +7 -0
  2. package/CLAUDE.md +7 -0
  3. package/README.md +302 -378
  4. package/dist/app-builder/build.js +2 -2
  5. package/dist/app-builder/nav-shell.js +8 -15
  6. package/dist/app-builder/vercel-output.js +4 -4
  7. package/dist/cli/make.js +2 -2
  8. package/dist/cli.js +38 -6
  9. package/dist/commands/build/app.js +1 -5
  10. package/dist/commands/build/components.js +1 -5
  11. package/dist/commands/build/index.js +1 -5
  12. package/dist/commands/checkout/index.d.ts +15 -12
  13. package/dist/commands/checkout/index.js +15 -54
  14. package/dist/commands/compat/deprecations.d.ts +46 -0
  15. package/dist/commands/compat/deprecations.js +62 -0
  16. package/dist/commands/compat/push-args.d.ts +48 -0
  17. package/dist/commands/compat/push-args.js +73 -0
  18. package/dist/commands/db/migrate.js +1 -5
  19. package/dist/commands/dev/index.js +1 -5
  20. package/dist/commands/eject/config.js +1 -5
  21. package/dist/commands/eject/pages.js +1 -5
  22. package/dist/commands/eject/theme.js +1 -5
  23. package/dist/commands/fetch/index.js +1 -5
  24. package/dist/commands/index.js +4 -0
  25. package/dist/commands/login/index.js +1 -5
  26. package/dist/commands/logout/index.js +1 -5
  27. package/dist/commands/make/component.js +1 -5
  28. package/dist/commands/make/page.js +3 -7
  29. package/dist/commands/make/template.js +1 -5
  30. package/dist/commands/publish/index.d.ts +18 -12
  31. package/dist/commands/publish/index.js +18 -54
  32. package/dist/commands/pull/index.d.ts +13 -0
  33. package/dist/commands/pull/index.js +20 -0
  34. package/dist/commands/push/index.d.ts +23 -0
  35. package/dist/commands/push/index.js +58 -0
  36. package/dist/commands/scaffold/index.js +1 -5
  37. package/dist/commands/start/index.js +1 -5
  38. package/dist/commands/types.d.ts +10 -0
  39. package/dist/commands/utils.d.ts +74 -6
  40. package/dist/commands/utils.js +89 -10
  41. package/dist/commands/validate/components.js +1 -5
  42. package/dist/config/index.d.ts +2 -1
  43. package/dist/config/index.js +2 -1
  44. package/dist/config/loader.d.ts +19 -6
  45. package/dist/config/loader.js +43 -13
  46. package/dist/config/normalizers/page.d.ts +4 -4
  47. package/dist/config/normalizers/page.js +2 -2
  48. package/dist/config/runtime.js +9 -25
  49. package/dist/index.d.ts +69 -22
  50. package/dist/index.js +148 -35
  51. package/dist/nav/resolver.js +3 -1
  52. package/dist/nav/workspace.js +2 -2
  53. package/dist/registry/auth/access-tokens.d.ts +11 -3
  54. package/dist/registry/auth/access-tokens.js +29 -3
  55. package/dist/registry/auth/index.d.ts +4 -3
  56. package/dist/registry/auth/index.js +10 -2
  57. package/dist/registry/auth/sync-secret.d.ts +27 -0
  58. package/dist/registry/auth/sync-secret.js +65 -0
  59. package/dist/registry/auth/types.d.ts +20 -1
  60. package/dist/registry/auth/types.js +3 -1
  61. package/dist/registry/auth/validation.d.ts +11 -0
  62. package/dist/registry/auth/validation.js +18 -1
  63. package/dist/registry/checkout/assets.d.ts +1 -1
  64. package/dist/registry/checkout/assets.js +21 -6
  65. package/dist/registry/checkout/index.d.ts +8 -1
  66. package/dist/registry/checkout/index.js +39 -6
  67. package/dist/registry/checkout/tokens.d.ts +1 -1
  68. package/dist/registry/checkout/tokens.js +12 -5
  69. package/dist/registry/connection.d.ts +10 -0
  70. package/dist/registry/connection.js +52 -7
  71. package/dist/registry/content-kinds.d.ts +27 -0
  72. package/dist/registry/content-kinds.js +33 -0
  73. package/dist/registry/db/client.d.ts +6 -1
  74. package/dist/registry/db/client.js +16 -3
  75. package/dist/registry/db/schema.d.ts +37 -3
  76. package/dist/registry/db/schema.js +9 -7
  77. package/dist/registry/publish/assets.d.ts +2 -2
  78. package/dist/registry/publish/assets.js +46 -35
  79. package/dist/registry/publish/index.d.ts +29 -5
  80. package/dist/registry/publish/index.js +87 -34
  81. package/dist/registry/publish/tokens.d.ts +2 -2
  82. package/dist/registry/publish/tokens.js +30 -24
  83. package/dist/registry/selection.d.ts +12 -0
  84. package/dist/registry/selection.js +22 -0
  85. package/dist/store/registry.d.ts +48 -0
  86. package/dist/store/registry.js +75 -12
  87. package/dist/transformers/preview/types.d.ts +2 -2
  88. package/dist/utils/markdown.d.ts +10 -0
  89. package/dist/utils/markdown.js +17 -0
  90. package/dist/utils/menu-shell.js +14 -7
  91. package/dist/utils/pages.d.ts +22 -0
  92. package/dist/utils/pages.js +73 -0
  93. package/dist/utils/path.d.ts +5 -0
  94. package/dist/utils/path.js +9 -0
  95. package/docs/api.md +1 -3
  96. package/docs/cli.md +1 -1
  97. package/drizzle/0002_add_pages.sql +5 -3
  98. package/drizzle/meta/0002_snapshot.json +17 -8
  99. package/drizzle/meta/0003_snapshot.json +17 -8
  100. package/drizzle/meta/0004_snapshot.json +17 -8
  101. package/drizzle/meta/0005_snapshot.json +17 -8
  102. package/package.json +1 -1
  103. package/src/app/components/util/index.ts +5 -23
  104. package/src/app/lib/docs-api/backend.ts +11 -0
  105. package/src/app/lib/docs-api/errors.ts +8 -7
  106. package/src/app/lib/docs-api/handler.ts +2 -3
  107. package/src/app/lib/docs-api/index.ts +2 -0
  108. package/src/app/lib/docs-api/page-discovery.ts +126 -0
  109. package/src/app/lib/docs-api/page-rendering.ts +17 -0
  110. package/src/app/lib/docs-api/page-search.ts +191 -0
  111. package/src/app/lib/docs-api/records.ts +11 -19
  112. package/src/app/lib/docs-api/registry.ts +90 -11
  113. package/src/app/lib/docs-api/search.ts +115 -0
  114. package/src/app/lib/registry-api/allowlist.ts +7 -5
  115. package/src/app/lib/registry-api/asset-transfer.ts +58 -31
  116. package/src/app/lib/registry-api/auth.ts +89 -9
  117. package/src/app/lib/registry-api/entity-routes.ts +17 -7
  118. package/src/app/lib/registry-api/errors.ts +10 -4
  119. package/src/app/lib/registry-api/handler.ts +13 -15
  120. package/src/app/lib/registry-api/meta.ts +4 -0
  121. package/src/app/lib/registry-api/revalidate.ts +31 -12
  122. package/src/app/lib/registry-api/store.ts +89 -26
  123. package/src/app/lib/registry-api/sync-compat.ts +166 -0
  124. package/src/app/lib/registry-api/token-transfer.ts +44 -12
  125. package/src/app/lib/registry-api/transfer-batch.ts +116 -0
  126. package/src/app/lib/registry-api/transfer.ts +62 -35
  127. package/src/app/lib/registry-api/validation.ts +33 -1
  128. package/src/app/lib/registry-connection.ts +1 -1
  129. package/src/app/next.config.mjs +6 -0
  130. package/src/app/pages/[...slug]/index.tsx +37 -22
  131. package/src/app/pages/api/account/tokens/index.ts +4 -13
  132. package/src/app/pages/api/docs/search/pages.json.ts +25 -0
  133. package/src/app/pages/api/oauth/revoke.ts +14 -7
  134. package/src/app/pages/api/registry/components/[id]/files/[...filePath].ts +1 -1
  135. package/src/app/pages/api/registry/components/[id].ts +2 -2
  136. package/src/app/pages/api/registry/components/index.ts +1 -1
  137. package/src/app/pages/api/registry/pages/[...id].ts +20 -0
  138. package/src/app/pages/api/registry/pages/index.ts +19 -0
  139. package/src/app/pages/api/registry/patterns/[id]/files/[...filePath].ts +1 -1
  140. package/src/app/pages/api/registry/patterns/[id].ts +2 -2
  141. package/src/app/pages/api/registry/patterns/index.ts +1 -1
  142. package/src/app/pages/api/registry/transfer/assets/blobs/have.ts +2 -2
  143. package/src/app/pages/api/sync/upload.ts +21 -0
  144. package/src/app/pages/index/index.tsx +14 -0
  145. package/src/app/pages/index.tsx +30 -5
  146. package/src/app-builder/build.ts +2 -2
  147. package/src/app-builder/nav-shell.ts +8 -13
  148. package/src/app-builder/vercel-output.ts +4 -4
  149. package/src/cli/make.ts +2 -2
  150. package/src/cli.ts +30 -6
  151. package/src/commands/build/app.ts +2 -3
  152. package/src/commands/build/components.ts +2 -3
  153. package/src/commands/build/index.ts +2 -3
  154. package/src/commands/checkout/index.ts +18 -44
  155. package/src/commands/compat/deprecations.ts +79 -0
  156. package/src/commands/compat/push-args.ts +106 -0
  157. package/src/commands/db/migrate.ts +2 -3
  158. package/src/commands/dev/index.ts +2 -3
  159. package/src/commands/eject/config.ts +2 -3
  160. package/src/commands/eject/pages.ts +2 -3
  161. package/src/commands/eject/theme.ts +2 -3
  162. package/src/commands/fetch/index.ts +2 -3
  163. package/src/commands/index.ts +4 -0
  164. package/src/commands/login/index.ts +2 -3
  165. package/src/commands/logout/index.ts +2 -3
  166. package/src/commands/make/component.ts +2 -3
  167. package/src/commands/make/page.ts +4 -5
  168. package/src/commands/make/template.ts +2 -3
  169. package/src/commands/publish/index.ts +21 -44
  170. package/src/commands/pull/index.ts +32 -0
  171. package/src/commands/push/index.ts +115 -0
  172. package/src/commands/scaffold/index.ts +2 -3
  173. package/src/commands/start/index.ts +2 -3
  174. package/src/commands/types.ts +11 -1
  175. package/src/commands/utils.ts +80 -11
  176. package/src/commands/validate/components.ts +2 -3
  177. package/src/config/index.ts +2 -1
  178. package/src/config/loader.ts +57 -12
  179. package/src/config/normalizers/page.ts +4 -4
  180. package/src/config/runtime.ts +9 -24
  181. package/src/index.ts +183 -42
  182. package/src/nav/resolver.ts +3 -1
  183. package/src/nav/workspace.ts +2 -2
  184. package/src/registry/auth/access-tokens.ts +29 -5
  185. package/src/registry/auth/index.ts +7 -1
  186. package/src/registry/auth/sync-secret.ts +67 -0
  187. package/src/registry/auth/types.ts +24 -1
  188. package/src/registry/auth/validation.ts +18 -0
  189. package/src/registry/checkout/assets.ts +24 -7
  190. package/src/registry/checkout/index.ts +41 -5
  191. package/src/registry/checkout/tokens.ts +12 -6
  192. package/src/registry/connection.ts +53 -5
  193. package/src/registry/content-kinds.ts +39 -0
  194. package/src/registry/db/client.ts +22 -2
  195. package/src/registry/db/schema.ts +9 -7
  196. package/src/registry/publish/assets.ts +47 -37
  197. package/src/registry/publish/index.ts +102 -38
  198. package/src/registry/publish/tokens.ts +35 -26
  199. package/src/registry/selection.ts +19 -0
  200. package/src/store/registry.ts +118 -13
  201. package/src/transformers/preview/types.ts +2 -2
  202. package/src/utils/README.md +1 -0
  203. package/src/utils/markdown.ts +11 -0
  204. package/src/utils/menu-shell.ts +14 -7
  205. package/src/utils/pages.ts +52 -0
  206. package/src/utils/path.ts +15 -6
  207. package/templates/default/package.json.tpl +4 -0
  208. package/config/docs/foundations/logos.md +0 -7
  209. package/src/app/lib/api/redact.ts +0 -46
@@ -8,11 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const __1 = __importDefault(require("../../"));
16
12
  const utils_1 = require("../utils");
17
13
  const command = {
18
14
  command: 'eject:config',
@@ -21,7 +17,7 @@ const command = {
21
17
  return (0, utils_1.getSharedOptions)(yargs);
22
18
  },
23
19
  handler: (args) => __awaiter(void 0, void 0, void 0, function* () {
24
- const handoff = new __1.default(args.debug, args.force);
20
+ const handoff = (0, utils_1.createHandoff)(args);
25
21
  yield handoff.ejectConfig();
26
22
  }),
27
23
  };
@@ -8,11 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const __1 = __importDefault(require("../../"));
16
12
  const utils_1 = require("../utils");
17
13
  const command = {
18
14
  command: 'eject:pages',
@@ -21,7 +17,7 @@ const command = {
21
17
  return (0, utils_1.getSharedOptions)(yargs);
22
18
  },
23
19
  handler: (args) => __awaiter(void 0, void 0, void 0, function* () {
24
- const handoff = new __1.default(args.debug, args.force);
20
+ const handoff = (0, utils_1.createHandoff)(args);
25
21
  yield handoff.ejectPages();
26
22
  }),
27
23
  };
@@ -8,11 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const __1 = __importDefault(require("../../"));
16
12
  const utils_1 = require("../utils");
17
13
  const command = {
18
14
  command: 'eject:theme',
@@ -21,7 +17,7 @@ const command = {
21
17
  return (0, utils_1.getSharedOptions)(yargs);
22
18
  },
23
19
  handler: (args) => __awaiter(void 0, void 0, void 0, function* () {
24
- const handoff = new __1.default(args.debug, args.force);
20
+ const handoff = (0, utils_1.createHandoff)(args);
25
21
  yield handoff.ejectTheme();
26
22
  }),
27
23
  };
@@ -8,11 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const __1 = __importDefault(require("../../"));
16
12
  const utils_1 = require("../utils");
17
13
  const command = {
18
14
  command: 'fetch',
@@ -21,7 +17,7 @@ const command = {
21
17
  return (0, utils_1.getSharedOptions)(yargs);
22
18
  },
23
19
  handler: (args) => __awaiter(void 0, void 0, void 0, function* () {
24
- const handoff = new __1.default(args.debug, args.force);
20
+ const handoff = (0, utils_1.createHandoff)(args);
25
21
  yield handoff.fetch();
26
22
  }),
27
23
  };
@@ -20,7 +20,9 @@ const logout_1 = __importDefault(require("./logout"));
20
20
  const component_1 = __importDefault(require("./make/component"));
21
21
  const page_1 = __importDefault(require("./make/page"));
22
22
  const template_1 = __importDefault(require("./make/template"));
23
+ const pull_1 = __importDefault(require("./pull"));
23
24
  const publish_1 = __importDefault(require("./publish"));
25
+ const push_1 = require("./push");
24
26
  const scaffold_1 = __importDefault(require("./scaffold"));
25
27
  const start_1 = __importDefault(require("./start"));
26
28
  const components_2 = __importDefault(require("./validate/components"));
@@ -42,6 +44,8 @@ exports.commands = [
42
44
  component_1.default,
43
45
  template_1.default,
44
46
  publish_1.default,
47
+ pull_1.default,
48
+ ...push_1.pushCommands,
45
49
  scaffold_1.default,
46
50
  start_1.default,
47
51
  components_2.default,
@@ -8,11 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const __1 = __importDefault(require("../../"));
16
12
  const device_1 = require("../../cli/auth/device");
17
13
  const store_1 = require("../../cli/auth/store");
18
14
  const connection_1 = require("../../registry/connection");
@@ -33,7 +29,7 @@ const command = {
33
29
  }),
34
30
  handler: (args) => __awaiter(void 0, void 0, void 0, function* () {
35
31
  var _a;
36
- const handoff = new __1.default(args.debug, args.force);
32
+ const handoff = (0, utils_1.createHandoff)(args);
37
33
  try {
38
34
  const configured = (0, connection_1.resolveRegistryConnection)(handoff.config);
39
35
  const remoteUrl = ((_a = args.url) === null || _a === void 0 ? void 0 : _a.trim()) || configured.url;
@@ -8,11 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const __1 = __importDefault(require("../../"));
16
12
  const device_1 = require("../../cli/auth/device");
17
13
  const store_1 = require("../../cli/auth/store");
18
14
  const logger_1 = require("../../utils/logger");
@@ -25,7 +21,7 @@ const command = {
25
21
  describe: 'Revoke credentials only when they belong to this exact registry URL',
26
22
  }),
27
23
  handler: (args) => __awaiter(void 0, void 0, void 0, function* () {
28
- const handoff = new __1.default(args.debug, args.force);
24
+ const handoff = (0, utils_1.createHandoff)(args);
29
25
  const auth = yield (0, store_1.readCliAuth)(handoff.workingPath);
30
26
  if (args.url && auth && !(0, store_1.cliAuthMatchesRegistry)(auth, args.url)) {
31
27
  logger_1.Logger.error(`The saved login belongs to ${auth.remoteUrl}, not ${(0, store_1.normalizeRegistryUrl)(args.url)}. No credentials were changed.`);
@@ -8,11 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const __1 = __importDefault(require("../.."));
16
12
  const logger_1 = require("../../utils/logger");
17
13
  const utils_1 = require("../utils");
18
14
  const command = {
@@ -25,7 +21,7 @@ const command = {
25
21
  });
26
22
  },
27
23
  handler: (args) => __awaiter(void 0, void 0, void 0, function* () {
28
- const handoff = new __1.default(args.debug, args.force);
24
+ const handoff = (0, utils_1.createHandoff)(args);
29
25
  const componentName = args.name;
30
26
  if (!/^[a-z0-9_-]+$/i.test(componentName)) {
31
27
  logger_1.Logger.error(`Component name must be alphanumeric and may contain dashes or underscores`);
@@ -8,11 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const __1 = __importDefault(require("../../"));
16
12
  const logger_1 = require("../../utils/logger");
17
13
  const utils_1 = require("../utils");
18
14
  const command = {
@@ -30,14 +26,14 @@ const command = {
30
26
  });
31
27
  },
32
28
  handler: (args) => __awaiter(void 0, void 0, void 0, function* () {
33
- const handoff = new __1.default(args.debug, args.force);
29
+ const handoff = (0, utils_1.createHandoff)(args);
34
30
  const pageName = args.name;
35
- if (!/^[a-z0-9]+$/i.test(pageName)) {
31
+ if (!/^[a-z0-9_-]+$/i.test(pageName)) {
36
32
  logger_1.Logger.error(`Page name must be alphanumeric and may contain dashes or underscores`);
37
33
  return;
38
34
  }
39
35
  let pageParent = args.parent;
40
- if (pageParent && !/^[a-z0-9]+$/i.test(pageParent)) {
36
+ if (pageParent && !/^[a-z0-9_-]+$/i.test(pageParent)) {
41
37
  logger_1.Logger.error(`Page parent must be alphanumeric and may contain dashes or underscores`);
42
38
  return;
43
39
  }
@@ -8,11 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const __1 = __importDefault(require("../../"));
16
12
  const logger_1 = require("../../utils/logger");
17
13
  const utils_1 = require("../utils");
18
14
  const command = {
@@ -30,7 +26,7 @@ const command = {
30
26
  });
31
27
  },
32
28
  handler: (args) => __awaiter(void 0, void 0, void 0, function* () {
33
- const handoff = new __1.default(args.debug, args.force);
29
+ const handoff = (0, utils_1.createHandoff)(args);
34
30
  const templateComponent = args.component;
35
31
  if (!/^[a-z0-9]+$/i.test(templateComponent)) {
36
32
  logger_1.Logger.error(`Template component must be alphanumeric and may contain dashes or underscores`);
@@ -1,22 +1,28 @@
1
1
  import { CommandModule } from 'yargs';
2
2
  import { SharedArgs } from '../types';
3
- import { RegistryEntityKind } from '../utils';
3
+ import { RegistryTargetKind } from '../utils';
4
4
  export interface PublishArgs extends SharedArgs {
5
- type: RegistryEntityKind;
6
- id?: string;
5
+ type: RegistryTargetKind;
6
+ id?: string[];
7
7
  }
8
8
  /**
9
- * `handoff-app publish <components|patterns|pages> [id]` runs a fresh local build and uploads to the
10
- * connected registry. Pass an `id` to build and upload that one entity, or omit it to build the kind
11
- * once and upload every declared entity, skipping any whose content already matches the registry
12
- * (pass `--force` to re-upload everything).
9
+ * `handoff-app publish <components|patterns|pages> [id...]` runs a fresh local build and uploads to
10
+ * the connected registry. Pass ids to build and upload only those entities, or omit them to build the
11
+ * kind once and upload every declared entity, skipping any whose content already matches the registry
12
+ * (`--force` re-uploads everything).
13
13
  *
14
- * `handoff-app publish tokens [setId]` — fresh token build + upload of every logical token set, or
15
- * only the named set (`foundation/colors`, `component/button`).
14
+ * `handoff-app publish tokens [setId...]` does a fresh token build and uploads every logical token
15
+ * set, or only the named ones (`foundation/colors`, `component/button`).
16
16
  *
17
- * `handoff-app publish assets [collection]` runs a fresh build and uploads every asset collection, or
18
- * only the named one (`icons`, `logos`, `fonts`). Available only from a connected workspace
19
- * (`runtime.mode: workspace` + a configured `registryConnection`).
17
+ * `handoff-app publish assets [collection...]` runs a fresh build and uploads every asset collection,
18
+ * or only the named ones (`icons`, `logos`, `fonts`).
19
+ *
20
+ * `handoff-app publish all` runs every kind in dependency order: tokens, assets, components,
21
+ * patterns, then pages.
22
+ *
23
+ * Available only from a connected workspace (`runtime.mode: workspace` + a configured
24
+ * `registryConnection`), except under `--dry-run`, which reports what would be uploaded and needs no
25
+ * registry at all.
20
26
  */
21
27
  declare const command: CommandModule<{}, PublishArgs>;
22
28
  export default command;
@@ -1,65 +1,29 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
2
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const __1 = __importDefault(require("../../"));
16
- const logger_1 = require("../../utils/logger");
17
3
  const utils_1 = require("../utils");
18
4
  /**
19
- * `handoff-app publish <components|patterns|pages> [id]` runs a fresh local build and uploads to the
20
- * connected registry. Pass an `id` to build and upload that one entity, or omit it to build the kind
21
- * once and upload every declared entity, skipping any whose content already matches the registry
22
- * (pass `--force` to re-upload everything).
5
+ * `handoff-app publish <components|patterns|pages> [id...]` runs a fresh local build and uploads to
6
+ * the connected registry. Pass ids to build and upload only those entities, or omit them to build the
7
+ * kind once and upload every declared entity, skipping any whose content already matches the registry
8
+ * (`--force` re-uploads everything).
9
+ *
10
+ * `handoff-app publish tokens [setId...]` does a fresh token build and uploads every logical token
11
+ * set, or only the named ones (`foundation/colors`, `component/button`).
12
+ *
13
+ * `handoff-app publish assets [collection...]` runs a fresh build and uploads every asset collection,
14
+ * or only the named ones (`icons`, `logos`, `fonts`).
23
15
  *
24
- * `handoff-app publish tokens [setId]` — fresh token build + upload of every logical token set, or
25
- * only the named set (`foundation/colors`, `component/button`).
16
+ * `handoff-app publish all` runs every kind in dependency order: tokens, assets, components,
17
+ * patterns, then pages.
26
18
  *
27
- * `handoff-app publish assets [collection]` runs a fresh build and uploads every asset collection, or
28
- * only the named one (`icons`, `logos`, `fonts`). Available only from a connected workspace
29
- * (`runtime.mode: workspace` + a configured `registryConnection`).
19
+ * Available only from a connected workspace (`runtime.mode: workspace` + a configured
20
+ * `registryConnection`), except under `--dry-run`, which reports what would be uploaded and needs no
21
+ * registry at all.
30
22
  */
31
23
  const command = {
32
- command: 'publish <type> [id]',
24
+ command: 'publish <type> [id..]',
33
25
  describe: 'Build and publish components, patterns, pages, design tokens, or assets to the connected registry',
34
- builder: (yargs) => {
35
- return (0, utils_1.getSharedOptions)(yargs)
36
- .positional('type', {
37
- describe: 'The kind of entity to publish',
38
- choices: utils_1.REGISTRY_ENTITY_KINDS,
39
- type: 'string',
40
- })
41
- .positional('id', {
42
- describe: 'The stable id of the entity (component/pattern/page id, token set id, or asset collection); omit to publish all of that kind',
43
- type: 'string',
44
- });
45
- },
46
- handler: (args) => __awaiter(void 0, void 0, void 0, function* () {
47
- const handoff = new __1.default(args.debug, args.force);
48
- try {
49
- if (args.type === 'tokens') {
50
- yield handoff.publishTokens(args.id);
51
- return;
52
- }
53
- if (args.type === 'assets') {
54
- yield handoff.publishAssets(args.id);
55
- return;
56
- }
57
- yield handoff.publish(utils_1.ENTITY_WIRE_KIND[args.type], args.id);
58
- }
59
- catch (error) {
60
- logger_1.Logger.error(error instanceof Error ? error.message : String(error));
61
- process.exitCode = 1;
62
- }
63
- }),
26
+ builder: (yargs) => (0, utils_1.withTargetPositionals)((0, utils_1.getPublishOptions)(yargs), 'publish'),
27
+ handler: (args) => (0, utils_1.runRegistryCommand)(args, (handoff) => (0, utils_1.runTarget)(handoff, args.type, args.id, 'publish')),
64
28
  };
65
29
  exports.default = command;
@@ -0,0 +1,13 @@
1
+ import { CommandModule } from 'yargs';
2
+ import { type CompatTargetArgs } from '../compat/push-args';
3
+ import { SharedArgs } from '../types';
4
+ /**
5
+ * Deprecated `pull`, the documented name for `checkout`, kept working over the canonical
6
+ * implementation. With no argument it pulls the entity kinds the docs describe (pages plus component
7
+ * and pattern declarations); with a kind or selective flags it narrows the same way `push` does.
8
+ * `--dry-run` is a supported `checkout` option, so it passes straight through.
9
+ */
10
+ export interface PullArgs extends SharedArgs, CompatTargetArgs {
11
+ }
12
+ declare const pull: CommandModule<{}, PullArgs>;
13
+ export default pull;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const deprecations_1 = require("../compat/deprecations");
4
+ const push_args_1 = require("../compat/push-args");
5
+ const utils_1 = require("../utils");
6
+ const pull = {
7
+ command: 'pull [type] [id..]',
8
+ describe: 'Deprecated alias for checkout',
9
+ deprecated: true,
10
+ builder: (yargs) => (0, utils_1.withTargetPositionals)((0, utils_1.getCheckoutOptions)(yargs), 'checkout').options({
11
+ components: { type: 'array', string: true, description: 'Checkout only these component ids' },
12
+ patterns: { type: 'array', string: true, description: 'Checkout only these pattern ids' },
13
+ pages: { type: 'array', string: true, description: 'Checkout only these page slugs' },
14
+ }),
15
+ handler: (args) => (0, utils_1.runRegistryCommand)(args, (handoff) => {
16
+ (0, deprecations_1.warnDeprecatedCommand)('pull', 'checkout');
17
+ return handoff.checkoutAll((0, push_args_1.resolveCompatTargets)(args));
18
+ }),
19
+ };
20
+ exports.default = pull;
@@ -0,0 +1,23 @@
1
+ import { CommandModule } from 'yargs';
2
+ import { type CompatAssetSkipArgs, type CompatSkipArgs, type CompatTargetArgs } from '../compat/push-args';
3
+ import { SharedArgs } from '../types';
4
+ /**
5
+ * Deprecated `push` family: the command names used by the published docs, kept working over the
6
+ * canonical `publish` implementation.
7
+ *
8
+ * Each command translates its documented arguments through `commands/compat` and then calls the same
9
+ * `Handoff` entry point `publish` uses, so there is no second publish path to keep in step. Options
10
+ * the docs describe for subsystems we do not have are declared hidden and warned about, so a command
11
+ * copied from the docs runs and explains itself rather than failing on an unknown argument.
12
+ */
13
+ export interface PushArgs extends SharedArgs, CompatTargetArgs {
14
+ }
15
+ export interface PushAllArgs extends SharedArgs, CompatSkipArgs {
16
+ }
17
+ export interface PushTokensArgs extends SharedArgs {
18
+ setId?: string[];
19
+ }
20
+ export interface PushAssetsArgs extends SharedArgs, CompatAssetSkipArgs {
21
+ collection?: string;
22
+ }
23
+ export declare const pushCommands: (CommandModule<{}, PushArgs> | CommandModule<{}, PushAllArgs> | CommandModule<{}, PushTokensArgs> | CommandModule<{}, PushAssetsArgs>)[];
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pushCommands = void 0;
4
+ const sets_1 = require("../../registry/assets/sets");
5
+ const deprecations_1 = require("../compat/deprecations");
6
+ const push_args_1 = require("../compat/push-args");
7
+ const utils_1 = require("../utils");
8
+ const push = {
9
+ command: 'push [type] [id..]',
10
+ describe: 'Deprecated alias for publish',
11
+ deprecated: true,
12
+ builder: (yargs) => (0, utils_1.withTargetPositionals)((0, utils_1.getPublishOptions)(yargs), 'publish').options(Object.assign({ components: { type: 'array', string: true, description: 'Publish only these component ids' }, patterns: { type: 'array', string: true, description: 'Publish only these pattern ids' }, pages: { type: 'array', string: true, description: 'Publish only these page slugs' } }, (0, deprecations_1.hiddenOptions)(deprecations_1.UNSUPPORTED_PUSH_OPTIONS))),
13
+ handler: (args) => (0, utils_1.runRegistryCommand)(args, (handoff) => {
14
+ (0, deprecations_1.warnDeprecatedCommand)('push', 'publish');
15
+ (0, deprecations_1.warnUnsupportedOptions)(args, deprecations_1.UNSUPPORTED_PUSH_OPTIONS);
16
+ return handoff.publishAll((0, push_args_1.resolveCompatTargets)(args));
17
+ }),
18
+ };
19
+ const pushAll = {
20
+ command: 'push:all',
21
+ describe: 'Deprecated alias for publish all',
22
+ deprecated: true,
23
+ builder: (yargs) => (0, utils_1.getPublishOptions)(yargs).options(Object.assign({ 'skip-tokens': { type: 'boolean', description: 'Skip the token step' }, 'skip-assets': { type: 'boolean', description: 'Skip the asset step' }, 'skip-components': { type: 'boolean', description: 'Skip the component step' }, 'skip-patterns': { type: 'boolean', description: 'Skip the pattern step' }, 'skip-pages': { type: 'boolean', description: 'Skip the page step' } }, (0, deprecations_1.hiddenOptions)(deprecations_1.UNSUPPORTED_PUSH_ALL_OPTIONS))),
24
+ handler: (args) => (0, utils_1.runRegistryCommand)(args, (handoff) => {
25
+ (0, deprecations_1.warnDeprecatedCommand)('push:all', 'publish all');
26
+ (0, deprecations_1.warnUnsupportedOptions)(args, deprecations_1.UNSUPPORTED_PUSH_ALL_OPTIONS);
27
+ return handoff.publishAll((0, push_args_1.resolveCompatAllKinds)(args));
28
+ }),
29
+ };
30
+ const pushTokens = {
31
+ command: 'push:tokens [setId..]',
32
+ describe: 'Deprecated alias for publish tokens',
33
+ deprecated: true,
34
+ builder: (yargs) => (0, utils_1.getPublishOptions)(yargs)
35
+ .positional('setId', { describe: 'Token set id, e.g. foundation/colors', type: 'string', array: true })
36
+ .options((0, deprecations_1.hiddenOptions)(deprecations_1.UNSUPPORTED_PUSH_TOKENS_OPTIONS)),
37
+ handler: (args) => (0, utils_1.runRegistryCommand)(args, (handoff) => {
38
+ (0, deprecations_1.warnDeprecatedCommand)('push:tokens', 'publish tokens');
39
+ (0, deprecations_1.warnUnsupportedOptions)(args, deprecations_1.UNSUPPORTED_PUSH_TOKENS_OPTIONS);
40
+ return handoff.publishTokens(args.setId);
41
+ }),
42
+ };
43
+ const pushAssets = {
44
+ command: 'push:assets [collection]',
45
+ describe: 'Deprecated alias for publish assets',
46
+ deprecated: true,
47
+ builder: (yargs) => (0, utils_1.getPublishOptions)(yargs)
48
+ .positional('collection', { describe: `Asset collection (${sets_1.ASSET_COLLECTIONS.join(', ')})`, type: 'string' })
49
+ .options({
50
+ 'skip-icons': { type: 'boolean', description: 'Skip the icons collection' },
51
+ 'skip-logos': { type: 'boolean', description: 'Skip the logos collection' },
52
+ }),
53
+ handler: (args) => (0, utils_1.runRegistryCommand)(args, (handoff) => {
54
+ (0, deprecations_1.warnDeprecatedCommand)('push:assets', 'publish assets');
55
+ return handoff.publishAssets((0, push_args_1.resolveCompatAssetSelection)(args, args.collection));
56
+ }),
57
+ };
58
+ exports.pushCommands = [push, pushAll, pushTokens, pushAssets];
@@ -8,11 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const __1 = __importDefault(require("../.."));
16
12
  const scaffold_1 = require("../../cli/scaffold");
17
13
  const utils_1 = require("../utils");
18
14
  const command = {
@@ -22,7 +18,7 @@ const command = {
22
18
  return (0, utils_1.getSharedOptions)(yargs);
23
19
  },
24
20
  handler: (args) => __awaiter(void 0, void 0, void 0, function* () {
25
- const handoff = new __1.default(args.debug, args.force);
21
+ const handoff = (0, utils_1.createHandoff)(args);
26
22
  yield (0, scaffold_1.runScaffold)(handoff);
27
23
  }),
28
24
  };
@@ -8,11 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const __1 = __importDefault(require("../../"));
16
12
  const utils_1 = require("../utils");
17
13
  const command = {
18
14
  command: 'start',
@@ -21,7 +17,7 @@ const command = {
21
17
  return (0, utils_1.getSharedOptions)(yargs);
22
18
  },
23
19
  handler: (args) => __awaiter(void 0, void 0, void 0, function* () {
24
- const handoff = new __1.default(args.debug, args.force);
20
+ const handoff = (0, utils_1.createHandoff)(args);
25
21
  yield handoff.start();
26
22
  }),
27
23
  };
@@ -1,5 +1,15 @@
1
1
  import { Arguments } from 'yargs';
2
2
  export interface SharedArgs extends Arguments {
3
+ /** Explicit config file, replacing the usual `handoff.config.*` lookup. */
4
+ config?: string;
3
5
  force?: boolean;
4
6
  debug?: boolean;
7
+ /**
8
+ * Report what would happen instead of doing it: publish uploads nothing and needs no registry URL
9
+ * or token, and checkout writes no workspace file. A publish dry run still runs the build, so build
10
+ * output on disk is refreshed; pair it with `skipBuild` to leave that alone too.
11
+ */
12
+ dryRun?: boolean;
13
+ /** yargs `--build` / `--no-build`; `false` publishes the existing build output. */
14
+ build?: boolean;
5
15
  }
@@ -1,10 +1,15 @@
1
1
  import { Argv } from 'yargs';
2
- import type { TransferEntityKind } from '../registry/transfer';
3
- /** Plural entity kinds accepted by the `publish`/`checkout` commands. */
4
- export declare const REGISTRY_ENTITY_KINDS: readonly ["components", "patterns", "pages", "tokens", "assets"];
5
- export type RegistryEntityKind = (typeof REGISTRY_ENTITY_KINDS)[number];
6
- /** Map the plural CLI kind to the singular wire kind used by entity publish/checkout. */
7
- export declare const ENTITY_WIRE_KIND: Record<'components' | 'patterns' | 'pages', TransferEntityKind>;
2
+ import Handoff from '../';
3
+ import { SharedArgs } from './types';
4
+ /** The `type` argument accepted by publish/checkout: any content kind, or `all` for every kind. */
5
+ export declare const REGISTRY_TARGET_KINDS: readonly ["components", "patterns", "pages", "tokens", "assets", "all"];
6
+ export type RegistryTargetKind = (typeof REGISTRY_TARGET_KINDS)[number];
7
+ export declare const createHandoff: (args: SharedArgs) => Handoff;
8
+ /**
9
+ * Run a registry command against a fresh Handoff. Registry failures are the user's to act on, so they
10
+ * surface as one actionable line and a non-zero exit rather than a stack trace.
11
+ */
12
+ export declare const runRegistryCommand: (args: SharedArgs, run: (handoff: Handoff) => Promise<unknown>) => Promise<void>;
8
13
  export declare const getSharedOptions: (yargs: Argv) => Argv<import("yargs").Omit<{}, "debug" | "config" | "force"> & import("yargs").InferredOptionTypes<{
9
14
  config: {
10
15
  alias: string;
@@ -22,3 +27,66 @@ export declare const getSharedOptions: (yargs: Argv) => Argv<import("yargs").Omi
22
27
  description: string;
23
28
  };
24
29
  }>>;
30
+ /** Shared options plus the transfer options: publish and its compatibility aliases use these. */
31
+ export declare const getPublishOptions: (yargs: Argv) => Argv<import("yargs").Omit<import("yargs").Omit<{}, "debug" | "config" | "force"> & import("yargs").InferredOptionTypes<{
32
+ config: {
33
+ alias: string;
34
+ type: "string";
35
+ description: string;
36
+ };
37
+ force: {
38
+ alias: string;
39
+ type: "boolean";
40
+ description: string;
41
+ };
42
+ debug: {
43
+ alias: string;
44
+ type: "boolean";
45
+ description: string;
46
+ };
47
+ }>, "build" | "dry-run"> & import("yargs").InferredOptionTypes<{
48
+ 'dry-run': {
49
+ type: "boolean";
50
+ description: string;
51
+ };
52
+ build: {
53
+ type: "boolean";
54
+ default: boolean;
55
+ description: string;
56
+ };
57
+ }>>;
58
+ /** Shared options plus `--dry-run`: checkout and its compatibility aliases use these. */
59
+ export declare const getCheckoutOptions: (yargs: Argv) => Argv<import("yargs").Omit<import("yargs").Omit<{}, "debug" | "config" | "force"> & import("yargs").InferredOptionTypes<{
60
+ config: {
61
+ alias: string;
62
+ type: "string";
63
+ description: string;
64
+ };
65
+ force: {
66
+ alias: string;
67
+ type: "boolean";
68
+ description: string;
69
+ };
70
+ debug: {
71
+ alias: string;
72
+ type: "boolean";
73
+ description: string;
74
+ };
75
+ }>, "dry-run"> & import("yargs").InferredOptionTypes<{
76
+ 'dry-run': {
77
+ type: "boolean";
78
+ description: string;
79
+ };
80
+ }>>;
81
+ /**
82
+ * Positional `type` + variadic `id`, shared by publish, checkout, and their compatibility aliases.
83
+ * `choices` is always declared: yargs allows an omitted optional positional while still rejecting an
84
+ * unrecognized one, so the deprecated commands get the same guard as the canonical ones.
85
+ */
86
+ export declare const withTargetPositionals: (yargs: Argv, verb: "publish" | "checkout") => Argv<{
87
+ type: "pages" | "components" | "patterns" | "assets" | "tokens" | "all";
88
+ } & {
89
+ id: string[];
90
+ }>;
91
+ /** Dispatch one `type` argument to the matching Handoff entry point. */
92
+ export declare const runTarget: (handoff: Handoff, type: RegistryTargetKind, ids: string[] | undefined, verb: "publish" | "checkout") => Promise<Handoff>;