@arkstack/console 0.12.36 → 0.13.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 (2) hide show
  1. package/dist/index.js +17 -13
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import { t as ArkstackConsoleApp } from "./app-DnaQWE9q.js";
3
3
  import { n as BaseTCConfig, r as TSConfig, t as BuildInterfaces } from "./BuildInterfaces-CsZ3Uerb.js";
4
- import { abort, abortIf, assertFound, config, env, importFile, initializeGlobalContext, loadPrototypes, outputDir, rebuildOutput } from "@arkstack/common";
4
+ import { abort, abortIf, assertFound, config, discoverCommands, env, importFile, initializeGlobalContext, loadPrototypes, outputDir, rebuildOutput } from "@arkstack/common";
5
5
  import { existsSync, realpathSync } from "node:fs";
6
6
  import { fileURLToPath, pathToFileURL } from "node:url";
7
7
  import path, { join } from "node:path";
8
8
  import { Arkstack } from "@arkstack/contract";
9
- import { MakeResource } from "resora";
9
+ import { MakeResource, applyRuntimeConfig, getDefaultConfig } from "resora";
10
10
  import { Command, Kernel } from "@h3ravel/musket";
11
11
  import { spawn } from "node:child_process";
12
12
  import { resolve } from "path";
@@ -186,7 +186,17 @@ var MakeFullResource = class extends Command {
186
186
 
187
187
  //#endregion
188
188
  //#region dist/commands/MakeResource.js
189
- var MakeResource$1 = class extends MakeResource {};
189
+ var MakeResource$1 = class extends MakeResource {
190
+ async handle() {
191
+ try {
192
+ applyRuntimeConfig({
193
+ ...getDefaultConfig(),
194
+ ...config("resources", {})
195
+ });
196
+ } catch {}
197
+ return super.handle();
198
+ }
199
+ };
190
200
 
191
201
  //#endregion
192
202
  //#region dist/commands/RouteList.js
@@ -300,7 +310,6 @@ const loadCoreApp = async () => {
300
310
  const runConsoleKernel = async (options = {}) => {
301
311
  loadPrototypes();
302
312
  const app = await loadCoreApp();
303
- const dist = path.relative(Arkstack.rootDir(), outputDir());
304
313
  const stubsDir = process.env.ARKSTACK_STUBS_DIR;
305
314
  globalThis.app = () => app;
306
315
  globalThis.env = env;
@@ -311,6 +320,7 @@ const runConsoleKernel = async (options = {}) => {
311
320
  globalThis.assertFound = assertFound;
312
321
  globalThis.arkctx = { runtime: "CLI" };
313
322
  await initializeGlobalContext();
323
+ const userCommands = await discoverCommands();
314
324
  await Kernel.init(await new ArkstackConsoleApp(app, { stubsDir }).loadConfig(), {
315
325
  logo: options.logo ?? logo_default,
316
326
  name: "Cmd",
@@ -321,16 +331,10 @@ const runConsoleKernel = async (options = {}) => {
321
331
  MakeFullResource,
322
332
  DevCommand,
323
333
  BuildCommand,
324
- MakeCommand
325
- ],
326
- discoveryPaths: [
327
- join(Arkstack.rootDir(), "src", "app", "console", "commands/*.js"),
328
- join(Arkstack.rootDir(), "src", "app/console/commands/*.js"),
329
- join(Arkstack.rootDir(), "src", "app/console/commands/*.mjs"),
330
- join(Arkstack.rootDir(), dist, "app/console/commands/*.js"),
331
- join(Arkstack.rootDir(), dist, "app/console/commands/*.mjs"),
332
- join(Arkstack.rootDir(), "node_modules", "@arkstack/*", "dist", "commands", "*.js")
334
+ MakeCommand,
335
+ ...userCommands
333
336
  ],
337
+ discoveryPaths: [join(Arkstack.rootDir(), "node_modules", "@arkstack/*", "dist", "commands", "*.js")],
334
338
  exceptionHandler(exception) {
335
339
  throw exception;
336
340
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkstack/console",
3
- "version": "0.12.36",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "description": "Console module for Arkstack, providing the command-line runtime and console integration layer.",
6
6
  "homepage": "https://arkstack.toneflix.net/guide/cli",
@@ -42,17 +42,17 @@
42
42
  }
43
43
  },
44
44
  "peerDependencies": {
45
- "arkormx": "^2.9.0",
45
+ "arkormx": "^2.9.2",
46
46
  "clear-router": "^2.8.8"
47
47
  },
48
48
  "dependencies": {
49
- "@h3ravel/musket": "^2.0.0",
49
+ "@h3ravel/musket": "^2.2.0",
50
50
  "@h3ravel/support": "^2.1.4",
51
51
  "chalk": "^5.6.2",
52
- "resora": "^1.3.25",
52
+ "resora": "^1.3.26",
53
53
  "ts-morph": "^28.0.0",
54
- "@arkstack/common": "^0.12.36",
55
- "@arkstack/contract": "^0.12.36"
54
+ "@arkstack/common": "^0.13.0",
55
+ "@arkstack/contract": "^0.13.0"
56
56
  },
57
57
  "scripts": {
58
58
  "build": "tsdown",