juxscript 1.1.135 → 1.1.137

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-13T17:15:00.187Z",
3
+ "generatedAt": "2026-02-13T17:29:37.469Z",
4
4
  "components": [
5
5
  {
6
6
  "file": "alert.js",
@@ -81,12 +81,18 @@ export class JuxCompiler {
81
81
  const relativePath = path.relative(this.srcDir, fullPath);
82
82
  const name = relativePath.replace(/\.[^/.]+$/, ''); // Remove extension
83
83
 
84
- // ✅ Skip if we've already processed this base name (avoid .jux + .js duplicates)
85
- if (processedNames.has(name)) {
86
- console.warn(`⚠️ Skipping duplicate: ${relativePath} (already processed ${name})`);
84
+ // ✅ Generate unique key that includes full path to avoid collisions
85
+ // This handles cases like:
86
+ // - apps/audits/audits.jux apps_audits_audits
87
+ // - apps/audits.jux → apps_audits
88
+ const uniqueKey = name.replace(/[\/\\]/g, '_').replace(/[^a-zA-Z0-9_]/g, '_');
89
+
90
+ // ✅ Skip if we've already processed this exact path
91
+ if (processedNames.has(uniqueKey)) {
92
+ console.warn(`⚠️ Skipping duplicate: ${relativePath} (already processed as ${uniqueKey})`);
87
93
  continue;
88
94
  }
89
- processedNames.add(name);
95
+ processedNames.add(uniqueKey);
90
96
 
91
97
  if (file.includes('data')) {
92
98
  dataModules.push({ name, file: relativePath, content });
@@ -250,6 +256,17 @@ export class JuxCompiler {
250
256
 
251
257
  const capitalized = sanitizedName.charAt(0).toUpperCase() + sanitizedName.slice(1);
252
258
 
259
+ // ✅ Check for duplicate function names and warn
260
+ const functionName = `render${capitalized}`;
261
+ if (sourceSnapshot[functionName]) {
262
+ console.error(`❌ DUPLICATE FUNCTION NAME: ${functionName}`);
263
+ console.error(` Conflict between:`);
264
+ console.error(` 1. ${sourceSnapshot[functionName].file}`);
265
+ console.error(` 2. ${v.file}`);
266
+ console.error(` This will cause a build error. Rename one of these files.`);
267
+ throw new Error(`Duplicate function name: ${functionName}`);
268
+ }
269
+
253
270
  sourceSnapshot[v.file] = {
254
271
  name: v.name,
255
272
  file: v.file,
@@ -257,11 +274,19 @@ export class JuxCompiler {
257
274
  lines: v.content.split('\n')
258
275
  };
259
276
 
277
+ // ✅ Also track by function name to catch duplicates
278
+ sourceSnapshot[functionName] = {
279
+ name: v.name,
280
+ file: v.file,
281
+ content: v.content,
282
+ lines: v.content.split('\n')
283
+ };
284
+
260
285
  let viewCode = this.removeImports(v.content).replace(/^\s*export\s+default\s+.*$/gm, '');
261
286
  const asyncPrefix = viewCode.includes('await ') ? 'async ' : '';
262
287
 
263
- // Use sanitized name in function declaration
264
- entry += `\n${asyncPrefix}function render${capitalized}() {\n${viewCode}\n}\n`;
288
+ // Use sanitized name in function declaration
289
+ entry += `\n${asyncPrefix}function ${functionName}() {\n${viewCode}\n}\n`;
265
290
  });
266
291
 
267
292
  dataModules.forEach(m => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juxscript",
3
- "version": "1.1.135",
3
+ "version": "1.1.137",
4
4
  "type": "module",
5
5
  "description": "A JavaScript UX authorship platform",
6
6
  "main": "index.js",