refactor(cli): simplify updater, remove cache and confirmation
- Remove the 24h disk cache (State, readState/writeState, checkInterval) that served stale latest versions within the TTL window - Remove file lock (Flock) and confirmation prompt (Prompt/Terminal) - Every check now hits the npm registry directly - Updates always auto-install on any version mismatch within the same major, including rollbacks where the registry version is lower - Drop the interactive option from check() and the confirm/declined/ dismissed action concepts
This commit is contained in:
parent
c22973ab9f
commit
11bf8d8a42
4 changed files with 38 additions and 95 deletions
|
|
@ -10,7 +10,7 @@ export default Runtime.handler(Commands, (input) =>
|
|||
const directory = Option.getOrUndefined(input.directory)
|
||||
if (directory !== undefined) process.chdir(directory)
|
||||
const updater = yield* Updater.Service
|
||||
yield* updater.check({ interactive: true })
|
||||
yield* updater.check()
|
||||
const daemon = yield* Daemon.Service
|
||||
const transport = yield* (input.standalone ? Standalone.transport() : daemon.transport())
|
||||
const { runTui } = yield* Effect.promise(() => import("../../tui"))
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ export default Runtime.handler(
|
|||
const url = HttpServer.formatAddress(address)
|
||||
console.log(input.stdio ? JSON.stringify({ url }) : `server listening on ${url}`)
|
||||
const updater = yield* Updater.Service
|
||||
yield* updater.check({ interactive: false }).pipe(Effect.forkScoped)
|
||||
yield* updater.check().pipe(Effect.forkScoped)
|
||||
return yield* (input.stdio ? waitForStdinClose() : Effect.never)
|
||||
}).pipe(Effect.annotateLogs({ role: "server" })),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue