juxscript 1.1.122 → 1.1.124

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "totalComponents": 69,
3
- "generatedAt": "2026-02-13T05:09:43.298Z",
3
+ "generatedAt": "2026-02-13T05:15:24.014Z",
4
4
  "components": [
5
5
  {
6
6
  "file": "alert.js",
@@ -234,7 +234,12 @@ export class JuxCompiler {
234
234
  views.forEach(v => {
235
235
  // ✅ Sanitize the name for use in function names
236
236
  // Replace slashes, dots, and other invalid characters with underscores
237
- const sanitizedName = v.name.replace(/[\/\\.\\-\s]/g, '_');
237
+ const sanitizedName = v.name
238
+ .replace(/[\/\\.\\-\s]/g, '_') // Replace /, \, ., -, spaces with _
239
+ .replace(/[^a-zA-Z0-9_]/g, '_') // Replace any other invalid chars with _
240
+ .replace(/_+/g, '_') // Collapse multiple consecutive underscores
241
+ .replace(/^_|_$/g, ''); // Remove leading/trailing underscores
242
+
238
243
  const capitalized = sanitizedName.charAt(0).toUpperCase() + sanitizedName.slice(1);
239
244
 
240
245
  sourceSnapshot[v.file] = {
@@ -512,20 +517,22 @@ navigate(location.pathname);
512
517
  <head>
513
518
  <meta charset="UTF-8">
514
519
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
515
- <title>JUX App</title>
516
- <script type="module" src="./bundle.js"></script>
520
+ <title>JUX Application</title>
517
521
  </head>
518
522
  <body>
519
523
  <div id="app"></div>
524
+ <script src="/bundle.js"></script>
525
+ <script src="/entry.js"></script>
520
526
  </body>
521
527
  </html>`;
522
- fs.writeFileSync(path.join(this.distDir, 'index.html'), html);
523
528
 
524
- fs.unlinkSync(entryPath);
525
- fs.rmSync(juxDistDir, { recursive: true, force: true });
529
+ fs.writeFileSync(
530
+ path.join(this.config.distDir, 'index.html'),
531
+ html,
532
+ 'utf8'
533
+ );
526
534
 
527
- console.log(`\nBuild Complete!\n`);
528
- return { success: true, errors: [], warnings: validation.warnings };
535
+ console.log(' Generated index.html');
529
536
  }
530
537
 
531
538
  /**
@@ -608,16 +615,17 @@ navigate(location.pathname);
608
615
  }
609
616
 
610
617
  /**
611
- * ✅ Generate name from folder structure
618
+ * ✅ Generate valid JavaScript identifier from file path
612
619
  * Example: abc/aaa.jux -> abc_aaa
613
- * Example: components/header.jux -> components_header
620
+ * Example: menus/main.jux -> menus_main
621
+ * Example: pages/blog/post.jux -> pages_blog_post
614
622
  */
615
623
  _generateNameFromPath(filepath) {
616
624
  return filepath
617
- .replace(/\.jux$/, '') // Remove .jux extension
618
- .replace(/[\/\\]/g, '_') // Replace slashes with underscores
619
- .replace(/[^a-zA-Z0-9_]/g, '_') // Replace any other invalid chars
620
- .replace(/_+/g, '_') // Collapse multiple underscores
621
- .replace(/^_|_$/g, ''); // Remove leading/trailing underscores
625
+ .replace(/\.jux$/, '') // Remove .jux extension
626
+ .replace(/[\/\\]/g, '_') // Replace / and \ with _
627
+ .replace(/[^a-zA-Z0-9_]/g, '_') // Replace any other invalid chars with _
628
+ .replace(/_+/g, '_') // Collapse multiple consecutive underscores
629
+ .replace(/^_|_$/g, ''); // Remove leading/trailing underscores
622
630
  }
623
631
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juxscript",
3
- "version": "1.1.122",
3
+ "version": "1.1.124",
4
4
  "type": "module",
5
5
  "description": "A JavaScript UX authorship platform",
6
6
  "main": "index.js",