laracrew 0.2.2 → 0.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/CHANGELOG.md CHANGED
@@ -17,6 +17,34 @@ Planned, in order — see `.claude/PLAN.md`:
17
17
  - `laracrew run <task>` for one-shot cross-project sequences
18
18
  - Background daemon: `up --detach`, `attach`, `status`, `logs -f`
19
19
 
20
+ ## [0.3.0] — 2026-09-30
21
+
22
+ ### Added
23
+
24
+ - **`laracrew draft`: build a stack without writing YAML.** `laracrew draft dual` starts
25
+ `dual.laracrew.yaml` in the current folder. `laracrew draft add --project api --path D:/work/api
26
+ --command "php artisan queue:work"` appends a service; the project's path is remembered after
27
+ its first mention and defaults to the current folder. `--default-state stopped` defines a
28
+ service that stays idle until you press `s`. `laracrew draft` shows the draft (so does `laracrew draft <name>` once it exists), and
29
+ `laracrew draft publish` validates it with the real schema and installs it under
30
+ `~/.laracrew/stacks/`, with `--link` to also install the global command. Service names are
31
+ derived from the project and the command (`api:queue:work`); `--name` overrides. The draft
32
+ is a plain stack file that can be edited by hand and committed next to the code.
33
+
34
+ ### Changed
35
+
36
+ - **The console got a polish.** Every command now shares one vocabulary of marks — `✔` done,
37
+ `✖` failed, `▲` worth a look, `▸` a next step — with ASCII stand-ins under `LARACREW_ASCII=1`
38
+ or `TERM=dumb`. `ls` counts and aligns its sections, `doctor` names the stack it checked and
39
+ ends with a one-line verdict, `init` and `link` report what they did as a checklist, config
40
+ errors separate the file, the message and the hints, and `--help` is coloured. `up --plain`
41
+ tells a clean exit (`▲ exited (code 0)`) from a crash (`✖ exited (code 1)`).
42
+ - Colour comes from `chalk` 5 (44 KB, no dependencies) instead of the hand-rolled painter. The
43
+ decision stays laracrew's own: `NO_COLOR`, `FORCE_COLOR` and the TTY check behave as before,
44
+ and `FORCE_COLOR=0` now means off, as it does everywhere else.
45
+ - `commander` 12 → 14 for the help styling hooks. One visible side effect: an extra positional
46
+ argument (`laracrew up dual extra`) is now an error instead of being ignored.
47
+
20
48
  ## [0.2.2] — 2026-09-30
21
49
 
22
50
  ### Added
@@ -198,7 +226,8 @@ once, from one command.
198
226
  - Accepted by the schema but not yet acted on: `watch`, `metrics` (read by `doctor` only), and
199
227
  `hooks`. Stack files written today stay valid.
200
228
 
201
- [Unreleased]: https://github.com/vidux/laracrew/compare/v0.2.2...HEAD
229
+ [Unreleased]: https://github.com/vidux/laracrew/compare/v0.3.0...HEAD
230
+ [0.3.0]: https://github.com/vidux/laracrew/compare/v0.2.2...v0.3.0
202
231
  [0.2.2]: https://github.com/vidux/laracrew/compare/v0.2.1...v0.2.2
203
232
  [0.2.1]: https://github.com/vidux/laracrew/compare/v0.2.0...v0.2.1
204
233
  [0.2.0]: https://github.com/vidux/laracrew/compare/v0.1.2...v0.2.0
package/README.md CHANGED
@@ -160,6 +160,23 @@ a browser. Add your projects and the commands that run under them, and it writes
160
160
  as you go — checking the same rules laracrew does, so a stack that looks right there boots. No
161
161
  install, no build step; it is one file.
162
162
 
