@simplysm/sd-cli 12.5.12 → 12.5.14
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/build-tools/SdNgBundler.js +125 -110
- package/dist/build-tools/SdNgBundler.js.map +1 -1
- package/dist/build-tools/SdTsCompiler.js +20 -15
- package/dist/build-tools/SdTsCompiler.js.map +1 -1
- package/dist/entry/SdCliProject.js +1 -1
- package/dist/entry/SdCliProject.js.map +1 -1
- package/package.json +11 -11
- package/src/build-tools/SdNgBundler.ts +185 -160
- package/src/build-tools/SdTsCompiler.ts +23 -15
- package/src/commons.ts +11 -8
- package/src/entry/SdCliProject.ts +1 -1
|
@@ -10,6 +10,7 @@ import { AngularCompilerHost } from "@angular/build/src/tools/angular/angular-ho
|
|
|
10
10
|
import { transformSupportedBrowsersToTargets } from "@angular/build/src/tools/esbuild/utils";
|
|
11
11
|
import browserslist from "browserslist";
|
|
12
12
|
import transformKeys from "@simplysm/ts-transformer-keys/transformer";
|
|
13
|
+
import { replaceBootstrap } from "@angular/build/src/tools/angular/transformers/jit-bootstrap-transformer";
|
|
13
14
|
|
|
14
15
|
export class SdTsCompiler {
|
|
15
16
|
readonly #logger = Logger.get(["simplysm", "sd-cli", "SdTsCompiler"]);
|
|
@@ -398,21 +399,31 @@ export class SdTsCompiler {
|
|
|
398
399
|
|
|
399
400
|
this.#debug(`prepare emit...`);
|
|
400
401
|
|
|
401
|
-
|
|
402
|
+
let transformers: ts.CustomTransformers = {};
|
|
403
|
+
|
|
404
|
+
if (this.#ngProgram) {
|
|
405
|
+
transformers = {
|
|
406
|
+
...transformers,
|
|
407
|
+
...this.#ngProgram.compiler.prepareEmit().transformers,
|
|
408
|
+
};
|
|
409
|
+
(transformers.before ??= []).push(replaceBootstrap(() => this.#program!.getTypeChecker()));
|
|
410
|
+
}
|
|
411
|
+
(transformers.before ??= []).push(transformKeys(this.#program));
|
|
402
412
|
|
|
403
413
|
// affected에 새로 추가된 파일은 포함되지 않는 현상이 있어 getSourceFiles로 바꿈
|
|
404
414
|
// -> 너무 느려져서 다시 돌림. 포함안되는 현상은 getAllDep 문제인가?
|
|
415
|
+
for (const affectedFile of affectedFileSet) {
|
|
416
|
+
if (this.#emittedFilesCacheMap.has(affectedFile)) {
|
|
417
|
+
continue;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
const sf = this.#program.getSourceFile(affectedFile);
|
|
421
|
+
if (!sf) {
|
|
422
|
+
continue;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// for (const sf of sourceFileSet) {
|
|
405
426
|
|
|
406
|
-
// for (const affectedFile of affectedFileSet) {
|
|
407
|
-
// if (this.#emittedFilesCacheMap.has(affectedFile)) {
|
|
408
|
-
// continue;
|
|
409
|
-
// }
|
|
410
|
-
//
|
|
411
|
-
// const sf = this.#program.getSourceFile(affectedFile);
|
|
412
|
-
// if (!sf) {
|
|
413
|
-
// continue;
|
|
414
|
-
// }
|
|
415
|
-
for (const sf of sourceFileSet) {
|
|
416
427
|
if (this.#emittedFilesCacheMap.has(path.normalize(sf.fileName))) {
|
|
417
428
|
continue;
|
|
418
429
|
}
|
|
@@ -472,10 +483,7 @@ export class SdTsCompiler {
|
|
|
472
483
|
},
|
|
473
484
|
undefined,
|
|
474
485
|
undefined,
|
|
475
|
-
|
|
476
|
-
...(ngTransformers ?? {}),
|
|
477
|
-
before: [...(ngTransformers?.before ?? []), transformKeys(this.#program)],
|
|
478
|
-
},
|
|
486
|
+
transformers,
|
|
479
487
|
);
|
|
480
488
|
}
|
|
481
489
|
|
package/src/commons.ts
CHANGED
|
@@ -8,9 +8,12 @@ export interface INpmConfig {
|
|
|
8
8
|
optionalDependencies?: Record<string, string>;
|
|
9
9
|
devDependencies?: Record<string, string>;
|
|
10
10
|
peerDependencies?: Record<string, string>;
|
|
11
|
-
peerDependenciesMeta?: Record<
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
peerDependenciesMeta?: Record<
|
|
12
|
+
string,
|
|
13
|
+
{
|
|
14
|
+
optional?: boolean;
|
|
15
|
+
}
|
|
16
|
+
>;
|
|
14
17
|
|
|
15
18
|
resolutions?: Record<string, string>;
|
|
16
19
|
|
|
@@ -18,7 +21,7 @@ export interface INpmConfig {
|
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
export interface ITsConfig {
|
|
21
|
-
files?: string[]
|
|
24
|
+
files?: string[];
|
|
22
25
|
compilerOptions: { lib: string[] };
|
|
23
26
|
angularCompilerOptions?: {};
|
|
24
27
|
}
|
|
@@ -83,7 +86,7 @@ export interface ISdCliServerPackageConfig {
|
|
|
83
86
|
};
|
|
84
87
|
iis?: {
|
|
85
88
|
nodeExeFilePath?: string;
|
|
86
|
-
}
|
|
89
|
+
};
|
|
87
90
|
}
|
|
88
91
|
|
|
89
92
|
export interface ISdCliClientPackageConfig {
|
|
@@ -99,7 +102,7 @@ export interface ISdCliClientPackageConfig {
|
|
|
99
102
|
web?: ISdCliClientBuilderWebConfig;
|
|
100
103
|
electron?: ISdCliClientBuilderElectronConfig;
|
|
101
104
|
cordova?: ISdCliClientBuilderCordovaConfig;
|
|
102
|
-
}
|
|
105
|
+
};
|
|
103
106
|
}
|
|
104
107
|
|
|
105
108
|
export interface ISdCliLocalDirectoryPublishConfig {
|
|
@@ -154,7 +157,7 @@ export interface ISdCliClientBuilderCordovaConfig {
|
|
|
154
157
|
name: string;
|
|
155
158
|
maxSdkVersion?: number;
|
|
156
159
|
}[];
|
|
157
|
-
}
|
|
160
|
+
};
|
|
158
161
|
};
|
|
159
162
|
env?: Record<string, string>;
|
|
160
163
|
browserslist?: string[];
|
|
@@ -165,4 +168,4 @@ export type TSdCliPostPublishConfig = ISdCliPostPublishScriptConfig;
|
|
|
165
168
|
export interface ISdCliPostPublishScriptConfig {
|
|
166
169
|
type: "script";
|
|
167
170
|
script: string;
|
|
168
|
-
}
|
|
171
|
+
}
|
|
@@ -530,7 +530,7 @@ export class SdCliProject {
|
|
|
530
530
|
logger.info("모든 빌드가 완료되었습니다.");
|
|
531
531
|
}
|
|
532
532
|
|
|
533
|
-
//
|
|
533
|
+
// piscina 사용시 ts파일을 못찾으므로 그냥 이렇게..
|
|
534
534
|
private static async _prepareClusterAsync(): Promise<cp.ChildProcess> {
|
|
535
535
|
const logger = Logger.get(["simplysm", "sd-cli", "SdCliProject", "_runBuildClusterAsync"]);
|
|
536
536
|
return await new Promise<cp.ChildProcess>((resolve, reject) => {
|