Replace the Python CLI with a Node CLI, add a systemd service command
The app is already 100% Node, so the Python launcher was pure overhead - it existed mainly to bootstrap Node, which is circular. The CLI is now merged into app/ (the single published npm package): `triggershell start` validates the config and imports server.ts directly in-process, so server.ts's own SIGTERM/SIGINT handling just works with no signal-relay/child-process layer needed. `dev` is dropped from the public CLI (contributors use `pnpm --dir app dev` directly); there's no `build` command either, since the package ships a prebuilt `.next` via a `prepack` hook. Adds `triggershell service install|uninstall|status` for running as a per-user or system systemd unit. Also fixes two bugs found while wiring this up: server.ts resolved `.next` relative to `process.cwd()`, which broke once the CLI could run from a directory other than the app itself; and an explicitly-`files`-listed package directory bypasses .npmignore for its subpaths, so `.next/cache` was inflating the npm tarball to ~670MB (now stripped in `prepack`, ~7MB). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+26
-5
@@ -1,13 +1,31 @@
|
||||
{
|
||||
"name": "app",
|
||||
"name": "triggershell",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://dev.pivoine.art/valknar/triggershell.git",
|
||||
"directory": "app"
|
||||
},
|
||||
"bin": {
|
||||
"triggershell": "bin/triggershell.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
},
|
||||
"files": [
|
||||
"bin",
|
||||
"src",
|
||||
"templates",
|
||||
"drizzle",
|
||||
".next",
|
||||
"server.ts",
|
||||
"next.config.ts",
|
||||
"next-env.d.ts",
|
||||
"tsconfig.json",
|
||||
"LICENSE"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "tsx watch server.ts",
|
||||
"build": "next build",
|
||||
@@ -15,13 +33,15 @@
|
||||
"lint": "eslint",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"format": "prettier --write .",
|
||||
"validate-config": "tsx scripts/validate-config.ts",
|
||||
"test": "tsx --test \"src/cli/**/*.test.ts\"",
|
||||
"db:generate": "drizzle-kit generate",
|
||||
"db:studio": "drizzle-kit studio"
|
||||
"db:studio": "drizzle-kit studio",
|
||||
"prepack": "rm -rf .next && next build && rm -rf .next/cache"
|
||||
},
|
||||
"dependencies": {
|
||||
"@base-ui/react": "^1.7.0",
|
||||
"@hookform/resolvers": "^5.8.0",
|
||||
"@inquirer/prompts": "^8.5.2",
|
||||
"@xterm/addon-fit": "^0.11.0",
|
||||
"@xterm/xterm": "^6.0.0",
|
||||
"argon2": "^0.45.1",
|
||||
@@ -29,6 +49,7 @@
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"cmdk": "^1.1.1",
|
||||
"commander": "^15.0.0",
|
||||
"drizzle-orm": "^0.45.2",
|
||||
"execa": "^10.0.1",
|
||||
"iron-session": "^8.0.4",
|
||||
@@ -43,6 +64,7 @@
|
||||
"shadcn": "^4.18.0",
|
||||
"sonner": "^2.0.8",
|
||||
"tailwind-merge": "^3.6.0",
|
||||
"tsx": "^4.23.12",
|
||||
"tw-animate-css": "^1.4.0",
|
||||
"ws": "^8.21.3",
|
||||
"yaml": "^2.9.0",
|
||||
@@ -63,7 +85,6 @@
|
||||
"prettier": "^3.9.6",
|
||||
"prettier-plugin-tailwindcss": "^0.8.1",
|
||||
"tailwindcss": "^4",
|
||||
"tsx": "^4.23.12",
|
||||
"typescript": "^5"
|
||||
},
|
||||
"packageManager": "pnpm@11.21.0"
|
||||
|
||||
Reference in New Issue
Block a user