@arkstack/console 0.15.1 → 0.15.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/index.js +33 -7
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
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-CPmSl41C.js";
|
|
4
|
+
import { createRequire } from "node:module";
|
|
4
5
|
import { Publisher, abort, abortIf, assertFound, config, discoverCommands, env, importFile, initializeGlobalContext, loadPrototypes, outputDir, rebuildOutput } from "@arkstack/common";
|
|
5
6
|
import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, statSync, writeFileSync } from "node:fs";
|
|
6
7
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -57,14 +58,21 @@ var DevCommand = class DevCommand extends Command {
|
|
|
57
58
|
description = "Run the development server";
|
|
58
59
|
async handle() {
|
|
59
60
|
const vars = DevCommand.devServerEnv(this.options());
|
|
61
|
+
const rootDir = Arkstack.rootDir();
|
|
62
|
+
const bin = DevCommand.resolveTsdownBin(rootDir);
|
|
63
|
+
const [command, args] = bin ? [process.execPath, [
|
|
64
|
+
bin,
|
|
65
|
+
"--log-level",
|
|
66
|
+
"silent"
|
|
67
|
+
]] : [process.platform === "win32" ? "pnpm.cmd" : "pnpm", [
|
|
68
|
+
"exec",
|
|
69
|
+
"tsdown",
|
|
70
|
+
"--log-level",
|
|
71
|
+
"silent"
|
|
72
|
+
]];
|
|
60
73
|
await new Promise((resolve, reject) => {
|
|
61
|
-
const child = spawn(
|
|
62
|
-
|
|
63
|
-
"tsdown",
|
|
64
|
-
"--log-level",
|
|
65
|
-
"silent"
|
|
66
|
-
], {
|
|
67
|
-
cwd: Arkstack.rootDir(),
|
|
74
|
+
const child = spawn(command, args, {
|
|
75
|
+
cwd: rootDir,
|
|
68
76
|
stdio: "inherit",
|
|
69
77
|
env: Object.assign(process.env, vars)
|
|
70
78
|
});
|
|
@@ -81,6 +89,24 @@ var DevCommand = class DevCommand extends Command {
|
|
|
81
89
|
});
|
|
82
90
|
}
|
|
83
91
|
/**
|
|
92
|
+
* Resolve the absolute path to tsdown's executable so it can be run directly
|
|
93
|
+
* with `node`, skipping the `pnpm exec` wrapper process. Returns `undefined`
|
|
94
|
+
* when tsdown cannot be resolved from the app root, letting the caller fall
|
|
95
|
+
* back to `pnpm exec`.
|
|
96
|
+
*
|
|
97
|
+
* @param rootDir The application root to resolve tsdown from.
|
|
98
|
+
*/
|
|
99
|
+
static resolveTsdownBin(rootDir) {
|
|
100
|
+
try {
|
|
101
|
+
const pkgPath = createRequire(join(rootDir, "noop.js")).resolve("tsdown/package.json");
|
|
102
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
103
|
+
const bin = typeof pkg.bin === "string" ? pkg.bin : pkg.bin?.tsdown;
|
|
104
|
+
return bin ? join(dirname(pkgPath), bin) : void 0;
|
|
105
|
+
} catch {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
84
110
|
* Map `dev` command flags to the environment variables the running server reads.
|
|
85
111
|
*
|
|
86
112
|
* The dev server binds `127.0.0.1` by default so it is local-only; `--host`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkstack/console",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
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",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"chalk": "^5.6.2",
|
|
52
52
|
"resora": "^1.3.27",
|
|
53
53
|
"ts-morph": "^28.0.0",
|
|
54
|
-
"@arkstack/common": "^0.15.
|
|
55
|
-
"@arkstack/contract": "^0.15.
|
|
54
|
+
"@arkstack/common": "^0.15.2",
|
|
55
|
+
"@arkstack/contract": "^0.15.2"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsdown",
|