From 654caa4bbd691dc86f168ed7f744eebdbfa32f08 Mon Sep 17 00:00:00 2001 From: Turtle Date: Sun, 20 Sep 2026 18:20:24 +0800 Subject: [PATCH] feat(bundle): accept an ordered patch file list in dsh.bundle.patch (#4722) * feat(bundle): accept an ordered patch file list in dsh.bundle.patch `dsh.bundle.patch` now accepts `string | string[]`. A list names patch files applied in order as one bundle layer; each file's relative plugin paths still resolve beside that file. `bundlePatchPaths` in dsh-app-boot is the one resolver from a declaration to absolute paths, and every reader uses it: profile loading, plugin-manager reconcile and bundle rows, the client-runtime roster, and the workspace, cordis-config, and product-isolation gates. `ProfileLayer.patchPath` becomes `patchPaths`. * fix(bundle): keep declared patch files package-relative in the workspace gate path.join produced backslash entries on Windows, so the expected files list did not match package.json files. bundlePatchFiles returns the validated declaration as written; bundlePatchPaths joins it. --- apps/cli/tests/resolved-profile-boot.spec.ts | 2 +- apps/web/tests/scaffold.ts | 2 +- docs/user/develop/basic/publish.i18n.yaml | 4 +- docs/user/develop/basic/publish.md | 2 +- docs/user/develop/basic/publish.zh.md | 2 +- packages/boot/app-boot/README.i18n.yaml | 4 +- packages/boot/app-boot/README.md | 2 +- packages/boot/app-boot/README.zh.md | 2 +- packages/boot/app-boot/src/index.ts | 2 + packages/boot/app-boot/src/profile.ts | 52 ++++++++++++++----- .../app-boot/tests/profile-resolution.spec.ts | 12 ++--- packages/boot/app-boot/tests/profile.spec.ts | 40 ++++++++++++-- packages/boot/plugin-manager/src/index.ts | 14 ++--- .../boot/plugin-manager/src/operations.ts | 4 +- .../src/assembly/bundle-roster.ts | 20 ++++--- .../assembly-bundle-roster.client.spec.ts | 13 ++++- .../tests/fixtures/production-profile.ts | 2 +- .../util/package-manifest/README.i18n.yaml | 4 +- packages/util/package-manifest/README.md | 2 +- packages/util/package-manifest/README.zh.md | 2 +- packages/util/package-manifest/src/types.ts | 4 +- scripts/check-workspace-constraints.spec.ts | 9 ++++ scripts/check-workspace-constraints.ts | 11 ++-- scripts/verify-cordis-config.ts | 15 +++--- scripts/verify-default-product-isolation.ts | 13 ++--- 25 files changed, 166 insertions(+), 73 deletions(-) diff --git a/apps/cli/tests/resolved-profile-boot.spec.ts b/apps/cli/tests/resolved-profile-boot.spec.ts index ff7609c83b..0df34251c6 100644 --- a/apps/cli/tests/resolved-profile-boot.spec.ts +++ b/apps/cli/tests/resolved-profile-boot.spec.ts @@ -125,7 +125,7 @@ describe('runProfile with an application-owned profile', () => { name: 'desktop', dir: home, patchPath: profilePatch, patches: [{ id: 'target', config: { profile: true, priority: 'profile' } }], layers: [{ - packageName: 'test-bundle', packageDir: home, patchPath: join(home, 'bundle.yml'), + packageName: 'test-bundle', packageDir: home, patchPaths: [join(home, 'bundle.yml')], patches: [{ insert: [ { id: 'target', name: 'target', config: { bundle: true, priority: 'bundle' } }, { id: 'session-telemetry-otel', name: 'telemetry' }, diff --git a/apps/web/tests/scaffold.ts b/apps/web/tests/scaffold.ts index b02ae8b91a..1a95d41d96 100644 --- a/apps/web/tests/scaffold.ts +++ b/apps/web/tests/scaffold.ts @@ -726,7 +726,7 @@ export async function launchWebScaffold(options: LaunchOptions = {}): Promise` and combines installable bundles with its own `cordis.patch.yml`. The YAML composition enables or disables HMR. The shipped `web` template uses live reload, while the other shipped templates apply patches only at startup. `sdk-minimal` names only its standalone bundle; the other templates retain base-plus-mode stacks. `dsh --profile --from-default-profile