@cabloy/module-info 1.1.9 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -6
- package/dist/index.js +4 -127
- package/dist/interface.d.ts +67 -7
- package/dist/onionScenesMeta.d.ts +6 -0
- package/dist/onionScenesMeta.js +48 -0
- package/dist/utils.d.ts +7 -0
- package/dist/utils.js +130 -0
- package/dist/vona.d.ts +9 -0
- package/dist/vona.js +3 -0
- package/dist/zova.d.ts +13 -0
- package/dist/zova.js +3 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { IModuleInfo, TypeProjectEntityType, TypeProjectMode } from './interface.js';
|
|
2
1
|
export * from './interface.js';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export declare function relativeNameToCapitalize(moduleName: string, firstCharToUpperCase: boolean): string;
|
|
2
|
+
export * from './onionScenesMeta.js';
|
|
3
|
+
export * from './utils.js';
|
|
4
|
+
export * from './vona.js';
|
|
5
|
+
export * from './zova.js';
|
|
8
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -14,132 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.relativeNameToCapitalize = exports.parseName = exports.parseInfoPro = exports.parseInfo = exports.parseInfoFromPath = void 0;
|
|
18
17
|
__exportStar(require("./interface.js"), exports);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const parts = pathName.split('/');
|
|
24
|
-
for (let i = parts.length - 1; i >= 0; i--) {
|
|
25
|
-
const part = parts[i];
|
|
26
|
-
if (part.indexOf('-') === -1)
|
|
27
|
-
continue;
|
|
28
|
-
const info = parseInfo(part);
|
|
29
|
-
if (!info)
|
|
30
|
-
continue;
|
|
31
|
-
return info;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.parseInfoFromPath = parseInfoFromPath;
|
|
35
|
-
const PREFIX_A = '/api/';
|
|
36
|
-
const PREFIX_B = 'vona-module-';
|
|
37
|
-
const PREFIX_C = './vona-module-';
|
|
38
|
-
const PREFIX_D = './';
|
|
39
|
-
const PREFIX_E = '/';
|
|
40
|
-
// aa-hello aa/hello
|
|
41
|
-
// first check / then -
|
|
42
|
-
function parseInfo(moduleName) {
|
|
43
|
-
if (!moduleName)
|
|
44
|
-
return;
|
|
45
|
-
if (moduleName.indexOf('://') > -1)
|
|
46
|
-
return;
|
|
47
|
-
if (moduleName.charAt(0) === '/')
|
|
48
|
-
moduleName = moduleName.substring(1);
|
|
49
|
-
let parts = moduleName.split('/').filter(item => item);
|
|
50
|
-
if (parts.length < 2) {
|
|
51
|
-
parts = moduleName.split('-').filter(item => item);
|
|
52
|
-
if (parts.length < 2)
|
|
53
|
-
return;
|
|
54
|
-
if (parts.length === 4)
|
|
55
|
-
parts = parts.slice(2);
|
|
56
|
-
if (parts.length === 5)
|
|
57
|
-
parts = parts.slice(3);
|
|
58
|
-
}
|
|
59
|
-
const info = {
|
|
60
|
-
pid: parts[0],
|
|
61
|
-
name: parts[1],
|
|
62
|
-
relativeName: `${parts[0]}-${parts[1]}`,
|
|
63
|
-
url: `${parts[0]}/${parts[1]}`,
|
|
64
|
-
originalName: parts.join('-'),
|
|
65
|
-
};
|
|
66
|
-
return info;
|
|
67
|
-
}
|
|
68
|
-
exports.parseInfo = parseInfo;
|
|
69
|
-
function parseInfoPro(moduleName, projectMode, projectEntityType) {
|
|
70
|
-
const info = parseInfo(moduleName);
|
|
71
|
-
if (!info)
|
|
72
|
-
return info;
|
|
73
|
-
if (['zova', 'vona'].includes(projectMode)) {
|
|
74
|
-
info.fullName = `${projectMode}-${projectEntityType}-${info.relativeName}`;
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
info.fullName = `cabloy-${projectEntityType}-${projectMode}-${info.relativeName}`;
|
|
78
|
-
}
|
|
79
|
-
return info;
|
|
80
|
-
}
|
|
81
|
-
exports.parseInfoPro = parseInfoPro;
|
|
82
|
-
// /api/aa/hello/home/index
|
|
83
|
-
// vona-module-aa-hello
|
|
84
|
-
// ./aa-hello/
|
|
85
|
-
// ./vona-module-aa-hello/
|
|
86
|
-
function parseName(moduleUrl) {
|
|
87
|
-
if (!moduleUrl)
|
|
88
|
-
return;
|
|
89
|
-
if (moduleUrl.indexOf('/api/static/') === 0) {
|
|
90
|
-
moduleUrl = '/api/' + moduleUrl.substring('/api/static/'.length);
|
|
91
|
-
}
|
|
92
|
-
if (moduleUrl.indexOf(PREFIX_A) === 0) {
|
|
93
|
-
return _parseNameLikeUrl(moduleUrl, PREFIX_A);
|
|
94
|
-
}
|
|
95
|
-
else if (moduleUrl.indexOf(PREFIX_B) === 0) {
|
|
96
|
-
return _parseName(moduleUrl, PREFIX_B);
|
|
97
|
-
}
|
|
98
|
-
else if (moduleUrl.indexOf(PREFIX_C) === 0) {
|
|
99
|
-
return _parseName(moduleUrl, PREFIX_C);
|
|
100
|
-
}
|
|
101
|
-
else if (moduleUrl.indexOf(PREFIX_D) === 0) {
|
|
102
|
-
return _parseName(moduleUrl, PREFIX_D);
|
|
103
|
-
}
|
|
104
|
-
else if (moduleUrl.indexOf(PREFIX_E) === 0) {
|
|
105
|
-
return _parseNameLikeUrl(moduleUrl, PREFIX_E);
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
// test-home test/home
|
|
109
|
-
return _parseName(moduleUrl.replace('/', '-'), '');
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
exports.parseName = parseName;
|
|
113
|
-
function _parseNameLikeUrl(moduleUrl, prefix) {
|
|
114
|
-
const posA = prefix.length;
|
|
115
|
-
const posB = moduleUrl.indexOf('/', posA) + 1;
|
|
116
|
-
if (posB === 0)
|
|
117
|
-
return;
|
|
118
|
-
let posC = moduleUrl.indexOf('/', posB);
|
|
119
|
-
if (posC === -1)
|
|
120
|
-
posC = moduleUrl.length;
|
|
121
|
-
return moduleUrl.substring(posA, posC).replace('/', '-');
|
|
122
|
-
}
|
|
123
|
-
function _parseName(moduleUrl, prefix) {
|
|
124
|
-
const posA = prefix.length;
|
|
125
|
-
let posB = moduleUrl.indexOf('/', posA);
|
|
126
|
-
if (posB === -1)
|
|
127
|
-
posB = moduleUrl.indexOf(':', posA);
|
|
128
|
-
if (posB === -1)
|
|
129
|
-
posB = moduleUrl.indexOf('.', posA);
|
|
130
|
-
if (posB === -1)
|
|
131
|
-
posB = moduleUrl.length;
|
|
132
|
-
return moduleUrl.substring(posA, posB);
|
|
133
|
-
}
|
|
134
|
-
function relativeNameToCapitalize(moduleName, firstCharToUpperCase) {
|
|
135
|
-
return moduleName
|
|
136
|
-
.split('-')
|
|
137
|
-
.map((name, index) => {
|
|
138
|
-
if (index === 0 && !firstCharToUpperCase)
|
|
139
|
-
return name;
|
|
140
|
-
return name.charAt(0).toUpperCase() + name.substring(1);
|
|
141
|
-
})
|
|
142
|
-
.join('');
|
|
143
|
-
}
|
|
144
|
-
exports.relativeNameToCapitalize = relativeNameToCapitalize;
|
|
18
|
+
__exportStar(require("./onionScenesMeta.js"), exports);
|
|
19
|
+
__exportStar(require("./utils.js"), exports);
|
|
20
|
+
__exportStar(require("./vona.js"), exports);
|
|
21
|
+
__exportStar(require("./zova.js"), exports);
|
|
145
22
|
//# sourceMappingURL=index.js.map
|
package/dist/interface.d.ts
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
import { VonaConfigMeta } from './vona.js';
|
|
2
|
+
import { ZovaConfigMeta } from './zova.js';
|
|
1
3
|
export type TypeProjectMode = 'front' | 'api' | 'zova' | 'vona';
|
|
2
4
|
export type TypeProjectEntityType = 'module' | 'suite';
|
|
3
5
|
export interface IModuleCapabilities {
|
|
4
|
-
monkey
|
|
5
|
-
sync
|
|
6
|
-
icon
|
|
7
|
-
theme
|
|
8
|
-
locale
|
|
6
|
+
monkey?: boolean;
|
|
7
|
+
sync?: boolean;
|
|
8
|
+
icon?: boolean;
|
|
9
|
+
theme?: boolean;
|
|
10
|
+
locale?: boolean;
|
|
11
|
+
preload?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface IModuleCapabilitiesZova extends IModuleCapabilities {
|
|
14
|
+
meta?: ZovaConfigMeta;
|
|
15
|
+
}
|
|
16
|
+
export interface IModuleCapabilitiesVona extends IModuleCapabilities {
|
|
17
|
+
meta?: VonaConfigMeta;
|
|
9
18
|
}
|
|
10
19
|
export interface IModuleInfo {
|
|
11
20
|
pid: string;
|
|
@@ -35,19 +44,48 @@ export interface IBundleVendor {
|
|
|
35
44
|
match: Array<string | RegExp>;
|
|
36
45
|
output: string;
|
|
37
46
|
}
|
|
47
|
+
export interface OnionSceneMeta {
|
|
48
|
+
module?: IModule;
|
|
49
|
+
sceneIsolate?: boolean;
|
|
50
|
+
hasLocal?: boolean;
|
|
51
|
+
optionsNone?: boolean;
|
|
52
|
+
optionsRoute?: boolean;
|
|
53
|
+
optionsArgumentPipe?: boolean;
|
|
54
|
+
optionsDynamic?: boolean;
|
|
55
|
+
optionsGlobalInterfaceName?: string;
|
|
56
|
+
optionsGlobalInterfaceFrom?: string;
|
|
57
|
+
scopeResource?: boolean;
|
|
58
|
+
beanLocal?: boolean;
|
|
59
|
+
boilerplate?: string;
|
|
60
|
+
metadataCustom?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface OnionMetaMeta {
|
|
63
|
+
module?: IModule;
|
|
64
|
+
scopeResource?: boolean;
|
|
65
|
+
boilerplate?: string;
|
|
66
|
+
metadataCustom?: string;
|
|
67
|
+
}
|
|
68
|
+
export type OnionScenesMeta = Record<string, OnionSceneMeta>;
|
|
69
|
+
export type OnionMetasMeta = Record<string, OnionMetaMeta>;
|
|
38
70
|
export interface IModulePackage {
|
|
39
71
|
name: string;
|
|
40
72
|
version: string;
|
|
41
73
|
vonaModule?: {
|
|
42
|
-
capabilities?:
|
|
74
|
+
capabilities?: IModuleCapabilitiesVona;
|
|
43
75
|
fileVersion: number;
|
|
44
76
|
dependencies?: Record<string, string>;
|
|
45
77
|
globalDependencies?: Record<string, string | boolean>;
|
|
78
|
+
globalDependenciesDev?: Record<string, string | boolean>;
|
|
79
|
+
onions?: OnionScenesMeta;
|
|
80
|
+
metas?: OnionMetasMeta;
|
|
46
81
|
};
|
|
47
82
|
zovaModule?: {
|
|
48
|
-
capabilities?:
|
|
83
|
+
capabilities?: IModuleCapabilitiesZova;
|
|
49
84
|
dependencies?: Record<string, string>;
|
|
50
85
|
globalDependencies?: Record<string, string | boolean>;
|
|
86
|
+
globalDependenciesDev?: Record<string, string | boolean>;
|
|
87
|
+
onions?: OnionScenesMeta;
|
|
88
|
+
metas?: OnionMetasMeta;
|
|
51
89
|
bundle?: {
|
|
52
90
|
vendors?: Array<IBundleVendor>;
|
|
53
91
|
};
|
|
@@ -57,4 +95,26 @@ export interface IModulePackage {
|
|
|
57
95
|
author: string;
|
|
58
96
|
dependencies: Record<string, string>;
|
|
59
97
|
}
|
|
98
|
+
export interface IGlobBeanFile {
|
|
99
|
+
file: string;
|
|
100
|
+
fileContent: string;
|
|
101
|
+
fileName: string;
|
|
102
|
+
fileNameJS: string;
|
|
103
|
+
fileNameJSRelative: string;
|
|
104
|
+
className: string;
|
|
105
|
+
beanName: string;
|
|
106
|
+
beanNameFull: string;
|
|
107
|
+
isIgnore: boolean;
|
|
108
|
+
isVirtual: boolean;
|
|
109
|
+
}
|
|
110
|
+
export interface IMetadataCustomGenerateOptions {
|
|
111
|
+
cli: any;
|
|
112
|
+
sceneName: string;
|
|
113
|
+
sceneNameCapitalize: string;
|
|
114
|
+
sceneMeta: OnionSceneMeta;
|
|
115
|
+
moduleName: string;
|
|
116
|
+
modulePath: string;
|
|
117
|
+
globFiles: IGlobBeanFile[];
|
|
118
|
+
}
|
|
119
|
+
export type TypeMetadataCustomGenerate = (options: IMetadataCustomGenerateOptions) => Promise<string>;
|
|
60
120
|
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IModule, OnionMetasMeta, OnionScenesMeta } from './interface.js';
|
|
2
|
+
export declare function getOnionScenesMeta(modules: Record<string, IModule>): OnionScenesMeta;
|
|
3
|
+
export declare function getOnionMetasMeta(modules: Record<string, IModule>): OnionMetasMeta;
|
|
4
|
+
export declare function _getOnionScenesMeta(modules: Record<string, IModule>): {};
|
|
5
|
+
export declare function _getOnionMetasMeta(modules: Record<string, IModule>): {};
|
|
6
|
+
//# sourceMappingURL=onionScenesMeta.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports._getOnionMetasMeta = exports._getOnionScenesMeta = exports.getOnionMetasMeta = exports.getOnionScenesMeta = void 0;
|
|
4
|
+
let __onionScenesMeta;
|
|
5
|
+
function getOnionScenesMeta(modules) {
|
|
6
|
+
if (!__onionScenesMeta) {
|
|
7
|
+
__onionScenesMeta = _getOnionScenesMeta(modules);
|
|
8
|
+
}
|
|
9
|
+
return __onionScenesMeta;
|
|
10
|
+
}
|
|
11
|
+
exports.getOnionScenesMeta = getOnionScenesMeta;
|
|
12
|
+
let __onionMetasMeta;
|
|
13
|
+
function getOnionMetasMeta(modules) {
|
|
14
|
+
if (!__onionMetasMeta) {
|
|
15
|
+
__onionMetasMeta = _getOnionMetasMeta(modules);
|
|
16
|
+
}
|
|
17
|
+
return __onionMetasMeta;
|
|
18
|
+
}
|
|
19
|
+
exports.getOnionMetasMeta = getOnionMetasMeta;
|
|
20
|
+
function _getOnionScenesMeta(modules) {
|
|
21
|
+
const result = {};
|
|
22
|
+
for (const moduleName in modules) {
|
|
23
|
+
const module = modules[moduleName];
|
|
24
|
+
const onions = module.package.vonaModule?.onions ?? module.package.zovaModule?.onions;
|
|
25
|
+
if (!onions)
|
|
26
|
+
continue;
|
|
27
|
+
for (const sceneName in onions) {
|
|
28
|
+
result[sceneName] = { ...onions[sceneName], module };
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
exports._getOnionScenesMeta = _getOnionScenesMeta;
|
|
34
|
+
function _getOnionMetasMeta(modules) {
|
|
35
|
+
const result = {};
|
|
36
|
+
for (const moduleName in modules) {
|
|
37
|
+
const module = modules[moduleName];
|
|
38
|
+
const metas = module.package.vonaModule?.metas ?? module.package.zovaModule?.metas;
|
|
39
|
+
if (!metas)
|
|
40
|
+
continue;
|
|
41
|
+
for (const sceneName in metas) {
|
|
42
|
+
result[sceneName] = { ...metas[sceneName], module };
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
exports._getOnionMetasMeta = _getOnionMetasMeta;
|
|
48
|
+
//# sourceMappingURL=onionScenesMeta.js.map
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IModuleInfo, TypeProjectEntityType, TypeProjectMode } from './interface.js';
|
|
2
|
+
export declare function parseInfoFromPath(pathName?: string | null): IModuleInfo | undefined;
|
|
3
|
+
export declare function parseInfo(moduleName: string | undefined): IModuleInfo | undefined;
|
|
4
|
+
export declare function parseInfoPro(moduleName: string | undefined, projectMode: TypeProjectMode, projectEntityType: TypeProjectEntityType): IModuleInfo | undefined;
|
|
5
|
+
export declare function parseName(moduleUrl: any): string | undefined;
|
|
6
|
+
export declare function relativeNameToCapitalize(moduleName: string, firstCharToUpperCase: boolean): string;
|
|
7
|
+
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.relativeNameToCapitalize = exports.parseName = exports.parseInfoPro = exports.parseInfo = exports.parseInfoFromPath = void 0;
|
|
4
|
+
function parseInfoFromPath(pathName) {
|
|
5
|
+
if (!pathName)
|
|
6
|
+
return;
|
|
7
|
+
pathName = pathName.replace(/\\/gi, '/');
|
|
8
|
+
const parts = pathName.split('/');
|
|
9
|
+
for (let i = parts.length - 1; i >= 0; i--) {
|
|
10
|
+
const part = parts[i];
|
|
11
|
+
if (part.indexOf('-') === -1)
|
|
12
|
+
continue;
|
|
13
|
+
const info = parseInfo(part);
|
|
14
|
+
if (!info)
|
|
15
|
+
continue;
|
|
16
|
+
return info;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.parseInfoFromPath = parseInfoFromPath;
|
|
20
|
+
const PREFIX_A = '/api/';
|
|
21
|
+
const PREFIX_B = 'vona-module-';
|
|
22
|
+
const PREFIX_C = './vona-module-';
|
|
23
|
+
const PREFIX_D = './';
|
|
24
|
+
const PREFIX_E = '/';
|
|
25
|
+
// aa-hello aa/hello
|
|
26
|
+
// first check / then -
|
|
27
|
+
function parseInfo(moduleName) {
|
|
28
|
+
if (!moduleName)
|
|
29
|
+
return;
|
|
30
|
+
if (moduleName.indexOf('://') > -1)
|
|
31
|
+
return;
|
|
32
|
+
if (moduleName.charAt(0) === '/')
|
|
33
|
+
moduleName = moduleName.substring(1);
|
|
34
|
+
let parts = moduleName.split('/').filter(item => item);
|
|
35
|
+
if (parts.length < 2) {
|
|
36
|
+
parts = moduleName.split('-').filter(item => item);
|
|
37
|
+
if (parts.length < 2)
|
|
38
|
+
return;
|
|
39
|
+
if (parts.length === 4)
|
|
40
|
+
parts = parts.slice(2);
|
|
41
|
+
if (parts.length === 5)
|
|
42
|
+
parts = parts.slice(3);
|
|
43
|
+
}
|
|
44
|
+
const info = {
|
|
45
|
+
pid: parts[0],
|
|
46
|
+
name: parts[1],
|
|
47
|
+
relativeName: `${parts[0]}-${parts[1]}`,
|
|
48
|
+
url: `${parts[0]}/${parts[1]}`,
|
|
49
|
+
originalName: parts.join('-'),
|
|
50
|
+
};
|
|
51
|
+
return info;
|
|
52
|
+
}
|
|
53
|
+
exports.parseInfo = parseInfo;
|
|
54
|
+
function parseInfoPro(moduleName, projectMode, projectEntityType) {
|
|
55
|
+
const info = parseInfo(moduleName);
|
|
56
|
+
if (!info)
|
|
57
|
+
return info;
|
|
58
|
+
if (['zova', 'vona'].includes(projectMode)) {
|
|
59
|
+
info.fullName = `${projectMode}-${projectEntityType}-${info.relativeName}`;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
info.fullName = `cabloy-${projectEntityType}-${projectMode}-${info.relativeName}`;
|
|
63
|
+
}
|
|
64
|
+
return info;
|
|
65
|
+
}
|
|
66
|
+
exports.parseInfoPro = parseInfoPro;
|
|
67
|
+
// /api/aa/hello/home/index
|
|
68
|
+
// vona-module-aa-hello
|
|
69
|
+
// ./aa-hello/
|
|
70
|
+
// ./vona-module-aa-hello/
|
|
71
|
+
function parseName(moduleUrl) {
|
|
72
|
+
if (!moduleUrl)
|
|
73
|
+
return;
|
|
74
|
+
if (moduleUrl.indexOf('/api/static/') === 0) {
|
|
75
|
+
moduleUrl = '/api/' + moduleUrl.substring('/api/static/'.length);
|
|
76
|
+
}
|
|
77
|
+
if (moduleUrl.indexOf(PREFIX_A) === 0) {
|
|
78
|
+
return _parseNameLikeUrl(moduleUrl, PREFIX_A);
|
|
79
|
+
}
|
|
80
|
+
else if (moduleUrl.indexOf(PREFIX_B) === 0) {
|
|
81
|
+
return _parseName(moduleUrl, PREFIX_B);
|
|
82
|
+
}
|
|
83
|
+
else if (moduleUrl.indexOf(PREFIX_C) === 0) {
|
|
84
|
+
return _parseName(moduleUrl, PREFIX_C);
|
|
85
|
+
}
|
|
86
|
+
else if (moduleUrl.indexOf(PREFIX_D) === 0) {
|
|
87
|
+
return _parseName(moduleUrl, PREFIX_D);
|
|
88
|
+
}
|
|
89
|
+
else if (moduleUrl.indexOf(PREFIX_E) === 0) {
|
|
90
|
+
return _parseNameLikeUrl(moduleUrl, PREFIX_E);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
// test-home test/home
|
|
94
|
+
return _parseName(moduleUrl.replace('/', '-'), '');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.parseName = parseName;
|
|
98
|
+
function _parseNameLikeUrl(moduleUrl, prefix) {
|
|
99
|
+
const posA = prefix.length;
|
|
100
|
+
const posB = moduleUrl.indexOf('/', posA) + 1;
|
|
101
|
+
if (posB === 0)
|
|
102
|
+
return;
|
|
103
|
+
let posC = moduleUrl.indexOf('/', posB);
|
|
104
|
+
if (posC === -1)
|
|
105
|
+
posC = moduleUrl.length;
|
|
106
|
+
return moduleUrl.substring(posA, posC).replace('/', '-');
|
|
107
|
+
}
|
|
108
|
+
function _parseName(moduleUrl, prefix) {
|
|
109
|
+
const posA = prefix.length;
|
|
110
|
+
let posB = moduleUrl.indexOf('/', posA);
|
|
111
|
+
if (posB === -1)
|
|
112
|
+
posB = moduleUrl.indexOf(':', posA);
|
|
113
|
+
if (posB === -1)
|
|
114
|
+
posB = moduleUrl.indexOf('.', posA);
|
|
115
|
+
if (posB === -1)
|
|
116
|
+
posB = moduleUrl.length;
|
|
117
|
+
return moduleUrl.substring(posA, posB);
|
|
118
|
+
}
|
|
119
|
+
function relativeNameToCapitalize(moduleName, firstCharToUpperCase) {
|
|
120
|
+
return moduleName
|
|
121
|
+
.split('-')
|
|
122
|
+
.map((name, index) => {
|
|
123
|
+
if (index === 0 && !firstCharToUpperCase)
|
|
124
|
+
return name;
|
|
125
|
+
return name.charAt(0).toUpperCase() + name.substring(1);
|
|
126
|
+
})
|
|
127
|
+
.join('');
|
|
128
|
+
}
|
|
129
|
+
exports.relativeNameToCapitalize = relativeNameToCapitalize;
|
|
130
|
+
//# sourceMappingURL=utils.js.map
|
package/dist/vona.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type VonaMetaFlavor = 'normal' | keyof VonaMetaFlavorExtend;
|
|
2
|
+
export type VonaMetaMode = 'local' | 'prod' | 'unittest';
|
|
3
|
+
export interface VonaConfigMeta {
|
|
4
|
+
flavor: VonaMetaFlavor;
|
|
5
|
+
mode: VonaMetaMode;
|
|
6
|
+
}
|
|
7
|
+
export interface VonaMetaFlavorExtend {
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=vona.d.ts.map
|
package/dist/vona.js
ADDED
package/dist/zova.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ZovaMetaFlavor = 'front' | 'admin' | keyof ZovaMetaFlavorExtend;
|
|
2
|
+
export type ZovaMetaMode = 'development' | 'production';
|
|
3
|
+
export type ZovaMetaAppMode = 'spa' | 'ssr' | 'pwa' | 'cordova' | 'capacitor' | 'electron' | 'bex' | keyof ZovaMetaAppModeExtend;
|
|
4
|
+
export interface ZovaConfigMeta {
|
|
5
|
+
flavor: ZovaMetaFlavor;
|
|
6
|
+
mode: ZovaMetaMode;
|
|
7
|
+
appMode: ZovaMetaAppMode;
|
|
8
|
+
}
|
|
9
|
+
export interface ZovaMetaFlavorExtend {
|
|
10
|
+
}
|
|
11
|
+
export interface ZovaMetaAppModeExtend {
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=zova.d.ts.map
|
package/dist/zova.js
ADDED