Skip to content

Commit 72e4e1b

Browse files
GaoNeng-wWwkagol
authored andcommitted
fix(cli): 修复部分函数命名
1 parent 7c130ae commit 72e4e1b

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

packages/devui-vue/devui-cli/commands/build-volar-support.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
const path = require("path");
22
const {
3-
bundleComponentItem,
4-
bundleGlobalDTSEnd,
5-
bundleGlobalDTSStart,
6-
bundleComponents,
7-
bundleDirectiveItem,
8-
bundleDirective,
9-
bundleServiceItem,
10-
bundleService
3+
buildComponentItem,
4+
buildGlobalDTSEnd,
5+
buildGlobalDTSStart,
6+
buildComponents,
7+
buildDirectiveItem,
8+
buildDirective,
9+
buildServiceItem,
10+
buildService
1111
} = require('../templates/dts');
1212
const { writeFileSync } = require('fs');
1313
const { useRelationTree } = require("../composables/use-relation-tree");
@@ -40,22 +40,22 @@ exports.volarSupport = (replaceIdentifier, readyToReleaseComponentName) => {
4040
nodeName = replaceIdentifier[foldNode.name][node.name]?.['exportKey'];
4141
}
4242
if (node.type === 'component'){
43-
componentDTSItem.push(bundleComponentItem(bigCamelCase(nodeName), reference));
43+
componentDTSItem.push(buildComponentItem(bigCamelCase(nodeName), reference));
4444
}
4545
if (node.type === 'directive'){
46-
directiveDTSItem.push(bundleDirectiveItem(nodeName, reference));
46+
directiveDTSItem.push(buildDirectiveItem(nodeName, reference));
4747
}
4848
if (node.type === 'service'){
49-
serviceDTSItem.push(bundleServiceItem(nodeName, reference));
49+
serviceDTSItem.push(buildServiceItem(nodeName, reference));
5050
}
5151
});
5252
});
5353
const template = `
54-
${bundleGlobalDTSStart()}
55-
${bundleComponents(componentDTSItem.join('\n'))}
56-
${bundleDirective(directiveDTSItem.join('\n'))}
57-
${bundleService(serviceDTSItem.join('\n'))}
58-
${bundleGlobalDTSEnd()}
54+
${buildGlobalDTSStart()}
55+
${buildComponents(componentDTSItem.join('\n'))}
56+
${buildDirective(directiveDTSItem.join('\n'))}
57+
${buildService(serviceDTSItem.join('\n'))}
58+
${buildGlobalDTSEnd()}
5959
`;
6060
try {
6161
writeFileSync('./build/global.d.ts', template);

packages/devui-vue/devui-cli/commands/build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ exports.build = async () => {
102102
} catch {}
103103
nuxtBuild.createNuxtPlugin();
104104
logger.success('准备生成global.d.ts');
105-
const volarSupportBundleState = volarSupport(replaceIdentifier, readyToReleaseComponentName);
105+
const volarSupportbuildState = volarSupport(replaceIdentifier, readyToReleaseComponentName);
106106
fs.writeFileSync('./build/index.d.ts', `
107107
export * from './types/vue-devui';
108108
import _default from './types/vue-devui';
109109
export default _default;
110110
`);
111-
if (volarSupportBundleState){
111+
if (volarSupportbuildState){
112112
logger.success('global.d.ts生成成功');
113113
} else {
114114
logger.error('global.d.ts生成失败, 因为发生错误');

packages/devui-vue/devui-cli/templates/dts.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
exports.bundleGlobalDTSStart = () => {
1+
exports.buildGlobalDTSStart = () => {
22
return `
33
export{}
44
declare module '@vue/runtime-core' {`;
55
};
6-
exports.bundleComponentItem = (componentName, key='') => {
6+
exports.buildComponentItem = (componentName, key='') => {
77
return `D${componentName}: typeof import('./types/vue-devui')['${key || componentName}']`;
88
};
9-
exports.bundleDirectiveItem = (directive, key='') => {
9+
exports.buildDirectiveItem = (directive, key='') => {
1010
return `v${directive}?: typeof import('./types/vue-devui')['${key || directive}']`;
1111
};
12-
exports.bundleServiceItem = (service,key='') => {
12+
exports.buildServiceItem = (service,key='') => {
1313
return `$${service}?: typeof import('./types/vue-devui')['${key || service}']`;
1414
};
15-
exports.bundleGlobalDTSEnd = () => {
15+
exports.buildGlobalDTSEnd = () => {
1616
return `
1717
}`;
1818
};
19-
exports.bundleComponents = (componentString) => {
19+
exports.buildComponents = (componentString) => {
2020
return `
2121
export interface GlobalComponents{
2222
${componentString}
2323
}
2424
`;
2525
};
26-
exports.bundleDirective = (directiveString) => {
26+
exports.buildDirective = (directiveString) => {
2727
return `
2828
export interface ComponentCustomProps {
2929
${directiveString}
3030
}
3131
`;
3232
};
33-
exports.bundleService = (serviceSting) => {
33+
exports.buildService = (serviceSting) => {
3434
return `
3535
export interface ComponentCustomProperties{
3636
${serviceSting}

0 commit comments

Comments
 (0)