Conversation
WalkthroughThis PR primarily bumps versions from 2.7.4 to 2.7.5 across packages. It also updates import map handling in packages/design-core/src/preview/src/preview/importMap.js to optionally apply custom import mappings from meta, adjusting placeholder replacement to be key-aware. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Preview as Preview (design-core)
participant Meta as Meta Register
participant Env as Env Vars
Preview->>Meta: getMergeMeta()
Meta-->>Preview: { customImportMap? }
Preview->>Env: useEnv()
Env-->>Preview: { VITE_CDN_DOMAIN, delimiters }
alt custom importMap provided
loop for each import key k
Preview->>Preview: replacePlaceholder(value, k)\n- use customImportMap.imports[k]\n- substitute placeholders
end
else no custom map
loop for each import key k
Preview->>Preview: replacePlaceholder(value, k)\n- default placeholder substitution
end
end
Preview-->>Preview: getImportMap() returns final imports
Note over Preview: Internal call signature changed:\nreplacePlaceholder(v, k)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 8
🧹 Nitpick comments (6)
packages/plugins/help/package.json (1)
10-12: Optional: add an exports map for clearer ESM entry resolution.Not required for this bump, but consider switching to exports to future‑proof consumption in Node/bundlers.
Apply:
"type": "module", - "main": "dist/index.js", - "module": "dist/index.js", + "exports": { + ".": { + "import": "./dist/index.js", + "default": "./dist/index.js" + } + },packages/toolbars/clean/package.json (1)
1-41: Add engines.node for Vite 5 compatibility (Node >=18).Since devDependencies use Vite 5, declare the Node runtime to avoid install/build surprises.
Apply near the top-level:
{ "name": "@opentiny/tiny-engine-toolbar-clean", "version": "2.7.5", + "engines": { + "node": ">=18" + }, "publishConfig": { "access": "public" },packages/plugins/schema/package.json (1)
1-44: Optional: add "exports" for clearer ESM entry and tooling interop.Defining an exports map improves Node/bundler resolution and prevents deep import paths. If this package is ESM-only, consider:
{ "name": "@opentiny/tiny-engine-plugin-schema", "version": "2.7.5", + "exports": { + ".": { + "import": "./dist/index.js" + } + }, "publishConfig": { "access": "public" }, "scripts": { "build": "vite build" }, "type": "module", "main": "dist/index.js", "module": "dist/index.js",packages/plugins/robot/package.json (1)
1-42: Optional: declare Node engine (Vite 5 requires Node ≥18)Add an
engines.nodeconstraint to prevent installs on unsupported Node versions."version": "2.7.5", "publishConfig": { "access": "public" }, + "engines": { + "node": ">=18" + }, "scripts": { "build": "vite build" },packages/design-core/src/preview/src/preview/importMap.js (2)
50-51: Also merge additional custom imports (not only overrides).Currently, custom entries only override defaults; extra keys are ignored. Merge them so custom maps can add packages too. Keep scripts last to override all.
Apply this diff:
importMap.imports = { - ...Object.fromEntries(Object.entries(importMapJSON.imports).map(([k, v]) => [k, replacePlaceholder(v, k)])), + ...Object.fromEntries(Object.entries(importMapJSON.imports).map(([k, v]) => [k, replacePlaceholder(v, k)])), + ...Object.fromEntries( + Object.entries(getMergeMeta('engine.config')?.importMap?.imports || {}).map(([k, v]) => [k, replacePlaceholder(v, k)]) + ), ...scripts }
20-31: Minor robustness/perf nits (optional).
- Cache env-derived values once per getImportMap call to avoid repeated useEnv calls.
- If placeholders can appear multiple times, prefer replaceAll or a global regex.
- When building cdnDomain for local bundles, ensure a single slash between BASE_URL and VITE_LOCAL_IMPORT_PATH.
I can provide a small refactor if you want.
Also applies to: 41-46
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (55)
designer-demo/package.json(1 hunks)mockServer/package.json(1 hunks)packages/block-compiler/package.json(1 hunks)packages/build/vite-config/package.json(1 hunks)packages/build/vite-plugin-meta-comments/package.json(1 hunks)packages/builtinComponent/package.json(1 hunks)packages/canvas/package.json(1 hunks)packages/common/package.json(1 hunks)packages/configurator/package.json(1 hunks)packages/design-core/package.json(1 hunks)packages/design-core/src/preview/src/preview/importMap.js(3 hunks)packages/engine-cli/package.json(1 hunks)packages/engine-cli/template/designer/package.json(2 hunks)packages/i18n/package.json(1 hunks)packages/layout/package.json(1 hunks)packages/plugins/block/package.json(1 hunks)packages/plugins/bridge/package.json(1 hunks)packages/plugins/datasource/package.json(1 hunks)packages/plugins/help/package.json(1 hunks)packages/plugins/i18n/package.json(1 hunks)packages/plugins/materials/package.json(1 hunks)packages/plugins/page/package.json(1 hunks)packages/plugins/robot/package.json(1 hunks)packages/plugins/schema/package.json(1 hunks)packages/plugins/script/package.json(1 hunks)packages/plugins/state/package.json(1 hunks)packages/plugins/tree/package.json(1 hunks)packages/plugins/tutorial/package.json(1 hunks)packages/register/package.json(1 hunks)packages/settings/design/package.json(1 hunks)packages/settings/events/package.json(1 hunks)packages/settings/panel/package.json(1 hunks)packages/settings/props/package.json(1 hunks)packages/settings/styles/package.json(1 hunks)packages/svgs/package.json(1 hunks)packages/theme/base/package.json(1 hunks)packages/toolbars/breadcrumb/package.json(1 hunks)packages/toolbars/clean/package.json(1 hunks)packages/toolbars/collaboration/package.json(1 hunks)packages/toolbars/fullscreen/package.json(1 hunks)packages/toolbars/generate-code/package.json(1 hunks)packages/toolbars/lang/package.json(1 hunks)packages/toolbars/lock/package.json(1 hunks)packages/toolbars/logo/package.json(1 hunks)packages/toolbars/media/package.json(1 hunks)packages/toolbars/preview/package.json(1 hunks)packages/toolbars/redoundo/package.json(1 hunks)packages/toolbars/refresh/package.json(1 hunks)packages/toolbars/save/package.json(1 hunks)packages/toolbars/setting/package.json(1 hunks)packages/toolbars/themeSwitch/package.json(1 hunks)packages/toolbars/view-setting/package.json(1 hunks)packages/utils/package.json(1 hunks)packages/vue-generator/package.json(1 hunks)packages/webcomponent/package.json(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-12-14T05:53:28.501Z
Learnt from: gene9831
PR: opentiny/tiny-engine#917
File: docs/开始/快速上手.md:31-31
Timestamp: 2024-12-14T05:53:28.501Z
Learning: The latest stable version of `opentiny/tiny-engine-cli` is `2.0.0`, and documentation should reference this version instead of any release candidates.
Applied to files:
mockServer/package.jsonpackages/i18n/package.jsonpackages/plugins/tree/package.jsonpackages/settings/design/package.jsonpackages/design-core/package.jsonpackages/register/package.jsonpackages/engine-cli/package.jsonpackages/utils/package.jsonpackages/plugins/page/package.jsonpackages/svgs/package.jsonpackages/webcomponent/package.jsonpackages/plugins/tutorial/package.jsonpackages/layout/package.jsonpackages/block-compiler/package.jsonpackages/plugins/state/package.jsonpackages/plugins/schema/package.jsonpackages/plugins/help/package.jsonpackages/vue-generator/package.jsonpackages/theme/base/package.jsonpackages/settings/styles/package.jsonpackages/toolbars/generate-code/package.jsonpackages/builtinComponent/package.jsonpackages/canvas/package.jsonpackages/settings/props/package.jsonpackages/plugins/block/package.jsonpackages/plugins/bridge/package.jsonpackages/common/package.jsonpackages/plugins/i18n/package.jsonpackages/toolbars/breadcrumb/package.jsonpackages/configurator/package.jsonpackages/plugins/script/package.jsonpackages/build/vite-config/package.jsonpackages/plugins/robot/package.json
📚 Learning: 2024-09-30T07:51:10.036Z
Learnt from: chilingling
PR: opentiny/tiny-engine#837
File: packages/vue-generator/src/plugins/genDependenciesPlugin.js:66-66
Timestamp: 2024-09-30T07:51:10.036Z
Learning: In the `tiny-engine` project, `opentiny/tiny-engine-dsl-vue` refers to the current package itself, and importing types from it may cause circular dependencies.
Applied to files:
packages/vue-generator/package.jsonpackages/engine-cli/template/designer/package.jsonpackages/build/vite-config/package.json
🧬 Code graph analysis (1)
packages/design-core/src/preview/src/preview/importMap.js (2)
packages/register/src/common.ts (1)
getMergeMeta(53-55)packages/design-core/src/preview/src/preview/srcFiles.js (2)
versionDelimiter(30-30)fileDelimiter(31-31)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: push-check
🔇 Additional comments (48)
packages/toolbars/lang/package.json (1)
3-3: Approve version bump—monorepo is fully aligned on 2.7.5
Monorepo-wide check confirms all @opentiny packages are at 2.7.5.packages/plugins/i18n/package.json (1)
3-3: Monorepo version bump to 2.7.5 verified
All packages, including plugin-i18n, are updated; no stale 2.7.4 references found. Ready to publish.packages/toolbars/media/package.json (1)
3-3: Approve version bump; monorepo consistent All @opentiny/tiny-engine-* packages are at 2.7.5 with no leftover 2.7.4 versions.packages/settings/styles/package.json (1)
3-3: All package.json versions are 2.7.5 and no 2.7.4 references remain. Version bump approved.packages/toolbars/clean/package.json (1)
3-3: Approve version bump to 2.7.5
All package.json files updated; no lingering 2.7.4 versions detected.packages/plugins/schema/package.json (1)
3-3: Ensure monorepo version alignment and workspace resolution
- Found packages not at 2.7.5:
• packages/engine-cli/template/designer/package.json (0.0.0)
• packages/engine-cli/template/plugin/package.json (1.0.0)
• packages/engine-cli/template/theme/package.json (2.0.0)
• packages/vue-generator/test/testcases/element-plus-case/expected/appdemo01/package.json (1.0.0)
• packages/vue-generator/test/testcases/generator/expected/appdemo01/package.json (1.0.0)- Detected internal deps without
workspace:*:
• @opentiny/tiny-engine-builtin-component@^2.0.0 → vue-generator/test/testcases/generator/expected/appdemo01/package.json
• @opentiny/tiny-engine-i18n-host@^1.0.0 → vue-generator/test/testcases/{element-plus-case,generator}/expected/appdemo01/package.json
• @opentiny/tiny-engine-meta-register,@tiny-engine-mock,@tiny-engine-utils,@tiny-engine-vite-config@^2.7.5 → engine-cli/template/designer
• @opentiny/tiny-engine@^2.5.0 → engine-cli/template/plugin- Confirm these mismatches are intentional (tests/templates) or bump versions and convert to
workspace:*before publishing.packages/toolbars/collaboration/package.json (1)
3-3: Version bump to 2.7.5 — LGTM.
- No deprecated
getMergeRegistryusage found in this package.- Confirm the lower versions in engine-cli templates and test fixtures are intentional.
- Add or update a changelog/release note for v2.7.5.
- Commit the updated root lockfile (pnpm-lock.yaml, yarn.lock, or package-lock.json).
packages/plugins/robot/package.json (1)
3-3: Version bump approved; all 2.7.x packages updated
No packages remain at 2.7.4 or mismatched 2.7.x versions; workspace:* deps are intact and will be resolved at publish.packages/block-compiler/package.json (1)
3-3: Version bump to 2.7.5: LGTMpackages/toolbars/preview/package.json (1)
3-3: Version bump to 2.7.5: LGTMpackages/utils/package.json (1)
3-3: Version bump to 2.7.5: LGTMpackages/toolbars/breadcrumb/package.json (1)
3-3: Version bump to 2.7.5: LGTMpackages/plugins/tree/package.json (1)
3-3: Version bump to 2.7.5: LGTMpackages/theme/base/package.json (1)
3-3: Version bump to 2.7.5: LGTMpackages/build/vite-config/package.json (1)
3-3: Version bump to 2.7.5: LGTMpackages/svgs/package.json (1)
3-3: Approve version bump to 2.7.5
All packages are aligned to v2.7.5.packages/vue-generator/package.json (1)
3-3: LGTM on version bump.No other changes detected.
packages/settings/design/package.json (1)
3-3: LGTM on version bump.Aligned with the 2.7.5 release train.
packages/toolbars/generate-code/package.json (1)
3-3: LGTM on version bump.No functional changes in this package.
packages/plugins/tutorial/package.json (1)
3-3: LGTM on version bump.Consistent with monorepo release.
packages/i18n/package.json (1)
3-3: LGTM on version bump.No additional diffs in this package.
packages/builtinComponent/package.json (1)
3-3: LGTM on version bump.Nothing else changed here.
packages/settings/events/package.json (1)
3-3: LGTM on version bump.All good for 2.7.5.
mockServer/package.json (1)
3-3: Version bump to 2.7.5 approved. All internal @opentiny/tiny-engine-* packages are consistently at 2.7.5.packages/toolbars/logo/package.json (1)
3-3: LGTM: coordinated version bump.packages/build/vite-plugin-meta-comments/package.json (1)
3-3: LGTM: version updated to 2.7.5.designer-demo/package.json (1)
4-4: LGTM: demo app version aligned to 2.7.5.packages/layout/package.json (1)
3-3: LGTM: layout package version aligned.packages/plugins/page/package.json (1)
3-3: LGTM: plugin-page version bump consistent.packages/plugins/state/package.json (1)
3-3: LGTM: plugin-state version bump consistent.packages/plugins/datasource/package.json (1)
3-3: LGTM: plugin-datasource version bump consistent.packages/design-core/package.json (1)
3-3: Version bump verified: all package.json versions updated to 2.7.5, no lingering 2.7.4, importMap enhancements (getMergeMeta import and replacePlaceholder) are present.packages/toolbars/themeSwitch/package.json (1)
3-3: LGTM on version bump.packages/toolbars/save/package.json (1)
3-3: LGTM on version bump.packages/toolbars/redoundo/package.json (1)
3-3: LGTM on version bump.packages/engine-cli/template/designer/package.json (1)
14-16: Template deps updated to ^2.7.5 — ensure publish order.Before releasing the CLI/template, publish all referenced 2.7.5 packages to avoid install breakage for users.
Also applies to: 27-28
packages/toolbars/view-setting/package.json (1)
3-3: LGTM on version bump.packages/plugins/materials/package.json (1)
3-3: LGTM on version bump.packages/toolbars/refresh/package.json (1)
3-3: LGTM on version bump.packages/settings/panel/package.json (1)
3-3: Version bump looks good; please manually verify no lingering “2.7.4” references across all package.json and template files.packages/canvas/package.json (1)
3-3: Version bump to 2.7.5 — LGTMPatch bump only; no other changes. Looks good.
packages/webcomponent/package.json (1)
3-3: Version bump to 2.7.5 — LGTMNo functional changes here. OK to proceed.
packages/engine-cli/package.json (1)
3-3: Version bump to 2.7.5 — LGTMEnsure the CLI template/package.json dependencies also reference 2.7.5 where applicable.
packages/common/package.json (1)
3-3: Version bump to 2.7.5 — LGTMAligned with monorepo patch release; no further concerns.
packages/configurator/package.json (1)
3-3: Version bump to 2.7.5 — LGTMNo additional changes detected; safe to publish.
packages/settings/props/package.json (1)
3-3: Version bump to 2.7.5 — LGTMPeers remain unchanged; patch bump is fine.
packages/plugins/bridge/package.json (1)
3-3: Version bump to 2.7.5 — LGTMBridge plugin metadata only; OK.
packages/design-core/src/preview/src/preview/importMap.js (1)
13-13: Verified getMergeMeta export and no getMergeRegistry usage remain
importMap import is correct; no deprecated API calls found.
English | 简体中文
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Background and solution
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
New Features
Chores