@holo-js/cli 0.2.5 → 0.3.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.
Files changed (53) hide show
  1. package/dist/{agent-skills-MSEMQUXT.mjs → agent-skills-CHAXS2YN.mjs} +13 -6
  2. package/dist/bin/holo.mjs +436 -109
  3. package/dist/{broadcast-5MJ3GJK7.mjs → broadcast-5VZM5SGQ.mjs} +13 -10
  4. package/dist/{broadcast-MRJGFCFH.mjs → broadcast-AABT52BK.mjs} +13 -10
  5. package/dist/cache-A42JSVYA.mjs +138 -0
  6. package/dist/cache-DUVBBOZU.mjs +138 -0
  7. package/dist/{cache-migrations-CPYQC7T6.mjs → cache-migrations-4WKSEN2Q.mjs} +12 -10
  8. package/dist/{cache-migrations-APDFSFEX.mjs → cache-migrations-PD2T5AV4.mjs} +14 -12
  9. package/dist/chunk-3RFRE7XG.mjs +491 -0
  10. package/dist/{chunk-PT72AMV7.mjs → chunk-6BHJLCAO.mjs} +256 -392
  11. package/dist/{chunk-KS5TWO75.mjs → chunk-EQUFFLRG.mjs} +7 -7
  12. package/dist/chunk-HX6MOYBO.mjs +2 -0
  13. package/dist/{chunk-YEFJBN56.mjs → chunk-JVLZ3SOW.mjs} +11 -8
  14. package/dist/{chunk-UPXQONEH.mjs → chunk-KRADH7PK.mjs} +55 -51
  15. package/dist/chunk-LALDNNPH.mjs +428 -0
  16. package/dist/chunk-LHK5YUR4.mjs +156 -0
  17. package/dist/{chunk-LBJAJLKU.mjs → chunk-M3IPUCTM.mjs} +1 -1
  18. package/dist/{chunk-TWITVSFZ.mjs → chunk-OI54DOHK.mjs} +256 -392
  19. package/dist/{chunk-LXGQCG56.mjs → chunk-OLZEMIDQ.mjs} +1 -1
  20. package/dist/{chunk-VP2E62DF.mjs → chunk-QSVMXMTQ.mjs} +49 -349
  21. package/dist/{chunk-J76GH2DR.mjs → chunk-R4ZYMEDU.mjs} +129 -86
  22. package/dist/{chunk-XDRCZ3Z5.mjs → chunk-TH5YCOZB.mjs} +57 -53
  23. package/dist/chunk-TRYHX5S4.mjs +360 -0
  24. package/dist/chunk-XBOVM6LO.mjs +41 -0
  25. package/dist/{chunk-ILU426CF.mjs → chunk-YACY2572.mjs} +482 -2
  26. package/dist/{config-MD27U4FM.mjs → config-BZHQK532.mjs} +3 -3
  27. package/dist/{dev-CT4DRTLN.mjs → dev-7KGRV56X.mjs} +10 -8
  28. package/dist/{dev-QDLR6C7K.mjs → dev-GQT37XJU.mjs} +10 -8
  29. package/dist/{discovery-GWTBF5RZ.mjs → discovery-HNH3BLDL.mjs} +8 -6
  30. package/dist/{generators-PUN5TFP5.mjs → generators-3FVW4AEJ.mjs} +18 -15
  31. package/dist/{generators-WQHI7DBW.mjs → generators-JWVNGUUE.mjs} +14 -11
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.mjs +434 -107
  34. package/dist/{media-migrations-D3CDNMPT.mjs → media-migrations-EG34NYAG.mjs} +13 -11
  35. package/dist/{media-migrations-IWCSCKSA.mjs → media-migrations-LGI7R7AR.mjs} +11 -9
  36. package/dist/plugins-ZGLB6JO6.mjs +24 -0
  37. package/dist/{queue-O3OSLGOV.mjs → queue-BEZDCZCY.mjs} +54 -16
  38. package/dist/{queue-GRB2IH5M.mjs → queue-R54DUUYA.mjs} +54 -16
  39. package/dist/{queue-migrations-7T42S4FX.mjs → queue-migrations-AM3AKT76.mjs} +16 -11
  40. package/dist/{queue-migrations-HFZB64OG.mjs → queue-migrations-U477YSFD.mjs} +18 -13
  41. package/dist/{runtime-TTRP2DGL.mjs → runtime-4TJYZLQV.mjs} +10 -8
  42. package/dist/{runtime-M3G5OKQV.mjs → runtime-MSRQD5W5.mjs} +10 -8
  43. package/dist/{runtime-GSXF4NB3.mjs → runtime-VR5BDPYQ.mjs} +1 -1
  44. package/dist/runtime-worker.mjs +7 -1
  45. package/dist/{scaffold-5BOVJYF3.mjs → scaffold-ASEX5LEX.mjs} +8 -4
  46. package/dist/{scaffold-NY3MWUZF.mjs → scaffold-ZAD3XUSD.mjs} +8 -4
  47. package/dist/{security-ST6ED7EK.mjs → security-4QLV7QCH.mjs} +8 -6
  48. package/dist/{security-H7AGDFBX.mjs → security-KYTLP4DF.mjs} +8 -6
  49. package/package.json +35 -8
  50. package/dist/cache-KVRYC7FB.mjs +0 -66
  51. package/dist/cache-WWE4Q4YE.mjs +0 -66
  52. package/dist/chunk-D7O4SU6N.mjs +0 -2
  53. package/dist/chunk-FGQ2I2YH.mjs +0 -22
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  fileExists
3
- } from "./chunk-LBJAJLKU.mjs";
4
- import {
5
- prepareProjectDiscovery
6
- } from "./chunk-VP2E62DF.mjs";
3
+ } from "./chunk-M3IPUCTM.mjs";
7
4
  import {
8
5
  loadProjectConfig,
9
6
  resolveGeneratedSchemaPath
10
- } from "./chunk-YEFJBN56.mjs";
7
+ } from "./chunk-JVLZ3SOW.mjs";
8
+ import {
9
+ prepareProjectDiscovery
10
+ } from "./chunk-QSVMXMTQ.mjs";
11
11
  import {
12
12
  loadGeneratedProjectRegistry
13
- } from "./chunk-J76GH2DR.mjs";
13
+ } from "./chunk-R4ZYMEDU.mjs";
14
14
  import {
15
15
  CLI_RUNTIME_ROOT,
16
16
  GENERATED_SCHEMA_RUNTIME_PATH,
17
17
  bundleProjectModule
18
- } from "./chunk-ILU426CF.mjs";
18
+ } from "./chunk-YACY2572.mjs";
19
19
 
