@simplysm/sd-cli 7.0.65 → 7.0.66
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 +3 -3
- package/dist/build-tool/SdCliCacheCompilerHost.d.ts +10 -0
- package/dist/build-tool/SdCliCordova.d.ts +16 -0
- package/dist/build-tool/SdCliCordova.mjs +171 -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 +68 -6
- package/dist/builder/SdCliJsLibBuilder.d.ts +14 -0
- package/dist/builder/SdCliServerBuilder.d.ts +25 -0
- package/dist/builder/SdCliServerBuilder.mjs +11 -13
- package/dist/builder/SdCliTsLibBuilder.d.ts +34 -0
- package/dist/builder/SdCliTsLibBuilder.mjs +83 -36
- package/dist/commons.d.ts +85 -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/SdCliWorkspace.d.ts +28 -0
- package/dist/entry-points/SdCliWorkspace.mjs +12 -16
- package/dist/index.d.ts +29 -0
- package/dist/index.mjs +5 -3
- package/dist/ng-tools/SdCliNgModuleGenerator.d.ts +26 -0
- package/dist/ng-tools/SdCliNgModuleGenerator.mjs +404 -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 +13 -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 +2 -3
- 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 -6
- package/src/bin/sd-cli.ts +2 -2
- package/src/build-tool/SdCliCordova.ts +219 -0
- package/src/{entry-points → build-tool}/SdCliIndexFileGenerator.ts +3 -2
- package/src/build-tool/SdCliPackageLinter.ts +18 -2
- package/src/builder/SdCliClientBuilder.ts +83 -5
- package/src/builder/SdCliServerBuilder.ts +10 -12
- package/src/builder/SdCliTsLibBuilder.ts +100 -44
- package/src/commons.ts +24 -0
- package/src/entry-points/SdCliWorkspace.ts +14 -17
- package/src/index.ts +4 -2
- package/src/ng-tools/{NgModuleGenerator.ts → SdCliNgModuleGenerator.ts} +241 -64
- 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 +13 -12
- package/src/ng-tools/typescript/SdCliTsUtil.ts +29 -0
- package/src/packages/SdCliPackage.ts +1 -2
- package/tsconfig-build.json +1 -1
- package/dist/ng-tools/NgModuleGenerator.mjs +0 -278
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { INpmConfig, ISdCliPackageBuildResult } from "../commons";
|
|
1
|
+
import { INpmConfig, ISdCliLibPackageConfig, ISdCliPackageBuildResult } from "../commons";
|
|
2
2
|
import { EventEmitter } from "events";
|
|
3
3
|
import ts from "typescript";
|
|
4
4
|
import { FsUtil, Logger, PathUtil, SdFsWatcher } from "@simplysm/sd-core-node";
|
|
@@ -12,10 +12,11 @@ import { SdCliCacheCompilerHost } from "../build-tool/SdCliCacheCompilerHost";
|
|
|
12
12
|
import { SdCliNgCacheCompilerHost } from "../build-tool/SdCliNgCacheCompilerHost";
|
|
13
13
|
import { NgCompiler } from "@angular/compiler-cli/src/ngtsc/core";
|
|
14
14
|
import { SdCliNpmConfigUtil } from "../utils/SdCliNpmConfigUtil";
|
|
15
|
-
import {
|
|
15
|
+
import { SdCliNgModuleGenerator } from "../ng-tools/SdCliNgModuleGenerator";
|
|
16
|
+
import { SdCliIndexFileGenerator } from "../build-tool/SdCliIndexFileGenerator";
|
|
16
17
|
|
|
17
18
|
export class SdCliTsLibBuilder extends EventEmitter {
|
|
18
|
-
private readonly _logger
|
|
19
|
+
private readonly _logger: Logger;
|
|
19
20
|
|
|
20
21
|
private _moduleResolutionCache?: ts.ModuleResolutionCache;
|
|
21
22
|
|
|
@@ -24,31 +25,63 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
24
25
|
private readonly _fileCache = new Map<string, IFileCache>();
|
|
25
26
|
private readonly _writeFileCache = new Map<string, string>();
|
|
26
27
|
|
|
28
|
+
private readonly _indexFileGenerator?: SdCliIndexFileGenerator;
|
|
29
|
+
|
|
27
30
|
private _program?: ts.Program;
|
|
28
31
|
private _ngProgram?: NgtscProgram;
|
|
29
32
|
private _builder?: ts.EmitAndSemanticDiagnosticsBuilderProgram;
|
|
30
|
-
private _ngModuleGenerator?:
|
|
33
|
+
private readonly _ngModuleGenerator?: SdCliNgModuleGenerator;
|
|
31
34
|
|
|
32
35
|
private readonly _tsconfigFilePath: string;
|
|
33
36
|
private readonly _parsedTsconfig: ts.ParsedCommandLine;
|
|
34
|
-
private readonly
|
|
37
|
+
private readonly _npmConfigMap = new Map<string, INpmConfig>();
|
|
35
38
|
|
|
36
39
|
private readonly _isAngular: boolean;
|
|
37
40
|
|
|
38
|
-
public constructor(private readonly _rootPath: string
|
|
41
|
+
public constructor(private readonly _rootPath: string,
|
|
42
|
+
private readonly _config: ISdCliLibPackageConfig,
|
|
43
|
+
private readonly _workspaceRootPath: string) {
|
|
39
44
|
super();
|
|
45
|
+
const npmConfig = this._getNpmConfig(this._rootPath)!;
|
|
46
|
+
|
|
47
|
+
// linter
|
|
40
48
|
this._linter = new SdCliPackageLinter(this._rootPath);
|
|
41
49
|
|
|
50
|
+
// logger
|
|
51
|
+
this._logger = Logger.get(["simplysm", "sd-cli", this.constructor.name, npmConfig.name]);
|
|
52
|
+
|
|
53
|
+
// isAngular
|
|
54
|
+
this._isAngular = SdCliNpmConfigUtil.getDependencies(npmConfig).defaults.includes("@angular/core");
|
|
55
|
+
|
|
42
56
|
// tsconfig
|
|
43
57
|
this._tsconfigFilePath = path.resolve(this._rootPath, "tsconfig-build.json");
|
|
44
58
|
const tsconfig = FsUtil.readJson(this._tsconfigFilePath);
|
|
45
|
-
this._parsedTsconfig = ts.parseJsonConfigFileContent(tsconfig, ts.sys, this._rootPath);
|
|
59
|
+
this._parsedTsconfig = ts.parseJsonConfigFileContent(tsconfig, ts.sys, this._rootPath, this._isAngular ? tsconfig.angularCompilerOptions : undefined);
|
|
46
60
|
|
|
47
|
-
|
|
48
|
-
|
|
61
|
+
if (this._isAngular) {
|
|
62
|
+
// NgModule 생성기 초기화
|
|
63
|
+
this._ngModuleGenerator = new SdCliNgModuleGenerator(this._rootPath, [
|
|
64
|
+
"controls",
|
|
65
|
+
"directives",
|
|
66
|
+
"guards",
|
|
67
|
+
"modals",
|
|
68
|
+
"providers",
|
|
69
|
+
"app",
|
|
70
|
+
"pages",
|
|
71
|
+
"print-templates",
|
|
72
|
+
"toasts",
|
|
73
|
+
"AppPage"
|
|
74
|
+
], {
|
|
75
|
+
glob: "**/*Page.ts",
|
|
76
|
+
fileEndsWith: "Page",
|
|
77
|
+
rootClassName: "AppPage"
|
|
78
|
+
});
|
|
79
|
+
}
|
|
49
80
|
|
|
50
|
-
//
|
|
51
|
-
|
|
81
|
+
// index 생성기 초기화
|
|
82
|
+
if (this._config.autoIndex) {
|
|
83
|
+
this._indexFileGenerator = new SdCliIndexFileGenerator(this._rootPath, this._config.autoIndex);
|
|
84
|
+
}
|
|
52
85
|
}
|
|
53
86
|
|
|
54
87
|
public override on(event: "change", listener: () => void): this;
|
|
@@ -60,32 +93,24 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
60
93
|
public async watchAsync(): Promise<void> {
|
|
61
94
|
this.emit("change");
|
|
62
95
|
|
|
63
|
-
|
|
96
|
+
this._logger.debug("dist 폴더 삭제...");
|
|
64
97
|
await FsUtil.removeAsync(this._parsedTsconfig.options.outDir!);
|
|
65
98
|
|
|
66
|
-
if (this.
|
|
67
|
-
|
|
68
|
-
this._ngModuleGenerator = new NgModuleGenerator(this._rootPath, [
|
|
69
|
-
"controls",
|
|
70
|
-
"directives",
|
|
71
|
-
"guards",
|
|
72
|
-
"modals",
|
|
73
|
-
"providers",
|
|
74
|
-
"pages",
|
|
75
|
-
"print-templates",
|
|
76
|
-
"toasts"
|
|
77
|
-
]);
|
|
78
|
-
|
|
79
|
-
// NgModule 타겟 디렉토리 삭제
|
|
80
|
-
await this._ngModuleGenerator.clearModulesAsync();
|
|
81
|
-
|
|
82
|
-
// NgModule 생성
|
|
99
|
+
if (this._ngModuleGenerator) {
|
|
100
|
+
this._logger.debug("NgModule 생성...");
|
|
83
101
|
await this._ngModuleGenerator.runAsync();
|
|
84
102
|
}
|
|
85
103
|
|
|
86
|
-
|
|
104
|
+
if (this._indexFileGenerator) {
|
|
105
|
+
this._logger.debug("index.js 생성 및 index.js용 변경감지 시작...");
|
|
106
|
+
await this._indexFileGenerator.runAsync();
|
|
107
|
+
await this._indexFileGenerator.watchAsync();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
this._logger.debug("프로그램 로딩...");
|
|
87
111
|
const buildPack = this._createSdBuildPack(this._parsedTsconfig);
|
|
88
112
|
|
|
113
|
+
this._logger.debug("변경감지 구성...");
|
|
89
114
|
const relatedPaths = await this.getAllRelatedPathsAsync();
|
|
90
115
|
const watcher = SdFsWatcher.watch(relatedPaths);
|
|
91
116
|
watcher.onChange({}, async (changeInfos) => {
|
|
@@ -95,24 +120,26 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
95
120
|
this._logger.debug("파일 변경 감지", changeInfos);
|
|
96
121
|
this.emit("change");
|
|
97
122
|
|
|
98
|
-
|
|
123
|
+
this._logger.debug("변경된 파일의 캐쉬 삭제...");
|
|
99
124
|
for (const changeFilePath of changeFilePaths) {
|
|
100
125
|
this._fileCache.delete(PathUtil.posix(changeFilePath));
|
|
101
126
|
}
|
|
102
127
|
|
|
103
|
-
if (this.
|
|
104
|
-
|
|
105
|
-
this._ngModuleGenerator
|
|
106
|
-
await this._ngModuleGenerator
|
|
128
|
+
if (this._ngModuleGenerator) {
|
|
129
|
+
this._logger.debug("NgModule 생성...");
|
|
130
|
+
this._ngModuleGenerator.removeCaches(changeFilePaths);
|
|
131
|
+
await this._ngModuleGenerator.runAsync();
|
|
107
132
|
}
|
|
108
133
|
|
|
109
134
|
const watchBuildResults: ISdCliPackageBuildResult[] = [];
|
|
110
135
|
|
|
111
|
-
|
|
136
|
+
this._logger.debug("프로그램 로딩...");
|
|
112
137
|
const watchBuildPack = this._createSdBuildPack(this._parsedTsconfig);
|
|
138
|
+
|
|
139
|
+
this._logger.debug("빌드...");
|
|
113
140
|
watchBuildResults.push(...await this._runBuilderAsync(watchBuildPack.builder, watchBuildPack.ngCompiler));
|
|
114
141
|
|
|
115
|
-
|
|
142
|
+
this._logger.debug("린트...");
|
|
116
143
|
const lintFilePaths = [
|
|
117
144
|
...watchBuildPack.affectedSourceFiles.map((item) => item.fileName),
|
|
118
145
|
...changeInfos.filter((item) => ["add", "change"].includes(item.event)).map((item) => item.path)
|
|
@@ -121,32 +148,43 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
121
148
|
watchBuildResults.push(...await this._linter.lintAsync(lintFilePaths, watchBuildPack.program));
|
|
122
149
|
}
|
|
123
150
|
|
|
151
|
+
this._logger.debug("변경감지 대상목록 재구성...");
|
|
124
152
|
const watchRelatedPaths = await this.getAllRelatedPathsAsync();
|
|
125
153
|
watcher.add(watchRelatedPaths);
|
|
126
154
|
|
|
127
155
|
this.emit("complete", watchBuildResults);
|
|
128
156
|
});
|
|
129
157
|
|
|
130
|
-
|
|
158
|
+
this._logger.debug("빌드...");
|
|
131
159
|
const buildResults = await this._runBuilderAsync(buildPack.builder, buildPack.ngCompiler);
|
|
132
160
|
|
|
133
|
-
|
|
161
|
+
this._logger.debug("린트...");
|
|
134
162
|
buildResults.push(...await this._linter.lintAsync(relatedPaths, buildPack.program));
|
|
135
163
|
|
|
136
164
|
this.emit("complete", buildResults);
|
|
137
165
|
}
|
|
138
166
|
|
|
139
167
|
public async buildAsync(): Promise<ISdCliPackageBuildResult[]> {
|
|
140
|
-
|
|
168
|
+
this._logger.debug("dist 폴더 삭제...");
|
|
141
169
|
await FsUtil.removeAsync(this._parsedTsconfig.options.outDir!);
|
|
142
170
|
|
|
143
|
-
|
|
171
|
+
if (this._ngModuleGenerator) {
|
|
172
|
+
this._logger.debug("NgModule 생성...");
|
|
173
|
+
await this._ngModuleGenerator.runAsync();
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (this._indexFileGenerator) {
|
|
177
|
+
this._logger.debug("index.js 생성...");
|
|
178
|
+
await this._indexFileGenerator.runAsync();
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
this._logger.debug("프로그램 로딩...");
|
|
144
182
|
const buildPack = this._createSdBuildPack(this._parsedTsconfig);
|
|
145
183
|
|
|
146
|
-
|
|
184
|
+
this._logger.debug("빌드...");
|
|
147
185
|
const buildResults = await this._runBuilderAsync(buildPack.builder, buildPack.ngCompiler);
|
|
148
186
|
|
|
149
|
-
|
|
187
|
+
this._logger.debug("린트...");
|
|
150
188
|
const relatedPaths = await this.getAllRelatedPathsAsync();
|
|
151
189
|
buildResults.push(...await this._linter.lintAsync(relatedPaths, buildPack.program));
|
|
152
190
|
|
|
@@ -154,7 +192,16 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
154
192
|
}
|
|
155
193
|
|
|
156
194
|
private async getAllRelatedPathsAsync(): Promise<string[]> {
|
|
157
|
-
const
|
|
195
|
+
const workspaceNpmConfig = this._getNpmConfig(this._workspaceRootPath)!;
|
|
196
|
+
const workspaceName = workspaceNpmConfig.name;
|
|
197
|
+
|
|
198
|
+
const fileCachePaths = Array.from(this._fileCache.keys())
|
|
199
|
+
.filter((filePath) => {
|
|
200
|
+
const workspaceRegex = new RegExp(`node_modules[\\\\/]@${workspaceName}[\\\\/]`);
|
|
201
|
+
return !filePath.includes("node_modules")
|
|
202
|
+
|| (/node_modules[\\/]@simplysm[\\/]/).test(filePath)
|
|
203
|
+
|| workspaceRegex.test(filePath);
|
|
204
|
+
});
|
|
158
205
|
const mySourceGlobPath = path.resolve(this._rootPath, "**", "+(*.js|*.cjs|*.mjs|*.ts)");
|
|
159
206
|
const mySourceFilePaths = await FsUtil.globAsync(mySourceGlobPath, {
|
|
160
207
|
ignore: [
|
|
@@ -267,6 +314,7 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
267
314
|
const affectedSourceFileSet: Set<ts.SourceFile> = new Set<ts.SourceFile>();
|
|
268
315
|
while (true) {
|
|
269
316
|
const result = this._builder.getSemanticDiagnosticsOfNextAffectedFile(undefined, (sourceFile) => {
|
|
317
|
+
// this._logger.debug(sourceFile.fileName + " SYNTAX 로딩...");
|
|
270
318
|
if (ngCompiler?.ignoreForDiagnostics.has(sourceFile) && sourceFile.fileName.endsWith(".ngtypecheck.ts")) {
|
|
271
319
|
const orgFileName = sourceFile.fileName.slice(0, -15) + ".ts";
|
|
272
320
|
const orgSourceFile = this._builder!.getSourceFile(orgFileName);
|
|
@@ -281,6 +329,7 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
281
329
|
});
|
|
282
330
|
if (!result) break;
|
|
283
331
|
|
|
332
|
+
// this._logger.debug((result.affected as ts.SourceFile).fileName + " SYNTAX 로딩");
|
|
284
333
|
affectedSourceFileSet.add(result.affected as ts.SourceFile);
|
|
285
334
|
}
|
|
286
335
|
|
|
@@ -356,6 +405,13 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
356
405
|
return compilerHost;
|
|
357
406
|
}
|
|
358
407
|
}
|
|
408
|
+
|
|
409
|
+
private _getNpmConfig(pkgPath: string): INpmConfig | undefined {
|
|
410
|
+
if (!this._npmConfigMap.has(pkgPath)) {
|
|
411
|
+
this._npmConfigMap.set(pkgPath, FsUtil.readJson(path.resolve(pkgPath, "package.json")));
|
|
412
|
+
}
|
|
413
|
+
return this._npmConfigMap.get(pkgPath);
|
|
414
|
+
}
|
|
359
415
|
}
|
|
360
416
|
|
|
361
417
|
interface IFileCache {
|
package/src/commons.ts
CHANGED
|
@@ -61,7 +61,31 @@ export interface ISdCliServerPackageConfig {
|
|
|
61
61
|
|
|
62
62
|
export interface ISdCliClientPackageConfig {
|
|
63
63
|
type: "client";
|
|
64
|
+
cordova?: ISdCliClientPackageCordovaConfig;
|
|
64
65
|
server: string;
|
|
65
66
|
env?: Record<string, string>;
|
|
66
67
|
configs?: Record<string, any>;
|
|
67
68
|
}
|
|
69
|
+
|
|
70
|
+
export interface ISdCliClientPackageCordovaConfig {
|
|
71
|
+
platforms: TSdCliCordovaPlatform[];
|
|
72
|
+
appId: string;
|
|
73
|
+
appName: string;
|
|
74
|
+
plugins?: string[];
|
|
75
|
+
icon?: string;
|
|
76
|
+
buildOption?: {
|
|
77
|
+
debug?: boolean;
|
|
78
|
+
bundle?: boolean;
|
|
79
|
+
sign?: {
|
|
80
|
+
android?: {
|
|
81
|
+
keystore: string;
|
|
82
|
+
storePassword: string;
|
|
83
|
+
alias: string;
|
|
84
|
+
password: string;
|
|
85
|
+
keystoreType: string;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export type TSdCliCordovaPlatform = "browser" | "ios" | "android" | "windows";
|
|
@@ -11,7 +11,6 @@ import { SdServiceServer } from "@simplysm/sd-service-server";
|
|
|
11
11
|
import { SdCliNpm } from "./SdCliNpm";
|
|
12
12
|
import { SdCliLocalUpdate } from "./SdCliLocalUpdate";
|
|
13
13
|
import { NextHandleFunction } from "connect";
|
|
14
|
-
import { SdCliIndexFileGenerator } from "./SdCliIndexFileGenerator";
|
|
15
14
|
|
|
16
15
|
export class SdCliWorkspace {
|
|
17
16
|
private readonly _logger = Logger.get(["simplysm", "sd-cli", this.constructor.name]);
|
|
@@ -36,13 +35,6 @@ export class SdCliWorkspace {
|
|
|
36
35
|
this._logger.debug("패키지 목록 구성...");
|
|
37
36
|
const pkgs = await this._getPackagesAsync(config);
|
|
38
37
|
|
|
39
|
-
this._logger.debug("패키지 인덱스 생성기 실행...");
|
|
40
|
-
await pkgs.parallelAsync(async (pkg) => {
|
|
41
|
-
if (pkg.config.type === "library" && pkg.config.autoIndex) {
|
|
42
|
-
await new SdCliIndexFileGenerator(pkg.rootPath, pkg.config.autoIndex).watchAsync();
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
|
|
46
38
|
this._logger.debug("패키지 이벤트 설정...");
|
|
47
39
|
let changeCount = 0;
|
|
48
40
|
const totalResultMap = new Map<string, ISdCliPackageBuildResult[]>();
|
|
@@ -74,7 +66,12 @@ export class SdCliWorkspace {
|
|
|
74
66
|
});
|
|
75
67
|
}
|
|
76
68
|
|
|
77
|
-
|
|
69
|
+
|
|
70
|
+
if (changeCount === 0) {
|
|
71
|
+
this._logger.log("빌드를 시작합니다...");
|
|
72
|
+
}
|
|
73
|
+
changeCount++;
|
|
74
|
+
|
|
78
75
|
const pkgNames = pkgs.map((item) => item.name);
|
|
79
76
|
const buildCompletedPackageNames: string[] = [];
|
|
80
77
|
await pkgs.parallelAsync(async (pkg) => {
|
|
@@ -91,6 +88,13 @@ export class SdCliWorkspace {
|
|
|
91
88
|
}
|
|
92
89
|
buildCompletedPackageNames.push(pkg.name);
|
|
93
90
|
});
|
|
91
|
+
|
|
92
|
+
changeCount--;
|
|
93
|
+
if (changeCount === 0) {
|
|
94
|
+
this._loggingResults(totalResultMap);
|
|
95
|
+
this._loggingOpenClientHrefs();
|
|
96
|
+
this._logger.info("모든 빌드가 완료되었습니다.");
|
|
97
|
+
}
|
|
94
98
|
}
|
|
95
99
|
|
|
96
100
|
private _isServerRestarting = false;
|
|
@@ -118,7 +122,7 @@ export class SdCliWorkspace {
|
|
|
118
122
|
delete serverInfo.server;
|
|
119
123
|
}
|
|
120
124
|
|
|
121
|
-
serverInfo.server = (await import("file:///" + entryFilePath + "?update=" + Uuid.new().toString())).default as SdServiceServer | undefined;
|
|
125
|
+
serverInfo.server = (await import("file:///" + entryFilePath + "?update=" + Uuid.new().toString())).default.default as SdServiceServer | undefined;
|
|
122
126
|
if (!serverInfo.server) {
|
|
123
127
|
this._logger.error(`${entryFilePath}(0, 0): 'SdServiceServer'를 'export'해야 합니다.`);
|
|
124
128
|
this._isServerRestarting = false;
|
|
@@ -143,13 +147,6 @@ export class SdCliWorkspace {
|
|
|
143
147
|
this._logger.debug("패키지 목록 구성...");
|
|
144
148
|
const pkgs = await this._getPackagesAsync(config);
|
|
145
149
|
|
|
146
|
-
this._logger.debug("패키지 인덱스 생성기 실행...");
|
|
147
|
-
await pkgs.parallelAsync(async (pkg) => {
|
|
148
|
-
if (pkg.config.type === "library" && pkg.config.autoIndex) {
|
|
149
|
-
await new SdCliIndexFileGenerator(pkg.rootPath, pkg.config.autoIndex).runAsync();
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
|
|
153
150
|
this._logger.debug("프로젝트 및 패키지 버전 설정...");
|
|
154
151
|
await this._upgradeVersionAsync(pkgs);
|
|
155
152
|
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * from "./build-tool/SdCliCacheCompilerHost";
|
|
2
|
+
export * from "./build-tool/SdCliCordova";
|
|
3
|
+
export * from "./build-tool/SdCliIndexFileGenerator";
|
|
2
4
|
export * from "./build-tool/SdCliNgCacheCompilerHost";
|
|
3
5
|
export * from "./build-tool/SdCliPackageLinter";
|
|
4
6
|
export * from "./builder/SdCliClientBuilder";
|
|
@@ -6,7 +8,6 @@ export * from "./builder/SdCliJsLibBuilder";
|
|
|
6
8
|
export * from "./builder/SdCliServerBuilder";
|
|
7
9
|
export * from "./builder/SdCliTsLibBuilder";
|
|
8
10
|
export * from "./commons";
|
|
9
|
-
export * from "./entry-points/SdCliIndexFileGenerator";
|
|
10
11
|
export * from "./entry-points/SdCliLocalUpdate";
|
|
11
12
|
export * from "./entry-points/SdCliNpm";
|
|
12
13
|
export * from "./entry-points/SdCliPrepare";
|
|
@@ -17,9 +18,10 @@ export * from "./ng-tools/babel/SdCliBbUtil";
|
|
|
17
18
|
export * from "./ng-tools/babel/TSdCliBbNgMetadata";
|
|
18
19
|
export * from "./ng-tools/babel/TSdCliBbTypeMetadata";
|
|
19
20
|
export * from "./ng-tools/commons";
|
|
20
|
-
export * from "./ng-tools/
|
|
21
|
+
export * from "./ng-tools/SdCliNgModuleGenerator";
|
|
21
22
|
export * from "./ng-tools/typescript/SdCliTsFileMetadata";
|
|
22
23
|
export * from "./ng-tools/typescript/SdCliTsRootMetadata";
|
|
24
|
+
export * from "./ng-tools/typescript/SdCliTsUtil";
|
|
23
25
|
export * from "./packages/SdCliPackage";
|
|
24
26
|
export * from "./SdCliBuildResultError";
|
|
25
27
|
export * from "./utils/SdCliBuildResultUtil";
|