diff --git a/internals/cli/package.json b/internals/cli/package.json index 2c68c376f9..71bcd19ded 100644 --- a/internals/cli/package.json +++ b/internals/cli/package.json @@ -12,12 +12,10 @@ "build": "tsup", "// -------注意带 # 开头的脚本命令不要直接执行------- ": "", "build:entry": "esno src/index.ts build:entry", - "#build:entry1": "node dist/index.js build:entry", "build:entry-app": "esno src/commands/build/build-entry-app.ts", "// ---------------------build 构建--------------------- ": "", "build:ui": "esno src/index.ts build:ui", - "build:ui1": "pnpm build && node dist/index.js build:ui", - "// #build:runtime-vue 构建适用于 Vue2/Vue3 的组件 Runtime (按需加载)": "", + "// 构建适用于 Vue2/Vue3 的组件 Runtime (按需加载)": "", "build:runtime": "pnpm build:entry-app && esno src/index.ts build:runtime", "// ---------------------全局适配@aurora包名--------------------- ": "", "release:aurora": "esno src/index.ts release:aurora", @@ -25,7 +23,6 @@ "release:e2eConfig": "esno src/index.ts release:e2eConfig", "// ----------------------辅助脚本---------------------- ": "", "create:ui": "esno src/commands/create/create-ui.ts", - "sync-icons": "esno src/commands/create/sync-icons.ts", "create:icon-saas": "esno src/index.ts create:icon-saas", "clean:build": "esno src/commands/clean.ts", "create:mapping": "esno src/commands/create/create-mapping.ts", diff --git a/internals/cli/src/commands/sync/sync-icons.ts b/internals/cli/src/commands/sync/sync-icons.ts deleted file mode 100644 index 722d964a92..0000000000 --- a/internals/cli/src/commands/sync/sync-icons.ts +++ /dev/null @@ -1,106 +0,0 @@ -/** - * 初始化/创建 ICON 组件,从 @opentiny/vue-theme/svgs 中提取 SVG 图标创建对应的 ICON 组件 - */ -import path from 'node:path' -import fs from 'fs-extra' -import semver from 'semver' -import { EOL } from 'node:os' -import handlebarsRender from '../build/handlebars.render' -import { - pathJoin, - logYellow, - getopentinyVersion, - capitalizeKebabCase, - prettierFormat, - logGreen, - logRed, - templatePath -} from '../../shared/utils' - -const svgRE = /\.svg$/ -const svgDir = pathJoin('..', 'node_modules', '@opentiny', 'theme', 'svgs') -const iconDir = pathJoin('..', 'packages', 'icon') -const packageJson = 'package.json' - -// 检查是否安装依赖包 -if (!fs.existsSync(svgDir)) { - logYellow('The @opentiny/vue-theme is not exist , please npm install @opentiny/vue-theme.') -} - -// 是否包含 package/icon 目录 -if (!fs.existsSync(iconDir)) { - fs.mkdirSync(iconDir) - - const version = getopentinyVersion({ key: 'version' }) - const iconTemplate = fs.readJSONSync(path.join(templatePath, 'component', packageJson)) - - // 删除多余的依赖 - if (iconTemplate.dependencies) { - delete iconTemplate.dependencies['@opentiny/vue-renderless'] - } - - const packageContent = handlebarsRender({ - template: JSON.stringify(iconTemplate), - data: { - NAME: 'icon', - MINOR: semver.minor(version) - }, - delimiter: ['\\[\\[', '\\]\\]'] - }) - - fs.writeFileSync(path.join(iconDir, packageJson), packageContent) -} - -const exportComponents: string[] = [] -const exportIcons: string[] = [] -const componentTemplate = fs.readFileSync(path.join(templatePath, 'icon', 'index.ts'), { encoding: 'utf8' }) - -// 根据 @opentiny/vue-theme/svgs 中的 svg 图片创建对应的 icon 组件 -fs.readdirSync(svgDir).forEach((fileName) => { - if (svgRE.test(fileName)) { - const svgName = fileName.replace(svgRE, '') - const iconPath = path.join(iconDir, svgName) - - if (!fs.existsSync(iconPath)) { - fs.mkdirSync(iconPath) - - const iconName = capitalizeKebabCase(svgName) - const fullIconName = `Icon${iconName}` - const iconEntryContent = handlebarsRender({ - template: componentTemplate, - data: { - CNAME: iconName, - SNAME: fileName - }, - delimiter: ['\\[\\[', '\\]\\]'] - }) - - fs.writeFileSync(path.join(iconPath, 'index.ts'), prettierFormat({ str: iconEntryContent })) - - exportComponents.push(`import ${fullIconName} from './${svgName}'`) - exportIcons.push(fullIconName) - } - } -}) - -if (exportComponents.length) { - fs.writeFileSync( - path.join(iconDir, 'index.ts'), - prettierFormat({ - str: `${exportComponents.join(EOL)} - - export { - ${exportIcons.join(',' + EOL)} - } - - export default { - ${exportIcons.join(',' + EOL)} - } - ` - }) - ) - - logGreen('npm run create:icon done.') -} else { - logRed('npm run create:icon fail.') -} diff --git a/package.json b/package.json index a326650526..4bdf282726 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,6 @@ "create:icon-saas": "pnpm -C internals/cli create:icon-saas", "// ---------- 创建组件和模板打包入口 ----------": "", "create:mapping": "pnpm -C internals/cli create:mapping", - "sync-icons": "pnpm -C internals/cli sync-icons", "build:entry-app": "pnpm -C internals/cli build:entry-app", "// ---------- 打包运行时组件库 ----------": "", "build:runtime": "pnpm create:icon-saas && pnpm -C internals/cli build:runtime", diff --git a/packages/modules.json b/packages/modules.json index 8077ac1b24..1c68610838 100644 --- a/packages/modules.json +++ b/packages/modules.json @@ -1689,6 +1689,19 @@ "pc" ] }, + "NumberAnimation": { + "path": "vue/src/number-animation/index.ts", + "type": "component", + "exclude": false, + "mode": [ + "pc" + ] + }, + "NumberAnimationPc": { + "path": "vue/src/number-animation/src/pc.vue", + "type": "template", + "exclude": false + }, "Numeric": { "path": "vue/src/numeric/index.ts", "type": "component", @@ -1708,19 +1721,6 @@ "type": "template", "exclude": false }, - "NumberAnimation": { - "path": "vue/src/number-animation/index.ts", - "type": "component", - "exclude": false, - "mode": [ - "pc" - ] - }, - "NumberAnimationPc": { - "path": "vue/src/number-animation/src/pc.vue", - "type": "template", - "exclude": false - }, "Option": { "path": "vue/src/option/index.ts", "type": "component",