juxscript 1.1.95 → 1.1.97

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": 63,
3
- "generatedAt": "2026-02-12T20:04:49.529Z",
3
+ "generatedAt": "2026-02-12T20:10:28.490Z",
4
4
  "components": [
5
5
  {
6
6
  "file": "alert.js",
@@ -490,7 +490,57 @@ navigate(location.pathname);
490
490
  }
491
491
 
492
492
  /**
493
- * ✅ Build method - INSIDE the class
493
+ * ✅ Copy source files to dist/jux for esbuild to resolve
494
+ */
495
+ _copySourceToDist() {
496
+ const distJuxDir = path.join(this.distDir, 'jux');
497
+
498
+ // Ensure dist/jux directory exists
499
+ if (!fs.existsSync(distJuxDir)) {
500
+ fs.mkdirSync(distJuxDir, { recursive: true });
501
+ }
502
+
503
+ // Copy all .jux and .js files from source to dist
504
+ this._copySourceFilesRecursive(this.srcDir, this.srcDir, distJuxDir);
505
+ }
506
+
507
+ /**
508
+ * Recursively copy .jux and .js files preserving folder structure
509
+ */
510
+ _copySourceFilesRecursive(src, baseDir, distBase) {
511
+ const entries = fs.readdirSync(src, { withFileTypes: true });
512
+
513
+ entries.forEach(entry => {
514
+ if (entry.name.startsWith('.')) return; // Skip hidden
515
+
516
+ const srcPath = path.join(src, entry.name);
517
+ const relativePath = path.relative(baseDir, srcPath);
518
+ const destPath = path.join(distBase, relativePath);
519
+
520
+ if (entry.isDirectory()) {
521
+ // Create directory if it doesn't exist
522
+ if (!fs.existsSync(destPath)) {
523
+ fs.mkdirSync(destPath, { recursive: true });
524
+ }
525
+ // Recurse into subdirectory
526
+ this._copySourceFilesRecursive(srcPath, baseDir, distBase);
527
+ } else if (entry.name.endsWith('.jux') || entry.name.endsWith('.js')) {
528
+ // Copy .jux and .js files (skip assets)
529
+ if (!this.isAssetFile(entry.name)) {
530
+ // Ensure parent directory exists
531
+ const destDir = path.dirname(destPath);
532
+ if (!fs.existsSync(destDir)) {
533
+ fs.mkdirSync(destDir, { recursive: true });
534
+ }
535
+ fs.copyFileSync(srcPath, destPath);
536
+ console.log(` 📋 Copied: ${relativePath}`);
537
+ }
538
+ }
539
+ });
540
+ }
541
+
542
+ /**
543
+ * ✅ Build method with source copy step
494
544
  */
495
545
  async build() {
496
546
  console.log('🔨 Building JUX application...\n');
@@ -511,6 +561,11 @@ navigate(location.pathname);
511
561
  fs.mkdirSync(this.distDir, { recursive: true });
512
562
  }
513
563
 
564
+ // ✅ Copy source files to dist/jux BEFORE generating entry point
565
+ console.log('📋 Copying source files to dist...');
566
+ this._copySourceToDist();
567
+ console.log('✅ Source files copied\n');
568
+
514
569
  // Generate entry point
515
570
  const entryCode = this.generateEntryPoint(views, dataModules, sharedModules);
516
571
  const entryPath = path.join(this.distDir, 'entry.js');
@@ -526,7 +581,11 @@ navigate(location.pathname);
526
581
  platform: 'browser',
527
582
  target: 'es2020',
528
583
  sourcemap: true,
529
- external: []
584
+ external: [],
585
+ // ✅ Tell esbuild how to resolve .jux files
586
+ loader: {
587
+ '.jux': 'js' // Treat .jux files as JavaScript
588
+ }
530
589
  });
531
590
 
532
591
  // Generate index.html
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juxscript",
3
- "version": "1.1.95",
3
+ "version": "1.1.97",
4
4
  "type": "module",
5
5
  "description": "A JavaScript UX authorship platform",
6
6
  "main": "index.js",