@holo-js/cli 0.2.3 → 0.2.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 (31) hide show
  1. package/dist/agent-skills-MSEMQUXT.mjs +173 -0
  2. package/dist/bin/holo.mjs +81 -21
  3. package/dist/{broadcast-IL24KZHW.mjs → broadcast-5MJ3GJK7.mjs} +1 -1
  4. package/dist/{broadcast-NVBDC5DR.mjs → broadcast-MRJGFCFH.mjs} +1 -1
  5. package/dist/{cache-INHARA5B.mjs → cache-KVRYC7FB.mjs} +1 -1
  6. package/dist/{cache-QT4L44AW.mjs → cache-WWE4Q4YE.mjs} +1 -1
  7. package/dist/{cache-migrations-A3PXSAEM.mjs → cache-migrations-APDFSFEX.mjs} +5 -5
  8. package/dist/{cache-migrations-MOIIT5FK.mjs → cache-migrations-CPYQC7T6.mjs} +5 -5
  9. package/dist/{chunk-HHQZB6Z4.mjs → chunk-PT72AMV7.mjs} +67 -67
  10. package/dist/{chunk-PJOYKYYG.mjs → chunk-TWITVSFZ.mjs} +67 -67
  11. package/dist/{chunk-42V4KAVA.mjs → chunk-UPXQONEH.mjs} +1 -1
  12. package/dist/{chunk-YKFOYZLS.mjs → chunk-XDRCZ3Z5.mjs} +1 -1
  13. package/dist/{dev-I3SVGKBU.mjs → dev-CT4DRTLN.mjs} +2 -2
  14. package/dist/{dev-KOQ3MDF4.mjs → dev-QDLR6C7K.mjs} +2 -2
  15. package/dist/{generators-M4IS5JUN.mjs → generators-PUN5TFP5.mjs} +5 -5
  16. package/dist/{generators-YJJHKGCV.mjs → generators-WQHI7DBW.mjs} +5 -5
  17. package/dist/index.mjs +81 -21
  18. package/dist/{media-migrations-TLZ5TC4Y.mjs → media-migrations-D3CDNMPT.mjs} +6 -6
  19. package/dist/{media-migrations-ZIYGFLLR.mjs → media-migrations-IWCSCKSA.mjs} +6 -6
  20. package/dist/{queue-C4GCAEO3.mjs → queue-GRB2IH5M.mjs} +3 -3
  21. package/dist/{queue-VNBAQSXD.mjs → queue-O3OSLGOV.mjs} +3 -3
  22. package/dist/{queue-migrations-KLI35TWM.mjs → queue-migrations-7T42S4FX.mjs} +21 -20
  23. package/dist/{queue-migrations-UPPGTXUT.mjs → queue-migrations-HFZB64OG.mjs} +21 -20
  24. package/dist/{runtime-UK77C7Y5.mjs → runtime-M3G5OKQV.mjs} +1 -1
  25. package/dist/{runtime-UMBLJHYV.mjs → runtime-TTRP2DGL.mjs} +1 -1
  26. package/dist/runtime-worker.mjs +6 -0
  27. package/dist/{scaffold-BQDH5BKC.mjs → scaffold-5BOVJYF3.mjs} +1 -1
  28. package/dist/{scaffold-K3J5J2O6.mjs → scaffold-NY3MWUZF.mjs} +1 -1
  29. package/dist/{security-2S6523NZ.mjs → security-H7AGDFBX.mjs} +1 -1
  30. package/dist/{security-73KA2VFP.mjs → security-ST6ED7EK.mjs} +1 -1
  31. package/package.json +8 -8
@@ -3,26 +3,26 @@ import {
3
3
  } from "./chunk-VRGB6DIS.mjs";
4
4
  import {
5
5
  runProjectPrepare
6
- } from "./chunk-YKFOYZLS.mjs";
6
+ } from "./chunk-XDRCZ3Z5.mjs";
7
7
  import "./chunk-FGQ2I2YH.mjs";
8
8
  import {
9
9
  hasRegisteredCreateTableMigration,
10
10
  hasRegisteredMigrationSlug,
11
11
  nextMigrationTemplate
12
12
  } from "./chunk-LXGQCG56.mjs";
13
- import {
14
- writeLine
15
- } from "./chunk-I7QBCEV7.mjs";
16
13
  import {
17
14
  ensureAbsent,
18
15
  fileExists
19
16
  } from "./chunk-LBJAJLKU.mjs";
17
+ import {
18
+ writeLine
19
+ } from "./chunk-I7QBCEV7.mjs";
20
20
  import "./chunk-D7O4SU6N.mjs";
21
21
  import {
22
22
  collectFiles,
23
23
  prepareProjectDiscovery
24
24
  } from "./chunk-VP2E62DF.mjs";
