@holo-js/cli 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/holo.mjs +38 -35
- package/dist/{broadcast-5VZM5SGQ.mjs → broadcast-GUQFANQ4.mjs} +9 -11
- package/dist/{cache-A42JSVYA.mjs → cache-PCM2BJJ2.mjs} +8 -9
- package/dist/{cache-migrations-4WKSEN2Q.mjs → cache-migrations-M6VC3JW3.mjs} +13 -15
- package/dist/{chunk-6BHJLCAO.mjs → chunk-BVULOZZ4.mjs} +52 -14
- package/dist/{chunk-TRYHX5S4.mjs → chunk-I6EXRSZM.mjs} +1 -1
- package/dist/{chunk-TH5YCOZB.mjs → chunk-JLZNWWFV.mjs} +28 -17
- package/dist/{chunk-R4ZYMEDU.mjs → chunk-NSG3OJDY.mjs} +116 -7
- package/dist/{chunk-YACY2572.mjs → chunk-OQEZ3MOE.mjs} +47 -47
- package/dist/{chunk-3RFRE7XG.mjs → chunk-SCVF2F3I.mjs} +2 -2
- package/dist/{chunk-EQUFFLRG.mjs → chunk-VQP6GHIQ.mjs} +6 -6
- package/dist/{chunk-QSVMXMTQ.mjs → chunk-VUJ4ITXR.mjs} +3 -3
- package/dist/{chunk-OLZEMIDQ.mjs → chunk-WMBFSYWK.mjs} +1 -1
- package/dist/{chunk-LHK5YUR4.mjs → chunk-XXQUCGBO.mjs} +1 -1
- package/dist/{chunk-I7QBCEV7.mjs → chunk-Y355VYRN.mjs} +5 -3
- package/dist/{chunk-VRGB6DIS.mjs → chunk-YJWHIQ45.mjs} +2 -0
- package/dist/{chunk-JVLZ3SOW.mjs → chunk-ZNJ4APGF.mjs} +2 -2
- package/dist/{config-BZHQK532.mjs → config-43W3SZUI.mjs} +3 -3
- package/dist/{dev-7KGRV56X.mjs → dev-SNXMGPLU.mjs} +9 -10
- package/dist/{discovery-HNH3BLDL.mjs → discovery-7TQXEUYW.mjs} +4 -4
- package/dist/{generators-3FVW4AEJ.mjs → generators-2KJ6OFWA.mjs} +14 -16
- package/dist/index.mjs +38 -35
- package/dist/{media-migrations-EG34NYAG.mjs → media-migrations-JMA7QMX7.mjs} +10 -12
- package/dist/{plugins-ZGLB6JO6.mjs → plugins-D6FWODCH.mjs} +3 -3
- package/dist/{queue-BEZDCZCY.mjs → queue-6QSL5VFZ.mjs} +11 -13
- package/dist/{queue-R54DUUYA.mjs → queue-SAPFMTB7.mjs} +13 -15
- package/dist/{queue-migrations-AM3AKT76.mjs → queue-migrations-GSREPIHP.mjs} +13 -15
- package/dist/{runtime-VR5BDPYQ.mjs → runtime-HYSSH54H.mjs} +1 -1
- package/dist/{runtime-4TJYZLQV.mjs → runtime-RX46GVZQ.mjs} +8 -10
- package/dist/runtime-worker.mjs +18 -1
- package/dist/{scaffold-ASEX5LEX.mjs → scaffold-HPNFLBF2.mjs} +7 -6
- package/dist/{security-KYTLP4DF.mjs → security-NR2WEPQ6.mjs} +8 -9
- package/package.json +19 -19
- package/dist/broadcast-AABT52BK.mjs +0 -206
- package/dist/cache-DUVBBOZU.mjs +0 -138
- package/dist/cache-migrations-PD2T5AV4.mjs +0 -175
- package/dist/chunk-HX6MOYBO.mjs +0 -2
- package/dist/chunk-KRADH7PK.mjs +0 -501
- package/dist/chunk-LALDNNPH.mjs +0 -428
- package/dist/chunk-M3IPUCTM.mjs +0 -25
- package/dist/chunk-OI54DOHK.mjs +0 -3170
- package/dist/dev-GQT37XJU.mjs +0 -46
- package/dist/generators-JWVNGUUE.mjs +0 -523
- package/dist/media-migrations-LGI7R7AR.mjs +0 -108
- package/dist/queue-migrations-U477YSFD.mjs +0 -173
- package/dist/runtime-MSRQD5W5.mjs +0 -59
- package/dist/scaffold-ZAD3XUSD.mjs +0 -143
- package/dist/security-4QLV7QCH.mjs +0 -73
package/dist/bin/holo.mjs
CHANGED
|
@@ -16,32 +16,30 @@ import {
|
|
|
16
16
|
resolveNewProjectInput,
|
|
17
17
|
resolveStringFlag,
|
|
18
18
|
splitCsv
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-YJWHIQ45.mjs";
|
|
20
20
|
import {
|
|
21
21
|
hasProjectDependency,
|
|
22
22
|
pinProjectDependencyVersions,
|
|
23
23
|
removeProjectDependency,
|
|
24
24
|
upsertProjectDependency
|
|
25
|
-
} from "../chunk-
|
|
26
|
-
import {
|
|
27
|
-
fileExists
|
|
28
|
-
} from "../chunk-M3IPUCTM.mjs";
|
|
25
|
+
} from "../chunk-XXQUCGBO.mjs";
|
|
29
26
|
import {
|
|
30
27
|
runWithSpinner,
|
|
31
|
-
supportsSpinner,
|
|
32
28
|
writeLine
|
|
33
|
-
} from "../chunk-
|
|
34
|
-
import
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
import "../chunk-
|
|
39
|
-
import "../chunk-
|
|
40
|
-
import "../chunk-
|
|
29
|
+
} from "../chunk-Y355VYRN.mjs";
|
|
30
|
+
import {
|
|
31
|
+
ensureEmptyDirectory,
|
|
32
|
+
fileExists
|
|
33
|
+
} from "../chunk-BVULOZZ4.mjs";
|
|
34
|
+
import "../chunk-ZNJ4APGF.mjs";
|
|
35
|
+
import "../chunk-VUJ4ITXR.mjs";
|
|
36
|
+
import "../chunk-NSG3OJDY.mjs";
|
|
37
|
+
import "../chunk-SCVF2F3I.mjs";
|
|
38
|
+
import "../chunk-I6EXRSZM.mjs";
|
|
41
39
|
import {
|
|
42
40
|
APP_CONFIG_FILE_NAMES,
|
|
43
41
|
SUPPORTED_AUTH_SOCIAL_PROVIDERS
|
|
44
|
-
} from "../chunk-
|
|
42
|
+
} from "../chunk-OQEZ3MOE.mjs";
|
|
45
43
|
|
|
46
44
|
// src/cli.ts
|
|
47
45
|
import { cp, mkdtemp, readFile as readFile2, rm, writeFile as writeFile2 } from "fs/promises";
|
|
@@ -133,31 +131,31 @@ var projectRuntimeModulePromise;
|
|
|
133
131
|
var projectScaffoldModulePromise;
|
|
134
132
|
var agentSkillsModulePromise;
|
|
135
133
|
function loadRuntimeModule() {
|
|
136
|
-
runtimeModulePromise ??= import("../runtime-
|
|
134
|
+
runtimeModulePromise ??= import("../runtime-RX46GVZQ.mjs");
|
|
137
135
|
return runtimeModulePromise;
|
|
138
136
|
}
|
|
139
137
|
function loadSecurityModule() {
|
|
140
|
-
securityModulePromise ??= import("../security-
|
|
138
|
+
securityModulePromise ??= import("../security-NR2WEPQ6.mjs");
|
|
141
139
|
return securityModulePromise;
|
|
142
140
|
}
|
|
143
141
|
function loadProjectConfigModule() {
|
|
144
|
-
projectConfigModulePromise ??= import("../config-
|
|
142
|
+
projectConfigModulePromise ??= import("../config-43W3SZUI.mjs");
|
|
145
143
|
return projectConfigModulePromise;
|
|
146
144
|
}
|
|
147
145
|
function loadProjectDiscoveryModule() {
|
|
148
|
-
projectDiscoveryModulePromise ??= import("../discovery-
|
|
146
|
+
projectDiscoveryModulePromise ??= import("../discovery-7TQXEUYW.mjs");
|
|
149
147
|
return projectDiscoveryModulePromise;
|
|
150
148
|
}
|
|
151
149
|
function loadProjectPluginsModule() {
|
|
152
|
-
projectPluginsModulePromise ??= import("../plugins-
|
|
150
|
+
projectPluginsModulePromise ??= import("../plugins-D6FWODCH.mjs");
|
|
153
151
|
return projectPluginsModulePromise;
|
|
154
152
|
}
|
|
155
153
|
function loadProjectRuntimeModule() {
|
|
156
|
-
projectRuntimeModulePromise ??= import("../runtime-
|
|
154
|
+
projectRuntimeModulePromise ??= import("../runtime-HYSSH54H.mjs");
|
|
157
155
|
return projectRuntimeModulePromise;
|
|
158
156
|
}
|
|
159
157
|
function loadProjectScaffoldModule() {
|
|
160
|
-
projectScaffoldModulePromise ??= import("../scaffold-
|
|
158
|
+
projectScaffoldModulePromise ??= import("../scaffold-HPNFLBF2.mjs");
|
|
161
159
|
return projectScaffoldModulePromise;
|
|
162
160
|
}
|
|
163
161
|
function loadAgentSkillsModule() {
|
|
@@ -165,7 +163,7 @@ function loadAgentSkillsModule() {
|
|
|
165
163
|
return agentSkillsModulePromise;
|
|
166
164
|
}
|
|
167
165
|
async function resolveRuntimeExecutor(runtimeExecutor) {
|
|
168
|
-
runtimeModulePromise ??= import("../runtime-
|
|
166
|
+
runtimeModulePromise ??= import("../runtime-RX46GVZQ.mjs");
|
|
169
167
|
return runtimeExecutor ?? (await runtimeModulePromise).withRuntimeEnvironment;
|
|
170
168
|
}
|
|
171
169
|
async function resolveExecutor(executors, loader, key) {
|
|
@@ -173,17 +171,17 @@ async function resolveExecutor(executors, loader, key) {
|
|
|
173
171
|
return existing ? existing : await loader();
|
|
174
172
|
}
|
|
175
173
|
async function resolveProjectExecutor(executors, key) {
|
|
176
|
-
devModulePromise ??= import("../dev-
|
|
174
|
+
devModulePromise ??= import("../dev-SNXMGPLU.mjs");
|
|
177
175
|
return resolveExecutor(executors, async () => (await devModulePromise)[key], key);
|
|
178
176
|
}
|
|
179
177
|
async function resolveQueueExecutor(executors, key) {
|
|
180
178
|
return resolveExecutor(executors, async () => {
|
|
181
179
|
if (key === "runQueueFailedTableCommand" || key === "runQueueTableCommand") {
|
|
182
|
-
queueMigrationsModulePromise ??= import("../queue-migrations-
|
|
180
|
+
queueMigrationsModulePromise ??= import("../queue-migrations-GSREPIHP.mjs");
|
|
183
181
|
const migrations = await queueMigrationsModulePromise;
|
|
184
182
|
return key === "runQueueFailedTableCommand" ? migrations.runQueueFailedTableCommand : migrations.runQueueTableCommand;
|
|
185
183
|
}
|
|
186
|
-
queueModulePromise ??= import("../queue-
|
|
184
|
+
queueModulePromise ??= import("../queue-SAPFMTB7.mjs");
|
|
187
185
|
const queue = await queueModulePromise;
|
|
188
186
|
const resolved = {
|
|
189
187
|
runQueueFailedCommand: queue.runQueueFailedCommand,
|
|
@@ -201,10 +199,10 @@ async function resolveQueueExecutor(executors, key) {
|
|
|
201
199
|
async function resolveCacheExecutor(executors, key) {
|
|
202
200
|
return resolveExecutor(executors, async () => {
|
|
203
201
|
if (key === "runCacheTableCommand") {
|
|
204
|
-
cacheMigrationsModulePromise ??= import("../cache-migrations-
|
|
202
|
+
cacheMigrationsModulePromise ??= import("../cache-migrations-M6VC3JW3.mjs");
|
|
205
203
|
return (await cacheMigrationsModulePromise).runCacheTableCommand;
|
|
206
204
|
}
|
|
207
|
-
cacheModulePromise ??= import("../cache-
|
|
205
|
+
cacheModulePromise ??= import("../cache-PCM2BJJ2.mjs");
|
|
208
206
|
const cache = await cacheModulePromise;
|
|
209
207
|
const resolved = {
|
|
210
208
|
runCacheClearCommand: cache.runCacheClearCommand,
|
|
@@ -214,15 +212,15 @@ async function resolveCacheExecutor(executors, key) {
|
|
|
214
212
|
}, key);
|
|
215
213
|
}
|
|
216
214
|
async function resolveMediaExecutor(executors, key) {
|
|
217
|
-
mediaMigrationsModulePromise ??= import("../media-migrations-
|
|
215
|
+
mediaMigrationsModulePromise ??= import("../media-migrations-JMA7QMX7.mjs");
|
|
218
216
|
return resolveExecutor(executors, async () => (await mediaMigrationsModulePromise)[key], key);
|
|
219
217
|
}
|
|
220
218
|
async function resolveBroadcastExecutor(executors, key) {
|
|
221
|
-
broadcastModulePromise ??= import("../broadcast-
|
|
219
|
+
broadcastModulePromise ??= import("../broadcast-GUQFANQ4.mjs");
|
|
222
220
|
return resolveExecutor(executors, async () => (await broadcastModulePromise)[key], key);
|
|
223
221
|
}
|
|
224
222
|
async function resolveGeneratorCommand(key) {
|
|
225
|
-
generatorsModulePromise ??= import("../generators-
|
|
223
|
+
generatorsModulePromise ??= import("../generators-2KJ6OFWA.mjs");
|
|
226
224
|
return (await generatorsModulePromise)[key];
|
|
227
225
|
}
|
|
228
226
|
|
|
@@ -457,7 +455,12 @@ function createInternalCommands(context, runtimeExecutor, queueExecutors = {}, p
|
|
|
457
455
|
usage: "holo new <name> [--framework <nuxt|next|sveltekit>] [--database <sqlite|mysql|postgres>] [--package-manager <bun|npm|pnpm|yarn>] [--package <storage|events|queue|validation|forms|auth|authorization|notifications|mail|broadcast|realtime|security|cache>] [--storage-default-disk <local|public>]",
|
|
458
456
|
source: "internal",
|
|
459
457
|
async prepare(input) {
|
|
460
|
-
const resolved = await resolveNewProjectInput(
|
|
458
|
+
const resolved = await resolveNewProjectInput(
|
|
459
|
+
context,
|
|
460
|
+
input,
|
|
461
|
+
void 0,
|
|
462
|
+
(projectName) => ensureEmptyDirectory(resolve2(context.cwd, projectName), projectName)
|
|
463
|
+
);
|
|
461
464
|
return {
|
|
462
465
|
args: [resolved.projectName],
|
|
463
466
|
flags: {
|
|
@@ -496,11 +499,11 @@ function createInternalCommands(context, runtimeExecutor, queueExecutors = {}, p
|
|
|
496
499
|
writeLine(context.stdout, `Created Holo project: ${targetDir}`);
|
|
497
500
|
await runWithSpinner(
|
|
498
501
|
context,
|
|
499
|
-
|
|
502
|
+
`Installing dependencies with ${packageManager}...`,
|
|
500
503
|
() => runProjectDependencyInstallForProject(context, projectExecutors, targetDir, {
|
|
501
|
-
writeStatus:
|
|
504
|
+
writeStatus: false
|
|
502
505
|
}),
|
|
503
|
-
|
|
506
|
+
`Dependencies installed with ${packageManager}.`
|
|
504
507
|
);
|
|
505
508
|
writeLine(context.stdout);
|
|
506
509
|
writeLine(context.stdout, "Next steps");
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
initializeProjectRuntime
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-M3IPUCTM.mjs";
|
|
3
|
+
} from "./chunk-VQP6GHIQ.mjs";
|
|
5
4
|
import {
|
|
6
5
|
writeLine
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-6BHJLCAO.mjs";
|
|
6
|
+
} from "./chunk-Y355VYRN.mjs";
|
|
7
|
+
import "./chunk-BVULOZZ4.mjs";
|
|
10
8
|
import {
|
|
11
9
|
loadProjectConfig
|
|
12
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZNJ4APGF.mjs";
|
|
13
11
|
import {
|
|
14
12
|
prepareProjectDiscovery
|
|
15
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VUJ4ITXR.mjs";
|
|
16
14
|
import {
|
|
17
15
|
loadGeneratedProjectRegistry
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-NSG3OJDY.mjs";
|
|
17
|
+
import "./chunk-SCVF2F3I.mjs";
|
|
18
|
+
import "./chunk-I6EXRSZM.mjs";
|
|
21
19
|
import {
|
|
22
20
|
importProjectModule,
|
|
23
21
|
resolveProjectPackageImportSpecifier
|
|
24
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-OQEZ3MOE.mjs";
|
|
25
23
|
|
|
26
24
|
// src/broadcast.ts
|
|
27
25
|
import { basename, extname, resolve } from "path";
|
|
@@ -3,17 +3,16 @@ import {
|
|
|
3
3
|
} from "./chunk-XBOVM6LO.mjs";
|
|
4
4
|
import {
|
|
5
5
|
writeLine
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-TRYHX5S4.mjs";
|
|
6
|
+
} from "./chunk-Y355VYRN.mjs";
|
|
7
|
+
import "./chunk-BVULOZZ4.mjs";
|
|
8
|
+
import "./chunk-ZNJ4APGF.mjs";
|
|
9
|
+
import "./chunk-VUJ4ITXR.mjs";
|
|
10
|
+
import "./chunk-NSG3OJDY.mjs";
|
|
11
|
+
import "./chunk-SCVF2F3I.mjs";
|
|
12
|
+
import "./chunk-I6EXRSZM.mjs";
|
|
14
13
|
import {
|
|
15
14
|
resolveProjectPackageImportSpecifier
|
|
16
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-OQEZ3MOE.mjs";
|
|
17
16
|
|
|
18
17
|
// src/cache.ts
|
|
19
18
|
import { loadConfigDirectory } from "@holo-js/config";
|
|
@@ -1,35 +1,33 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runProjectPrepare
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-JLZNWWFV.mjs";
|
|
4
|
+
import "./chunk-XXQUCGBO.mjs";
|
|
5
5
|
import {
|
|
6
6
|
getRegistryMigrationSlug,
|
|
7
7
|
hasRegisteredCreateTableMigration,
|
|
8
8
|
hasRegisteredMigrationSlug,
|
|
9
9
|
nextMigrationTemplate
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-M3IPUCTM.mjs";
|
|
10
|
+
} from "./chunk-WMBFSYWK.mjs";
|
|
12
11
|
import {
|
|
13
12
|
writeLine
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
prepareProjectDiscovery
|
|
18
|
-
} from "./chunk-QSVMXMTQ.mjs";
|
|
19
|
-
import "./chunk-OI54DOHK.mjs";
|
|
13
|
+
} from "./chunk-Y355VYRN.mjs";
|
|
14
|
+
import "./chunk-BVULOZZ4.mjs";
|
|
20
15
|
import {
|
|
21
16
|
ensureProjectConfig
|
|
22
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ZNJ4APGF.mjs";
|
|
18
|
+
import {
|
|
19
|
+
prepareProjectDiscovery
|
|
20
|
+
} from "./chunk-VUJ4ITXR.mjs";
|
|
23
21
|
import {
|
|
24
22
|
loadGeneratedProjectRegistry
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-NSG3OJDY.mjs";
|
|
24
|
+
import "./chunk-SCVF2F3I.mjs";
|
|
25
|
+
import "./chunk-I6EXRSZM.mjs";
|
|
28
26
|
import {
|
|
29
27
|
makeProjectRelativePath,
|
|
30
28
|
resolveDefaultArtifactPath,
|
|
31
29
|
writeTextFile
|
|
32
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-OQEZ3MOE.mjs";
|
|
33
31
|
|
|
34
32
|
// src/cache-migrations.ts
|
|
35
33
|
import { resolve } from "path";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadProjectConfig,
|
|
3
3
|
resolveGeneratedSchemaPath
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZNJ4APGF.mjs";
|
|
5
5
|
import {
|
|
6
6
|
loadGeneratedProjectRegistry,
|
|
7
7
|
relativeImportPath,
|
|
@@ -14,13 +14,17 @@ import {
|
|
|
14
14
|
renderGeneratedModelTypes,
|
|
15
15
|
renderManagedHostedAuthRouteFiles,
|
|
16
16
|
renderNextGeneratedRealtimeDefinitions,
|
|
17
|
+
renderNextGeneratedRealtimeMutationRoute,
|
|
18
|
+
renderNextGeneratedRealtimeQueryRoute,
|
|
17
19
|
renderNextHoloHelper,
|
|
20
|
+
renderNextRealtimeMutationRoute,
|
|
21
|
+
renderNextRealtimeQueryRoute,
|
|
18
22
|
renderNextRuntimeBootstrap,
|
|
19
23
|
renderSvelteViteConfig
|
|
20
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-NSG3OJDY.mjs";
|
|
21
25
|
import {
|
|
22
26
|
loadProjectPluginFrameworkDescriptors
|
|
23
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-SCVF2F3I.mjs";
|
|
24
28
|
import {
|
|
25
29
|
AUTH_CONFIG_FILE_NAMES,
|
|
26
30
|
AUTH_SOCIAL_PROVIDER_PACKAGE_NAMES,
|
|
@@ -60,7 +64,7 @@ import {
|
|
|
60
64
|
resolveFirstExistingPath,
|
|
61
65
|
sanitizePackageName,
|
|
62
66
|
writeTextFile
|
|
63
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-OQEZ3MOE.mjs";
|
|
64
68
|
|
|
65
69
|
// src/project/scaffold.ts
|
|
66
70
|
import { mkdir as mkdir3, readdir as readdir2 } from "fs/promises";
|
|
@@ -1393,13 +1397,43 @@ function mergeInstalledAuthFeatures(current, requested) {
|
|
|
1393
1397
|
}
|
|
1394
1398
|
|
|
1395
1399
|
// src/project/scaffold/framework.ts
|
|
1396
|
-
import { mkdir as mkdir2,
|
|
1400
|
+
import { mkdir as mkdir2, writeFile } from "fs/promises";
|
|
1397
1401
|
import { dirname, resolve as resolve3 } from "path";
|
|
1398
1402
|
import {
|
|
1399
|
-
normalizeHoloProjectConfig
|
|
1403
|
+
normalizeHoloProjectConfig as normalizeHoloProjectConfig2
|
|
1400
1404
|
} from "@holo-js/kernel";
|
|
1401
1405
|
import { renderGeneratedSchemaPlaceholder } from "@holo-js/db";
|
|
1402
1406
|
|
|
1407
|
+
// src/fs-utils.ts
|
|
1408
|
+
import { readdir, stat } from "fs/promises";
|
|
1409
|
+
|
|
1410
|
+
// src/project.ts
|
|
1411
|
+
import { normalizeHoloProjectConfig } from "@holo-js/kernel";
|
|
1412
|
+
|
|
1413
|
+
// src/fs-utils.ts
|
|
1414
|
+
async function fileExists(path) {
|
|
1415
|
+
try {
|
|
1416
|
+
await stat(path);
|
|
1417
|
+
return true;
|
|
1418
|
+
} catch {
|
|
1419
|
+
return false;
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
async function ensureAbsent(path) {
|
|
1423
|
+
const existing = await readTextFile(path);
|
|
1424
|
+
if (typeof existing !== "undefined") {
|
|
1425
|
+
throw new TypeError(`Refusing to overwrite existing file: ${path}`);
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
async function ensureEmptyDirectory(path, displayPath = path) {
|
|
1429
|
+
const entries = await readdir(path).catch(() => []);
|
|
1430
|
+
if (entries.length > 0) {
|
|
1431
|
+
throw new Error(
|
|
1432
|
+
`The destination "${displayPath}" already exists and is not empty. Choose a different project name or empty that folder first.`
|
|
1433
|
+
);
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1403
1437
|
// src/project/scaffold/project-renderers.ts
|
|
1404
1438
|
import {
|
|
1405
1439
|
createMigrationFileName
|
|
@@ -2317,12 +2351,9 @@ ${normalizedGroup.join("\n")}
|
|
|
2317
2351
|
`;
|
|
2318
2352
|
}
|
|
2319
2353
|
async function scaffoldProject(projectRoot, options) {
|
|
2320
|
-
|
|
2321
|
-
if (existingEntries.length > 0) {
|
|
2322
|
-
throw new Error(`Refusing to scaffold into a non-empty directory: ${projectRoot}`);
|
|
2323
|
-
}
|
|
2354
|
+
await ensureEmptyDirectory(projectRoot);
|
|
2324
2355
|
const { env, example } = renderScaffoldEnvFiles(options);
|
|
2325
|
-
const config =
|
|
2356
|
+
const config = normalizeHoloProjectConfig2();
|
|
2326
2357
|
const generatedSchemaPath = resolveGeneratedSchemaPath(projectRoot, config);
|
|
2327
2358
|
const optionalPackages = normalizeScaffoldOptionalPackages(options.optionalPackages);
|
|
2328
2359
|
const storageEnabled = optionalPackages.includes("storage");
|
|
@@ -2850,9 +2881,13 @@ async function installRealtimeIntoProject(projectRoot) {
|
|
|
2850
2881
|
await mkdir3(realtimeRoot, { recursive: true });
|
|
2851
2882
|
if (framework === "next") {
|
|
2852
2883
|
const routes = [
|
|
2884
|
+
{ path: "app/holo/realtime/query/route.ts", contents: renderNextRealtimeQueryRoute() },
|
|
2885
|
+
{ path: "app/holo/realtime/mutation/route.ts", contents: renderNextRealtimeMutationRoute() },
|
|
2853
2886
|
{ path: ".holo-js/generated/next/holo.ts", contents: renderNextHoloHelper() },
|
|
2854
2887
|
{ path: ".holo-js/generated/next/bootstrap.mjs", contents: renderNextRuntimeBootstrap() },
|
|
2855
|
-
{ path: ".holo-js/generated/next/realtime-definitions.ts", contents: await renderNextRealtimeDefinitions(projectRoot) }
|
|
2888
|
+
{ path: ".holo-js/generated/next/realtime-definitions.ts", contents: await renderNextRealtimeDefinitions(projectRoot) },
|
|
2889
|
+
{ path: ".holo-js/generated/next/realtime-query-route.ts", contents: renderNextGeneratedRealtimeQueryRoute() },
|
|
2890
|
+
{ path: ".holo-js/generated/next/realtime-mutation-route.ts", contents: renderNextGeneratedRealtimeMutationRoute() }
|
|
2856
2891
|
];
|
|
2857
2892
|
for (const route of routes) {
|
|
2858
2893
|
const routePath = resolve4(projectRoot, route.path);
|
|
@@ -2962,7 +2997,7 @@ async function installMediaIntoProject(projectRoot) {
|
|
|
2962
2997
|
if (!mediaConfigPath) {
|
|
2963
2998
|
await writeTextFile(resolve4(projectRoot, "config/media.ts"), renderMediaConfig());
|
|
2964
2999
|
}
|
|
2965
|
-
const { createMediaTableMigration } = await import("./media-migrations-
|
|
3000
|
+
const { createMediaTableMigration } = await import("./media-migrations-JMA7QMX7.mjs");
|
|
2966
3001
|
const migrationFilePath = await createMediaTableMigration(projectRoot, {
|
|
2967
3002
|
skipIfExists: true
|
|
2968
3003
|
});
|
|
@@ -3166,5 +3201,8 @@ export {
|
|
|
3166
3201
|
installMediaIntoProject,
|
|
3167
3202
|
installSecurityIntoProject,
|
|
3168
3203
|
installCacheIntoProject,
|
|
3169
|
-
installBroadcastIntoProject
|
|
3204
|
+
installBroadcastIntoProject,
|
|
3205
|
+
fileExists,
|
|
3206
|
+
ensureAbsent,
|
|
3207
|
+
ensureEmptyDirectory
|
|
3170
3208
|
};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
hasProjectDependency
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XXQUCGBO.mjs";
|
|
4
4
|
import {
|
|
5
5
|
syncManagedDriverDependencies
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BVULOZZ4.mjs";
|
|
7
7
|
import {
|
|
8
8
|
ensureGeneratedSchemaPlaceholder,
|
|
9
9
|
ensureProjectConfig
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZNJ4APGF.mjs";
|
|
11
11
|
import {
|
|
12
12
|
prepareProjectDiscovery
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VUJ4ITXR.mjs";
|
|
14
14
|
import {
|
|
15
15
|
renderFrameworkRunnerForDescriptor
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-NSG3OJDY.mjs";
|
|
17
17
|
import {
|
|
18
18
|
loadProjectPluginFrameworkDescriptors
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-SCVF2F3I.mjs";
|
|
20
20
|
import {
|
|
21
21
|
getFrameworkDescriptorByIdFrom,
|
|
22
22
|
getFrameworkDescriptorsWith,
|
|
23
23
|
readTextFile,
|
|
24
24
|
writeTextFile
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-OQEZ3MOE.mjs";
|
|
26
26
|
|
|
27
27
|
// src/dev.ts
|
|
28
28
|
import { spawnSync, spawn } from "child_process";
|
|
@@ -125,21 +125,32 @@ async function runProjectStartServer(io, projectRoot, spawnProcess = spawn, pass
|
|
|
125
125
|
throw new Error(`Project production server failed with exit code ${result.code ?? "unknown"}.`);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
async function runProjectDependencyInstall(io, projectRoot,
|
|
128
|
+
async function runProjectDependencyInstall(io, projectRoot, spawnProcess = spawn) {
|
|
129
129
|
const invocation = await resolvePackageManagerInstallInvocation(projectRoot);
|
|
130
|
-
const
|
|
130
|
+
const child = spawnProcess(invocation.command, [...invocation.args], {
|
|
131
131
|
cwd: projectRoot,
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
env: process.env,
|
|
133
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
134
134
|
});
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
let stdout = "";
|
|
136
|
+
let stderr = "";
|
|
137
|
+
child.stdout?.on("data", (chunk) => stdout += String(chunk));
|
|
138
|
+
child.stderr?.on("data", (chunk) => stderr += String(chunk));
|
|
139
|
+
const result = await new Promise((resolvePromise) => {
|
|
140
|
+
child.on("error", (error) => resolvePromise({ kind: "error", error }));
|
|
141
|
+
child.on("close", (code) => resolvePromise({ kind: "close", code }));
|
|
142
|
+
});
|
|
143
|
+
if (result.kind === "error") {
|
|
144
|
+
throw result.error;
|
|
137
145
|
}
|
|
138
|
-
if (
|
|
139
|
-
io.
|
|
146
|
+
if (stdout) {
|
|
147
|
+
io.stdout.write(stdout);
|
|
140
148
|
}
|
|
141
|
-
if (
|
|
142
|
-
|
|
149
|
+
if (stderr) {
|
|
150
|
+
io.stderr.write(stderr);
|
|
151
|
+
}
|
|
152
|
+
if (result.code !== 0) {
|
|
153
|
+
throw new Error(stderr.trim() || stdout.trim() || "Project dependency installation failed.");
|
|
143
154
|
}
|
|
144
155
|
}
|
|
145
156
|
async function runProjectPrepare(projectRoot, io, options = {}) {
|