163
+ **Or build it from the command line**, one service at a time, from inside the project:
164
+
165
+ ```bash
166
+ cd D:/work/api
167
+ laracrew draft dual # starts ./dual.laracrew.yaml
168
+ laracrew draft add --project api --command "php artisan queue:work" # --path defaults to this folder
169
+ laracrew draft add --project api --command "php artisan schedule:work" # the path is remembered
170
+ laracrew draft add --project portal --path D:/work/portal --command "php artisan queue:work"
171
+ laracrew draft add --project portal --command "npm run dev" --default-state stopped # idle until you press s
172
+ laracrew draft publish # validates it, installs ~/.laracrew/stacks/dual
173
+ ```
174
+
175
+ `laracrew draft` on its own shows what the draft holds. Service names come from the project and
176
+ the command (`api:queue:work`, `portal:dev`); `--name` overrides. The draft is a plain
177
+ `stack.yaml`: edit it by hand, keep it next to the code, commit it. `publish` checks it with the
178
+ same rules as any other stack, and `--link` also installs the global command (`dual`).
179
+
163
180
  ---
164
181
 
165
182
  ## One command per project set
@@ -172,7 +189,7 @@ laracrew link dual
172
189
  ```
173
190
 
174
191
  ```
175
- created dual -> laracrew up dual
192
+ ✔ created dual → laracrew up dual
176
193
 
177
194
  in C:\Users\you\AppData\Roaming\npm
178
195
 
@@ -467,6 +484,9 @@ profiles:
467
484
 
468
485
  ```bash
469
486
  laracrew init [--examples] # create ~/.laracrew; --examples adds a demo stack + template
487
+ laracrew draft [name] # start a stack draft in this folder, or show it
488
+ laracrew draft add --command "…" [--project key] [--path dir] [--name svc] [--default-state stopped]
489
+ laracrew draft publish [--force] [--link] # validate the draft and install it under ~/.laracrew
470
490
  laracrew ls [--json] # list stacks, projects and tasks
471
491
  laracrew doctor [stack] # check a stack before booting it
472
492
  laracrew up [stack] [options] # boot the fleet and supervise it
@@ -499,6 +519,8 @@ laracrew up dual --json | jq 'select(.type=="service:exit")'
499
519
  ### What `doctor` checks
500
520
 
501
521
  ```
522
+ doctor · dual
523
+
502
524
  ✔ stack "dual" is valid — 8 services
503
525
  ✔ php: PHP 8.3.11 (cli)
504
526
  ✖ api and portal share Redis 127.0.0.1:6379/0# AND queue(s): default
@@ -507,6 +529,8 @@ laracrew up dual --json | jq 'select(.type=="service:exit")'
507
529
  jobs run inline on dispatch, so the worker will sit idle forever — set it to redis or database
508
530
  ✖ port 8000 is already in use
509
531
  ▲ redis not reachable at 127.0.0.1:6380
532
+
533
+ ✖ 3 problems, 1 warning
510
534
  ```
511
535
 
512
536
  Exit code is 1 when anything is at `✖`, so it drops straight into a pre-flight script.
@@ -519,11 +543,15 @@ commands say it talks to Redis. Run `doctor` on a Django or Node stack and you g
519
543
  that apply to it, not a wall of PHP complaints:
520
544
 
521
545
  ```
546
+ doctor · django-celery
547
+
522
548
  ✔ stack "django-celery" is valid — 8 services
523
549
  ✔ port 8000 is free
524
550
  ✔ postgres is reachable — tcp 127.0.0.1:5432
525
551
  ▲ redis is not reachable — tcp 127.0.0.1:6379 (ECONNREFUSED)
526
552
  laracrew never starts an external service; anything that needs it will wait at its gate