25
- import "./chunk-PJOYKYYG.mjs";
25
+ import "./chunk-TWITVSFZ.mjs";
26
26
  import {
27
27
  ensureGeneratedSchemaPlaceholder,
28
28
  ensureProjectConfig
package/dist/index.mjs CHANGED
@@ -29,7 +29,7 @@ import {
29
29
  } from "./chunk-I7QBCEV7.mjs";
30
30
  import "./chunk-D7O4SU6N.mjs";
31
31
  import "./chunk-VP2E62DF.mjs";
32
- import "./chunk-HHQZB6Z4.mjs";
32
+ import "./chunk-TWITVSFZ.mjs";
33
33
  import "./chunk-YEFJBN56.mjs";
34
34
  import "./chunk-J76GH2DR.mjs";
35
35
  import {
@@ -116,6 +116,7 @@ var AUTH_INSTALL_FEATURES = ["social", "workos", "clerk"];
116
116
  var AUTH_SOCIAL_PROVIDER_MODES = ["default", "specific"];
117
117
  var EVENTS_QUEUE_ACTIONS = ["skip", "enable"];
118
118
  var MODEL_GENERATOR_OPTIONS = ["migration", "observer", "seeder", "factory"];
119
+ var COMMAND_LIST_DESCRIPTION_COLUMN = 32;
119
120
  var runtimeModulePromise;
120
121
  var queueModulePromise;
121
122
  var cacheModulePromise;
@@ -130,44 +131,45 @@ var projectConfigModulePromise;
130
131
  var projectDiscoveryModulePromise;
131
132
  var projectRuntimeModulePromise;
132
133
  var projectScaffoldModulePromise;
134
+ var agentSkillsModulePromise;
133
135
  function loadRuntimeModule() {
134
- runtimeModulePromise ??= import("./runtime-UMBLJHYV.mjs");
136
+ runtimeModulePromise ??= import("./runtime-M3G5OKQV.mjs");
135
137
  return runtimeModulePromise;
136
138
  }
137
139
  function loadQueueModule() {
138
- queueModulePromise ??= import("./queue-VNBAQSXD.mjs");
140
+ queueModulePromise ??= import("./queue-O3OSLGOV.mjs");
139
141
  return queueModulePromise;
140
142
  }
141
143
  function loadCacheModule() {
142
- cacheModulePromise ??= import("./cache-INHARA5B.mjs");
144
+ cacheModulePromise ??= import("./cache-KVRYC7FB.mjs");
143
145
  return cacheModulePromise;
144
146
  }
145
147
  function loadQueueMigrationsModule() {
146
- queueMigrationsModulePromise ??= import("./queue-migrations-UPPGTXUT.mjs");
148
+ queueMigrationsModulePromise ??= import("./queue-migrations-7T42S4FX.mjs");
147
149
  return queueMigrationsModulePromise;
148
150
  }
149
151
  function loadCacheMigrationsModule() {
150
- cacheMigrationsModulePromise ??= import("./cache-migrations-A3PXSAEM.mjs");
152
+ cacheMigrationsModulePromise ??= import("./cache-migrations-APDFSFEX.mjs");
151
153
  return cacheMigrationsModulePromise;
152
154
  }
153
155
  function loadMediaMigrationsModule() {
154
- mediaMigrationsModulePromise ??= import("./media-migrations-TLZ5TC4Y.mjs");
156
+ mediaMigrationsModulePromise ??= import("./media-migrations-IWCSCKSA.mjs");
155
157
  return mediaMigrationsModulePromise;
156
158
  }
157
159
  function loadGeneratorsModule() {
158
- generatorsModulePromise ??= import("./generators-M4IS5JUN.mjs");
160
+ generatorsModulePromise ??= import("./generators-WQHI7DBW.mjs");
159
161
  return generatorsModulePromise;
160
162
  }
161
163
  function loadBroadcastModule() {
162
- broadcastModulePromise ??= import("./broadcast-IL24KZHW.mjs");
164
+ broadcastModulePromise ??= import("./broadcast-5MJ3GJK7.mjs");
163
165
  return broadcastModulePromise;
164
166
  }
165
167
  function loadSecurityModule() {
166
- securityModulePromise ??= import("./security-73KA2VFP.mjs");
168
+ securityModulePromise ??= import("./security-ST6ED7EK.mjs");
167
169
  return securityModulePromise;
168
170
  }
169
171
  function loadDevModule() {
170
- devModulePromise ??= import("./dev-KOQ3MDF4.mjs");
172
+ devModulePromise ??= import("./dev-CT4DRTLN.mjs");
171
173
  return devModulePromise;
172
174
  }
173
175
  function loadProjectConfigModule() {
@@ -183,9 +185,13 @@ function loadProjectRuntimeModule() {
183
185
  return projectRuntimeModulePromise;
184
186
  }
185
187
  function loadProjectScaffoldModule() {
186
- projectScaffoldModulePromise ??= import("./scaffold-K3J5J2O6.mjs");
188
+ projectScaffoldModulePromise ??= import("./scaffold-5BOVJYF3.mjs");
187
189
  return projectScaffoldModulePromise;
188
190
  }
191
+ function loadAgentSkillsModule() {
192
+ agentSkillsModulePromise ??= import("./agent-skills-MSEMQUXT.mjs");
193
+ return agentSkillsModulePromise;
194
+ }
189
195
  async function resolveRuntimeExecutor(runtimeExecutor) {
190
196
  return runtimeExecutor ?? (await loadRuntimeModule()).withRuntimeEnvironment;
191
197
  }
@@ -256,20 +262,27 @@ function createCommandContext(io, projectRoot, loadProject, input) {
256
262
  function printCommandList(io, registry) {
257
263
  const internal = registry.filter((command) => command.source === "internal");
258
264
  const app = registry.filter((command) => command.source === "app");
259
- writeLine(io.stdout, "Internal Commands");
260
- for (const command of internal) {
261
- writeLine(io.stdout, ` ${command.usage} ${command.description}`);
262
- }
265
+ writeLine(io.stdout, "Usage:");
266
+ writeLine(io.stdout, " holo <command> [options] [arguments]");
267
+ writeLine(io.stdout);
268
+ writeLine(io.stdout, "Internal commands:");
269
+ printCommandListEntries(io, internal);
263
270
  writeLine(io.stdout);
264
- writeLine(io.stdout, "App Commands");
271
+ writeLine(io.stdout, "App commands:");
265
272
  if (app.length === 0) {
266
273
  writeLine(io.stdout, " (none)");
267
274
  return;
268
275
  }
269
- for (const command of app) {
270
- writeLine(io.stdout, ` ${command.usage} ${command.description}`);
276
+ printCommandListEntries(io, app);
277
+ }
278
+ function printCommandListEntries(io, commands) {
279
+ for (const command of commands) {
280
+ printCommandListEntry(io, command);
271
281
  }
272
282
  }
283
+ function printCommandListEntry(io, command) {
284
+ writeLine(io.stdout, ` ${command.name.padEnd(COMMAND_LIST_DESCRIPTION_COLUMN)}${command.description}`);
285
+ }
273
286
  function printCommandHelp(io, command) {
274
287
  writeLine(io.stdout, command.usage);
275
288
  writeLine(io.stdout, command.description);
@@ -372,6 +385,50 @@ function createInternalCommands(context, runtimeExecutor, queueExecutors = {}, p
372
385
  writeLine(context.stdout, ` ${resolvePackageManagerDevCommand(packageManager)}`);
373
386
  }
374
387
  },
388
+ {
389
+ name: "agents:install",
390
+ aliases: ["agent:install", "ai:install"],
391
+ description: "Install Holo-JS docs-search skills for coding agents.",
392
+ usage: "holo agents:install [--agent <all|codex|claude|cursor|windsurf|opencode|gemini|kiro>] [--global] [--force]",
393
+ source: "internal",
394
+ async prepare(input) {
395
+ const { normalizeAgentSkillTargets, SUPPORTED_AGENT_SKILL_TARGETS } = await loadAgentSkillsModule();
396
+ const requestedAgents = (collectMultiStringFlag(input.flags, "agent") ?? []).flatMap((entry) => splitCsv(entry) ?? []);
397
+ const agents = requestedAgents.length > 0 ? normalizeAgentSkillTargets(requestedAgents) : isInteractive(context, input.flags) ? await promptMultiChoice(context, "Coding agents", SUPPORTED_AGENT_SKILL_TARGETS, {
398
+ required: true,
399
+ initialValues: [...SUPPORTED_AGENT_SKILL_TARGETS]
400
+ }) : normalizeAgentSkillTargets([]);
401
+ return {
402
+ args: [],
403
+ flags: {
404
+ agent: agents,
405
+ ...resolveBooleanFlag(input.flags, "global") === true ? { global: true } : {},
406
+ ...resolveBooleanFlag(input.flags, "force") === true ? { force: true } : {}
407
+ }
408
+ };
409
+ },
410
+ async run(commandContext) {
411
+ const { installAgentSkills } = await loadAgentSkillsModule();
412
+ const agents = collectMultiStringFlag(commandContext.flags, "agent") ?? [];
413
+ const results = await installAgentSkills(context.projectRoot, {
414
+ agents,
415
+ global: commandContext.flags.global === true,
416
+ force: commandContext.flags.force === true
417
+ });
418
+ const created = results.filter((result) => result.status === "created").length;
419
+ const updated = results.filter((result) => result.status === "updated").length;
420
+ const unchanged = results.filter((result) => result.status === "unchanged").length;
421
+ const changed = created + updated;
422
+ writeLine(
423
+ context.stdout,
424
+ changed > 0 ? "Installed Holo-JS agent skills." : "Holo-JS agent skills are already installed."
425
+ );
426
+ for (const result of results) {
427
+ writeLine(context.stdout, ` - ${result.status} ${result.agent}: ${result.path}`);
428
+ }
429
+ writeLine(context.stdout, ` - summary: ${created} created, ${updated} updated, ${unchanged} unchanged`);
430
+ }
431
+ },
375
432
  {
376
433
  name: "key:generate",
377
434
  description: "Generate APP_KEY in the project .env file when it is missing.",
@@ -746,7 +803,9 @@ function createInternalCommands(context, runtimeExecutor, queueExecutors = {}, p
746
803
  async run() {
747
804
  const runProjectPrepare = await resolveProjectExecutor(projectExecutors, "runProjectPrepare");
748
805
  const runProjectBuild = await resolveProjectExecutor(projectExecutors, "runProjectBuild");
806
+ const executeRuntime = await resolveRuntimeExecutor(runtimeExecutor);
749
807
  await runProjectPrepare(context.projectRoot, context);
808
+ await executeRuntime(context.projectRoot, "hydrate-schema", {}, async () => void 0);
750
809
  await runProjectBuild(context, context.projectRoot);
751
810
  }
752
811
  },
@@ -1579,7 +1638,8 @@ function findCommand(registry, name) {
1579
1638
  async function runCli(argv, io) {
1580
1639
  try {
1581
1640
  const requestedCommandName = argv[0];
1582
- const projectRoot = requestedCommandName === "new" ? io.cwd : await (await loadProjectRuntimeModule()).findProjectRoot(io.cwd);
1641
+ const usesCurrentDirectoryAsProjectRoot = requestedCommandName === "new" || requestedCommandName === "agents:install" || requestedCommandName === "agent:install" || requestedCommandName === "ai:install";
1642
+ const projectRoot = usesCurrentDirectoryAsProjectRoot ? io.cwd : await (await loadProjectRuntimeModule()).findProjectRoot(io.cwd);
1583
1643
  let cachedProject;
1584
1644
  const loadProject = async () => {
1585
1645
  cachedProject ??= await (await loadProjectConfigModule()).loadProjectConfig(projectRoot);
@@ -1594,7 +1654,7 @@ async function runCli(argv, io) {
1594
1654
  };
1595
1655
  const internalCommands = createInternalCommands(internalContext);
1596
1656
  const registry = [...internalCommands];
1597
- const canSkipAppDiscovery = requestedCommandName === "config:cache" || requestedCommandName === "config:clear" || requestedCommandName === "key:generate" || requestedCommandName === "new" || requestedCommandName === "install" || requestedCommandName === "auth:notifications:publish" || requestedCommandName === "prepare" || requestedCommandName === "dev" || requestedCommandName === "build" || requestedCommandName === "cache:table" || requestedCommandName === "cache:clear" || requestedCommandName === "cache:forget" || requestedCommandName === "media:table" || requestedCommandName === "broadcast:work" || requestedCommandName === "queue:table" || requestedCommandName === "queue:failed-table" || requestedCommandName === "queue:work" || requestedCommandName === "queue:listen" || requestedCommandName === "queue:failed" || requestedCommandName === "queue:retry" || requestedCommandName === "queue:forget" || requestedCommandName === "queue:flush" || requestedCommandName === "queue:restart" || requestedCommandName === "queue:clear" || requestedCommandName === "rate-limit:clear";
1657
+ const canSkipAppDiscovery = requestedCommandName === "config:cache" || requestedCommandName === "config:clear" || requestedCommandName === "key:generate" || requestedCommandName === "new" || requestedCommandName === "install" || requestedCommandName === "agents:install" || requestedCommandName === "agent:install" || requestedCommandName === "ai:install" || requestedCommandName === "auth:notifications:publish" || requestedCommandName === "prepare" || requestedCommandName === "dev" || requestedCommandName === "build" || requestedCommandName === "cache:table" || requestedCommandName === "cache:clear" || requestedCommandName === "cache:forget" || requestedCommandName === "media:table" || requestedCommandName === "broadcast:work" || requestedCommandName === "queue:table" || requestedCommandName === "queue:failed-table" || requestedCommandName === "queue:work" || requestedCommandName === "queue:listen" || requestedCommandName === "queue:failed" || requestedCommandName === "queue:retry" || requestedCommandName === "queue:forget" || requestedCommandName === "queue:flush" || requestedCommandName === "queue:restart" || requestedCommandName === "queue:clear" || requestedCommandName === "rate-limit:clear";
1598
1658
  if (!canSkipAppDiscovery) {
1599
1659
  const initialProject = await loadProject();
1600
1660
  const appCommands = (await (await loadProjectDiscoveryModule()).discoverAppCommands(projectRoot, initialProject.config)).map((entry) => createAppCommandDefinition(entry));
@@ -3,15 +3,15 @@ import {
3
3
  hasRegisteredMigrationSlug,
4
4
  nextMigrationTemplate
5
5
  } from "./chunk-LXGQCG56.mjs";
6
- import "./chunk-LBJAJLKU.mjs";
7
6
  import {
8
7
  writeLine
9
8
  } from "./chunk-I7QBCEV7.mjs";
9
+ import "./chunk-LBJAJLKU.mjs";
10
10
  import "./chunk-D7O4SU6N.mjs";
11
11
  import {
12
12
  prepareProjectDiscovery
13
13
  } from "./chunk-VP2E62DF.mjs";
14
- import "./chunk-HHQZB6Z4.mjs";
14
+ import "./chunk-PT72AMV7.mjs";
15
15
  import {
16
16
  ensureProjectConfig
17
17
  } from "./chunk-YEFJBN56.mjs";
@@ -35,10 +35,10 @@ function normalizeMediaMigrationName(tableName = DEFAULT_MEDIA_TABLE) {
35
35
  function renderMediaTableMigration(tableName = DEFAULT_MEDIA_TABLE) {
36
36
  const tableNameLiteral = JSON.stringify(tableName);
37
37
  return [
38
- "import { defineMigration, type MigrationContext } from '@holo-js/db'",
38
+ "import { defineMigration } from '@holo-js/db'",
39
39
  "",
40
40
  "export default defineMigration({",
41
- " async up({ schema }: MigrationContext) {",
41
+ " async up({ schema }) {",
42
42
  ` await schema.createTable(${tableNameLiteral}, (table) => {`,
43
43
  " table.id()",
44
44
  " table.uuid('uuid').unique()",
@@ -60,7 +60,7 @@ function renderMediaTableMigration(tableName = DEFAULT_MEDIA_TABLE) {
60
60
  " table.index(['model_type', 'model_id', 'collection_name'])",
61
61
  " })",
62
62
  " },",
63
- " async down({ schema }: MigrationContext) {",
63
+ " async down({ schema }) {",
64
64
  ` await schema.dropTable(${tableNameLiteral})`,
65
65
  " },",
66
66
  "})",
@@ -93,7 +93,7 @@ async function createMediaTableMigration(projectRoot, options = {}) {
93
93
  }
94
94
  async function runMediaTableCommand(io, projectRoot) {
95
95
  const migrationFilePath = await createMediaTableMigration(projectRoot);
96
- const { runProjectPrepare } = await import("./dev-KOQ3MDF4.mjs");
96
+ const { runProjectPrepare } = await import("./dev-QDLR6C7K.mjs");
97
97
  await runProjectPrepare(projectRoot);
98
98
  writeLine(io.stdout, `Created migration: ${makeProjectRelativePath(projectRoot, migrationFilePath)}`);
99
99
  }
@@ -3,15 +3,15 @@ import {
3
3
  hasRegisteredMigrationSlug,
4
4
  nextMigrationTemplate
5
5
  } from "./chunk-LXGQCG56.mjs";
6
+ import "./chunk-LBJAJLKU.mjs";
6
7
  import {
7
8
  writeLine
8
9
  } from "./chunk-I7QBCEV7.mjs";
9
- import "./chunk-LBJAJLKU.mjs";
10
10
  import "./chunk-D7O4SU6N.mjs";
11
11
  import {
12
12
  prepareProjectDiscovery
13
13
  } from "./chunk-VP2E62DF.mjs";
14
- import "./chunk-PJOYKYYG.mjs";
14
+ import "./chunk-TWITVSFZ.mjs";
15
15
  import {
16
16
  ensureProjectConfig
17
17
  } from "./chunk-YEFJBN56.mjs";
@@ -35,10 +35,10 @@ function normalizeMediaMigrationName(tableName = DEFAULT_MEDIA_TABLE) {
35
35
  function renderMediaTableMigration(tableName = DEFAULT_MEDIA_TABLE) {
36
36
  const tableNameLiteral = JSON.stringify(tableName);
37
37
  return [
38
- "import { defineMigration, type MigrationContext } from '@holo-js/db'",
38
+ "import { defineMigration } from '@holo-js/db'",
39
39
  "",
40
40
  "export default defineMigration({",
41
- " async up({ schema }: MigrationContext) {",
41
+ " async up({ schema }) {",
42
42
  ` await schema.createTable(${tableNameLiteral}, (table) => {`,
43
43
  " table.id()",
44
44
  " table.uuid('uuid').unique()",
@@ -60,7 +60,7 @@ function renderMediaTableMigration(tableName = DEFAULT_MEDIA_TABLE) {
60
60
  " table.index(['model_type', 'model_id', 'collection_name'])",
61
61
  " })",
62
62
  " },",
63
- " async down({ schema }: MigrationContext) {",
63
+ " async down({ schema }) {",
64
64
  ` await schema.dropTable(${tableNameLiteral})`,
65
65
  " },",
66
66
  "})",
@@ -93,7 +93,7 @@ async function createMediaTableMigration(projectRoot, options = {}) {
93
93
  }
94
94
  async function runMediaTableCommand(io, projectRoot) {
95
95
  const migrationFilePath = await createMediaTableMigration(projectRoot);
96
- const { runProjectPrepare } = await import("./dev-I3SVGKBU.mjs");
96
+ const { runProjectPrepare } = await import("./dev-CT4DRTLN.mjs");
97
97
  await runProjectPrepare(projectRoot);
98
98
  writeLine(io.stdout, `Created migration: ${makeProjectRelativePath(projectRoot, migrationFilePath)}`);
99
99
  }
@@ -4,7 +4,7 @@ import {
4
4
  normalizeWatchedFilePath,
5
5
  runProjectPrepare,
6
6
  toPosixSlashes
7
- } from "./chunk-YKFOYZLS.mjs";
7
+ } from "./chunk-UPXQONEH.mjs";
8
8
  import "./chunk-FGQ2I2YH.mjs";
9
9
  import {
10
10
  writeLine
@@ -17,7 +17,7 @@ import "./chunk-D7O4SU6N.mjs";
17
17
  import {
18
18
  prepareProjectDiscovery
19
19
  } from "./chunk-VP2E62DF.mjs";
20
- import "./chunk-PJOYKYYG.mjs";
20
+ import "./chunk-PT72AMV7.mjs";
21
21
  import {
22
22
  ensureProjectConfig,
23
23
  loadProjectConfig
@@ -261,7 +261,7 @@ async function getQueueRuntimeEnvironment(projectRoot) {
261
261
  throw new Error(`Discovered job "${entry.sourcePath}" does not export a Holo job.`);
262
262
  }
263
263
  if (!queueModule?.getRegisteredQueueJob(entry.name)) {
264
- queueModule.registerQueueJob(queueModule.normalizeQueueJobDefinition(job), {
264
+ queueModule.registerQueueJob(job, {
265
265
  name: entry.name,
266
266
  sourcePath: entry.sourcePath
267
267
  });
@@ -7,7 +7,7 @@ import {
7
7
  normalizeWatchedFilePath,
8
8
  runProjectPrepare,
9
9
  toPosixSlashes
10
- } from "./chunk-42V4KAVA.mjs";
10
+ } from "./chunk-XDRCZ3Z5.mjs";
11
11
  import "./chunk-FGQ2I2YH.mjs";
12
12
  import "./chunk-LBJAJLKU.mjs";
13
13
  import {
@@ -17,7 +17,7 @@ import "./chunk-D7O4SU6N.mjs";
17
17
  import {
18
18
  prepareProjectDiscovery
19
19
  } from "./chunk-VP2E62DF.mjs";
20
- import "./chunk-HHQZB6Z4.mjs";
20
+ import "./chunk-TWITVSFZ.mjs";
21
21
  import {
22
22
  ensureProjectConfig,
23
23
  loadProjectConfig
@@ -261,7 +261,7 @@ async function getQueueRuntimeEnvironment(projectRoot) {
261
261
  throw new Error(`Discovered job "${entry.sourcePath}" does not export a Holo job.`);
262
262
  }
263
263
  if (!queueModule?.getRegisteredQueueJob(entry.name)) {
264
- queueModule.registerQueueJob(queueModule.normalizeQueueJobDefinition(job), {
264
+ queueModule.registerQueueJob(job, {
265
265
  name: entry.name,
266
266
  sourcePath: entry.sourcePath
267
267
  });
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runProjectPrepare
3
- } from "./chunk-YKFOYZLS.mjs";
3
+ } from "./chunk-XDRCZ3Z5.mjs";
4
4
  import "./chunk-FGQ2I2YH.mjs";
5
5
  import {
6
6
  getRegistryMigrationSlug,
@@ -8,15 +8,15 @@ import {
8
8
  hasRegisteredMigrationSlug,
9
9
  nextMigrationTemplate
10
10
  } from "./chunk-LXGQCG56.mjs";
11
+ import "./chunk-LBJAJLKU.mjs";
11
12
  import {
12
13
  writeLine
13
14
  } from "./chunk-I7QBCEV7.mjs";
14
- import "./chunk-LBJAJLKU.mjs";
15
15
  import "./chunk-D7O4SU6N.mjs";
16
16
  import {
17
17
  prepareProjectDiscovery
18
18
  } from "./chunk-VP2E62DF.mjs";
19
- import "./chunk-PJOYKYYG.mjs";
19
+ import "./chunk-TWITVSFZ.mjs";
20
20
  import {
21
21
  ensureProjectConfig
22
22
  } from "./chunk-YEFJBN56.mjs";
@@ -41,15 +41,17 @@ async function loadQueueConfig(projectRoot) {
41
41
  function normalizeQueueMigrationName(tableName) {
42
42
  return normalizeMigrationSlug(`create_${tableName.replaceAll(".", "_")}_table`);
43
43
  }
44
+ function renderStringLiteral(value) {
45
+ return JSON.stringify(value);
46
+ }
44
47
  function renderQueueTableMigration(tableName) {
45
- const tableNameLiteral = JSON.stringify(tableName);
46
48
  const indexPrefix = tableName.replaceAll(".", "_");
47
49
  return [
48
- "import { defineMigration, type MigrationContext } from '@holo-js/db'",
50
+ "import { defineMigration } from '@holo-js/db'",
49
51
  "",
50
52
  "export default defineMigration({",
51
- " async up({ schema }: MigrationContext) {",
52
- ` await schema.createTable(${tableNameLiteral}, (table) => {`,
53
+ " async up({ schema }) {",
54
+ ` await schema.createTable(${renderStringLiteral(tableName)}, (table) => {`,
53
55
  " table.string('id').primaryKey()",
54
56
  " table.string('job')",
55
57
  " table.string('connection')",
@@ -61,27 +63,26 @@ function renderQueueTableMigration(tableName) {
61
63
  " table.bigInteger('reserved_at').nullable()",
62
64
  " table.string('reservation_id').nullable()",
63
65
  " table.bigInteger('created_at')",
64
- ` table.index(['queue', 'available_at'], ${JSON.stringify(`${indexPrefix}_queue_available_at_index`)})`,
65
- ` table.index(['queue', 'reserved_at'], ${JSON.stringify(`${indexPrefix}_queue_reserved_at_index`)})`,
66
- ` table.index(['reservation_id'], ${JSON.stringify(`${indexPrefix}_reservation_id_index`)})`,
66
+ ` table.index(['queue', 'available_at'], ${renderStringLiteral(`${indexPrefix}_queue_available_at_index`)})`,
67
+ ` table.index(['queue', 'reserved_at'], ${renderStringLiteral(`${indexPrefix}_queue_reserved_at_index`)})`,
68
+ ` table.index(['reservation_id'], ${renderStringLiteral(`${indexPrefix}_reservation_id_index`)})`,
67
69
  " })",
68
70
  " },",
69
- " async down({ schema }: MigrationContext) {",
70
- ` await schema.dropTable(${tableNameLiteral})`,
71
+ " async down({ schema }) {",
72
+ ` await schema.dropTable(${renderStringLiteral(tableName)})`,
71
73
  " },",
72
74
  "})",
73
75
  ""
74
76
  ].join("\n");
75
77
  }
76
78
  function renderFailedJobsTableMigration(tableName) {
77
- const tableNameLiteral = JSON.stringify(tableName);
78
79
  const indexPrefix = tableName.replaceAll(".", "_");
79
80
  return [
80
- "import { defineMigration, type MigrationContext } from '@holo-js/db'",
81
+ "import { defineMigration } from '@holo-js/db'",
81
82
  "",
82
83
  "export default defineMigration({",
83
- " async up({ schema }: MigrationContext) {",
84
- ` await schema.createTable(${tableNameLiteral}, (table) => {`,
84
+ " async up({ schema }) {",
85
+ ` await schema.createTable(${renderStringLiteral(tableName)}, (table) => {`,
85
86
  " table.string('id').primaryKey()",
86
87
  " table.string('job_id')",
87
88
  " table.string('job')",
@@ -90,12 +91,12 @@ function renderFailedJobsTableMigration(tableName) {
90
91
  " table.text('payload')",
91
92
  " table.text('exception')",
92
93
  " table.bigInteger('failed_at')",
93
- ` table.index(['job_id'], ${JSON.stringify(`${indexPrefix}_job_id_index`)})`,
94
- ` table.index(['failed_at'], ${JSON.stringify(`${indexPrefix}_failed_at_index`)})`,
94
+ ` table.index(['job_id'], ${renderStringLiteral(`${indexPrefix}_job_id_index`)})`,
95
+ ` table.index(['failed_at'], ${renderStringLiteral(`${indexPrefix}_failed_at_index`)})`,
95
96
  " })",
96
97
  " },",
97
- " async down({ schema }: MigrationContext) {",
98
- ` await schema.dropTable(${tableNameLiteral})`,
98
+ " async down({ schema }) {",
99
+ ` await schema.dropTable(${renderStringLiteral(tableName)})`,
99
100
  " },",
100
101
  "})",
101
102
  ""
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runProjectPrepare
3
- } from "./chunk-42V4KAVA.mjs";
3
+ } from "./chunk-UPXQONEH.mjs";
4
4
  import "./chunk-FGQ2I2YH.mjs";
5
5
  import {
6
6
  getRegistryMigrationSlug,
@@ -8,15 +8,15 @@ import {
8
8
  hasRegisteredMigrationSlug,
9
9
  nextMigrationTemplate
10
10
  } from "./chunk-LXGQCG56.mjs";
11
- import "./chunk-LBJAJLKU.mjs";
12
11
  import {
13
12
  writeLine
14
13
  } from "./chunk-I7QBCEV7.mjs";
14
+ import "./chunk-LBJAJLKU.mjs";
15
15
  import "./chunk-D7O4SU6N.mjs";
16
16
  import {
17
17
  prepareProjectDiscovery
18
18
  } from "./chunk-VP2E62DF.mjs";
19
- import "./chunk-HHQZB6Z4.mjs";
19
+ import "./chunk-PT72AMV7.mjs";
20
20
  import {
21
21
  ensureProjectConfig
22
22
  } from "./chunk-YEFJBN56.mjs";
@@ -41,15 +41,17 @@ async function loadQueueConfig(projectRoot) {
41
41
  function normalizeQueueMigrationName(tableName) {
42
42
  return normalizeMigrationSlug(`create_${tableName.replaceAll(".", "_")}_table`);
43
43
  }
44
+ function renderStringLiteral(value) {
45
+ return JSON.stringify(value);
46
+ }
44
47
  function renderQueueTableMigration(tableName) {
45
- const tableNameLiteral = JSON.stringify(tableName);
46
48
  const indexPrefix = tableName.replaceAll(".", "_");
47
49
  return [
48
- "import { defineMigration, type MigrationContext } from '@holo-js/db'",
50
+ "import { defineMigration } from '@holo-js/db'",
49
51
  "",
50
52
  "export default defineMigration({",
51
- " async up({ schema }: MigrationContext) {",
52
- ` await schema.createTable(${tableNameLiteral}, (table) => {`,
53
+ " async up({ schema }) {",
54
+ ` await schema.createTable(${renderStringLiteral(tableName)}, (table) => {`,
53
55
  " table.string('id').primaryKey()",
54
56
  " table.string('job')",
55
57
  " table.string('connection')",
@@ -61,27 +63,26 @@ function renderQueueTableMigration(tableName) {
61
63
  " table.bigInteger('reserved_at').nullable()",
62
64
  " table.string('reservation_id').nullable()",
63
65
  " table.bigInteger('created_at')",
64
- ` table.index(['queue', 'available_at'], ${JSON.stringify(`${indexPrefix}_queue_available_at_index`)})`,
65
- ` table.index(['queue', 'reserved_at'], ${JSON.stringify(`${indexPrefix}_queue_reserved_at_index`)})`,
66
- ` table.index(['reservation_id'], ${JSON.stringify(`${indexPrefix}_reservation_id_index`)})`,
66
+ ` table.index(['queue', 'available_at'], ${renderStringLiteral(`${indexPrefix}_queue_available_at_index`)})`,
67
+ ` table.index(['queue', 'reserved_at'], ${renderStringLiteral(`${indexPrefix}_queue_reserved_at_index`)})`,
68
+ ` table.index(['reservation_id'], ${renderStringLiteral(`${indexPrefix}_reservation_id_index`)})`,
67
69
  " })",
68
70
  " },",
69
- " async down({ schema }: MigrationContext) {",
70
- ` await schema.dropTable(${tableNameLiteral})`,
71
+ " async down({ schema }) {",
72
+ ` await schema.dropTable(${renderStringLiteral(tableName)})`,
71
73
  " },",
72
74
  "})",
73
75
  ""
74
76
  ].join("\n");
75
77
  }
76
78
  function renderFailedJobsTableMigration(tableName) {
77
- const tableNameLiteral = JSON.stringify(tableName);
78
79
  const indexPrefix = tableName.replaceAll(".", "_");
79
80
  return [
80
- "import { defineMigration, type MigrationContext } from '@holo-js/db'",
81
+ "import { defineMigration } from '@holo-js/db'",
81
82
  "",
82
83
  "export default defineMigration({",
83
- " async up({ schema }: MigrationContext) {",
84
- ` await schema.createTable(${tableNameLiteral}, (table) => {`,
84
+ " async up({ schema }) {",
85
+ ` await schema.createTable(${renderStringLiteral(tableName)}, (table) => {`,
85
86
  " table.string('id').primaryKey()",
86
87
  " table.string('job_id')",
87
88
  " table.string('job')",
@@ -90,12 +91,12 @@ function renderFailedJobsTableMigration(tableName) {
90
91
  " table.text('payload')",
91
92
  " table.text('exception')",
92
93
  " table.bigInteger('failed_at')",
93
- ` table.index(['job_id'], ${JSON.stringify(`${indexPrefix}_job_id_index`)})`,
94
- ` table.index(['failed_at'], ${JSON.stringify(`${indexPrefix}_failed_at_index`)})`,
94
+ ` table.index(['job_id'], ${renderStringLiteral(`${indexPrefix}_job_id_index`)})`,
95
+ ` table.index(['failed_at'], ${renderStringLiteral(`${indexPrefix}_failed_at_index`)})`,
95
96
  " })",
96
97
  " },",
97
- " async down({ schema }: MigrationContext) {",
98
- ` await schema.dropTable(${tableNameLiteral})`,
98
+ " async down({ schema }) {",
99
+ ` await schema.dropTable(${renderStringLiteral(tableName)})`,
99
100
  " },",
100
101
  "})",
101
102
  ""
@@ -26,7 +26,7 @@ import {
26
26
  import "./chunk-LBJAJLKU.mjs";
27
27
  import "./chunk-D7O4SU6N.mjs";
28
28
  import "./chunk-VP2E62DF.mjs";
29
- import "./chunk-PJOYKYYG.mjs";
29
+ import "./chunk-TWITVSFZ.mjs";
30
30
  import "./chunk-YEFJBN56.mjs";
31
31
  import "./chunk-J76GH2DR.mjs";
32
32
  import "./chunk-ILU426CF.mjs";
@@ -26,7 +26,7 @@ import {
26
26
  import "./chunk-LBJAJLKU.mjs";
27
27
  import "./chunk-D7O4SU6N.mjs";
28
28
  import "./chunk-VP2E62DF.mjs";
29
- import "./chunk-HHQZB6Z4.mjs";
29
+ import "./chunk-PT72AMV7.mjs";
30
30
  import "./chunk-YEFJBN56.mjs";
31
31
  import "./chunk-J76GH2DR.mjs";
32
32
  import "./chunk-ILU426CF.mjs";
@@ -204,6 +204,12 @@ try {
204
204
  const executed = await createMigrationService(manager.connection(), migrations).migrate(payload.options ?? {});
205
205
  await writeGeneratedSchemaArtifact(manager, payload.generatedSchemaOutputPath, payload.generatedSchemaRuntimeOutputPath);
206
206
  printExecutedItems(executed, "No migrations were executed.", "Migrations executed:");
207
+ } else if (payload.kind === "hydrate-schema") {
208
+ await preloadGeneratedSchema(manager, payload.generatedSchema);
209
+ const migrations = await loadMigrations(payloadEntries(payload.migrations));
210
+ await hydrateGeneratedSchemaFromRanMigrations(manager, migrations);
211
+ await writeGeneratedSchemaArtifact(manager, payload.generatedSchemaOutputPath, payload.generatedSchemaRuntimeOutputPath);
212
+ writeOutput("Generated schema metadata refreshed.");
207
213
  } else if (payload.kind === "fresh") {
208
214
  const migrations = await loadMigrations(payloadEntries(payload.migrations));
209
215
  const schema = createSchemaService(manager.connection());
@@ -56,7 +56,7 @@ import {
56
56
  upsertMediaPackageDependency,
57
57
  upsertNotificationsPackageDependency,
58
58
  upsertSecurityPackageDependency
59
- } from "./chunk-PJOYKYYG.mjs";
59
+ } from "./chunk-TWITVSFZ.mjs";
60
60
  import "./chunk-YEFJBN56.mjs";
61
61
  import {
62
62
  renderAuthProviderRouteFiles,
@@ -56,7 +56,7 @@ import {
56
56
  upsertMediaPackageDependency,
57
57
  upsertNotificationsPackageDependency,
58
58
  upsertSecurityPackageDependency
59
- } from "./chunk-HHQZB6Z4.mjs";
59
+ } from "./chunk-PT72AMV7.mjs";
60
60
  import "./chunk-YEFJBN56.mjs";
61
61
  import {
62
62
  renderAuthProviderRouteFiles,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-I7QBCEV7.mjs";
4
4
  import "./chunk-D7O4SU6N.mjs";
5
5
  import "./chunk-VP2E62DF.mjs";
6
- import "./chunk-PJOYKYYG.mjs";
6
+ import "./chunk-PT72AMV7.mjs";
7
7
  import "./chunk-YEFJBN56.mjs";
8
8
  import "./chunk-J76GH2DR.mjs";
9
9
  import {