20
20
  // src/runtime.ts
21
21
  import { spawn } from "child_process";
@@ -0,0 +1,2 @@
1
+ // src/project.ts
2
+ import { normalizeHoloProjectConfig } from "@holo-js/kernel";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadGeneratedProjectRegistry
3
- } from "./chunk-J76GH2DR.mjs";
3
+ } from "./chunk-R4ZYMEDU.mjs";
4
4
  import {
5
5
  APP_CONFIG_FILE_NAMES,
6
6
  DATABASE_CONFIG_FILE_NAMES,
@@ -8,7 +8,7 @@ import {
8
8
  isModulePackage,
9
9
  pathExists,
10
10
  resolveFirstExistingPath
11
- } from "./chunk-ILU426CF.mjs";
11
+ } from "./chunk-YACY2572.mjs";
12
12
 
13
13
  // src/project/config.ts
14
14
  import { createHash } from "crypto";
@@ -18,14 +18,16 @@ import { pathToFileURL } from "url";
18
18
  import {
19
19
  loadConfigDirectory,
20
20
  holoAppDefaults,
21
- holoDatabaseDefaults,
22
21
  loadEnvironment,
23
- normalizeAppConfig,
24
- normalizeDatabaseConfig
22
+ normalizeAppConfig
25
23
  } from "@holo-js/config";
