create-laju-app 1.0.9 → 1.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.
Files changed (3) hide show
  1. package/README.md +322 -322
  2. package/bin/cli.js +90 -90
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,322 +1,322 @@
1
- # Laju
2
-
3
- A high-performance TypeScript web framework combining HyperExpress, Svelte 5, and Inertia.js for building modern full-stack applications. Features server-side rendering, real-time capabilities, and seamless client-server state management.
4
-
5
- Visit [laju.dev](https://laju.dev)
6
-
7
- ## Features
8
-
9
- - Fast server-side rendering with HyperExpress
10
- - Modern frontend with Svelte 5
11
- - TypeScript support for better type safety
12
- - Inertia.js integration for seamless client-server communication
13
- - Built-in authentication system
14
- - SQLite database with Knex query builder
15
- - Email support with Nodemailer
16
- - Google APIs integration
17
- - Redis caching support
18
- - Asset bundling with Vite
19
- - TailwindCSS for styling
20
-
21
- ## Prerequisites
22
-
23
- - Node.js (Latest LTS version recommended)
24
- - npm or yarn
25
- - Redis server (optional, for caching)
26
-
27
- ## Installation
28
-
29
- 1. Run the following command
30
- ```bash
31
- npx create-laju-app project-name
32
- ```
33
- 2. Open the project directory
34
- ```bash
35
- cd project-name
36
- ```
37
- 2. Install dependencies:
38
- ```bash
39
- npm install
40
- ```
41
- 4. Copy `.env.example` to `.env` and configure your environment variables:
42
- ```bash
43
- cp .env.example .env
44
- ```
45
-
46
- ## Development
47
-
48
- To start the development server:
49
-
50
- ```bash
51
- npm run dev
52
- ```
53
-
54
- This will:
55
- - Start the Vite development server for frontend assets
56
- - Run the backend server with nodemon for auto-reloading
57
-
58
- ## Building for Production
59
-
60
- To build the application for production:
61
-
62
- ```bash
63
- npm run build
64
- ```
65
-
66
- This command will:
67
- - Clean the build directory
68
- - Build frontend assets with Vite
69
- - Compile TypeScript files
70
- - Copy necessary files to the build directory
71
-
72
- ## Project Structure
73
-
74
- - `/app` - Core application files
75
- - `/middlewares` - Custom middleware functions
76
- - `/services` - Service layer implementations
77
- - `/controllers` - Application controllers
78
- - `/resources` - Frontend resources
79
- - `/views` - Svelte components and views
80
- - `/js` - JavaScript assets and modules
81
- - `/routes` - Route definitions
82
- - `/migrations` - Database migrations
83
- - `/public` - Static files
84
- - `/dist` - Compiled assets (generated)
85
- - `/build` - Production build output
86
-
87
- ## Key Dependencies
88
-
89
- ### Backend
90
- - HyperExpress - High-performance web server
91
- - Knex - SQL query builder
92
- - SQLite3 - Database
93
- - Nodemailer - Email sending
94
- - Redis - Caching (optional)
95
-
96
- ### Frontend
97
- - Svelte 5 - UI framework
98
- - Inertia.js - Client-server communication
99
- - TailwindCSS - Utility-first CSS framework
100
- - Vite - Build tool and dev server
101
-
102
- ## Scripts
103
-
104
- - `npm run dev` - Start development server
105
- - `npm run build` - Build for production
106
-
107
- ## Contributing
108
-
109
- 1. Fork the repository
110
- 2. Create your feature branch
111
- 3. Commit your changes
112
- 4. Push to the branch
113
- 5. Create a new Pull Request
114
-
115
- ## License
116
-
117
- ISC License
118
-
119
- ## Tutorial: Building Your First App
120
-
121
- This tutorial will guide you through building a simple application using this framework.
122
-
123
- ### 1. Setting Up a New Route and Controller
124
-
125
- First, let's create a new route and controller for a blog post feature.
126
-
127
- 1. Create a new controller file `app/controllers/PostController.ts`:
128
-
129
- ```typescript
130
- import { Request, Response } from "../../type";
131
- import DB from "../services/DB";
132
-
133
- class Controller {
134
- public async index(request: Request, response: Response) {
135
- const posts = await DB.from("posts");
136
- return response.inertia("posts/index", { posts });
137
- }
138
-
139
- public async create(request: Request, response: Response) {
140
- return response.inertia("posts/create");
141
- }
142
-
143
- public async store(request: Request, response: Response) {
144
- const { title, content } = request.body;
145
-
146
- await DB.table("posts").insert({
147
- title,
148
- content,
149
- created_at: Date.now(),
150
- updated_at: Date.now()
151
- });
152
-
153
- return response.redirect("/posts");
154
- }
155
- }
156
-
157
- export default new Controller();
158
- ```
159
-
160
- 2. Add routes in `routes/web.ts`:
161
-
162
- ```typescript
163
- import PostController from "../app/controllers/PostController";
164
-
165
- // Add these routes with your existing routes
166
- Route.get("/posts", PostController.index);
167
- Route.get("/posts/create", PostController.create);
168
- Route.post("/posts", PostController.store);
169
- ```
170
-
171
- ### 2. Creating the Database Migration
172
-
173
- Create a migration for the posts table:
174
-
175
- ```bash
176
- npx knex migrate:make create_posts_table
177
- ```
178
-
179
- In the generated migration file:
180
-
181
- ```typescript
182
- import { Knex } from "knex";
183
-
184
- export async function up(knex: Knex): Promise<void> {
185
- await knex.schema.createTable('posts', function (table) {
186
- table.increments('id').primary();
187
- table.string('title').notNullable();
188
- table.text('content').notNullable();
189
- table.bigInteger('created_at');
190
- table.bigInteger('updated_at');
191
- });
192
- }
193
-
194
- export async function down(knex: Knex): Promise<void> {
195
- await knex.schema.dropTable('posts');
196
- }
197
- ```
198
-
199
- Run the migration:
200
-
201
- ```bash
202
- npx knex migrate:latest
203
- ```
204
-
205
- ### 3. Creating Svelte Components
206
-
207
- 1. Create `resources/views/posts/index.svelte`:
208
-
209
- ```svelte
210
- <script>
211
- export let posts = [];
212
- </script>
213
-
214
- <div class="max-w-4xl mx-auto p-4">
215
- <div class="flex justify-between items-center mb-6">
216
- <h1 class="text-2xl font-bold">Blog Posts</h1>
217
- <a
218
- href="/posts/create"
219
- class="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600"
220
- >
221
- Create Post
222
- </a>
223
- </div>
224
-
225
- <div class="space-y-4">
226
- {#each posts as post}
227
- <div class="border p-4 rounded">
228
- <h2 class="text-xl font-semibold">{post.title}</h2>
229
- <p class="mt-2 text-gray-600">{post.content}</p>
230
- </div>
231
- {/each}
232
- </div>
233
- </div>
234
- ```
235
-
236
- 2. Create `resources/views/posts/create.svelte`:
237
-
238
- ```svelte
239
- <script>
240
- import { router } from '@inertiajs/svelte';
241
-
242
- let form = {
243
- title: '',
244
- content: ''
245
- };
246
-
247
- function handleSubmit() {
248
- router.post('/posts', form);
249
- }
250
- </script>
251
-
252
- <div class="max-w-4xl mx-auto p-4">
253
- <h1 class="text-2xl font-bold mb-6">Create New Post</h1>
254
-
255
- <form on:submit|preventDefault={handleSubmit} class="space-y-4">
256
- <div>
257
- <label class="block text-sm font-medium mb-1">Title</label>
258
- <input
259
- type="text"
260
- bind:value={form.title}
261
- class="w-full px-3 py-2 border rounded"
262
- />
263
- </div>
264
-
265
- <div>
266
- <label class="block text-sm font-medium mb-1">Content</label>
267
- <textarea
268
- bind:value={form.content}
269
- class="w-full px-3 py-2 border rounded h-32"
270
- ></textarea>
271
- </div>
272
-
273
- <div>
274
- <button
275
- type="submit"
276
- class="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600"
277
- >
278
- Create Post
279
- </button>
280
- </div>
281
- </form>
282
- </div>
283
- ```
284
-
285
- ### 4. Testing Your Application
286
-
287
- 1. Start the development server:
288
- ```bash
289
- npm run dev
290
- ```
291
-
292
- 2. Visit `http://localhost:5555/posts` in your browser
293
- 3. Try creating a new post using the form
294
- 4. View the list of posts on the index page
295
-
296
- ### Key Concepts
297
-
298
- 1. **Routing**: Routes are defined in `routes/web.ts` using the HyperExpress router
299
- 2. **Controllers**: Handle business logic and return Inertia responses
300
- 3. **Database**: Use Knex.js for database operations and migrations
301
- 4. **Frontend**: Svelte components with Inertia.js for seamless page transitions
302
- 5. **Styling**: TailwindCSS for utility-first styling
303
-
304
- ### Best Practices
305
-
306
- 1. **File Organization**
307
- - Keep controllers in `app/controllers`
308
- - Place Svelte components in `resources/views`
309
- - Database migrations in `migrations`
310
-
311
- 2. **Code Structure**
312
- - Use TypeScript types for better type safety
313
- - Keep controllers focused on single responsibilities
314
- - Use Inertia.js for state management between server and client
315
-
316
- 3. **Database**
317
- - Always use migrations for database changes
318
- - Use the Query Builder for complex queries
319
- - Include timestamps for tracking record changes
320
-
321
- Need help with anything specific? Feel free to ask!
322
-
1
+ # Laju
2
+
3
+ A high-performance TypeScript web framework combining HyperExpress, Svelte 5, and Inertia.js for building modern full-stack applications. Features server-side rendering, real-time capabilities, and seamless client-server state management.
4
+
5
+ Visit [laju.dev](https://laju.dev)
6
+
7
+ ## Features
8
+
9
+ - Fast server-side rendering with HyperExpress
10
+ - Modern frontend with Svelte 5
11
+ - TypeScript support for better type safety
12
+ - Inertia.js integration for seamless client-server communication
13
+ - Built-in authentication system
14
+ - SQLite database with Knex query builder
15
+ - Email support with Nodemailer
16
+ - Google APIs integration
17
+ - Redis caching support
18
+ - Asset bundling with Vite
19
+ - TailwindCSS for styling
20
+
21
+ ## Prerequisites
22
+
23
+ - Node.js (Latest LTS version recommended)
24
+ - npm or yarn
25
+ - Redis server (optional, for caching)
26
+
27
+ ## Installation
28
+
29
+ 1. Run the following command
30
+ ```bash
31
+ npx create-laju-app project-name
32
+ ```
33
+ 2. Open the project directory
34
+ ```bash
35
+ cd project-name
36
+ ```
37
+ 2. Install dependencies:
38
+ ```bash
39
+ npm install
40
+ ```
41
+ 4. Copy `.env.example` to `.env` and configure your environment variables:
42
+ ```bash
43
+ cp .env.example .env
44
+ ```
45
+
46
+ ## Development
47
+
48
+ To start the development server:
49
+
50
+ ```bash
51
+ npm run dev
52
+ ```
53
+
54
+ This will:
55
+ - Start the Vite development server for frontend assets
56
+ - Run the backend server with nodemon for auto-reloading
57
+
58
+ ## Building for Production
59
+
60
+ To build the application for production:
61
+
62
+ ```bash
63
+ npm run build
64
+ ```
65
+
66
+ This command will:
67
+ - Clean the build directory
68
+ - Build frontend assets with Vite
69
+ - Compile TypeScript files
70
+ - Copy necessary files to the build directory
71
+
72
+ ## Project Structure
73
+
74
+ - `/app` - Core application files
75
+ - `/middlewares` - Custom middleware functions
76
+ - `/services` - Service layer implementations
77
+ - `/controllers` - Application controllers
78
+ - `/resources` - Frontend resources
79
+ - `/views` - Svelte components and views
80
+ - `/js` - JavaScript assets and modules
81
+ - `/routes` - Route definitions
82
+ - `/migrations` - Database migrations
83
+ - `/public` - Static files
84
+ - `/dist` - Compiled assets (generated)
85
+ - `/build` - Production build output
86
+
87
+ ## Key Dependencies
88
+
89
+ ### Backend
90
+ - HyperExpress - High-performance web server
91
+ - Knex - SQL query builder
92
+ - SQLite3 - Database
93
+ - Nodemailer - Email sending
94
+ - Redis - Caching (optional)
95
+
96
+ ### Frontend
97
+ - Svelte 5 - UI framework
98
+ - Inertia.js - Client-server communication
99
+ - TailwindCSS - Utility-first CSS framework
100
+ - Vite - Build tool and dev server
101
+
102
+ ## Scripts
103
+
104
+ - `npm run dev` - Start development server
105
+ - `npm run build` - Build for production
106
+
107
+ ## Contributing
108
+
109
+ 1. Fork the repository
110
+ 2. Create your feature branch
111
+ 3. Commit your changes
112
+ 4. Push to the branch
113
+ 5. Create a new Pull Request
114
+
115
+ ## License
116
+
117
+ ISC License
118
+
119
+ ## Tutorial: Building Your First App
120
+
121
+ This tutorial will guide you through building a simple application using this framework.
122
+
123
+ ### 1. Setting Up a New Route and Controller
124
+
125
+ First, let's create a new route and controller for a blog post feature.
126
+
127
+ 1. Create a new controller file `app/controllers/PostController.ts`:
128
+
129
+ ```typescript
130
+ import { Request, Response } from "../../type";
131
+ import DB from "../services/DB";
132
+
133
+ class Controller {
134
+ public async index(request: Request, response: Response) {
135
+ const posts = await DB.from("posts");
136
+ return response.inertia("posts/index", { posts });
137
+ }
138
+
139
+ public async create(request: Request, response: Response) {
140
+ return response.inertia("posts/create");
141
+ }
142
+
143
+ public async store(request: Request, response: Response) {
144
+ const { title, content } = request.body;
145
+
146
+ await DB.table("posts").insert({
147
+ title,
148
+ content,
149
+ created_at: Date.now(),
150
+ updated_at: Date.now()
151
+ });
152
+
153
+ return response.redirect("/posts");
154
+ }
155
+ }
156
+
157
+ export default new Controller();
158
+ ```
159
+
160
+ 2. Add routes in `routes/web.ts`:
161
+
162
+ ```typescript
163
+ import PostController from "../app/controllers/PostController";
164
+
165
+ // Add these routes with your existing routes
166
+ Route.get("/posts", PostController.index);
167
+ Route.get("/posts/create", PostController.create);
168
+ Route.post("/posts", PostController.store);
169
+ ```
170
+
171
+ ### 2. Creating the Database Migration
172
+
173
+ Create a migration for the posts table:
174
+
175
+ ```bash
176
+ npx knex migrate:make create_posts_table
177
+ ```
178
+
179
+ In the generated migration file:
180
+
181
+ ```typescript
182
+ import { Knex } from "knex";
183
+
184
+ export async function up(knex: Knex): Promise<void> {
185
+ await knex.schema.createTable('posts', function (table) {
186
+ table.increments('id').primary();
187
+ table.string('title').notNullable();
188
+ table.text('content').notNullable();
189
+ table.bigInteger('created_at');
190
+ table.bigInteger('updated_at');
191
+ });
192
+ }
193
+
194
+ export async function down(knex: Knex): Promise<void> {
195
+ await knex.schema.dropTable('posts');
196
+ }
197
+ ```
198
+
199
+ Run the migration:
200
+
201
+ ```bash
202
+ npx knex migrate:latest
203
+ ```
204
+
205
+ ### 3. Creating Svelte Components
206
+
207
+ 1. Create `resources/views/posts/index.svelte`:
208
+
209
+ ```svelte
210
+ <script>
211
+ export let posts = [];
212
+ </script>
213
+
214
+ <div class="max-w-4xl mx-auto p-4">
215
+ <div class="flex justify-between items-center mb-6">
216
+ <h1 class="text-2xl font-bold">Blog Posts</h1>
217
+ <a
218
+ href="/posts/create"
219
+ class="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600"
220
+ >
221
+ Create Post
222
+ </a>
223
+ </div>
224
+
225
+ <div class="space-y-4">
226
+ {#each posts as post}
227
+ <div class="border p-4 rounded">
228
+ <h2 class="text-xl font-semibold">{post.title}</h2>
229
+ <p class="mt-2 text-gray-600">{post.content}</p>
230
+ </div>
231
+ {/each}
232
+ </div>
233
+ </div>
234
+ ```
235
+
236
+ 2. Create `resources/views/posts/create.svelte`:
237
+
238
+ ```svelte
239
+ <script>
240
+ import { router } from '@inertiajs/svelte';
241
+
242
+ let form = {
243
+ title: '',
244
+ content: ''
245
+ };
246
+
247
+ function handleSubmit() {
248
+ router.post('/posts', form);
249
+ }
250
+ </script>
251
+
252
+ <div class="max-w-4xl mx-auto p-4">
253
+ <h1 class="text-2xl font-bold mb-6">Create New Post</h1>
254
+
255
+ <form on:submit|preventDefault={handleSubmit} class="space-y-4">
256
+ <div>
257
+ <label class="block text-sm font-medium mb-1">Title</label>
258
+ <input
259
+ type="text"
260
+ bind:value={form.title}
261
+ class="w-full px-3 py-2 border rounded"
262
+ />
263
+ </div>
264
+
265
+ <div>
266
+ <label class="block text-sm font-medium mb-1">Content</label>
267
+ <textarea
268
+ bind:value={form.content}
269
+ class="w-full px-3 py-2 border rounded h-32"
270
+ ></textarea>
271
+ </div>
272
+
273
+ <div>
274
+ <button
275
+ type="submit"
276
+ class="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600"
277
+ >
278
+ Create Post
279
+ </button>
280
+ </div>
281
+ </form>
282
+ </div>
283
+ ```
284
+
285
+ ### 4. Testing Your Application
286
+
287
+ 1. Start the development server:
288
+ ```bash
289
+ npm run dev
290
+ ```
291
+
292
+ 2. Visit `http://localhost:5555/posts` in your browser
293
+ 3. Try creating a new post using the form
294
+ 4. View the list of posts on the index page
295
+
296
+ ### Key Concepts
297
+
298
+ 1. **Routing**: Routes are defined in `routes/web.ts` using the HyperExpress router
299
+ 2. **Controllers**: Handle business logic and return Inertia responses
300
+ 3. **Database**: Use Knex.js for database operations and migrations
301
+ 4. **Frontend**: Svelte components with Inertia.js for seamless page transitions
302
+ 5. **Styling**: TailwindCSS for utility-first styling
303
+
304
+ ### Best Practices
305
+
306
+ 1. **File Organization**
307
+ - Keep controllers in `app/controllers`
308
+ - Place Svelte components in `resources/views`
309
+ - Database migrations in `migrations`
310
+
311
+ 2. **Code Structure**
312
+ - Use TypeScript types for better type safety
313
+ - Keep controllers focused on single responsibilities
314
+ - Use Inertia.js for state management between server and client
315
+
316
+ 3. **Database**
317
+ - Always use migrations for database changes
318
+ - Use the Query Builder for complex queries
319
+ - Include timestamps for tracking record changes
320
+
321
+ Need help with anything specific? Feel free to ask!
322
+
package/bin/cli.js CHANGED
@@ -1,91 +1,91 @@
1
- #!/usr/bin/env node
2
-
3
- const { program } = require('commander');
4
- const prompts = require('prompts');
5
- const degit = require('degit');
6
- const path = require('path');
7
- const fs = require('fs');
8
- const { execSync } = require('child_process');
9
-
10
- program
11
- .name('create-laju-app')
12
- .description('CLI to create a new project from template')
13
- .version('1.0.0');
14
-
15
- program
16
- .argument('[project-directory]', 'Project directory name')
17
- .action(async (projectDirectory) => {
18
- try {
19
- // If no project name, ask user
20
- if (!projectDirectory) {
21
- const response = await prompts({
22
- type: 'text',
23
- name: 'projectDirectory',
24
- message: 'Enter project name:'
25
- });
26
- projectDirectory = response.projectDirectory;
27
- }
28
-
29
- if (!projectDirectory) {
30
- console.log('Project name is required to continue.');
31
- process.exit(1);
32
- }
33
-
34
- const targetPath = path.resolve(projectDirectory);
35
-
36
- // Check if directory exists
37
- if (fs.existsSync(targetPath)) {
38
- console.log(`Directory ${projectDirectory} already exists. Choose another name.`);
39
- process.exit(1);
40
- }
41
-
42
- console.log(`Creating a new project in ${targetPath}...`);
43
-
44
- // Clone template from GitHub
45
- const emitter = degit('maulanashalihin/laju');
46
-
47
- await emitter.clone(targetPath);
48
-
49
- // Read package.json from template
50
- const packageJsonPath = path.join(targetPath, 'package.json');
51
- const packageJson = require(packageJsonPath);
52
-
53
- // Update project name in package.json
54
- packageJson.name = projectDirectory;
55
-
56
- // Write back package.json
57
- fs.writeFileSync(
58
- packageJsonPath,
59
- JSON.stringify(packageJson, null, 2)
60
- );
61
-
62
- // Change directory and run setup commands
63
- process.chdir(targetPath);
64
- console.log('📦 Installing dependencies...');
65
- execSync('npm install', { stdio: 'inherit' });
66
- console.log('📝 Copying environment file...');
67
-
68
- execSync(process.platform === 'win32' ? 'copy .env.example .env' : 'cp .env.example .env', { stdio: 'inherit' });
69
- console.log('🔄 Running migrations...');
70
- execSync('npx knex migrate:latest', { stdio: 'inherit' });
71
- console.log('🎉 Project created successfully!');
72
- console.log('');
73
- console.log('🚀 Your project is ready! You can now start developing.');
74
-
75
- console.log('');
76
- console.log('👉 Next steps:');
77
- console.log('📁 cd ' + targetPath);
78
- console.log('🔥 npm run dev to start the development server.');
79
- console.log('📦 npm run build to build the production files.');
80
- console.log('');
81
- console.log('� Build Faster with Laju - Happy Coding!');
82
-
83
-
84
-
85
- } catch (error) {
86
- console.error('Error:', error.message);
87
- process.exit(1);
88
- }
89
- });
90
-
1
+ #!/usr/bin/env node
2
+
3
+ const { program } = require('commander');
4
+ const prompts = require('prompts');
5
+ const degit = require('degit');
6
+ const path = require('path');
7
+ const fs = require('fs');
8
+ const { execSync } = require('child_process');
9
+
10
+ program
11
+ .name('create-laju-app')
12
+ .description('CLI to create a new project from template')
13
+ .version('1.0.0');
14
+
15
+ program
16
+ .argument('[project-directory]', 'Project directory name')
17
+ .action(async (projectDirectory) => {
18
+ try {
19
+ // If no project name, ask user
20
+ if (!projectDirectory) {
21
+ const response = await prompts({
22
+ type: 'text',
23
+ name: 'projectDirectory',
24
+ message: 'Enter project name:'
25
+ });
26
+ projectDirectory = response.projectDirectory;
27
+ }
28
+
29
+ if (!projectDirectory) {
30
+ console.log('Project name is required to continue.');
31
+ process.exit(1);
32
+ }
33
+
34
+ const targetPath = path.resolve(projectDirectory);
35
+
36
+ // Check if directory exists
37
+ if (fs.existsSync(targetPath)) {
38
+ console.log(`Directory ${projectDirectory} already exists. Choose another name.`);
39
+ process.exit(1);
40
+ }
41
+
42
+ console.log(`Creating a new project in ${targetPath}...`);
43
+
44
+ // Clone template from GitHub
45
+ const emitter = degit('maulanashalihin/laju');
46
+
47
+ await emitter.clone(targetPath);
48
+
49
+ // Read package.json from template
50
+ const packageJsonPath = path.join(targetPath, 'package.json');
51
+ const packageJson = require(packageJsonPath);
52
+
53
+ // Update project name in package.json
54
+ packageJson.name = projectDirectory;
55
+
56
+ // Write back package.json
57
+ fs.writeFileSync(
58
+ packageJsonPath,
59
+ JSON.stringify(packageJson, null, 2)
60
+ );
61
+
62
+ // Change directory and run setup commands
63
+ process.chdir(targetPath);
64
+ console.log('📦 Installing dependencies...');
65
+ execSync('npm install', { stdio: 'inherit' });
66
+ console.log('📝 Copying environment file...');
67
+
68
+ execSync(process.platform === 'win32' ? 'copy .env.example .env' : 'cp .env.example .env', { stdio: 'inherit' });
69
+ console.log('🔄 Running migrations...');
70
+ execSync('npx knex migrate:latest', { stdio: 'inherit' });
71
+ console.log('🎉 Project created successfully!');
72
+ console.log('');
73
+ console.log('🚀 Your project is ready! You can now start developing.');
74
+
75
+ console.log('');
76
+ console.log('👉 Next steps:');
77
+ console.log('📁 cd ' + projectDirectory);
78
+ console.log('🔥 npm run dev to start the development server.');
79
+ console.log('📦 npm run build to build the production files.');
80
+ console.log('');
81
+
82
+
83
+
84
+
85
+ } catch (error) {
86
+ console.error('Error:', error.message);
87
+ process.exit(1);
88
+ }
89
+ });
90
+
91
91
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-laju-app",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "keywords": [
5
5
  "laju",
6
6
  "svelte",