juxscript 1.0.30 → 1.0.31
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 +27 -1
- package/machinery/compiler.js +0 -3
- package/package.json +1 -1
- /package/presets/{index.jux → jux.jux} +0 -0
package/bin/cli.js
CHANGED
|
@@ -233,7 +233,28 @@ async function buildProject(isServe = false) {
|
|
|
233
233
|
// Create structure
|
|
234
234
|
fs.mkdirSync(juxDir, { recursive: true });
|
|
235
235
|
|
|
236
|
-
// Copy
|
|
236
|
+
// Copy jux.jux as the starter index.jux (if it exists)
|
|
237
|
+
const juxJuxSrc = path.join(PATHS.packageRoot, 'presets', 'jux.jux');
|
|
238
|
+
const indexJuxDest = path.join(juxDir, 'index.jux');
|
|
239
|
+
|
|
240
|
+
if (fs.existsSync(juxJuxSrc)) {
|
|
241
|
+
fs.copyFileSync(juxJuxSrc, indexJuxDest);
|
|
242
|
+
console.log('+ Created jux/index.jux from jux.jux template');
|
|
243
|
+
} else {
|
|
244
|
+
// Fallback to hey.jux if jux.jux doesn't exist
|
|
245
|
+
const heyJuxSrc = path.join(PATHS.packageRoot, 'presets', 'hey.jux');
|
|
246
|
+
if (fs.existsSync(heyJuxSrc)) {
|
|
247
|
+
fs.copyFileSync(heyJuxSrc, indexJuxDest);
|
|
248
|
+
console.log('+ Created jux/index.jux from hey.jux template');
|
|
249
|
+
} else {
|
|
250
|
+
console.warn('⚠️ No template found, creating basic file');
|
|
251
|
+
const basicContent = `import { jux } from 'juxscript';\n\njux.heading('welcome').text('Welcome to JUX').render('#app');`;
|
|
252
|
+
fs.writeFileSync(indexJuxDest, basicContent);
|
|
253
|
+
console.log('+ Created jux/index.jux');
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// Copy entire presets folder to jux/presets/ (excluding jux.jux)
|
|
237
258
|
const presetsSrc = path.join(PATHS.packageRoot, 'presets');
|
|
238
259
|
const presetsDest = path.join(juxDir, 'presets');
|
|
239
260
|
|
|
@@ -247,6 +268,11 @@ async function buildProject(isServe = false) {
|
|
|
247
268
|
const srcPath = path.join(src, entry.name);
|
|
248
269
|
const destPath = path.join(dest, entry.name);
|
|
249
270
|
|
|
271
|
+
// Skip jux.jux since we already copied it to index.jux
|
|
272
|
+
if (entry.isFile() && entry.name === 'jux.jux') {
|
|
273
|
+
continue;
|
|
274
|
+
}
|
|
275
|
+
|
|
250
276
|
if (entry.isDirectory()) {
|
|
251
277
|
fs.mkdirSync(destPath, { recursive: true });
|
|
252
278
|
copyRecursive(srcPath, destPath);
|
package/machinery/compiler.js
CHANGED
|
@@ -662,9 +662,6 @@ export function generateIndexHtml(distDir, routes, mainJsFilename = 'main.js') {
|
|
|
662
662
|
<title>Jux Application</title>
|
|
663
663
|
</head>
|
|
664
664
|
<body data-theme="">
|
|
665
|
-
<nav style="padding: 20px; background: #f5f5f5; border-bottom: 2px solid #ddd;">
|
|
666
|
-
${navLinks}
|
|
667
|
-
</nav>
|
|
668
665
|
<!-- App container - router renders here -->
|
|
669
666
|
<div id="app"></div>
|
|
670
667
|
${importMapScript}
|
package/package.json
CHANGED
|
File without changes
|