what-framework-cli 0.13.3 → 0.13.5
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/package.json +2 -2
- package/src/cli.js +9 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "what-framework-cli",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.5",
|
|
4
4
|
"description": "What Framework CLI - Dev server, build, and deployment tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"author": "ZVN DEV (https://zvndev.com)",
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"what-framework": "^0.13.
|
|
25
|
+
"what-framework": "^0.13.5"
|
|
26
26
|
},
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|
package/src/cli.js
CHANGED
|
@@ -372,6 +372,7 @@ async function dev() {
|
|
|
372
372
|
const wsClients = new Set();
|
|
373
373
|
|
|
374
374
|
// Auto-start MCP bridge if what-devtools-mcp is installed
|
|
375
|
+
/** @type {import('node:child_process').ChildProcess | null} */
|
|
375
376
|
let mcpProcess = null;
|
|
376
377
|
const noMcp = args.includes('--no-mcp');
|
|
377
378
|
if (!noMcp) {
|
|
@@ -792,7 +793,11 @@ function getFlag(name, defaultValue) {
|
|
|
792
793
|
}
|
|
793
794
|
|
|
794
795
|
// Async config loader — uses dynamic import() instead of unsafe new Function()
|
|
796
|
+
/** @type {{ mode?: string, pagesDir?: string, outDir?: string, hmr?: boolean, hash?: boolean, adapter?: string, [key: string]: any } | null} */
|
|
795
797
|
var _configCache = null;
|
|
798
|
+
/**
|
|
799
|
+
* @returns {Promise<{ mode?: string, pagesDir?: string, outDir?: string, hmr?: boolean, hash?: boolean, adapter?: string, [key: string]: any }>}
|
|
800
|
+
*/
|
|
796
801
|
async function loadConfigAsync() {
|
|
797
802
|
if (_configCache) return _configCache;
|
|
798
803
|
const configPath = join(cwd, 'what.config.js');
|
|
@@ -801,8 +806,9 @@ async function loadConfigAsync() {
|
|
|
801
806
|
// Use file:// URL for cross-platform ESM import compatibility
|
|
802
807
|
const fileUrl = new URL(`file://${configPath}`);
|
|
803
808
|
const mod = await import(fileUrl.href);
|
|
804
|
-
|
|
805
|
-
|
|
809
|
+
const loaded = mod.default || mod;
|
|
810
|
+
_configCache = loaded;
|
|
811
|
+
return loaded;
|
|
806
812
|
} catch { /* use defaults */ }
|
|
807
813
|
}
|
|
808
814
|
_configCache = { mode: 'hybrid', pagesDir: 'src/pages', outDir: 'dist' };
|
|
@@ -959,6 +965,7 @@ function injectDevClient(html) {
|
|
|
959
965
|
// file: from node_modules/what-framework-cli/src, `../../what/src` points at a
|
|
960
966
|
// package name that was never published. Resolve by package name instead, from
|
|
961
967
|
// the CLI, from what-framework itself (pnpm-style trees), then from the project.
|
|
968
|
+
/** @type {{ core?: string, router?: string, server?: string, missing?: string[] } | null} */
|
|
962
969
|
var _runtimeDirs = null;
|
|
963
970
|
function resolveRuntimeDirs() {
|
|
964
971
|
if (_runtimeDirs) return _runtimeDirs;
|