@simplysm/sd-cli 7.0.65 → 7.0.75
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/SdCliBuildResultError.d.ts +5 -0
- package/dist/bin/sd-cli.d.ts +2 -0
- package/dist/bin/sd-cli.mjs +27 -6
- package/dist/build-tool/SdCliCacheCompilerHost.d.ts +10 -0
- package/dist/build-tool/SdCliCordova.d.ts +16 -0
- package/dist/build-tool/SdCliCordova.mjs +176 -0
- package/dist/build-tool/SdCliIndexFileGenerator.d.ts +13 -0
- package/dist/{entry-points → build-tool}/SdCliIndexFileGenerator.mjs +4 -3
- package/dist/build-tool/SdCliNgCacheCompilerHost.d.ts +11 -0
- package/dist/build-tool/SdCliPackageLinter.d.ts +8 -0
- package/dist/build-tool/SdCliPackageLinter.mjs +19 -2
- package/dist/builder/SdCliClientBuilder.d.ts +23 -0
- package/dist/builder/SdCliClientBuilder.mjs +69 -6
- package/dist/builder/SdCliJsLibBuilder.d.ts +14 -0
- package/dist/builder/SdCliServerBuilder.d.ts +25 -0
- package/dist/builder/SdCliServerBuilder.mjs +19 -10
- package/dist/builder/SdCliTsLibBuilder.d.ts +34 -0
- package/dist/builder/SdCliTsLibBuilder.mjs +84 -37
- package/dist/commons.d.ts +101 -0
- package/dist/entry-points/SdCliLocalUpdate.d.ts +13 -0
- package/dist/entry-points/SdCliNpm.d.ts +6 -0
- package/dist/entry-points/SdCliPrepare.d.ts +5 -0
- package/dist/entry-points/SdCliPrepare.mjs +2 -2
- package/dist/entry-points/SdCliWorkspace.d.ts +31 -0
- package/dist/entry-points/SdCliWorkspace.mjs +67 -51
- package/dist/index.d.ts +29 -0
- package/dist/index.mjs +5 -3
- package/dist/ng-tools/SdCliNgModuleGenerator.d.ts +28 -0
- package/dist/ng-tools/SdCliNgModuleGenerator.mjs +486 -0
- package/dist/ng-tools/babel/SdCliBbFileMetadata.d.ts +23 -0
- package/dist/ng-tools/babel/SdCliBbFileMetadata.mjs +187 -36
- package/dist/ng-tools/babel/SdCliBbRootMetadata.d.ts +22 -0
- package/dist/ng-tools/babel/SdCliBbRootMetadata.mjs +10 -7
- package/dist/ng-tools/babel/SdCliBbUtil.d.ts +5 -0
- package/dist/ng-tools/babel/SdCliBbUtil.mjs +2 -2
- package/dist/ng-tools/babel/TSdCliBbNgMetadata.d.ts +42 -0
- package/dist/ng-tools/babel/TSdCliBbNgMetadata.mjs +107 -76
- package/dist/ng-tools/babel/TSdCliBbTypeMetadata.d.ts +44 -0
- package/dist/ng-tools/commons.d.ts +9 -0
- package/dist/ng-tools/typescript/SdCliTsFileMetadata.d.ts +61 -0
- package/dist/ng-tools/typescript/SdCliTsFileMetadata.mjs +12 -12
- package/dist/ng-tools/typescript/SdCliTsRootMetadata.d.ts +8 -0
- package/dist/ng-tools/typescript/SdCliTsUtil.d.ts +5 -0
- package/dist/ng-tools/typescript/SdCliTsUtil.mjs +28 -0
- package/dist/packages/SdCliPackage.d.ts +23 -0
- package/dist/packages/SdCliPackage.mjs +53 -7
- package/dist/utils/SdCliBuildResultUtil.d.ts +9 -0
- package/dist/utils/SdCliConfigUtil.d.ts +7 -0
- package/dist/utils/SdCliNpmConfigUtil.d.ts +7 -0
- package/package.json +11 -8
- package/src/bin/sd-cli.ts +26 -5
- package/src/build-tool/SdCliCordova.ts +224 -0
- package/src/{entry-points → build-tool}/SdCliIndexFileGenerator.ts +3 -2
- package/src/build-tool/SdCliPackageLinter.ts +18 -2
- package/src/builder/SdCliClientBuilder.ts +84 -5
- package/src/builder/SdCliServerBuilder.ts +20 -9
- package/src/builder/SdCliTsLibBuilder.ts +101 -45
- package/src/commons.ts +43 -0
- package/src/entry-points/SdCliPrepare.ts +1 -1
- package/src/entry-points/SdCliWorkspace.ts +71 -56
- package/src/index.ts +4 -2
- package/src/ng-tools/SdCliNgModuleGenerator.ts +643 -0
- package/src/ng-tools/babel/SdCliBbFileMetadata.ts +234 -38
- package/src/ng-tools/babel/SdCliBbRootMetadata.ts +10 -6
- package/src/ng-tools/babel/SdCliBbUtil.ts +1 -1
- package/src/ng-tools/babel/TSdCliBbNgMetadata.ts +36 -22
- package/src/ng-tools/commons.ts +1 -1
- package/src/ng-tools/typescript/SdCliTsFileMetadata.ts +12 -12
- package/src/ng-tools/typescript/SdCliTsUtil.ts +29 -0
- package/src/packages/SdCliPackage.ts +56 -6
- package/tsconfig-build.json +1 -1
- package/tsconfig.json +3 -0
- package/dist/ng-tools/NgModuleGenerator.mjs +0 -278
- package/src/ng-tools/NgModuleGenerator.ts +0 -361
|
@@ -1,361 +0,0 @@
|
|
|
1
|
-
import { SdCliTsRootMetadata } from "./typescript/SdCliTsRootMetadata";
|
|
2
|
-
import { SdCliBbRootMetadata } from "./babel/SdCliBbRootMetadata";
|
|
3
|
-
import { SdCliBbClassMetadata, SdCliBbObjectMetadata } from "./babel/TSdCliBbTypeMetadata";
|
|
4
|
-
import {
|
|
5
|
-
SdCliBbNgComponentMetadata,
|
|
6
|
-
SdCliBbNgDirectiveMetadata,
|
|
7
|
-
SdCliBbNgModuleMetadata,
|
|
8
|
-
SdCliBbNgPipeMetadata
|
|
9
|
-
} from "./babel/TSdCliBbNgMetadata";
|
|
10
|
-
import { NeverEntryError } from "@simplysm/sd-core-common";
|
|
11
|
-
import { TSdCliMetaRef } from "./commons";
|
|
12
|
-
import { SdCliTsNgInjectableMetadata } from "./typescript/SdCliTsFileMetadata";
|
|
13
|
-
import path from "path";
|
|
14
|
-
import { JSDOM } from "jsdom";
|
|
15
|
-
import { FsUtil, PathUtil } from "@simplysm/sd-core-node";
|
|
16
|
-
import os from "os";
|
|
17
|
-
|
|
18
|
-
// TODO: 에러 메시지 처리
|
|
19
|
-
export class NgModuleGenerator {
|
|
20
|
-
private readonly _bbMeta: SdCliBbRootMetadata;
|
|
21
|
-
private readonly _tsMeta: SdCliTsRootMetadata;
|
|
22
|
-
|
|
23
|
-
private readonly _srcPath = path.resolve(process.cwd(), "packages", "sd-angular", "src");
|
|
24
|
-
private readonly _modulesPath = path.resolve(process.cwd(), "packages", "sd-angular", "src", "_modules");
|
|
25
|
-
|
|
26
|
-
private readonly _fileWriterCache = new Map<string, string>();
|
|
27
|
-
|
|
28
|
-
public constructor(packagePath: string, private readonly _srcDirRelPaths: string[]) {
|
|
29
|
-
this._bbMeta = new SdCliBbRootMetadata(packagePath);
|
|
30
|
-
this._tsMeta = new SdCliTsRootMetadata(packagePath);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
public async clearModulesAsync(): Promise<void> {
|
|
34
|
-
await FsUtil.removeAsync(this._modulesPath);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
public removeCaches(changedFilePaths: string[]): void {
|
|
38
|
-
this._bbMeta.removeCaches(changedFilePaths);
|
|
39
|
-
this._tsMeta.removeCaches(changedFilePaths);
|
|
40
|
-
for (const changedFilePath of changedFilePaths) {
|
|
41
|
-
this._fileWriterCache.delete(changedFilePath);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
public async runAsync(): Promise<void> {
|
|
46
|
-
const bbNgModules = this._getBbNgModuleDefs();
|
|
47
|
-
const tsPreset = this._getTsGenNgModulePreset();
|
|
48
|
-
|
|
49
|
-
const genNgModules = this._getGenNgModuleDefs(bbNgModules, tsPreset.modules, tsPreset.sources);
|
|
50
|
-
await this._genFileAsync(genNgModules);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
private _getBbNgModuleDefs(): IBbNgModuleDef[] {
|
|
54
|
-
const entryRecord = this._bbMeta.getEntryFileMetaRecord();
|
|
55
|
-
const result: IBbNgModuleDef[] = [];
|
|
56
|
-
|
|
57
|
-
for (const moduleName of Object.keys(entryRecord)) {
|
|
58
|
-
const fileMeta = entryRecord[moduleName];
|
|
59
|
-
for (const exp of fileMeta.exports) {
|
|
60
|
-
const metaTmp = typeof exp.target !== "string" && "__TDeclRef__" in exp.target ? this._bbMeta.findMeta(exp.target) : exp.target;
|
|
61
|
-
const metas = metaTmp instanceof Array ? metaTmp : [metaTmp];
|
|
62
|
-
for (const meta of metas) {
|
|
63
|
-
if (meta instanceof SdCliBbClassMetadata) {
|
|
64
|
-
if (meta.ngDecl instanceof SdCliBbNgModuleMetadata) {
|
|
65
|
-
const ngDecl = meta.ngDecl;
|
|
66
|
-
|
|
67
|
-
const resultItem: IBbNgModuleDef = {
|
|
68
|
-
moduleName,
|
|
69
|
-
name: exp.exportedName,
|
|
70
|
-
providers: [],
|
|
71
|
-
exports: [],
|
|
72
|
-
selectors: [],
|
|
73
|
-
pipeNames: []
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
for (const modProv of ngDecl.def.providers) {
|
|
77
|
-
if (modProv instanceof SdCliBbClassMetadata) {
|
|
78
|
-
const ref = this._bbMeta.findExportRef({
|
|
79
|
-
filePath: modProv.filePath,
|
|
80
|
-
name: modProv.name
|
|
81
|
-
});
|
|
82
|
-
if (ref) {
|
|
83
|
-
resultItem.providers.push(ref);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
else if (modProv instanceof SdCliBbObjectMetadata) {
|
|
87
|
-
// 무시
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
throw new NeverEntryError();
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
for (const modExp of ngDecl.def.exports) {
|
|
95
|
-
if (modExp instanceof SdCliBbClassMetadata) {
|
|
96
|
-
const ref = this._bbMeta.findExportRef({
|
|
97
|
-
filePath: modExp.filePath,
|
|
98
|
-
name: modExp.name
|
|
99
|
-
});
|
|
100
|
-
if (ref) {
|
|
101
|
-
resultItem.exports.push(ref);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (modExp.ngDecl instanceof SdCliBbNgDirectiveMetadata) {
|
|
105
|
-
resultItem.selectors.push(modExp.ngDecl.selector);
|
|
106
|
-
}
|
|
107
|
-
else if (modExp.ngDecl instanceof SdCliBbNgComponentMetadata) {
|
|
108
|
-
resultItem.selectors.push(modExp.ngDecl.selector);
|
|
109
|
-
}
|
|
110
|
-
else if (modExp.ngDecl instanceof SdCliBbNgPipeMetadata) {
|
|
111
|
-
resultItem.pipeNames.push(modExp.ngDecl.pipeName);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
else if (typeof modExp !== "string" && "__TDeclRef__" in modExp) {
|
|
115
|
-
const modExpMeta = this._bbMeta.findMeta(modExp);
|
|
116
|
-
if (modExpMeta instanceof Array) {
|
|
117
|
-
throw new NeverEntryError();
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
if (modExpMeta instanceof SdCliBbClassMetadata) {
|
|
121
|
-
const ref = this._bbMeta.findExportRef({
|
|
122
|
-
filePath: modExpMeta.filePath,
|
|
123
|
-
name: modExpMeta.name
|
|
124
|
-
});
|
|
125
|
-
if (ref) {
|
|
126
|
-
resultItem.exports.push(ref);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (modExpMeta.ngDecl instanceof SdCliBbNgDirectiveMetadata) {
|
|
130
|
-
resultItem.selectors.push(modExpMeta.ngDecl.selector);
|
|
131
|
-
}
|
|
132
|
-
else if (modExpMeta.ngDecl instanceof SdCliBbNgComponentMetadata) {
|
|
133
|
-
resultItem.selectors.push(modExpMeta.ngDecl.selector);
|
|
134
|
-
}
|
|
135
|
-
else if (modExpMeta.ngDecl instanceof SdCliBbNgPipeMetadata) {
|
|
136
|
-
resultItem.pipeNames.push(modExpMeta.ngDecl.pipeName);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
throw new NeverEntryError();
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
result.push(resultItem);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return result;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
private _getTsGenNgModulePreset(): { modules: ITsNgPresetModuleDef[]; sources: ITsNgPresetSourceDef[] } {
|
|
156
|
-
const fileMetas = this._tsMeta.getFileMetas();
|
|
157
|
-
|
|
158
|
-
const result: { modules: ITsNgPresetModuleDef[]; sources: ITsNgPresetSourceDef[] } = { modules: [], sources: [] };
|
|
159
|
-
|
|
160
|
-
for (const fileMeta of fileMetas) {
|
|
161
|
-
if (!this._srcDirRelPaths.some((item) => fileMeta.filePath.startsWith(path.resolve(this._srcPath, item)))) {
|
|
162
|
-
continue;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
for (const cls of fileMeta.directExportClasses) {
|
|
166
|
-
if (cls.target.ngDecl) {
|
|
167
|
-
if (cls.target.ngDecl instanceof SdCliTsNgInjectableMetadata) {
|
|
168
|
-
if (cls.target.ngDecl.providedIn === "root") {
|
|
169
|
-
continue;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
const moduleClassName = cls.exportedName + "Module";
|
|
174
|
-
const moduleFilePath = path.resolve(this._modulesPath, path.relative(this._srcPath, path.dirname(fileMeta.filePath)), moduleClassName);
|
|
175
|
-
|
|
176
|
-
result.sources.push({
|
|
177
|
-
filePath: fileMeta.filePath,
|
|
178
|
-
name: cls.exportedName,
|
|
179
|
-
module: {
|
|
180
|
-
filePath: moduleFilePath,
|
|
181
|
-
name: moduleClassName
|
|
182
|
-
},
|
|
183
|
-
imports: fileMeta.imports,
|
|
184
|
-
template: "template" in cls.target.ngDecl ? cls.target.ngDecl.template : undefined,
|
|
185
|
-
isProvider: cls.target.ngDecl instanceof SdCliTsNgInjectableMetadata
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
result.modules.push({
|
|
189
|
-
filePath: moduleFilePath,
|
|
190
|
-
name: moduleClassName,
|
|
191
|
-
source: {
|
|
192
|
-
filePath: fileMeta.filePath,
|
|
193
|
-
name: cls.exportedName
|
|
194
|
-
},
|
|
195
|
-
selector: "selector" in cls.target.ngDecl ? cls.target.ngDecl.selector : undefined,
|
|
196
|
-
pipeName: "pipeName" in cls.target.ngDecl ? cls.target.ngDecl.pipeName : undefined
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
return result;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
private _getGenNgModuleDefs(bbModules: IBbNgModuleDef[], presetModules: ITsNgPresetModuleDef[], presetSources: ITsNgPresetSourceDef[]): ITsGenNgModuleDef[] {
|
|
206
|
-
const result: ITsGenNgModuleDef[] = [];
|
|
207
|
-
|
|
208
|
-
for (const el of presetSources) {
|
|
209
|
-
const imports: TSdCliMetaRef[] = [];
|
|
210
|
-
for (const imp of el.imports) {
|
|
211
|
-
if ("moduleName" in imp) {
|
|
212
|
-
for (const mod of bbModules) {
|
|
213
|
-
if (mod.exports.some((item) => item.moduleName === imp.moduleName && item.name === imp.name)) {
|
|
214
|
-
imports.push({ moduleName: mod.moduleName, name: mod.name, __TDeclRef__: "__TDeclRef__" });
|
|
215
|
-
}
|
|
216
|
-
if (mod.providers.some((item) => item.moduleName === imp.moduleName && item.name === imp.name)) {
|
|
217
|
-
imports.push({ moduleName: mod.moduleName, name: mod.name, __TDeclRef__: "__TDeclRef__" });
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
else {
|
|
222
|
-
for (const mod of presetModules) {
|
|
223
|
-
if (mod.source && mod.source.filePath === imp.filePath && mod.source.name === imp.name) {
|
|
224
|
-
imports.push({ filePath: mod.filePath, name: mod.name, __TDeclRef__: "__TDeclRef__" });
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
if (el.template !== undefined) {
|
|
231
|
-
const templateDOM = new JSDOM(el.template);
|
|
232
|
-
|
|
233
|
-
for (const mod of bbModules) {
|
|
234
|
-
for (const selector of mod.selectors) {
|
|
235
|
-
if (
|
|
236
|
-
templateDOM.window.document.querySelector([
|
|
237
|
-
selector,
|
|
238
|
-
selector.replace(/\[/g, "[\\[").replace(/]/g, "\\]]"),
|
|
239
|
-
selector.replace(/\[/g, "[\\(").replace(/]/g, "\\)]")
|
|
240
|
-
].join(", ")) != null
|
|
241
|
-
) {
|
|
242
|
-
imports.push({ moduleName: mod.moduleName, name: mod.name, __TDeclRef__: "__TDeclRef__" });
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
for (const pipeName of mod.pipeNames) {
|
|
247
|
-
if (new RegExp("| *" + pipeName + "[^\\w]").test(el.template)) {
|
|
248
|
-
imports.push({ moduleName: mod.moduleName, name: mod.name, __TDeclRef__: "__TDeclRef__" });
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
for (const mod of presetModules) {
|
|
254
|
-
if (mod.selector !== undefined) {
|
|
255
|
-
if (
|
|
256
|
-
templateDOM.window.document.querySelector([
|
|
257
|
-
mod.selector,
|
|
258
|
-
mod.selector.replace(/\[/g, "[\\[").replace(/]/g, "\\]]"),
|
|
259
|
-
mod.selector.replace(/\[/g, "[\\(").replace(/]/g, "\\)]")
|
|
260
|
-
].join(", ")) != null
|
|
261
|
-
) {
|
|
262
|
-
imports.push({ filePath: mod.filePath, name: mod.name, __TDeclRef__: "__TDeclRef__" });
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
if (mod.pipeName !== undefined) {
|
|
267
|
-
if (new RegExp("| *" + mod.pipeName + "[^\\w]").test(el.template)) {
|
|
268
|
-
imports.push({ filePath: mod.filePath, name: mod.name, __TDeclRef__: "__TDeclRef__" });
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
result.push({
|
|
275
|
-
filePath: el.module.filePath,
|
|
276
|
-
name: el.module.name,
|
|
277
|
-
imports: imports.distinct(),
|
|
278
|
-
exports: el.isProvider ? [] : [{ filePath: el.filePath, name: el.name }],
|
|
279
|
-
providers: el.isProvider ? [{ filePath: el.filePath, name: el.name }] : []
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
return result;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
private async _genFileAsync(mods: ITsGenNgModuleDef[]): Promise<void> {
|
|
287
|
-
for (const mod of mods) {
|
|
288
|
-
const importMap = [...mod.imports, ...mod.exports, ...mod.providers]
|
|
289
|
-
.map((item) => ({
|
|
290
|
-
moduleName: "moduleName" in item ? item.moduleName : this._getImportModuleName(mod.filePath, item.filePath),
|
|
291
|
-
name: item.name
|
|
292
|
-
}))
|
|
293
|
-
.groupBy((item) => item.moduleName)
|
|
294
|
-
.toMap((item) => item.key, (item) => item.values.map((v) => v.name));
|
|
295
|
-
importMap.getOrCreate("@angular/core", []).push("NgModule");
|
|
296
|
-
|
|
297
|
-
const importTexts: string[] = [];
|
|
298
|
-
for (const moduleName of Array.from(importMap.keys()).orderBy()) {
|
|
299
|
-
const targetNames = importMap.get(moduleName)!.distinct();
|
|
300
|
-
if (targetNames.length === 0) continue;
|
|
301
|
-
importTexts.push(`import { ${targetNames.join(", ")} } from "${moduleName}";`);
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
const content = `
|
|
305
|
-
${importTexts.join(os.EOL)}
|
|
306
|
-
|
|
307
|
-
@NgModule({
|
|
308
|
-
imports: [${mod.imports.map((item) => item.name).orderBy().join(", ")}],
|
|
309
|
-
declarations: [${mod.exports.map((item) => item.name).distinct().orderBy().join(", ")}],
|
|
310
|
-
exports: [${mod.exports.map((item) => item.name).distinct().orderBy().join(", ")}],
|
|
311
|
-
providers: [${mod.providers.map((item) => item.name).distinct().orderBy().join(", ")}]
|
|
312
|
-
})
|
|
313
|
-
export class ${mod.name} {
|
|
314
|
-
}`.trim();
|
|
315
|
-
|
|
316
|
-
if (this._fileWriterCache.get(mod.filePath) !== content) {
|
|
317
|
-
await FsUtil.writeFileAsync(mod.filePath + ".ts", content);
|
|
318
|
-
this._fileWriterCache.set(mod.filePath, content);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
private _getImportModuleName(mainFilePath: string, importFilePath: string): string {
|
|
324
|
-
const filePath = PathUtil.posix(path.relative(path.dirname(mainFilePath), importFilePath).replace(/\.ts$/, ""));
|
|
325
|
-
return filePath.startsWith(".") ? filePath : "./" + filePath;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
interface IBbNgModuleDef {
|
|
330
|
-
moduleName: string;
|
|
331
|
-
name: string;
|
|
332
|
-
providers: { moduleName: string; name: string }[];
|
|
333
|
-
exports: { moduleName: string; name: string }[];
|
|
334
|
-
selectors: string[];
|
|
335
|
-
pipeNames: string[];
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
interface ITsNgPresetModuleDef {
|
|
339
|
-
filePath: string;
|
|
340
|
-
name: string;
|
|
341
|
-
source?: { filePath: string; name: string };
|
|
342
|
-
selector?: string;
|
|
343
|
-
pipeName?: string;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
interface ITsNgPresetSourceDef {
|
|
347
|
-
filePath: string;
|
|
348
|
-
name: string;
|
|
349
|
-
module: { filePath: string; name: string };
|
|
350
|
-
imports: TSdCliMetaRef[];
|
|
351
|
-
template?: string;
|
|
352
|
-
isProvider: boolean;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
interface ITsGenNgModuleDef {
|
|
356
|
-
filePath: string;
|
|
357
|
-
name: string;
|
|
358
|
-
imports: TSdCliMetaRef[];
|
|
359
|
-
exports: { filePath: string; name: string }[];
|
|
360
|
-
providers: { filePath: string; name: string }[];
|
|
361
|
-
}
|