553
+
554
+ ✔ no blocking problems, 1 warning
527
555
  ```
528
556
 
529
557
  Services marked `external: true` are checked through the gate they already declare, so whatever
@@ -581,7 +609,7 @@ project, `LARACREW_PROJECT=<key>`.
581
609
 
582
610
  ## Status
583
611
 
584
- **v0.2.2 — supervisor and full-screen view are built and tested.**
612
+ **v0.3.0 — supervisor, full-screen view and `laracrew draft` are built and tested.**
585
613
 
586
614
  Working now: config pipeline, dependency-ordered boot with readiness gates, restart policies with
587
615
  exponential backoff, the graceful stop ladder — `stop.exec` for any process, `stop.artisan` as the
@@ -621,15 +649,15 @@ The full plan lives in [.claude/PLAN.md](.claude/PLAN.md), with the design in
621
649
  npm install
622
650
  npm run dev -- up example # tsx, no build step
623
651
  npm run build # tsup -> dist/index.js
624
- npm test # vitest, 248 tests
652
+ npm test # vitest, 281 tests
625
653
  npm run typecheck
626
654
  npm link # put `laracrew` on PATH while hacking on it
627
655
  ```
628
656
 
629
- Runtime dependencies, in total: `commander`, `yaml`, `zod`. Process spawning, tree-killing and
630
- colour are hand-rolled — see [ARCHITECTURE.md §9](.claude/ARCHITECTURE.md) for why `execa`,
631
- `tree-kill` and `picocolors` were dropped. Startup time is a feature for a tool you run twenty
632
- times a day.
657
+ Runtime dependencies, in total: `commander`, `yaml`, `zod` and `chalk`. Process spawning and
658
+ tree-killing are hand-rolled — see [ARCHITECTURE.md §9](.claude/ARCHITECTURE.md) for why `execa`
659
+ and `tree-kill` were dropped, and what `chalk` costs. Startup time is a feature for a tool you run
660
+ twenty times a day.
633
661
 
634
662
  The test suite spawns real child processes, binds real ports and asserts that no pid survives a
635
663
  shutdown — including a deliberately spawned grandchild and a process that ignores `SIGTERM`. Every
@@ -639,6 +667,51 @@ Architectural rule worth knowing before you contribute: **nothing in `src/core/`
639
667
  `src/cli/`**. Core emits typed events; the plain renderer, the JSON renderer and the coming TUI are
640
668
  all just subscribers. That's what keeps `--plain`, `--detach` and the tests honest.
641
669
 
670
+ ### Try it without installing from npm
671
+
672
+ Five steps from a fresh clone to a running stack, without touching your real `~/.laracrew`:
673
+
674
+ 1. **Clone and install.**
675
+
676
+ ```bash
677
+ git clone https://github.com/vidux/laracrew.git && cd laracrew && npm install
678
+ ```
679
+
680
+ 2. **Point it at a throwaway home.** Everything below reads and writes there, not your real config.
681
+
682
+ ```bash
683
+ export LARACREW_HOME=/tmp/laracrew-try # PowerShell: $env:LARACREW_HOME = "$env:TEMP\laracrew-try"
684
+ ```
685
+
686
+ 3. **Run from source.** `npm run dev` runs `src/index.ts` through `tsx` — no build step, every edit is live.
687
+
688
+ ```bash
689
+ npm run dev -- init --examples
690
+ npm run dev -- doctor example
691
+ npm run dev -- up example # the full-screen view; q quits
692
+ npm run dev -- up example --plain # what a pipe or CI sees
693
+ ```
694
+
695
+ 4. **Run the real binary.** `laracrew link` needs the build, and this is what users get.
696
+
697
+ ```bash
698
+ npm run build && npm link # `laracrew` on your PATH -> this checkout's dist/
699
+ laracrew up example
700
+ npm unlink -g laracrew # when you are done
701
+ ```
702
+
703
+ Rebuild after each change: the link runs `dist/index.js`, not the TypeScript.
704
+
705
+ 5. **Test the exact tarball npm would publish.** The smoke test packs it, installs it into an empty
706
+ directory, runs the installed binary and checks that no child process survived:
707
+
708
+ ```bash
709
+ bash .claude/skills/prepare-for-publish/smoke-test.sh
710
+ ```
711
+
712
+ By hand: `npm pack`, then in an empty directory `npm install ../laracrew/laracrew-<version>.tgz`
713
+ and `npx laracrew --version`.
714
+
642
715
  ## License
643
716
 
644
717
  MIT