create-what 0.1.3 → 0.3.0
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/index.js +16 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -46,15 +46,23 @@ const dirs = [
|
|
|
46
46
|
];
|
|
47
47
|
dirs.forEach(d => mkdirSync(join(root, d), { recursive: true }));
|
|
48
48
|
|
|
49
|
+
// --- .gitignore ---
|
|
50
|
+
writeFileSync(join(root, '.gitignore'), `node_modules
|
|
51
|
+
dist
|
|
52
|
+
.vite
|
|
53
|
+
.DS_Store
|
|
54
|
+
*.local
|
|
55
|
+
`);
|
|
56
|
+
|
|
49
57
|
// --- package.json ---
|
|
50
58
|
const pkgDeps = {
|
|
51
|
-
'what-framework': '^0.
|
|
59
|
+
'what-framework': '^0.3.0',
|
|
52
60
|
'what-framework-cli': '^0.1.0',
|
|
53
61
|
};
|
|
54
62
|
|
|
55
63
|
const pkgDevDeps = useJSX
|
|
56
64
|
? {
|
|
57
|
-
'what-compiler': '^0.
|
|
65
|
+
'what-compiler': '^0.3.0',
|
|
58
66
|
'@babel/core': '^7.23.0',
|
|
59
67
|
'vite': '^5.0.0',
|
|
60
68
|
}
|
|
@@ -131,7 +139,7 @@ writeFileSync(join(root, 'index.html'), `<!DOCTYPE html>
|
|
|
131
139
|
if (useJSX) {
|
|
132
140
|
|
|
133
141
|
// --- src/app.jsx ---
|
|
134
|
-
writeFileSync(join(root, 'src/app.jsx'), `import { mount
|
|
142
|
+
writeFileSync(join(root, 'src/app.jsx'), `import { mount } from 'what-framework';
|
|
135
143
|
import { Router, Link, defineRoutes } from 'what-framework/router';
|
|
136
144
|
import { Layout } from './layouts/main.jsx';
|
|
137
145
|
import { Home } from './pages/index.jsx';
|
|
@@ -443,10 +451,12 @@ ${useJSX ? ' vite.config.js # Vite + what-compiler plugin\n' : ''} package.
|
|
|
443
451
|
## Learn More
|
|
444
452
|
|
|
445
453
|
- [What Framework docs](https://github.com/aspect/what-fw)
|
|
446
|
-
- JSX authoring: uses \`what-compiler\` to
|
|
454
|
+
- JSX authoring: uses \`what-compiler\` to compile JSX to h() calls through the core reconciler
|
|
447
455
|
- Vanilla authoring: use \`h(tag, props, ...children)\` directly -- zero build step needed
|
|
448
456
|
`);
|
|
449
457
|
|
|
458
|
+
// --- styles.css (move from public/ to root for Vite) ---
|
|
459
|
+
|
|
450
460
|
// --- Done ---
|
|
451
461
|
console.log(` Done! Next steps:\n`);
|
|
452
462
|
console.log(` cd ${name}`);
|
|
@@ -455,7 +465,8 @@ console.log(` npm run dev\n`);
|
|
|
455
465
|
|
|
456
466
|
if (useJSX) {
|
|
457
467
|
console.log(` JSX mode enabled. Components use .jsx extensions.`);
|
|
458
|
-
console.log(` The what-compiler Vite plugin
|
|
468
|
+
console.log(` The what-compiler Vite plugin compiles JSX to h() calls.`);
|
|
469
|
+
console.log(` Open http://localhost:5173 after running dev.\n`);
|
|
459
470
|
} else {
|
|
460
471
|
console.log(` Vanilla mode. Components use h() calls -- no compiler needed.\n`);
|
|
461
472
|
}
|