@hexclave/cli 1.0.85 → 1.0.87
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/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/commands/init.ts +10 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hexclave/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.87",
|
|
4
4
|
"repository": "https://github.com/hexclave/hexclave",
|
|
5
5
|
"description": "The CLI for Hexclave. https://hexclave.com",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"extract-zip": "^2.0.1",
|
|
28
28
|
"jiti": "^2.4.2",
|
|
29
29
|
"tar": "^7.4.3",
|
|
30
|
-
"@hexclave/
|
|
31
|
-
"@hexclave/
|
|
32
|
-
"@hexclave/shared": "1.0.
|
|
30
|
+
"@hexclave/js": "1.0.87",
|
|
31
|
+
"@hexclave/shared-backend": "1.0.87",
|
|
32
|
+
"@hexclave/shared": "1.0.87"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/cross-spawn": "^6.0.6",
|
package/src/commands/init.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StackClientApp } from "@hexclave/js";
|
|
2
|
-
import { ALL_APPS } from "@hexclave/shared/dist/apps/apps-config";
|
|
2
|
+
import { ALL_APPS, expandAppSoftRequirements, type AppId } from "@hexclave/shared/dist/apps/apps-config";
|
|
3
3
|
import { detectImportPackageFromDir } from "@hexclave/shared/dist/config-eval";
|
|
4
4
|
import { renderConfigFileContent } from "@hexclave/shared/dist/config-rendering";
|
|
5
5
|
import { throwErr } from "@hexclave/shared/dist/utils/errors";
|
|
@@ -386,7 +386,10 @@ async function handleCreate(opts: InitOptions, outputDir: string): Promise<{ con
|
|
|
386
386
|
const validAppIds = Object.keys(ALL_APPS);
|
|
387
387
|
const invalidApps = selectedApps.filter((id) => !validAppIds.includes(id));
|
|
388
388
|
if (invalidApps.length > 0) {
|
|
389
|
-
|
|
389
|
+
const availableAppIds = Object.entries(ALL_APPS)
|
|
390
|
+
.filter(([, app]) => app.stage !== "alpha")
|
|
391
|
+
.map(([appId]) => appId);
|
|
392
|
+
throw new CliError(`Unknown app IDs: ${invalidApps.join(", ")}. Available IDs: ${availableAppIds.join(", ")}`);
|
|
390
393
|
}
|
|
391
394
|
} else {
|
|
392
395
|
const stageOrder = { stable: 0, beta: 1 } as const;
|
|
@@ -404,8 +407,12 @@ async function handleCreate(opts: InitOptions, outputDir: string): Promise<{ con
|
|
|
404
407
|
});
|
|
405
408
|
}
|
|
406
409
|
|
|
410
|
+
const validatedSelectedApps = selectedApps.filter((appId): appId is AppId => Object.prototype.hasOwnProperty.call(ALL_APPS, appId));
|
|
411
|
+
if (validatedSelectedApps.length !== selectedApps.length) {
|
|
412
|
+
throw new CliError("App selection contained an unknown app after validation.");
|
|
413
|
+
}
|
|
407
414
|
const installed = Object.fromEntries(
|
|
408
|
-
|
|
415
|
+
[...expandAppSoftRequirements(validatedSelectedApps)].map((appId) => [appId, { enabled: true }])
|
|
409
416
|
);
|
|
410
417
|
|
|
411
418
|
const config = {
|