diff --git a/internals/cli/src/commands/build/build-ui.ts b/internals/cli/src/commands/build/build-ui.ts index c1ede9996..8dd742548 100644 --- a/internals/cli/src/commands/build/build-ui.ts +++ b/internals/cli/src/commands/build/build-ui.ts @@ -10,7 +10,7 @@ import { getAlias, pathFromWorkspaceRoot } from '../../config/vite' import { external } from '../../shared/config' import type { Module } from '../../shared/module-utils' import { getAllIcons, getAllModules, getByName } from '../../shared/module-utils' -import { logGreen, kebabCase, capitalizeKebabCase, getMinorVersion, isValidVersion } from '../../shared/utils' +import { logGreen, kebabCase, capitalizeKebabCase, getPatchVersion, isValidVersion } from '../../shared/utils' import generatePackageJsonPlugin from './rollup/generate-package-json' import inlineChunksPlugin from './rollup/inline-chunks' import replaceModuleNamePlugin from './rollup/replace-module-name' @@ -138,9 +138,9 @@ export const getBaseConfig = ({ vueVersion, dtsInclude, dts, buildTarget, isRunt Object.entries(content.dependencies).forEach(([key, value]) => { // dependencies里的@opentiny,统一使用:~x.x.0 if (isThemeOrRenderless(key)) { - dependencies[key] = getMinorVersion(themeAndRenderlessVersion) + dependencies[key] = getPatchVersion(themeAndRenderlessVersion) } else if ((value as string).includes('workspace:~')) { - dependencies[key] = getMinorVersion(versionTarget) + dependencies[key] = getPatchVersion(versionTarget) } else { dependencies[key] = value } diff --git a/internals/cli/src/commands/build/rollup/inline-chunks.ts b/internals/cli/src/commands/build/rollup/inline-chunks.ts index 1330507a3..aa5d02658 100644 --- a/internals/cli/src/commands/build/rollup/inline-chunks.ts +++ b/internals/cli/src/commands/build/rollup/inline-chunks.ts @@ -25,6 +25,8 @@ export default function ({ deleteInlinedFiles = true }): Plugin { .replace(/export {[\s\S]+$/, '') .replace(/_extends/g, '_extends_tiny') .replace(/_createForOfIteratorHelperLoose/g, '_createForOfIteratorHelperLoose_tiny') + .replace(/_unsupportedIterableToArray/g, '_unsupportedIterableToArray_tiny') + .replace(/_arrayLikeToArray/g, '_arrayLikeToArray_tiny') bundlesToDelete.add(chunkName) } diff --git a/internals/cli/src/shared/utils.ts b/internals/cli/src/shared/utils.ts index e851b873e..fc5b8c238 100644 --- a/internals/cli/src/shared/utils.ts +++ b/internals/cli/src/shared/utils.ts @@ -283,6 +283,13 @@ const getMinorVersion = (version) => { return `~${semver.major(version)}.${semver.minor(version)}.0` } +// 支持 alpha / beta 等版本号 +export const getPatchVersion = (version) => { + const versionItems = version.split('.') + versionItems.pop() + return `~${versionItems.join('.')}.0` +} + /** * 获取组件的版本号 * @param {String} name 文件名|字段名 diff --git a/packages/vue-common/src/adapter/vue2/index.ts b/packages/vue-common/src/adapter/vue2/index.ts index 0477e3d5c..de4a728e1 100644 --- a/packages/vue-common/src/adapter/vue2/index.ts +++ b/packages/vue-common/src/adapter/vue2/index.ts @@ -5,16 +5,16 @@ import { bindFilter, emitter, getElementCssClass, getElementStatusClass } from ' import teleport from '../teleport' // vue2.7有version字段 -const isVueHoos = Boolean(vueHooks.version?.includes('2.7')) +const isVueHooks = Boolean(Vue.version?.includes('2.7')) -const hooks = isVueHoos ? vueHooks : compositionHooks +const hooks = isVueHooks ? vueHooks : compositionHooks const Teleport = teleport(hooks) export { emitter, bindFilter, getElementCssClass, getElementStatusClass, Teleport } // 只有在vue的版本小于2.7并且composition-api没有注册的情况下才去注册hooks -if (!hooks.default['__composition_api_installed__'] && !isVueHoos) { +if (!hooks.default['__composition_api_installed__'] && !isVueHooks) { Vue.use(hooks.default) } diff --git a/packages/vue/src/rich-text-editor/index.ts b/packages/vue/src/rich-text-editor/index.ts index 468f44984..872a159cb 100644 --- a/packages/vue/src/rich-text-editor/index.ts +++ b/packages/vue/src/rich-text-editor/index.ts @@ -1,5 +1,4 @@ import RichTextEditor from './src/pc.vue' -import '@opentiny/vue-theme/logout/index.less' import { version } from './package.json' /* istanbul ignore next */ diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index ea345b935..2d98772f4 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -2,5 +2,3 @@ packages: - packages/** - examples/* - internals/* - - '!packages/dist*/**' - - '!packages/**/dist'