laracrew 0.1.1 → 0.2.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.
@@ -76,4 +76,10 @@ here, it stops when the rest of the stack stops.
76
76
  mis-split on a path containing spaces the way a shell string can.
77
77
 
78
78
  **A gate with nothing to start is fine.** An `external: true` service is just a health check, so
79
- it can stand in as a named wait step — see `kafka-wait` in the microservices example.
79
+ it can stand in as a named wait step — see `kafka-wait` in the microservices example. `laracrew
80
+ doctor` probes those gates before boot, so declaring your Postgres and Redis this way is also how
81
+ you get them checked.
82
+
83
+ **The Laravel checks only apply to Laravel.** `doctor` works out which projects actually run PHP
84
+ and which actually talk to Redis, from the commands they declare and the `.env` they read. A
85
+ Django or Node stack gets the port and dependency checks and none of the PHP ones.
@@ -61,6 +61,11 @@ services:
61
61
  env:
62
62
  PYTHONUNBUFFERED: "1"
63
63
  ready: { logMatch: "ready\\.$|celery@.* ready", timeoutMs: 30000 }
64
+ # The Celery equivalent of `artisan queue:restart`: ask the worker to finish the task it
65
+ # holds and exit by itself. Only if it is still there after 25s does laracrew signal it.
66
+ stop:
67
+ exec: [".venv/bin/celery", "-A", "bookstore", "control", "shutdown"]
68
+ graceMs: 25000
64
69
 
65
70
  - name: celery:beat
66
71
  project: app
@@ -64,8 +64,11 @@ services:
64
64
  cmd: ["npm", "run", "worker"] # BullMQ / Bee-Queue consumer
65
65
  groups: [backend, workers]
66
66
  needs: [redis, types:build]
67
- # Give an in-flight job a moment to settle before the process is taken down.
68
- stop: { graceMs: 10000 }
67
+ # Same deal as a Laravel queue worker: ask it to drain, give it 10s, then escalate.
68
+ # The script closes the BullMQ worker and exits once the current job is acked.
69
+ stop:
70
+ exec: ["npm", "run", "worker:drain"]
71
+ graceMs: 10000
69
72
 
70
73
  - name: web
71
74
  project: web
@@ -44,8 +44,10 @@ services:
44
44
  groups: [infra]
45
45
  # Ready when every port we depend on is actually accepting connections.
46
46
  ready: { tcp: "127.0.0.1:5432", timeoutMs: 120000, intervalMs: 1000 }
47
- # Compose needs time to stop its own containers cleanly.
48
- stop: { graceMs: 30000 }
47
+ # Let Compose stop its own containers the way it wants to, before anything is killed.
48
+ stop:
49
+ exec: ["docker", "compose", "stop"]
50
+ graceMs: 30000
49
51
 
50
52
  - name: kafka-wait
51
53
  external: true # nothing to start; this row exists purely as a gate
package/package.json CHANGED
@@ -1,55 +1,63 @@
1
- {
2
- "name": "laracrew",
3
- "version": "0.1.1",
4
- "description": "Boot and supervise all the long-running processes of your Laravel projects with one command.",
5
- "keywords": [
6
- "laravel",
7
- "cli",
8
- "tui",
9
- "queue",
10
- "horizon",
11
- "redis",
12
- "process-manager",
13
- "dev-tools"
14
- ],
15
- "license": "MIT",
16
- "type": "module",
17
- "engines": {
18
- "node": ">=20"
19
- },
20
- "bin": {
21
- "laracrew": "./dist/index.js"
22
- },
23
- "exports": {
24
- ".": "./dist/index.js",
25
- "./package.json": "./package.json"
26
- },
27
- "files": [
28
- "dist",
29
- "examples",
30
- "CHANGELOG.md"
31
- ],
32
- "sideEffects": false,
33
- "scripts": {
34
- "build": "tsup",
35
- "dev": "tsx src/index.ts",
36
- "test": "vitest run",
37
- "test:watch": "vitest",
38
- "typecheck": "tsc --noEmit",
39
- "prepublishOnly": "npm run typecheck && npm test && npm run build",
40
- "prepack": "npm run build"
41
- },
42
- "dependencies": {
43
- "commander": "^12.1.0",
44
- "yaml": "^2.5.1",
45
- "zod": "^3.23.8"
46
- },
47
- "devDependencies": {
48
- "@types/node": "^22.7.4",
49
- "tsup": "^8.3.0",
50
- "tsx": "^4.19.1",
51
- "typescript": "^5.6.2",
52
- "vitest": "^2.1.1"
53
- },
54
- "author": "viduranga <https://github.com/vidux>"
55
- }
1
+ {
2
+ "name": "laracrew",
3
+ "version": "0.2.0",
4
+ "description": "Boot and supervise all the long-running processes of your projects with one command. Laravel-aware, works with anything.",
5
+ "keywords": [
6
+ "laravel",
7
+ "cli",
8
+ "tui",
9
+ "queue",
10
+ "horizon",
11
+ "redis",
12
+ "process-manager",
13
+ "dev-tools"
14
+ ],
15
+ "license": "MIT",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/vidux/laracrew.git"
19
+ },
20
+ "homepage": "https://github.com/vidux/laracrew#readme",
21
+ "bugs": {
22
+ "url": "https://github.com/vidux/laracrew/issues"
23
+ },
24
+ "type": "module",
25
+ "engines": {
26
+ "node": ">=20"
27
+ },
28
+ "bin": {
29
+ "laracrew": "./dist/index.js"
30
+ },
31
+ "exports": {
32
+ ".": "./dist/index.js",
33
+ "./package.json": "./package.json"
34
+ },
35
+ "files": [
36
+ "dist",
37
+ "examples",
38
+ "CHANGELOG.md"
39
+ ],
40
+ "sideEffects": false,
41
+ "scripts": {
42
+ "build": "tsup",
43
+ "dev": "tsx src/index.ts",
44
+ "test": "vitest run",
45
+ "test:watch": "vitest",
46
+ "typecheck": "tsc --noEmit",
47
+ "prepublishOnly": "npm run typecheck && npm test && npm run build",
48
+ "prepack": "npm run build"
49
+ },
50
+ "dependencies": {
51
+ "commander": "^12.1.0",
52
+ "yaml": "^2.5.1",
53
+ "zod": "^3.23.8"
54
+ },
55
+ "devDependencies": {
56
+ "@types/node": "^22.7.4",
57
+ "tsup": "^8.3.0",
58
+ "tsx": "^4.19.1",
59
+ "typescript": "^5.6.2",
60
+ "vitest": "^2.1.1"
61
+ },
62
+ "author": "viduranga <https://github.com/vidux>"
63
+ }