26
24
  import {
27
25
  DEFAULT_HOLO_PROJECT_PATHS,
28
- normalizeHoloProjectConfig,
26
+ normalizeHoloProjectConfig
27
+ } from "@holo-js/kernel";
28
+ import {
29
+ holoDatabaseDefaults,
30
+ normalizeDatabaseConfig,
29
31
  renderGeneratedSchemaPlaceholder
30
32
  } from "@holo-js/db";
31
33
  function isObject(value) {
@@ -91,7 +93,7 @@ async function importProjectConfigFile(projectRoot, filePath, environmentValues)
91
93
  const previousEnvEntries = /* @__PURE__ */ new Map();
92
94
  const importUrl = await resolveProjectConfigImportUrl(filePath, environmentValues);
93
95
  const configExtension = extname(filePath);
94
- const bundled = configExtension === ".ts" || configExtension === ".mts" ? await bundleProjectModule(projectRoot, filePath) : void 0;
96
+ const bundled = configExtension === ".ts" || configExtension === ".mts" ? await bundleProjectModule(projectRoot, filePath, { bundleDependencies: true }) : void 0;
95
97
  const resolvedImportUrl = bundled ? `${pathToFileURL(bundled.path).href}${new URL(importUrl).search}` : importUrl;
96
98
  try {
97
99
  for (const [key, value] of Object.entries(environmentValues)) {
@@ -181,6 +183,7 @@ async function serializeProjectConfig(projectRoot, config, manifestPath) {
181
183
  url: appConfig.url,
182
184
  debug: appConfig.debug,
183
185
  env: appConfig.env,
186
+ plugins: appConfig.plugins,
184
187
  paths: config.paths
185
188
  }, null, 2);
186
189
  const extension = extname(manifestPath);
@@ -214,7 +217,7 @@ async function serializeDatabaseConfig(projectRoot, _targetPath) {
214
217
  connections: databaseConfig.connections
215
218
  }, null, 2);
216
219
  return [
217
- "import { defineDatabaseConfig } from '@holo-js/config'",
220
+ "import { defineDatabaseConfig } from '@holo-js/db'",
218
221
  "",
219
222
  "export default defineDatabaseConfig(",
220
223
  contents,
@@ -1,23 +1,28 @@
1
1
  import {
2
2
  hasProjectDependency
3
- } from "./chunk-FGQ2I2YH.mjs";
3
+ } from "./chunk-LHK5YUR4.mjs";
4
4
  import {
5
5
  prepareProjectDiscovery
6
- } from "./chunk-VP2E62DF.mjs";
6
+ } from "./chunk-QSVMXMTQ.mjs";
7
7
  import {
8
8
  syncManagedDriverDependencies
9
- } from "./chunk-PT72AMV7.mjs";
9
+ } from "./chunk-OI54DOHK.mjs";
10
10
  import {
11
11
  ensureGeneratedSchemaPlaceholder,
12
12
  ensureProjectConfig
13
- } from "./chunk-YEFJBN56.mjs";
13
+ } from "./chunk-JVLZ3SOW.mjs";
14
14
  import {
15
- renderFrameworkRunner
16
- } from "./chunk-J76GH2DR.mjs";
15
+ renderFrameworkRunnerForDescriptor
16
+ } from "./chunk-R4ZYMEDU.mjs";
17
17
  import {
18
+ loadProjectPluginFrameworkDescriptors
19
+ } from "./chunk-3RFRE7XG.mjs";
20
+ import {
21
+ getFrameworkDescriptorByIdFrom,
22
+ getFrameworkDescriptorsWith,
18
23
  readTextFile,
19
24
  writeTextFile
20
- } from "./chunk-ILU426CF.mjs";
25
+ } from "./chunk-YACY2572.mjs";
21
26
 
22
27
  // src/dev.ts
