create-laju-app 1.1.5 → 1.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/README.md +2 -1
- package/bin/cli.js +43 -0
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -24,6 +24,7 @@ npx create-laju-app <project-name> [options]
|
|
|
24
24
|
| Option | Description | Default |
|
|
25
25
|
|--------|-------------|---------|
|
|
26
26
|
| `--package-manager` | Package manager to use (npm, yarn, bun) | Auto-detect |
|
|
27
|
+
| `--tailwind` | TailwindCSS version to use (v3, v4) | Prompt (defaults to v4) |
|
|
27
28
|
|
|
28
29
|
## What's Included
|
|
29
30
|
|
|
@@ -32,7 +33,7 @@ The created project includes:
|
|
|
32
33
|
- **Laju Framework** - High-performance TypeScript web framework
|
|
33
34
|
- **Svelte 5** - Reactive UI with runes
|
|
34
35
|
- **Inertia.js** - SPA without client-side routing
|
|
35
|
-
- **TailwindCSS
|
|
36
|
+
- **TailwindCSS** - Utility-first CSS with Vite (v4 or v3)
|
|
36
37
|
- **Database** - SQLite + Knex.js migrations
|
|
37
38
|
- **Authentication** - Session-based auth + OAuth (Google)
|
|
38
39
|
- **Storage** - S3/Wasabi support with presigned URLs
|
package/bin/cli.js
CHANGED
|
@@ -106,9 +106,27 @@ program
|
|
|
106
106
|
.description('CLI to create a new project from template')
|
|
107
107
|
.version('1.0.0');
|
|
108
108
|
|
|
109
|
+
async function selectTailwindVersion() {
|
|
110
|
+
console.log('');
|
|
111
|
+
console.log('\x1b[36m Which TailwindCSS version would you like to use?\x1b[0m');
|
|
112
|
+
|
|
113
|
+
const response = await prompts({
|
|
114
|
+
type: 'select',
|
|
115
|
+
name: 'tailwindVersion',
|
|
116
|
+
message: '',
|
|
117
|
+
choices: [
|
|
118
|
+
{ title: 'TailwindCSS 4 (latest ✓)', value: 'v4' },
|
|
119
|
+
{ title: 'TailwindCSS 3 (stable)', value: 'v3' }
|
|
120
|
+
]
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
return response.tailwindVersion || 'v4';
|
|
124
|
+
}
|
|
125
|
+
|
|
109
126
|
program
|
|
110
127
|
.argument('[project-directory]', 'Project directory name')
|
|
111
128
|
.option('--package-manager <pm>', 'Package manager to use (npm, yarn, bun)')
|
|
129
|
+
.option('--tailwind <version>', 'TailwindCSS version to use (v3, v4)')
|
|
112
130
|
.action(async (projectDirectory, options) => {
|
|
113
131
|
try {
|
|
114
132
|
console.log('');
|
|
@@ -130,6 +148,20 @@ program
|
|
|
130
148
|
console.log('\x1b[36m Using ' + packageManager + '\x1b[0m');
|
|
131
149
|
console.log('');
|
|
132
150
|
|
|
151
|
+
// Select TailwindCSS version (default to v4 if not specified)
|
|
152
|
+
let tailwindVersion;
|
|
153
|
+
if (options.tailwind) {
|
|
154
|
+
tailwindVersion = options.tailwind;
|
|
155
|
+
if (!['v3', 'v4'].includes(tailwindVersion)) {
|
|
156
|
+
console.log('\x1b[1;31m✖\x1b[0m \x1b[1;91mError:\x1b[0m Invalid TailwindCSS version. Use v3 or v4.');
|
|
157
|
+
process.exit(1);
|
|
158
|
+
}
|
|
159
|
+
} else {
|
|
160
|
+
tailwindVersion = await selectTailwindVersion();
|
|
161
|
+
}
|
|
162
|
+
console.log('\x1b[36m Using TailwindCSS ' + tailwindVersion + '\x1b[0m');
|
|
163
|
+
console.log('');
|
|
164
|
+
|
|
133
165
|
// If no project name, ask user
|
|
134
166
|
if (!projectDirectory) {
|
|
135
167
|
console.log('\x1b[36m Project name:\x1b[0m');
|
|
@@ -191,6 +223,9 @@ program
|
|
|
191
223
|
// Update project name in package.json
|
|
192
224
|
packageJson.name = projectDirectory;
|
|
193
225
|
|
|
226
|
+
// Reset version to 0.0.1 for new project
|
|
227
|
+
packageJson.version = '0.0.1';
|
|
228
|
+
|
|
194
229
|
// Write back package.json
|
|
195
230
|
fs.writeFileSync(
|
|
196
231
|
packageJsonPath,
|
|
@@ -216,6 +251,14 @@ program
|
|
|
216
251
|
console.log('\x1b[36m Preparing database...\x1b[0m');
|
|
217
252
|
execSync('npm run refresh 1', { stdio: 'inherit', timeout: 60000 });
|
|
218
253
|
console.log('\x1b[32m ✓ Database ready\x1b[0m');
|
|
254
|
+
|
|
255
|
+
// Migrate to TailwindCSS v4 if selected
|
|
256
|
+
if (tailwindVersion === 'v4') {
|
|
257
|
+
console.log('');
|
|
258
|
+
console.log('\x1b[36m Migrating to TailwindCSS v4...\x1b[0m');
|
|
259
|
+
execSync('npm run tailwind:migrate to-v4', { stdio: 'inherit', timeout: 60000 });
|
|
260
|
+
console.log('\x1b[32m ✓ TailwindCSS v4 ready\x1b[0m');
|
|
261
|
+
}
|
|
219
262
|
} finally {
|
|
220
263
|
process.chdir(originalDir);
|
|
221
264
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-laju-app",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "CLI tool to scaffold new Laju framework projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"laju",
|
|
@@ -34,6 +34,10 @@
|
|
|
34
34
|
"README.md",
|
|
35
35
|
"LICENSE"
|
|
36
36
|
],
|
|
37
|
+
"type": "commonjs",
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
37
41
|
"dependencies": {
|
|
38
42
|
"commander": "^11.0.0",
|
|
39
43
|
"degit": "^2.8.4",
|