The Web shell's PLATFORM_MODULES list is closed to new packages, and a feature plugin cannot runtime-import another plugin's values. Turn ui-cli-account from a statically linked library into a dynamic client plugin that dsh-web-app mounts. `ctx.cliAccounts.register()` follows the plugin's account stream and contributes the bundle section, title tag, activation prompt, and notice. The surfaces read the shared copy from the plugin's namespace through the locale seat; the plugin supplies its Remote operations, its success notices, and a presenter that maps the page snapshot to the section's translated display. Confirmations become action data the section asks before running, and the activation prompt connects through the section's first primary action that asks no confirmation. Drop the shell seeding, the apps/web dependency, and the CSS publication exception the static form needed.
44 lines
1.9 KiB
TypeScript
44 lines
1.9 KiB
TypeScript
/**
|
|
* Platform-singleton module-table. These are the ONLY entities the shell
|
|
* shares into the frozen module table — fetch bundles resolve their externals
|
|
* against exactly this set through the loader's require. Keys come from the
|
|
* platform constant module ({@link ./platform.ts}, the single source
|
|
* of truth with the tsdown client externals); values stay shell-static
|
|
* imports so every bundle sees the same instance.
|
|
*/
|
|
import * as React from 'react'
|
|
import * as ReactJsxRuntime from 'react/jsx-runtime'
|
|
import * as ReactDom from 'react-dom'
|
|
import * as ReactDomClient from 'react-dom/client'
|
|
import * as Cordis from '@deepseek-ai/cordis'
|
|
import * as Zod from 'zod'
|
|
import * as ReactVirtual from '@tanstack/react-virtual'
|
|
import * as ClientStore from '@deepseek-ai/dsh-client-store'
|
|
import * as UiSlots from '@deepseek-ai/dsh-client-ui-slots'
|
|
import * as UiPrimitives from '@deepseek-ai/dsh-client-ui-primitives'
|
|
import * as UiDockkit from '@deepseek-ai/dsh-client-ui-dockkit'
|
|
import type { PlatformModule } from './platform.ts'
|
|
|
|
/**
|
|
* Build the static table handed to the module loader at boot.
|
|
* @returns module specifier → exported entity (one entry per platform word).
|
|
*/
|
|
export function getStaticModules(): Record<string, unknown> {
|
|
// The satisfies pin is the projection contract: a word added to
|
|
// PLATFORM_MODULES without a static import here (or vice versa) fails to
|
|
// compile instead of drifting into a runtime require miss.
|
|
return {
|
|
'react': React,
|
|
'react/jsx-runtime': ReactJsxRuntime,
|
|
'react-dom': ReactDom,
|
|
'react-dom/client': ReactDomClient,
|
|
'@deepseek-ai/cordis': Cordis,
|
|
'zod': Zod,
|
|
'@tanstack/react-virtual': ReactVirtual,
|
|
'@deepseek-ai/dsh-client-store': ClientStore,
|
|
'@deepseek-ai/dsh-client-ui-slots': UiSlots,
|
|
'@deepseek-ai/dsh-client-ui-primitives': UiPrimitives,
|
|
'@deepseek-ai/dsh-client-ui-dockkit': UiDockkit,
|
|
} satisfies Record<PlatformModule, unknown>
|
|
}
|