@simplysm/sd-cli 7.0.59 → 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/SdCliBuildResultError.mjs +8 -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 +90 -20
- 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 +30 -0
- 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 +482 -0
- package/dist/ng-tools/babel/SdCliBbRootMetadata.d.ts +22 -0
- package/dist/ng-tools/babel/SdCliBbRootMetadata.mjs +174 -0
- package/dist/ng-tools/babel/SdCliBbUtil.d.ts +5 -0
- package/dist/ng-tools/babel/SdCliBbUtil.mjs +14 -0
- package/dist/ng-tools/babel/TSdCliBbNgMetadata.d.ts +42 -0
- package/dist/ng-tools/babel/TSdCliBbNgMetadata.mjs +200 -0
- package/dist/ng-tools/babel/TSdCliBbTypeMetadata.d.ts +44 -0
- package/dist/ng-tools/babel/TSdCliBbTypeMetadata.mjs +127 -0
- package/dist/ng-tools/commons.d.ts +9 -0
- package/dist/ng-tools/commons.mjs +2 -0
- package/dist/ng-tools/typescript/SdCliTsFileMetadata.d.ts +61 -0
- package/dist/ng-tools/typescript/SdCliTsFileMetadata.mjs +326 -0
- package/dist/ng-tools/typescript/SdCliTsRootMetadata.d.ts +8 -0
- package/dist/ng-tools/typescript/SdCliTsRootMetadata.mjs +28 -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/dist/utils/SdCliNpmConfigUtil.mjs +3 -3
- package/package.json +16 -7
- package/src/SdCliBuildResultError.ts +9 -0
- 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 +105 -21
- package/src/commons.ts +24 -0
- package/src/entry-points/SdCliWorkspace.ts +14 -17
- package/src/index.ts +29 -0
- package/src/ng-tools/SdCliNgModuleGenerator.ts +538 -0
- package/src/ng-tools/babel/SdCliBbFileMetadata.ts +568 -0
- package/src/ng-tools/babel/SdCliBbRootMetadata.ts +211 -0
- package/src/ng-tools/babel/SdCliBbUtil.ts +15 -0
- package/src/ng-tools/babel/TSdCliBbNgMetadata.ts +234 -0
- package/src/ng-tools/babel/TSdCliBbTypeMetadata.ts +177 -0
- package/src/ng-tools/commons.ts +3 -0
- package/src/ng-tools/typescript/SdCliTsFileMetadata.ts +385 -0
- package/src/ng-tools/typescript/SdCliTsRootMetadata.ts +32 -0
- package/src/ng-tools/typescript/SdCliTsUtil.ts +29 -0
- package/src/packages/SdCliPackage.ts +1 -2
- package/src/utils/SdCliNpmConfigUtil.ts +2 -2
- package/tsconfig-build.json +6 -2
- package/tsconfig.json +5 -1
|
@@ -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,9 +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 { SdCliNgModuleGenerator } from "../ng-tools/SdCliNgModuleGenerator";
|
|
16
|
+
import { SdCliIndexFileGenerator } from "../build-tool/SdCliIndexFileGenerator";
|
|
15
17
|
|
|
16
18
|
export class SdCliTsLibBuilder extends EventEmitter {
|
|
17
|
-
private readonly _logger
|
|
19
|
+
private readonly _logger: Logger;
|
|
18
20
|
|
|
19
21
|
private _moduleResolutionCache?: ts.ModuleResolutionCache;
|
|
20
22
|
|
|
@@ -23,30 +25,63 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
23
25
|
private readonly _fileCache = new Map<string, IFileCache>();
|
|
24
26
|
private readonly _writeFileCache = new Map<string, string>();
|
|
25
27
|
|
|
28
|
+
private readonly _indexFileGenerator?: SdCliIndexFileGenerator;
|
|
29
|
+
|
|
26
30
|
private _program?: ts.Program;
|
|
27
31
|
private _ngProgram?: NgtscProgram;
|
|
28
32
|
private _builder?: ts.EmitAndSemanticDiagnosticsBuilderProgram;
|
|
33
|
+
private readonly _ngModuleGenerator?: SdCliNgModuleGenerator;
|
|
29
34
|
|
|
30
35
|
private readonly _tsconfigFilePath: string;
|
|
31
36
|
private readonly _parsedTsconfig: ts.ParsedCommandLine;
|
|
32
|
-
private readonly
|
|
37
|
+
private readonly _npmConfigMap = new Map<string, INpmConfig>();
|
|
33
38
|
|
|
34
39
|
private readonly _isAngular: boolean;
|
|
35
40
|
|
|
36
|
-
public constructor(private readonly _rootPath: string
|
|
41
|
+
public constructor(private readonly _rootPath: string,
|
|
42
|
+
private readonly _config: ISdCliLibPackageConfig,
|
|
43
|
+
private readonly _workspaceRootPath: string) {
|
|
37
44
|
super();
|
|
45
|
+
const npmConfig = this._getNpmConfig(this._rootPath)!;
|
|
46
|
+
|
|
47
|
+
// linter
|
|
38
48
|
this._linter = new SdCliPackageLinter(this._rootPath);
|
|
39
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
|
+
|
|
40
56
|
// tsconfig
|
|
41
57
|
this._tsconfigFilePath = path.resolve(this._rootPath, "tsconfig-build.json");
|
|
42
58
|
const tsconfig = FsUtil.readJson(this._tsconfigFilePath);
|
|
43
|
-
this._parsedTsconfig = ts.parseJsonConfigFileContent(tsconfig, ts.sys, this._rootPath);
|
|
59
|
+
this._parsedTsconfig = ts.parseJsonConfigFileContent(tsconfig, ts.sys, this._rootPath, this._isAngular ? tsconfig.angularCompilerOptions : undefined);
|
|
44
60
|
|
|
45
|
-
|
|
46
|
-
|
|
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
|
+
}
|
|
47
80
|
|
|
48
|
-
//
|
|
49
|
-
|
|
81
|
+
// index 생성기 초기화
|
|
82
|
+
if (this._config.autoIndex) {
|
|
83
|
+
this._indexFileGenerator = new SdCliIndexFileGenerator(this._rootPath, this._config.autoIndex);
|
|
84
|
+
}
|
|
50
85
|
}
|
|
51
86
|
|
|
52
87
|
public override on(event: "change", listener: () => void): this;
|
|
@@ -58,12 +93,24 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
58
93
|
public async watchAsync(): Promise<void> {
|
|
59
94
|
this.emit("change");
|
|
60
95
|
|
|
61
|
-
|
|
96
|
+
this._logger.debug("dist 폴더 삭제...");
|
|
62
97
|
await FsUtil.removeAsync(this._parsedTsconfig.options.outDir!);
|
|
63
98
|
|
|
64
|
-
|
|
99
|
+
if (this._ngModuleGenerator) {
|
|
100
|
+
this._logger.debug("NgModule 생성...");
|
|
101
|
+
await this._ngModuleGenerator.runAsync();
|
|
102
|
+
}
|
|
103
|
+
|
|
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("프로그램 로딩...");
|
|
65
111
|
const buildPack = this._createSdBuildPack(this._parsedTsconfig);
|
|
66
112
|
|
|
113
|
+
this._logger.debug("변경감지 구성...");
|
|
67
114
|
const relatedPaths = await this.getAllRelatedPathsAsync();
|
|
68
115
|
const watcher = SdFsWatcher.watch(relatedPaths);
|
|
69
116
|
watcher.onChange({}, async (changeInfos) => {
|
|
@@ -73,18 +120,26 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
73
120
|
this._logger.debug("파일 변경 감지", changeInfos);
|
|
74
121
|
this.emit("change");
|
|
75
122
|
|
|
76
|
-
|
|
123
|
+
this._logger.debug("변경된 파일의 캐쉬 삭제...");
|
|
77
124
|
for (const changeFilePath of changeFilePaths) {
|
|
78
125
|
this._fileCache.delete(PathUtil.posix(changeFilePath));
|
|
79
126
|
}
|
|
80
127
|
|
|
128
|
+
if (this._ngModuleGenerator) {
|
|
129
|
+
this._logger.debug("NgModule 생성...");
|
|
130
|
+
this._ngModuleGenerator.removeCaches(changeFilePaths);
|
|
131
|
+
await this._ngModuleGenerator.runAsync();
|
|
132
|
+
}
|
|
133
|
+
|
|
81
134
|
const watchBuildResults: ISdCliPackageBuildResult[] = [];
|
|
82
135
|
|
|
83
|
-
|
|
136
|
+
this._logger.debug("프로그램 로딩...");
|
|
84
137
|
const watchBuildPack = this._createSdBuildPack(this._parsedTsconfig);
|
|
138
|
+
|
|
139
|
+
this._logger.debug("빌드...");
|
|
85
140
|
watchBuildResults.push(...await this._runBuilderAsync(watchBuildPack.builder, watchBuildPack.ngCompiler));
|
|
86
141
|
|
|
87
|
-
|
|
142
|
+
this._logger.debug("린트...");
|
|
88
143
|
const lintFilePaths = [
|
|
89
144
|
...watchBuildPack.affectedSourceFiles.map((item) => item.fileName),
|
|
90
145
|
...changeInfos.filter((item) => ["add", "change"].includes(item.event)).map((item) => item.path)
|
|
@@ -93,32 +148,43 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
93
148
|
watchBuildResults.push(...await this._linter.lintAsync(lintFilePaths, watchBuildPack.program));
|
|
94
149
|
}
|
|
95
150
|
|
|
151
|
+
this._logger.debug("변경감지 대상목록 재구성...");
|
|
96
152
|
const watchRelatedPaths = await this.getAllRelatedPathsAsync();
|
|
97
153
|
watcher.add(watchRelatedPaths);
|
|
98
154
|
|
|
99
155
|
this.emit("complete", watchBuildResults);
|
|
100
156
|
});
|
|
101
157
|
|
|
102
|
-
|
|
158
|
+
this._logger.debug("빌드...");
|
|
103
159
|
const buildResults = await this._runBuilderAsync(buildPack.builder, buildPack.ngCompiler);
|
|
104
160
|
|
|
105
|
-
|
|
161
|
+
this._logger.debug("린트...");
|
|
106
162
|
buildResults.push(...await this._linter.lintAsync(relatedPaths, buildPack.program));
|
|
107
163
|
|
|
108
164
|
this.emit("complete", buildResults);
|
|
109
165
|
}
|
|
110
166
|
|
|
111
167
|
public async buildAsync(): Promise<ISdCliPackageBuildResult[]> {
|
|
112
|
-
|
|
168
|
+
this._logger.debug("dist 폴더 삭제...");
|
|
113
169
|
await FsUtil.removeAsync(this._parsedTsconfig.options.outDir!);
|
|
114
170
|
|
|
115
|
-
|
|
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("프로그램 로딩...");
|
|
116
182
|
const buildPack = this._createSdBuildPack(this._parsedTsconfig);
|
|
117
183
|
|
|
118
|
-
|
|
184
|
+
this._logger.debug("빌드...");
|
|
119
185
|
const buildResults = await this._runBuilderAsync(buildPack.builder, buildPack.ngCompiler);
|
|
120
186
|
|
|
121
|
-
|
|
187
|
+
this._logger.debug("린트...");
|
|
122
188
|
const relatedPaths = await this.getAllRelatedPathsAsync();
|
|
123
189
|
buildResults.push(...await this._linter.lintAsync(relatedPaths, buildPack.program));
|
|
124
190
|
|
|
@@ -126,7 +192,16 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
126
192
|
}
|
|
127
193
|
|
|
128
194
|
private async getAllRelatedPathsAsync(): Promise<string[]> {
|
|
129
|
-
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
|
+
});
|
|
130
205
|
const mySourceGlobPath = path.resolve(this._rootPath, "**", "+(*.js|*.cjs|*.mjs|*.ts)");
|
|
131
206
|
const mySourceFilePaths = await FsUtil.globAsync(mySourceGlobPath, {
|
|
132
207
|
ignore: [
|
|
@@ -239,6 +314,7 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
239
314
|
const affectedSourceFileSet: Set<ts.SourceFile> = new Set<ts.SourceFile>();
|
|
240
315
|
while (true) {
|
|
241
316
|
const result = this._builder.getSemanticDiagnosticsOfNextAffectedFile(undefined, (sourceFile) => {
|
|
317
|
+
// this._logger.debug(sourceFile.fileName + " SYNTAX 로딩...");
|
|
242
318
|
if (ngCompiler?.ignoreForDiagnostics.has(sourceFile) && sourceFile.fileName.endsWith(".ngtypecheck.ts")) {
|
|
243
319
|
const orgFileName = sourceFile.fileName.slice(0, -15) + ".ts";
|
|
244
320
|
const orgSourceFile = this._builder!.getSourceFile(orgFileName);
|
|
@@ -253,6 +329,7 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
253
329
|
});
|
|
254
330
|
if (!result) break;
|
|
255
331
|
|
|
332
|
+
// this._logger.debug((result.affected as ts.SourceFile).fileName + " SYNTAX 로딩");
|
|
256
333
|
affectedSourceFileSet.add(result.affected as ts.SourceFile);
|
|
257
334
|
}
|
|
258
335
|
|
|
@@ -328,6 +405,13 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
328
405
|
return compilerHost;
|
|
329
406
|
}
|
|
330
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
|
+
}
|
|
331
415
|
}
|
|
332
416
|
|
|
333
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
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from "./build-tool/SdCliCacheCompilerHost";
|
|
2
|
+
export * from "./build-tool/SdCliCordova";
|
|
3
|
+
export * from "./build-tool/SdCliIndexFileGenerator";
|
|
4
|
+
export * from "./build-tool/SdCliNgCacheCompilerHost";
|
|
5
|
+
export * from "./build-tool/SdCliPackageLinter";
|
|
6
|
+
export * from "./builder/SdCliClientBuilder";
|
|
7
|
+
export * from "./builder/SdCliJsLibBuilder";
|
|
8
|
+
export * from "./builder/SdCliServerBuilder";
|
|
9
|
+
export * from "./builder/SdCliTsLibBuilder";
|
|
10
|
+
export * from "./commons";
|
|
11
|
+
export * from "./entry-points/SdCliLocalUpdate";
|
|
12
|
+
export * from "./entry-points/SdCliNpm";
|
|
13
|
+
export * from "./entry-points/SdCliPrepare";
|
|
14
|
+
export * from "./entry-points/SdCliWorkspace";
|
|
15
|
+
export * from "./ng-tools/babel/SdCliBbFileMetadata";
|
|
16
|
+
export * from "./ng-tools/babel/SdCliBbRootMetadata";
|
|
17
|
+
export * from "./ng-tools/babel/SdCliBbUtil";
|
|
18
|
+
export * from "./ng-tools/babel/TSdCliBbNgMetadata";
|
|
19
|
+
export * from "./ng-tools/babel/TSdCliBbTypeMetadata";
|
|
20
|
+
export * from "./ng-tools/commons";
|
|
21
|
+
export * from "./ng-tools/SdCliNgModuleGenerator";
|
|
22
|
+
export * from "./ng-tools/typescript/SdCliTsFileMetadata";
|
|
23
|
+
export * from "./ng-tools/typescript/SdCliTsRootMetadata";
|
|
24
|
+
export * from "./ng-tools/typescript/SdCliTsUtil";
|
|
25
|
+
export * from "./packages/SdCliPackage";
|
|
26
|
+
export * from "./SdCliBuildResultError";
|
|
27
|
+
export * from "./utils/SdCliBuildResultUtil";
|
|
28
|
+
export * from "./utils/SdCliConfigUtil";
|
|
29
|
+
export * from "./utils/SdCliNpmConfigUtil";
|