create-dalila 1.1.8 → 1.1.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/README.md CHANGED
@@ -16,7 +16,7 @@ Open http://localhost:4242 to see your app.
16
16
  ## What's Included
17
17
 
18
18
  - Counter example with signals and computed values
19
- - Hot reload development server
19
+ - Hot reload development server + route generation watcher
20
20
  - TypeScript support out of the box
21
21
  - Minimal CSS styling
22
22
 
@@ -34,7 +34,7 @@ my-app/
34
34
 
35
35
  ## Scripts
36
36
 
37
- - `npm run dev` - Start development server
37
+ - `npm run dev` - Start dev server and route watcher
38
38
  - `npm run build` - Compile TypeScript
39
39
 
40
40
  ## Learn More
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-dalila",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
4
4
  "description": "Create Dalila apps with one command",
5
5
  "bin": {
6
6
  "create-dalila": "index.js"
@@ -0,0 +1,32 @@
1
+ import { spawn } from 'node:child_process';
2
+
3
+ const procs = [];
4
+
5
+ function run(cmd, args) {
6
+ const proc = spawn(cmd, args, {
7
+ stdio: 'inherit',
8
+ shell: true,
9
+ });
10
+
11
+ procs.push(proc);
12
+
13
+ proc.on('exit', (code) => {
14
+ if (code !== 0 && code !== null) {
15
+ process.exit(code);
16
+ }
17
+ });
18
+
19
+ return proc;
20
+ }
21
+
22
+ run('dalila', ['routes', 'watch']);
23
+ run('dalila-dev', []);
24
+
25
+ function shutdown() {
26
+ for (const proc of procs) {
27
+ proc.kill('SIGINT');
28
+ }
29
+ }
30
+
31
+ process.on('SIGINT', shutdown);
32
+ process.on('SIGTERM', shutdown);
@@ -4,7 +4,7 @@
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
7
- "dev": "dalila-dev",
7
+ "dev": "node dev.mjs",
8
8
  "routes": "dalila routes generate",
9
9
  "routes:watch": "dalila routes watch",
10
10
  "build": "tsc",
@@ -15,7 +15,6 @@
15
15
  "dalila": "latest"
16
16
  },
17
17
  "devDependencies": {
18
- "chokidar": "^3.6.0",
19
18
  "typescript": "^5.7.3"
20
19
  }
21
20
  }