juxscript 1.1.7 → 1.1.9
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/bin/cli.js +1 -1
- package/machinery/build3.js +8 -7
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -45,7 +45,7 @@ async function createProject(projectName) {
|
|
|
45
45
|
// Updated to use jux namespace and renderTo
|
|
46
46
|
fs.writeFileSync(
|
|
47
47
|
path.join(juxDir, 'index.jux'),
|
|
48
|
-
`import { jux } from 'juxscript';\n\njux.element('h1', { id: 'welcome' })\n .text('Welcome to JUX!')\n .
|
|
48
|
+
`import { jux } from 'juxscript';\n\njux.element('h1', { id: 'welcome' })\n .text('Welcome to JUX!')\n .render('app');\n`
|
|
49
49
|
);
|
|
50
50
|
console.log(' ✓ Created starter file');
|
|
51
51
|
}
|
package/machinery/build3.js
CHANGED
|
@@ -11,24 +11,25 @@ const JUX_CONFIG_PATH = path.resolve(PROJECT_ROOT, 'juxconfig.js');
|
|
|
11
11
|
let rawConfig = {};
|
|
12
12
|
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const imported = await import(JUX_CONFIG_PATH);
|
|
15
|
+
rawConfig = imported.config || imported.default || {};
|
|
15
16
|
console.log(`⚙️ Loaded config: ${JUX_CONFIG_PATH}`);
|
|
16
17
|
} catch (err) {
|
|
17
18
|
console.warn(`⚠️ No juxconfig.js found, using defaults`);
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
// ═══════════════════════════════════════════════════════════════
|
|
21
|
-
// EXPLODE CONFIG
|
|
22
|
+
// EXPLODE CONFIG - Handle both old and new structure
|
|
22
23
|
// ═══════════════════════════════════════════════════════════════
|
|
23
24
|
const directories = {
|
|
24
|
-
source: rawConfig.directories?.source || './jux',
|
|
25
|
-
distribution: rawConfig.directories?.distribution || './.jux-dist'
|
|
25
|
+
source: rawConfig.directories?.source || rawConfig.sourceDir || './jux',
|
|
26
|
+
distribution: rawConfig.directories?.distribution || rawConfig.distDir || './.jux-dist'
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
const defaults = {
|
|
29
|
-
httpPort: rawConfig.defaults?.httpPort || 3000,
|
|
30
|
-
wsPort: rawConfig.defaults?.wsPort || 3001,
|
|
31
|
-
autoRoute: rawConfig.defaults?.autoRoute ?? true
|
|
30
|
+
httpPort: rawConfig.defaults?.httpPort || rawConfig.ports?.http || 3000,
|
|
31
|
+
wsPort: rawConfig.defaults?.wsPort || rawConfig.ports?.ws || 3001,
|
|
32
|
+
autoRoute: rawConfig.defaults?.autoRoute ?? rawConfig.autoRoutes ?? true
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
// Resolve absolute paths
|