create-aziz-app 3.0.4 → 3.0.6
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.
|
|
3
|
+
"version": "3.0.6",
|
|
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",
|
|
@@ -25,8 +25,6 @@
|
|
|
25
25
|
"create-aziz-app": "bin/create-aziz-app.js"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
|
-
"preversion": "git add -A && (git diff --cached --quiet || git commit -m \"chore: pre-release changes\")",
|
|
29
|
-
"version": "git add -A",
|
|
30
28
|
"postversion": "git push && git push --tags",
|
|
31
29
|
"dev": "cd template && node scripts/dev-server.js"
|
|
32
30
|
}
|
|
@@ -209,9 +209,6 @@ export const router = {
|
|
|
209
209
|
// Find matching route
|
|
210
210
|
const match = resolveRoute(pathname);
|
|
211
211
|
|
|
212
|
-
// Find matching route
|
|
213
|
-
const match = resolveRoute(pathname);
|
|
214
|
-
|
|
215
212
|
if (!match) {
|
|
216
213
|
root.innerHTML = '';
|
|
217
214
|
const notFound = h('div', { style: { padding: '40px', textAlign: 'center' } },
|
|
@@ -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
|
-
|
|
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
|
}
|