23
28
  import { spawnSync, spawn } from "child_process";
@@ -97,9 +102,9 @@ async function runProjectBuild(io, projectRoot, spawn2 = spawnSync) {
97
102
  throw new Error(result.stderr?.trim() || result.stdout?.trim() || "Project build failed.");
98
103
  }
99
104
  }
100
- async function runProjectStartServer(io, projectRoot, spawnProcess = spawn) {
105
+ async function runProjectStartServer(io, projectRoot, spawnProcess = spawn, passthroughArgs = []) {
101
106
  const invocation = resolveFrameworkRunnerInvocation(projectRoot, "start");
102
- const child = spawnProcess(invocation.command, [...invocation.args], {
107
+ const child = spawnProcess(invocation.command, [...invocation.args, ...passthroughArgs], {
103
108
  cwd: projectRoot,
104
109
  env: process.env,
105
110
  stdio: ["pipe", "pipe", "pipe"]
@@ -137,37 +142,17 @@ async function runProjectDependencyInstall(io, projectRoot, spawn2 = spawnSync)
137
142
  throw new Error(result.stderr?.trim() || result.stdout?.trim() || "Project dependency installation failed.");
138
143
  }
139
144
  }
140
- var FRAMEWORK_SYNC_DEFINITIONS = [
141
- {
142
- framework: "nuxt",
143
- commands: {
144
- bun: ["bun", "x", "nuxt", "prepare"],
145
- npm: ["npm", "exec", "--", "nuxt", "prepare"],
146
- pnpm: ["pnpm", "exec", "nuxt", "prepare"],
147
- yarn: ["yarn", "run", "nuxt", "prepare"]
148
- },
149
- errorLabel: "nuxt prepare"
150
- },
151
- {
152
- framework: "sveltekit",
153
- commands: {
154
- bun: ["bun", "x", "svelte-kit", "sync"],
155
- npm: ["npm", "exec", "--", "svelte-kit", "sync"],
156
- pnpm: ["pnpm", "exec", "svelte-kit", "sync"],
157
- yarn: ["yarn", "run", "svelte-kit", "sync"]
158
- },
159
- errorLabel: "svelte-kit sync"
160
- }
161
- ];
162
145
  async function runProjectPrepare(projectRoot, io, options = {}) {
163
146
  const project = await ensureProjectConfig(projectRoot);
164
147
  await ensureGeneratedSchemaPlaceholder(projectRoot, project.config);
165
148
  await prepareProjectDiscovery(projectRoot, project.config);
166
149
  await refreshFrameworkRunner(projectRoot);
167
150
  const syncFramework = options.syncFramework ?? true;
151
+ const syncDefinitions = syncFramework ? await resolveProjectFrameworkSyncDefinitions(projectRoot) : [];
168
152
  if (syncFramework) {
169
- await runFrameworkSync(projectRoot, FRAMEWORK_SYNC_DEFINITIONS[0]);
170
- await runFrameworkSync(projectRoot, FRAMEWORK_SYNC_DEFINITIONS[1]);
153
+ for (const definition of syncDefinitions) {
154
+ await runFrameworkSync(projectRoot, definition);
155
+ }
171
156
  }
172
157
  const updatedDependencies = await syncManagedDriverDependencies(projectRoot);
173
158
  if (updatedDependencies && io) {
@@ -175,8 +160,9 @@ async function runProjectPrepare(projectRoot, io, options = {}) {
175
160
  await prepareProjectDiscovery(projectRoot, project.config);
176
161
  await refreshFrameworkRunner(projectRoot);
177
162
  if (syncFramework) {
178
- await runFrameworkSync(projectRoot, FRAMEWORK_SYNC_DEFINITIONS[0]);
179
- await runFrameworkSync(projectRoot, FRAMEWORK_SYNC_DEFINITIONS[1]);
163
+ for (const definition of syncDefinitions) {
164
+ await runFrameworkSync(projectRoot, definition);
165
+ }
180
166
  }
181
167
  }
182
168
  }
@@ -186,35 +172,53 @@ async function runProjectHotPrepare(projectRoot, io) {
186
172
  async function refreshFrameworkRunner(projectRoot) {
187
173
  const frameworkProjectPath = resolve(projectRoot, ".holo-js/framework/project.json");
188
174
  const frameworkRunnerPath = resolve(projectRoot, ".holo-js/framework/run.mjs");
189
- const framework = await resolveProjectFramework(projectRoot, frameworkProjectPath);
190
- if (!framework) {
175
+ const descriptor = await resolveProjectFramework(projectRoot, frameworkProjectPath);
176
+ if (!descriptor) {
191
177
  return;
192
178
  }
193
- await writeTextFile(frameworkProjectPath, `${JSON.stringify({ framework }, null, 2)}
179
+ await writeTextFile(frameworkProjectPath, `${JSON.stringify({ framework: descriptor.id }, null, 2)}
194
180
  `);
195
- await writeTextFile(frameworkRunnerPath, renderFrameworkRunner({ framework }));
181
+ await writeTextFile(frameworkRunnerPath, renderFrameworkRunnerForDescriptor(descriptor));
196
182
  }
197
183
  async function resolveProjectFramework(projectRoot, frameworkProjectPath) {
184
+ const pluginDescriptors = await loadProjectPluginFrameworkDescriptors(projectRoot);
198
185
  try {
199
186
  const content = await readFile(frameworkProjectPath, "utf8");
200
187
  const manifest = JSON.parse(content);
201
- if (manifest.framework !== "next" && manifest.framework !== "nuxt" && manifest.framework !== "sveltekit") {
202
- return;
203
- }
204
- return manifest.framework;
188
+ const descriptor = typeof manifest.framework === "string" ? getFrameworkDescriptorByIdFrom(manifest.framework, pluginDescriptors) : void 0;
189
+ return descriptor ?? resolveProjectFrameworkFromDependencies(projectRoot, pluginDescriptors);
205
190
  } catch {
191
+ return resolveProjectFrameworkFromDependencies(projectRoot, pluginDescriptors);
206
192
  }
207
- if (await hasProjectDependency(projectRoot, "next")) {
208
- return "next";
209
- }
210
- if (await hasProjectDependency(projectRoot, "nuxt")) {
211
- return "nuxt";
212
- }
213
- if (await hasProjectDependency(projectRoot, "@sveltejs/kit")) {
214
- return "sveltekit";
193
+ }
194
+ async function resolveProjectFrameworkFromDependencies(projectRoot, pluginDescriptors = []) {
195
+ for (const descriptor of getFrameworkDescriptorsWith(pluginDescriptors)) {
196
+ const matches = await Promise.all(
197
+ descriptor.detectPackages.map((packageName) => hasProjectDependency(projectRoot, packageName))
198
+ );
199
+ if (matches.some(Boolean)) {
200
+ return descriptor;
201
+ }
215
202
  }
216
203
  return void 0;
217
204
  }
205
+ async function resolveProjectFrameworkSyncDefinitions(projectRoot) {
206
+ const pluginDescriptors = await loadProjectPluginFrameworkDescriptors(projectRoot);
207
+ const seen = /* @__PURE__ */ new Set();
208
+ const definitions = [];
209
+ for (const descriptor of getFrameworkDescriptorsWith(pluginDescriptors)) {
210
+ if (!descriptor.sync || seen.has(descriptor.id)) {
211
+ continue;
212
+ }
213
+ seen.add(descriptor.id);
214
+ definitions.push({
215
+ framework: descriptor.id,
216
+ commands: descriptor.sync.commands,
217
+ errorLabel: descriptor.sync.errorLabel
218
+ });
219
+ }
220
+ return Object.freeze(definitions);
221
+ }
218
222
  async function runFrameworkSync(projectRoot, definition) {
219
223
  const frameworkProjectPath = resolve(projectRoot, ".holo-js/framework/project.json");
220
224
  try {