create-aziz-app 3.0.4 → 3.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-aziz-app",
3
- "version": "3.0.4",
3
+ "version": "3.0.5",
4
4
  "description": "Create Aziz.js apps — lightweight Next.js clone with file-based routing, React hooks, and API routes",
5
5
  "keywords": [
6
6
  "aziz.js",
@@ -21,8 +21,14 @@ try {
21
21
  Babel = null;
22
22
  }
23
23
 
24
- function transformJSX(code, filename) {
24
+ function transformJSX(code, filename, filePath) {
25
25
  if (!Babel) return code;
26
+
27
+ // Skip framework internals — they have no JSX
28
+ if (filePath.includes('/_framework/') || filePath.includes('\\_framework\\')) {
29
+ return code;
30
+ }
31
+
26
32
  try {
27
33
  const result = Babel.transform(code, {
28
34
  filename,
@@ -35,7 +41,6 @@ function transformJSX(code, filename) {
35
41
  return result.code;
36
42
  } catch (err) {
37
43
  console.error(`❌ JSX transform error in ${filename}:`, err.message);
38
- // Return error as a JS comment so browser shows it
39
44
  return `throw new Error(${JSON.stringify('JSX transform error in ' + filename + ': ' + err.message)});`;
40
45
  }
41
46
  }
@@ -394,8 +399,7 @@ const server = http.createServer(async (req, res) => {
394
399
  // Transform JS/JSX files: JSX → h() + rewrite imports
395
400
  if (fileExt === '.js' || fileExt === '.jsx' || fileExt === '.mjs') {
396
401
  let code = content.toString();
397
- // Transform JSX first, then rewrite imports
398
- code = transformJSX(code, path.basename(filePath));
402
+ code = transformJSX(code, path.basename(filePath), filePath);
399
403
  code = rewriteImports(code, filePath);
400
404
  content = Buffer.from(code);
401
405
  }