create-vorzelajs 0.0.8 → 0.0.10
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/dist/index.js
CHANGED
|
@@ -31,6 +31,13 @@ async function pathExists(p) {
|
|
|
31
31
|
return false;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
+
function generateViteConfig(config) {
|
|
35
|
+
const optionsArg = config.pwa ? ', { pwa: true }' : '';
|
|
36
|
+
return `import { resolveVorzelaConfig } from 'vorzelajs/vite'
|
|
37
|
+
|
|
38
|
+
export default resolveVorzelaConfig(import.meta.dirname${optionsArg})
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
34
41
|
function generatePackageJson(config) {
|
|
35
42
|
const pkg = {
|
|
36
43
|
name: config.name,
|
|
@@ -43,7 +50,7 @@ function generatePackageJson(config) {
|
|
|
43
50
|
check: 'tsc --noEmit',
|
|
44
51
|
},
|
|
45
52
|
dependencies: {
|
|
46
|
-
vorzelajs: '^0.0.
|
|
53
|
+
vorzelajs: '^0.0.9',
|
|
47
54
|
'solid-js': '^1.9',
|
|
48
55
|
},
|
|
49
56
|
devDependencies: {
|
|
@@ -86,6 +93,14 @@ async function main() {
|
|
|
86
93
|
],
|
|
87
94
|
initial: 0,
|
|
88
95
|
},
|
|
96
|
+
{
|
|
97
|
+
type: 'toggle',
|
|
98
|
+
name: 'pwa',
|
|
99
|
+
message: 'Enable PWA?',
|
|
100
|
+
initial: false,
|
|
101
|
+
active: 'Yes',
|
|
102
|
+
inactive: 'No',
|
|
103
|
+
},
|
|
89
104
|
], {
|
|
90
105
|
onCancel() {
|
|
91
106
|
console.info('\nCancelled.');
|
|
@@ -94,6 +109,7 @@ async function main() {
|
|
|
94
109
|
});
|
|
95
110
|
const config = {
|
|
96
111
|
name: argProjectName ?? response.name ?? 'my-app',
|
|
112
|
+
pwa: response.pwa ?? false,
|
|
97
113
|
template: response.template ?? 'modern',
|
|
98
114
|
styling: response.styling ?? 'tailwindcss',
|
|
99
115
|
};
|
|
@@ -121,6 +137,8 @@ async function main() {
|
|
|
121
137
|
await fs.copyFile(stylesSource, stylesDest);
|
|
122
138
|
// 4. Generate package.json
|
|
123
139
|
await fs.writeFile(path.join(targetDir, 'package.json'), generatePackageJson(config));
|
|
140
|
+
// 5. Generate vite.config.ts
|
|
141
|
+
await fs.writeFile(path.join(targetDir, 'vite.config.ts'), generateViteConfig(config));
|
|
124
142
|
console.info(`\nDone! Next steps:\n`);
|
|
125
143
|
console.info(` cd ${config.name}`);
|
|
126
144
|
console.info(` npm install`);
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|