Flatten the repo: move everything out of app/ to the root
Now that the CLI and the Next.js app are one package, nesting it inside app/ served no purpose - the repo root itself becomes the published npm package. Merges app/.gitignore and app/README.md into the root versions, drops the now-duplicate app/LICENSE, and updates path references (README, docs/ARCHITECTURE.md, docs/CONFIG_REFERENCE.md, package.json's repository.directory) that assumed the app/ nesting. Also fixes a real bug this surfaced: the in-app docs viewer resolved docs/ relative to process.cwd(), which only worked by accident when the CLI happened to be invoked from app/'s parent directory. A first attempt at fixing it with import.meta.dirname broke instead, for the same cross-module-graph reason config-path resolution already documented - Next compiles Route Handlers through a separate module graph that doesn't preserve source-relative import.meta paths. Fixed by exposing the app root via TRIGGERSHELL_APP_ROOT (set once in server.ts, where import.meta *does* resolve correctly), the same pattern already used for TRIGGERSHELL_CONFIG_PATH. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -34,7 +34,7 @@ Edit `triggershell.yml` to add your own scripts (see [Configuration](#configurat
|
||||
re-run `triggershell start`.
|
||||
|
||||
> The `triggershell` package isn't published to npm yet. Until it is, build and link a local copy
|
||||
> instead: `pnpm --dir app install && pnpm --dir app build && pnpm --dir app link --global`.
|
||||
> instead: `pnpm install && pnpm build && pnpm link --global`.
|
||||
|
||||
## Requirements
|
||||
|
||||
@@ -150,21 +150,23 @@ Full reference with request/response shapes and curl examples: [`docs/API.md`](d
|
||||
## Development
|
||||
|
||||
This is the workflow for working on TriggerShell itself, not for installing/running it — it
|
||||
bypasses the CLI entirely and talks to `app/`'s own scripts directly, with hot reload:
|
||||
bypasses the CLI entirely and talks to the app's own scripts directly, with hot reload. The app is
|
||||
still not meant to be run standalone with `next dev`/`next start`, since it needs the custom server
|
||||
(`server.ts`) for the WebSocket endpoint — `pnpm dev`/`pnpm start` below cover that:
|
||||
|
||||
```bash
|
||||
pnpm --dir app install
|
||||
pnpm --dir app dev # tsx watch server.ts - reads TRIGGERSHELL_CONFIG_PATH from the environment
|
||||
pnpm --dir app lint
|
||||
pnpm --dir app typecheck
|
||||
pnpm --dir app test # CLI unit tests (src/cli/**/*.test.ts)
|
||||
pnpm --dir app db:studio # browse the SQLite DB
|
||||
pnpm install
|
||||
pnpm dev # tsx watch server.ts - reads TRIGGERSHELL_CONFIG_PATH from the environment
|
||||
pnpm lint
|
||||
pnpm typecheck
|
||||
pnpm test # CLI unit tests (src/cli/**/*.test.ts)
|
||||
pnpm db:studio # browse the SQLite DB
|
||||
```
|
||||
|
||||
Repo layout:
|
||||
Repo layout — the repo root itself is the published npm package (Next.js app + the `triggershell`
|
||||
CLI in `bin/`/`src/cli/`), alongside:
|
||||
|
||||
```
|
||||
app/ The published npm package: Next.js app + the `triggershell` CLI (bin/, src/cli/) in one
|
||||
examples/ A runnable example config + scripts
|
||||
docs/ Config/architecture/API reference docs
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user