The module system moves out of dsh-client-runtime (./loader retired) into its own package: a lazy CJS table where executing a bundle only registers its factory and materialization happens at first require, memoized, with recursive requires self-ordering. ClientModuleSystem is a class; index.ts keeps the types and a thin factory. Boot is two-phase: phase one prefetches the immediately tier in parallel (registration only, failures deferred to phase two's loud import); phase two mounts the vendored Loader with the module system as internal, creates one entry per graph row plus the app-shell pseudo-row the kernel appends itself, and settles on an all-ACTIVE sweep. The shell kernel is self-sufficient: hand-rolled loader-status stores, no plugin value imports, platform seed list single- sourced in platform.ts.
21 lines
918 B
TypeScript
21 lines
918 B
TypeScript
/**
|
|
* Platform singletons the shell shares into the module table.
|
|
* Single source of truth (design §3.3, contract C1): seed keys = tsdown
|
|
* client externals = the shared surface. The three projections import this
|
|
* module — the seed table ({@link ../seed.ts}), the tsdown client preset's
|
|
* external judgement (packages/client/tsdown.client.ts), and the vite alias
|
|
* check — so the list cannot drift between them.
|
|
* @module @deepseek-ai/dsh-client-web/src/platform
|
|
*/
|
|
|
|
/** The module specifiers the shell shares into the frozen module table. */
|
|
export const PLATFORM_MODULES = [
|
|
'react', 'react/jsx-runtime', 'react-dom', 'react-dom/client', 'cordis',
|
|
'@deepseek-ai/dsh-client-ui-slots',
|
|
'@deepseek-ai/dsh-client-web-react',
|
|
'@deepseek-ai/dsh-client-ui-primitives',
|
|
] as const
|
|
|
|
/** One platform module specifier (a seed-table key). */
|
|
export type PlatformModule = (typeof PLATFORM_MODULES)[number]
|