refactor(cmdline): trim the command-line seams to existing interfaces
The web runtime creates its dev-mode client-hmr row in the root tree after Loader settlement with plain loader.create, deleting the vendored Entry.enableRuntime state machine and dsh-cmdline's enableRow export. Include declares the existing EntryGroup.key tree-carrier marker instead of the EntryConfigResolver protocol (its own path stays literal; nothing used a dynamic path). The launcher recognizes no app row: SIGTERM exits 0 on every surface, every boot watches its user patch layers, and the headless runner exits through ctx.appExit, deleting ctx.headlessIo. Also restores the vendor README rescope entry to the position the rescope-vendor exact-edit anchor requires, fixing the master hygiene regression.
This commit is contained in:
33
vendor/loader/src/config/entry.ts
vendored
33
vendor/loader/src/config/entry.ts
vendored
@@ -5,17 +5,6 @@ import { EntryGroup } from './group.ts'
|
||||
import { EntryTree } from './tree.ts'
|
||||
import { evaluate } from './utils.ts'
|
||||
|
||||
/** Static plugin hook for resolving a container config while preserving nested entry configs. */
|
||||
export const EntryConfigResolver = Symbol.for('cordis.loader.entry-config-resolver')
|
||||
|
||||
/**
|
||||
* Resolve a container's own config while preserving any nested entry configs.
|
||||
* @param ctx - the container plugin context.
|
||||
* @param config - the container's raw config.
|
||||
* @returns the config to validate for this activation.
|
||||
*/
|
||||
export type EntryConfigResolver = (ctx: Context, config: any) => any
|
||||
|
||||
/** Serialized plugin entry options stored in loader config files. */
|
||||
export interface EntryOptions {
|
||||
/** Stable id inside the containing entry tree. */
|
||||
@@ -73,8 +62,6 @@ export class Entry {
|
||||
|
||||
_initTask?: Promise<void>
|
||||
_disposing = 0
|
||||
private runtimeEnabled = false
|
||||
private runtimeEnableTask?: Promise<void>
|
||||
|
||||
constructor(public loader: Loader) {
|
||||
this.ctx = loader.ctx.extend({ [Entry.key]: this })
|
||||
@@ -101,31 +88,15 @@ export class Entry {
|
||||
private _disabled(options: EntryOptions) {
|
||||
// group is always enabled
|
||||
if (options.group) return false
|
||||
if (options.disabled && !this.runtimeEnabled) return true
|
||||
if (options.disabled) return true
|
||||
let entry = this.parent.ctx.fiber.entry
|
||||
while (entry) {
|
||||
if (entry.options.disabled && !entry.runtimeEnabled) return true
|
||||
if (entry.options.disabled) return true
|
||||
entry = entry.parent.ctx.fiber.entry
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable this in-memory entry without rewriting its configured `disabled`
|
||||
* value; the override survives config reapplication for this entry object.
|
||||
* @returns a promise settling after its initial activation attempt.
|
||||
*/
|
||||
enableRuntime(): Promise<void> {
|
||||
if (this.runtimeEnableTask !== undefined) return this.runtimeEnableTask
|
||||
this.runtimeEnabled = true
|
||||
this.runtimeEnableTask = this.refresh().catch((error: unknown) => {
|
||||
this.runtimeEnabled = false
|
||||
this.runtimeEnableTask = undefined
|
||||
throw error
|
||||
})
|
||||
return this.runtimeEnableTask
|
||||
}
|
||||
|
||||
evaluate(expr: string) {
|
||||
return evaluate(this.ctx, expr)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user