mirror of
https://gitee.com/honghuangdc/soybean-admin-element-plus.git
synced 2025-12-30 10:22:25 +00:00
chore(other): 🥚 add postbuild print (#47)
* chore(other): 🥚 add postbuild print * fix(projects): 🐛 fix ElementPlus in GlobalComponents
This commit is contained in:
1
.npmrc
1
.npmrc
@@ -2,3 +2,4 @@ registry=https://registry.npmmirror.com/
|
||||
shamefully-hoist=true
|
||||
ignore-workspace-root-check=true
|
||||
link-workspace-packages=true
|
||||
enable-pre-post-scripts=true
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { PluginOption } from 'vite';
|
||||
import Icons from 'unplugin-icons/vite';
|
||||
import IconsResolver from 'unplugin-icons/resolver';
|
||||
import Components from 'unplugin-vue-components/vite';
|
||||
// import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
|
||||
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
|
||||
import { FileSystemIconLoader } from 'unplugin-icons/loaders';
|
||||
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons';
|
||||
|
||||
@@ -31,7 +31,7 @@ export function setupUnplugin(viteEnv: Env.ImportMeta) {
|
||||
dts: 'src/typings/components.d.ts',
|
||||
types: [{ from: 'vue-router', names: ['RouterLink', 'RouterView'] }],
|
||||
resolvers: [
|
||||
// ElementPlusResolver(), // auto import Element Plus components。 full import to see /src/plugins/ui.ts
|
||||
ElementPlusResolver(), // auto import Element Plus components。 full import to see /src/plugins/ui.ts
|
||||
IconsResolver({ customCollections: [collectionName], componentPrefix: VITE_ICON_PREFIX })
|
||||
]
|
||||
}),
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
"dev:prod": "vite --mode prod",
|
||||
"gen-route": "sa gen-route",
|
||||
"lint": "eslint . --fix",
|
||||
"postbuild": "sa print-soybean",
|
||||
"prepare": "simple-git-hooks",
|
||||
"preview": "vite preview",
|
||||
"release": "sa release",
|
||||
|
||||
@@ -4,3 +4,4 @@ export * from './update-pkg';
|
||||
export * from './changelog';
|
||||
export * from './release';
|
||||
export * from './router';
|
||||
export * from './print-soybean';
|
||||
|
||||
16
packages/scripts/src/commands/print-soybean.ts
Normal file
16
packages/scripts/src/commands/print-soybean.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
const SOYBEANJS =
|
||||
'2020205f5f5f5f5f202020205f5f5f5f2020205f5f20202020205f5f20205f5f5f5f202020205f5f5f5f5f5f20202020202020202020202020205f2020205f20202020202020205f202020205f5f5f5f5f200a20202f205f5f5f5f7c20202f205f5f205c20205c205c2020202f202f207c20205f205c20207c20205f5f5f5f7c20202020202f5c20202020207c205c207c207c2020202020207c207c20202f205f5f5f5f7c0a207c20285f5f5f2020207c207c20207c207c20205c205c5f2f202f20207c207c5f29207c207c207c5f5f202020202020202f20205c202020207c20205c7c207c2020202020207c207c207c20285f5f5f20200a20205c5f5f5f205c20207c207c20207c207c2020205c2020202f2020207c20205f203c20207c20205f5f7c20202020202f202f5c205c2020207c202e2060207c20205f2020207c207c20205c5f5f5f205c200a20205f5f5f5f29207c207c207c5f5f7c207c202020207c207c202020207c207c5f29207c207c207c5f5f5f5f2020202f205f5f5f5f205c20207c207c5c20207c207c207c5f5f7c207c20205f5f5f5f29207c0a207c5f5f5f5f5f2f2020205c5f5f5f5f2f20202020207c5f7c202020207c5f5f5f5f2f20207c5f5f5f5f5f5f7c202f5f2f202020205c5f5c207c5f7c205c5f7c20205c5f5f5f5f2f20207c5f5f5f5f5f2f20';
|
||||
|
||||
function decode16(str: string): string {
|
||||
const arr: string[] = [];
|
||||
for (let i = 0; i < str.length; i += 2) {
|
||||
const asciiCode = Number.parseInt(str.slice(i, i + 2), 16);
|
||||
const charValue = String.fromCharCode(asciiCode);
|
||||
arr.push(charValue);
|
||||
}
|
||||
return arr.join('');
|
||||
}
|
||||
|
||||
export async function printSoybean() {
|
||||
console.log(decode16(SOYBEANJS));
|
||||
}
|
||||
@@ -1,11 +1,28 @@
|
||||
import cac from 'cac';
|
||||
import { blue, lightGreen } from 'kolorist';
|
||||
import { version } from '../package.json';
|
||||
import { cleanup, genChangelog, generateRoute, gitCommit, gitCommitVerify, release, updatePkg } from './commands';
|
||||
import {
|
||||
cleanup,
|
||||
genChangelog,
|
||||
generateRoute,
|
||||
gitCommit,
|
||||
gitCommitVerify,
|
||||
printSoybean,
|
||||
release,
|
||||
updatePkg
|
||||
} from './commands';
|
||||
import { loadCliOptions } from './config';
|
||||
import type { Lang } from './locales';
|
||||
|
||||
type Command = 'cleanup' | 'update-pkg' | 'git-commit' | 'git-commit-verify' | 'changelog' | 'release' | 'gen-route';
|
||||
type Command =
|
||||
| 'cleanup'
|
||||
| 'update-pkg'
|
||||
| 'git-commit'
|
||||
| 'git-commit-verify'
|
||||
| 'changelog'
|
||||
| 'release'
|
||||
| 'gen-route'
|
||||
| 'print-soybean';
|
||||
|
||||
type CommandAction<A extends object> = (args?: A) => Promise<void> | void;
|
||||
|
||||
@@ -96,6 +113,12 @@ export async function setupCli() {
|
||||
action: async () => {
|
||||
await generateRoute();
|
||||
}
|
||||
},
|
||||
'print-soybean': {
|
||||
desc: 'print soybean',
|
||||
action: async () => {
|
||||
await printSoybean();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
6
src/typings/components.d.ts
vendored
6
src/typings/components.d.ts
vendored
@@ -23,8 +23,6 @@ declare module 'vue' {
|
||||
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
|
||||
ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
|
||||
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
|
||||
ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
|
||||
ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
|
||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||
ElDivider: typeof import('element-plus/es')['ElDivider']
|
||||
ElDrawer: typeof import('element-plus/es')['ElDrawer']
|
||||
@@ -49,16 +47,12 @@ declare module 'vue' {
|
||||
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
||||
ElSelect: typeof import('element-plus/es')['ElSelect']
|
||||
ElSpace: typeof import('element-plus/es')['ElSpace']
|
||||
ElStatistic: typeof import('element-plus/es')['ElStatistic']
|
||||
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
|
||||
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
||||
ElTable: typeof import('element-plus/es')['ElTable']
|
||||
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
||||
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
||||
ElTabs: typeof import('element-plus/es')['ElTabs']
|
||||
ElTag: typeof import('element-plus/es')['ElTag']
|
||||
ElTimeline: typeof import('element-plus/es')['ElTimeline']
|
||||
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
|
||||
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
||||
ElTree: typeof import('element-plus/es')['ElTree']
|
||||
ElWatermark: typeof import('element-plus/es')['ElWatermark']
|
||||
|
||||
Reference in New Issue
Block a user