Skip to content

Conversation

@chilingling
Copy link
Member

@chilingling chilingling commented Oct 13, 2025

English | 简体中文

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Built its own designer, fully self-validated

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Background and solution

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Preview now supports custom import map overrides, applying environment placeholders automatically and falling back to defaults when not provided. This improves flexibility when loading external resources in design preview.
  • Chores

    • Bumped versions across the suite to 2.7.5, including core, plugins, toolbars, utilities, and templates, with no functional changes.

@github-actions github-actions bot added ignore-for-release release merge to release/ branch, before release period labels Oct 13, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 13, 2025

Walkthrough

This 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

Cohort / File(s) Summary
Import map logic update
packages/design-core/src/preview/src/preview/importMap.js
Added getMergeMeta import; replacePlaceholder signature updated to accept key; getImportMap now passes key into replacePlaceholder; applies customImportMap.imports[k] when provided; retains default placeholder substitution path.
Template dependency version bumps
packages/engine-cli/template/designer/package.json
Dependency ranges updated from ^2.7.4 to ^2.7.5 for @opentiny/tiny-engine related packages.
Root demo/server version bumps
designer-demo/package.json, mockServer/package.json
Version fields bumped from 2.7.4 to 2.7.5.
Build/tooling version bumps
packages/build/vite-config/package.json, packages/build/vite-plugin-meta-comments/package.json, packages/engine-cli/package.json
Version fields bumped from 2.7.4 to 2.7.5.
Core libraries version bumps
packages/block-compiler/package.json, packages/builtinComponent/package.json, packages/canvas/package.json, packages/common/package.json, packages/configurator/package.json, packages/design-core/package.json, packages/i18n/package.json, packages/layout/package.json, packages/register/package.json, packages/svgs/package.json, packages/theme/base/package.json, packages/utils/package.json, packages/vue-generator/package.json, packages/webcomponent/package.json
Version fields bumped from 2.7.4 to 2.7.5.
Settings packages version bumps
packages/settings/.../package.json (design, events, panel, props, styles)
Version fields bumped from 2.7.4 to 2.7.5.
Plugins version bumps
packages/plugins/*/package.json (block, bridge, datasource, help, i18n, materials, page, robot, schema, script, state, tree, tutorial)
Version fields bumped from 2.7.4 to 2.7.5.
Toolbars version bumps
packages/toolbars/*/package.json (breadcrumb, clean, collaboration, fullscreen, generate-code, lang, lock, logo, media, preview, redoundo, refresh, save, setting, themeSwitch, view-setting)
Version fields bumped from 2.7.4 to 2.7.5.

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)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • v2.7.4 #1667 — Prior coordinated version bump from 2.7.3 to 2.7.4 across the same package set.

Suggested reviewers

  • hexqi

Poem

I nudge the knobs from four to five,
A hop, a bump—our versions thrive.
Import maps now know each key,
Custom paths align with glee.
Thump-thump paws on release day,
Carrots queued—ship it, hooray! 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title “v2.7.5” refers to the version bump applied throughout the packages but is overly generic and does not communicate the primary functional change around custom import map integration in preview. It therefore only partially reflects the changeset.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.node constraint 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

📥 Commits

Reviewing files that changed from the base of the PR and between 4ad307d and 59ecd72.

📒 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.json
  • packages/i18n/package.json
  • packages/plugins/tree/package.json
  • packages/settings/design/package.json
  • packages/design-core/package.json
  • packages/register/package.json
  • packages/engine-cli/package.json
  • packages/utils/package.json
  • packages/plugins/page/package.json
  • packages/svgs/package.json
  • packages/webcomponent/package.json
  • packages/plugins/tutorial/package.json
  • packages/layout/package.json
  • packages/block-compiler/package.json
  • packages/plugins/state/package.json
  • packages/plugins/schema/package.json
  • packages/plugins/help/package.json
  • packages/vue-generator/package.json
  • packages/theme/base/package.json
  • packages/settings/styles/package.json
  • packages/toolbars/generate-code/package.json
  • packages/builtinComponent/package.json
  • packages/canvas/package.json
  • packages/settings/props/package.json
  • packages/plugins/block/package.json
  • packages/plugins/bridge/package.json
  • packages/common/package.json
  • packages/plugins/i18n/package.json
  • packages/toolbars/breadcrumb/package.json
  • packages/configurator/package.json
  • packages/plugins/script/package.json
  • packages/build/vite-config/package.json
  • packages/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.json
  • packages/engine-cli/template/designer/package.json
  • packages/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 getMergeRegistry usage 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: LGTM

packages/toolbars/preview/package.json (1)

3-3: Version bump to 2.7.5: LGTM

packages/utils/package.json (1)

3-3: Version bump to 2.7.5: LGTM

packages/toolbars/breadcrumb/package.json (1)

3-3: Version bump to 2.7.5: LGTM

packages/plugins/tree/package.json (1)

3-3: Version bump to 2.7.5: LGTM

packages/theme/base/package.json (1)

3-3: Version bump to 2.7.5: LGTM

packages/build/vite-config/package.json (1)

3-3: Version bump to 2.7.5: LGTM

packages/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 — LGTM

Patch bump only; no other changes. Looks good.

packages/webcomponent/package.json (1)

3-3: Version bump to 2.7.5 — LGTM

No functional changes here. OK to proceed.

packages/engine-cli/package.json (1)

3-3: Version bump to 2.7.5 — LGTM

Ensure 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 — LGTM

Aligned with monorepo patch release; no further concerns.

packages/configurator/package.json (1)

3-3: Version bump to 2.7.5 — LGTM

No additional changes detected; safe to publish.

packages/settings/props/package.json (1)

3-3: Version bump to 2.7.5 — LGTM

Peers remain unchanged; patch bump is fine.

packages/plugins/bridge/package.json (1)

3-3: Version bump to 2.7.5 — LGTM

Bridge 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.

@hexqi hexqi merged commit 137e4b0 into opentiny:release/v2.7.x Oct 14, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-for-release release merge to release/ branch, before release period

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants