The packer images the web template bundles, every optional bundle, and an installation manifest instead of a dumped composition, and the Worker boots that profile through app-boot like dsh web. Package-local lazy client chunks move into content-addressed archives that the VFS fetches on first asynchronous read; client-modules reads chunks asynchronously. The Worker replaces node-addon-require-builtin with Node v24.18.0 internal-module interfaces and reports Node 24, so plugin metadata, the Cordis Loader, and HMR reach one cascaded loader backed by the Worker loader. Resolution failures carry Node error codes, the empty load cache lets HMR apply profile changes, and every optional bundle switches on and off live. Platform stubs throw ERR_FEATURE_UNAVAILABLE_ON_PLATFORM.
117 lines
5.3 KiB
TypeScript
117 lines
5.3 KiB
TypeScript
/**
|
|
* Differential check of the worker's crypto/url/util shims against Node.
|
|
*/
|
|
import { expect, test } from 'vitest'
|
|
import { createHash as nodeCreateHash } from 'node:crypto'
|
|
import { fileURLToPath as nodeFileURLToPath, pathToFileURL as nodePathToFileURL } from 'node:url'
|
|
import { inherits as nodeInherits, isDeepStrictEqual as nodeIsDeepStrictEqual, promisify as nodePromisify } from 'node:util'
|
|
import * as shimCrypto from '@deepseek-ai/dsh-experimental-webworker-runtime/src/node/builtin_modules/implemented/crypto.ts'
|
|
import * as shimUrl from '@deepseek-ai/dsh-experimental-webworker-runtime/src/node/builtin_modules/implemented/url.ts'
|
|
import * as shimUtil from '@deepseek-ai/dsh-experimental-webworker-runtime/src/node/builtin_modules/implemented/util.ts'
|
|
|
|
const compare = (label: string, actual: unknown, expected: unknown): void => {
|
|
const [shimmed, node] = [JSON.stringify(actual), JSON.stringify(expected)]
|
|
test(label, () => { expect(shimmed).toBe(node) })
|
|
}
|
|
|
|
const INPUTS = ['', 'a', 'hello world', '中文字符串', ' |