@deepseek-ai/dsh-experimental-webworker-packer 0.2.1-rc.3 → 0.2.2-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +2 -2
- package/README.md +2 -2
- package/README.zh.md +2 -2
- package/lib/bin.js +1 -1
- package/lib/index.js +1 -1
- package/lib/{repository-DhiU_Xz2.js → repository-h-zod9uz.js} +2 -1
- package/package.json +10 -9
package/README.i18n.yaml
CHANGED
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
en: 4e53164159b5ce41
|
|
16
16
|
zh: 89582dc0294d0776
|
|
17
17
|
/deepseek-ai-dsh-experimental-webworker-packer/use-this-package:
|
|
18
|
-
en:
|
|
19
|
-
zh:
|
|
18
|
+
en: 6a4ec925ea6681f5
|
|
19
|
+
zh: 4af12d1d3de38dbd
|
|
20
20
|
/deepseek-ai-dsh-experimental-webworker-packer/model-experience:
|
|
21
21
|
en: e16b355530dadc1c
|
|
22
22
|
zh: 8488e03b253b7b33
|
package/README.md
CHANGED
|
@@ -29,12 +29,12 @@ The packer owns the internal `dsh.configTrees` declaration, its validation, and
|
|
|
29
29
|
|
|
30
30
|
The pack is a three-layer standard stack:
|
|
31
31
|
|
|
32
|
-
1. **Roster** — the shipped profile template's bundles and every bundle in
|
|
32
|
+
1. **Roster** — the shipped profile template's bundles and every bundle in `OPTIONAL_BUNDLES` from [`dsh-official-bundles`](../../util/official-bundles/README.md), each resolved from the CLI manifest as the launcher resolves it, plus every package their patch files name (insert lists and grouped rows included), plus the rows of every config tree the CLI declares in its `package.json` `dsh.configTrees`, materialized as a Node-style dependency closure. External peer edges never bind the worker; workspace peers stay on the chain. The CLI manifest itself enters the image alone at `node_modules/@deepseek-ai/dsh/package.json`, as the worker's bundle resolution anchor; the manifest records its name and the profile.
|
|
33
33
|
2. **Publish view** — each workspace or vendored package contributes its built npm slice (`files` through picomatch) without source or workspace `dist/`. External packages retain published JavaScript under both `src/` and `dist/` because their `main` or `exports` may point there; only generic test, map, declaration, and archive exclusions apply.
|
|
34
34
|
3. **Reachability sweep** — the runtime loader's own resolution walks from every non-wildcard workspace runtime export plus the worker assembly's seeds (`IMAGE_ENTRY_SEEDS`), lowering each reached module to the wrapper contract at pack time. Declaration-only condition trees do not seed the sweep; runtime requests for those exports still fail. The transform reports statically named imports, re-exports, and dynamic imports; calls through `require`; and module-scope direct calls of the form `createRequire(import.meta.url)('pkg')` through a named import from `node:module` or `module`, including an import alias. Page assets (`lib/client.js` behind `./client` exports) ship verbatim; an unresolvable request from our own code fails the pack, third-party ones are tolerated to fail loud at require time.
|
|
35
35
|
4. **Lazy chunks** — every page chunk a page asset requests as a literal `require.async("./client.<name>.js")`, the only form the dynamic Client build emits, leaves the base image unless a `./client` export names it. Each becomes its own deterministic archive named `lazy/<sha256 of the archive>.tar.gz` beside the base image, and the manifest registers its path, size, and archive for the worker's lazy filesystem. A request for a chunk the package does not publish fails the pack.
|
|
36
36
|
|
|
37
|
-
`repository.ts` owns the repo-shaped inputs (workspace scan of `vendor/`, `packages/`, `native/system/packages/`, and `apps/`; the profile roster through
|
|
37
|
+
`repository.ts` owns the repo-shaped inputs (workspace scan of `vendor/`, `packages/`, `native/system/packages/`, and `apps/`; the profile roster through the shipped templates and optional-bundle list of `dsh-official-bundles` and app-boot's bundle patch readers; the CLI manifest as the installation; the home patch, which sets the runtime's `PLATFORM_ENTRY_CONFIG` fields over each named row's config composed from the template's bundle layers); `pack.ts` owns none of them, so the same library packs a different tree by being called differently. The native scan makes the Landlock entry package an ordinary published-view dependency while its executable remains a Worker platform implementation. The CLI is `dsh-pack-vfs-image --out <file> [--profile web]`; it writes the lazy archives beside the base image, and `apps/web`'s `build:preview` runs it after the preview shell build.
|
|
38
38
|
|
|
39
39
|
The repository adapter also declares the preview-only fixture trees under `webworker-runtime/tests/fixtures/`. The CLI packs each named fixture into a separate deterministic overlay archive plus a browser-readable manifest. Overlay files bypass npm publish-view and module-reachability exclusions, so dot directories and example source files remain intact; their mounts are limited to `home/` and `workspace/`. `packVfsOverlay` treats all files as opaque bytes.
|
|
40
40
|
|
package/README.zh.md
CHANGED
|
@@ -29,12 +29,12 @@ VFS 镜像打包器:把一份随附 profile 的 bundle 和安装提供的 opti
|
|
|
29
29
|
|
|
30
30
|
打包是三层标准栈:
|
|
31
31
|
|
|
32
|
-
1. **Roster**——随附 profile 模板的 bundle 和
|
|
32
|
+
1. **Roster**——随附 profile 模板的 bundle 和 [`dsh-official-bundles`](../../util/official-bundles/README.zh.md) `OPTIONAL_BUNDLES` 中的每个 bundle(各自按启动器的方式从 CLI manifest 解析),加上它们 patch 文件点名的每个包(含 insert 列表与分组行),再加上 CLI(命令行界面)在 `package.json` `dsh.configTrees` 里声明的每棵配置树的行,按 Node 式依赖闭包物化。外部 peer 边绝不会绑定到 worker,workspace peer 保留在链上。CLI manifest 本身单独进入镜像,位于 `node_modules/@deepseek-ai/dsh/package.json`,作为 worker 解析 bundle 的锚点;manifest 记录它的名称和 profile。
|
|
33
33
|
2. **发布视图**——每个 workspace 或 vendored 包贡献其构建后的 npm 切片(`files` 走 picomatch),不带源码和 workspace `dist/`。外部包的 `main` 或 `exports` 可能指向 `src/` 或 `dist/`,因此两处发布 JavaScript 都会保留,只应用通用的测试、map、声明与归档排除规则。
|
|
34
34
|
3. **可达性 sweep**——用运行时加载器自己的解析, 从全部不含通配符的 workspace 运行时导出加 worker 装配种子 (`IMAGE_ENTRY_SEEDS`) 出发, 打包时把每个可达模块转换为符合包装层约定的形式. 仅含类型声明的条件树不作为扫描入口; 运行时代码请求这些导出仍会失败. 该转换会报告名称可静态确定的 import、re-export 与动态 import、经 `require` 发起的调用, 以及通过 `node:module` 或 `module` 具名导入 (含导入别名) 在模块作用域直接发起的 `createRequire(import.meta.url)('pkg')` 调用. 页面资产 (`./client` 导出背后的 `lib/client.js`) 原样直发; 自家代码的不可解析请求会让打包失败, 第三方不可解析请求则允许延后到 require 时明确失败.
|
|
35
35
|
4. **懒加载 chunk**——页面资产以字面量 `require.async("./client.<name>.js")`(动态 Client 构建产出的唯一形式)请求的每个页面 chunk,除非被 `./client` 导出点名,否则移出基础镜像。每个 chunk 成为基础镜像旁的一个独立确定性归档,命名为 `lazy/<归档的 sha256>.tar.gz`;manifest 为 worker 的懒加载文件系统登记其路径、大小和归档。请求包未发布的 chunk 会让打包失败。
|
|
36
36
|
|
|
37
|
-
`repository.ts` 拥有仓库形态输入(`vendor/`、`packages/`、`native/system/packages/` 与 `apps/` 的 workspace 扫描;经
|
|
37
|
+
`repository.ts` 拥有仓库形态输入(`vendor/`、`packages/`、`native/system/packages/` 与 `apps/` 的 workspace 扫描;经 `dsh-official-bundles` 的随附模板、optional bundle 列表和 app-boot 的 bundle patch 读取器得出 profile roster;以 CLI manifest 作为安装清单;home patch 在模板各 bundle 层合成出的行配置之上设置运行时 `PLATFORM_ENTRY_CONFIG` 字段);`pack.ts` 一概不拥有,同一库换参即可打另一棵树。Native 扫描使 Landlock 入口包成为普通发布视图依赖,其可执行文件仍由 Worker 平台实现。CLI 为 `dsh-pack-vfs-image --out <file> [--profile web]`;它把懒加载归档写在基础镜像旁,`apps/web` 的 `build:preview` 在预览壳构建后运行它。
|
|
38
38
|
|
|
39
39
|
仓库适配器还声明 `webworker-runtime/tests/fixtures/` 下仅用于 preview 的 fixture(测试前置数据) tree。CLI 会把每套具名 fixture 打成一份独立的确定性 overlay 归档,并写出浏览器可读的 manifest(元数据清单)。Overlay 文件绕过 npm 发布视图和模块可达性排除规则,因此点目录与示例源码会完整保留;其挂载位置仅限 `home/` 与 `workspace/`。`packVfsOverlay` 将所有文件视为不透明字节。
|
|
40
40
|
|
package/lib/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as packRepositoryImage, c as packPreviewFixture, n as describePack, o as previewFixtures } from "./repository-
|
|
2
|
+
import { a as packRepositoryImage, c as packPreviewFixture, n as describePack, o as previewFixtures } from "./repository-h-zod9uz.js";
|
|
3
3
|
import { PREVIEW_FIXTURE_MANIFEST_FILE, PREVIEW_FIXTURE_MANIFEST_VERSION } from "@deepseek-ai/dsh-experimental-webworker-runtime";
|
|
4
4
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as packRepositoryImage, c as packPreviewFixture, d as collectModuleNames, f as packVfsImage, i as installationManifest, l as DEFAULT_ROOT, m as WRAPPER_CONTRACT, n as describePack, o as previewFixtures, p as packVfsOverlay, r as indexWorkspacePackages, s as profileRoster, t as configTrees, u as MANIFEST_PATH } from "./repository-
|
|
1
|
+
import { a as packRepositoryImage, c as packPreviewFixture, d as collectModuleNames, f as packVfsImage, i as installationManifest, l as DEFAULT_ROOT, m as WRAPPER_CONTRACT, n as describePack, o as previewFixtures, p as packVfsOverlay, r as indexWorkspacePackages, s as profileRoster, t as configTrees, u as MANIFEST_PATH } from "./repository-h-zod9uz.js";
|
|
2
2
|
export { DEFAULT_ROOT, MANIFEST_PATH, WRAPPER_CONTRACT, collectModuleNames, configTrees, describePack, indexWorkspacePackages, installationManifest, packPreviewFixture, packRepositoryImage, packVfsImage, packVfsOverlay, previewFixtures, profileRoster };
|
|
@@ -6,7 +6,8 @@ import { gzipSync } from "node:zlib";
|
|
|
6
6
|
import picomatch from "picomatch";
|
|
7
7
|
import yaml from "js-yaml";
|
|
8
8
|
import { entryListSchema } from "@deepseek-ai/cordis-plugin-include";
|
|
9
|
-
import {
|
|
9
|
+
import { PROFILE_PATCH_FILENAME, bundlePatchPaths, composeEntries, loadOverlayPatches, resolveBundleDir } from "@deepseek-ai/dsh-app-boot";
|
|
10
|
+
import { OPTIONAL_BUNDLES, PROFILE_TEMPLATES } from "@deepseek-ai/dsh-official-bundles";
|
|
10
11
|
import { tmpdir } from "node:os";
|
|
11
12
|
import { isSessionFormatJsonObject, parseSessionFormatLogFilename, sessionFormatLogFilename } from "@deepseek-ai/dsh-session-format";
|
|
12
13
|
import { createSessionFormatCatalogWithChildren, historicalSessionFormatCatalog, sessionFormatCatalog } from "@deepseek-ai/dsh-session-format-catalog";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-experimental-webworker-packer",
|
|
3
3
|
"description": "Build-time packer for the browser runtime's base VFS image and ordered data-overlay archives",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.2-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -33,21 +33,22 @@
|
|
|
33
33
|
],
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@deepseek-ai/cordis-plugin-include": "~1.0.
|
|
37
|
-
"@deepseek-ai/dsh-app-boot": "0.2.
|
|
38
|
-
"@deepseek-ai/dsh-experimental-webworker-runtime": "0.2.
|
|
39
|
-
"@deepseek-ai/dsh-
|
|
40
|
-
"@deepseek-ai/dsh-session-format
|
|
41
|
-
"@deepseek-ai/dsh-session-format-
|
|
36
|
+
"@deepseek-ai/cordis-plugin-include": "~1.0.11-alpha.1",
|
|
37
|
+
"@deepseek-ai/dsh-app-boot": "0.2.2-alpha.2",
|
|
38
|
+
"@deepseek-ai/dsh-experimental-webworker-runtime": "0.2.2-alpha.2",
|
|
39
|
+
"@deepseek-ai/dsh-official-bundles": "0.2.2-alpha.2",
|
|
40
|
+
"@deepseek-ai/dsh-session-format": "0.2.2-alpha.2",
|
|
41
|
+
"@deepseek-ai/dsh-session-format-catalog": "0.2.2-alpha.2",
|
|
42
|
+
"@deepseek-ai/dsh-session-format-v3-to-v4": "0.2.2-alpha.2",
|
|
42
43
|
"js-yaml": "^4.3.2",
|
|
43
44
|
"picomatch": "^4.0.7"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
|
-
"@deepseek-ai/cordis": "~4.0.
|
|
47
|
+
"@deepseek-ai/cordis": "~4.0.6-alpha.1",
|
|
47
48
|
"@types/js-yaml": "^4.0.9",
|
|
48
49
|
"@types/picomatch": "^4.0.3"
|
|
49
50
|
},
|
|
50
51
|
"peerDependencies": {
|
|
51
|
-
"@deepseek-ai/cordis": "~4.0.
|
|
52
|
+
"@deepseek-ai/cordis": "~4.0.6-alpha.1"
|
|
52
53
|
}
|
|
53
54
|
}
|