Archon/packages/cli/tsconfig.json
Rasmus Widing 36bd9cff8f
feat: add archon serve command for one-command web UI install (#1011)
* Investigate issue #978: one-command web UI install via archon serve

* feat: add `archon serve` command for one-command web UI install (#978)

Extract `startServer(opts)` from server's monolithic `main()` into an
exported function with `ServerOptions` (webDistPath, port,
skipPlatformAdapters). Add `import.meta.main` guard so the file still
works as a standalone script for `bun dev`.

Create `archon serve` CLI command that lazily downloads a pre-built
web UI tarball from GitHub releases on first run, verifies SHA-256
checksum, extracts atomically, then starts the full server. Cached
per version in `~/.archon/web-dist/<version>/`.

Update release CI to build the web UI, package it as
`archon-web.tar.gz`, and include in release checksums.

* fix: address review findings for archon serve command

- Validate --port range (1-65535) and reject NaN before any other checks
- Capture tar stderr for actionable extraction error messages
- Add structured logging (download_started/download_failed/server_start_failed)
- Post-extraction sanity check for index.html
- Wrap renameSync with error context and tmpDir cleanup
- Wrap fetch() calls to preserve URL context on network errors
- Validate parseChecksum returns 64 hex chars
- Set skipPlatformAdapters: true for standalone web UI mode
- Improve ServerOptions/ServeOptions JSDoc
- Move consoleErrorSpy cleanup to afterEach in tests
- Add tests for port validation and malformed hash rejection
- Update CLAUDE.md: CLI section, directory tree, package descriptions
- Update README.md: mention archon serve for binary installs
- Update docs-web: CLI reference, archon-directories

* refactor: simplify serve command implementation

- Use BUNDLED_IS_BINARY directly instead of version === 'dev' sentinel
- Extract toError() helper for repeated error normalization
- Use dirname() instead of manual substring/lastIndexOf
- Extract cleanupAndThrow() for repeated rmSync + throw pattern
- Add missing assertion on port 0 test for consistency
2026-04-10 13:33:47 +03:00

33 lines
903 B
JSON

{
"extends": "../../tsconfig.json",
"compilerOptions": {
"noEmit": true,
"paths": {
"@archon/adapters": ["../adapters/src"],
"@archon/adapters/*": ["../adapters/src/*"],
"@archon/core": ["../core/src"],
"@archon/core/*": ["../core/src/*"],
"@archon/server": ["../server/src"],
"@archon/server/*": ["../server/src/*"],
"@archon/workflows": ["../workflows/src"],
"@archon/workflows/*": ["../workflows/src/*"],
"@archon/paths": ["../paths/src"],
"@archon/git": ["../git/src"]
}
},
"include": [
"src/**/*",
"../core/src/**/*.ts",
"../server/src/**/*.ts",
"../adapters/src/**/*.ts",
"../workflows/src/defaults/text-imports.d.ts"
],
"exclude": [
"node_modules",
"dist",
"**/*.test.ts",
"../core/src/**/*.test.ts",
"../server/src/**/*.test.ts",
"../adapters/src/**/*.test.ts"
]
}