@simplysm/sd-cli 12.13.23 → 12.13.36
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/entry/SdCliAiCommand.d.ts +3 -0
- package/dist/entry/SdCliAiCommand.js +65 -0
- package/dist/entry/SdCliAiCommand.js.map +1 -0
- package/dist/entry/SdCliCordova.d.ts +16 -0
- package/dist/entry/SdCliCordova.js +398 -0
- package/dist/entry/SdCliCordova.js.map +1 -0
- package/dist/entry/SdCliElectron.d.ts +18 -0
- package/dist/entry/SdCliElectron.js +129 -0
- package/dist/entry/SdCliElectron.js.map +1 -0
- package/dist/entry/SdCliLocalUpdate.d.ts +11 -0
- package/dist/entry/SdCliLocalUpdate.js +84 -0
- package/dist/entry/SdCliLocalUpdate.js.map +1 -0
- package/dist/entry/SdCliPostinstall.d.ts +3 -0
- package/dist/entry/SdCliPostinstall.js +39 -0
- package/dist/entry/SdCliPostinstall.js.map +1 -0
- package/dist/entry/SdCliProject.d.ts +21 -0
- package/dist/entry/SdCliProject.js +302 -0
- package/dist/entry/SdCliProject.js.map +1 -0
- package/dist/fix/convert-extends-sd-modal-base-to-interface.d.ts +1 -0
- package/dist/fix/convert-extends-sd-modal-base-to-interface.js +289 -0
- package/dist/fix/convert-extends-sd-modal-base-to-interface.js.map +1 -0
- package/dist/fix/convert-extends-sd-print-template-base-to-interface.d.ts +1 -0
- package/dist/fix/convert-extends-sd-print-template-base-to-interface.js +179 -0
- package/dist/fix/convert-extends-sd-print-template-base-to-interface.js.map +1 -0
- package/dist/fix/convert-flat-pages-to-flat-menus.d.ts +1 -0
- package/dist/fix/convert-flat-pages-to-flat-menus.js +68 -0
- package/dist/fix/convert-flat-pages-to-flat-menus.js.map +1 -0
- package/dist/fix/convert-get-menus-to-usable-menus.d.ts +1 -0
- package/dist/fix/convert-get-menus-to-usable-menus.js +48 -0
- package/dist/fix/convert-get-menus-to-usable-menus.js.map +1 -0
- package/dist/fix/convert-modal-show-params.d.ts +1 -0
- package/dist/fix/convert-modal-show-params.js +29 -0
- package/dist/fix/convert-modal-show-params.js.map +1 -0
- package/dist/fix/convert-print-params.d.ts +1 -0
- package/dist/fix/convert-print-params.js +37 -0
- package/dist/fix/convert-print-params.js.map +1 -0
- package/dist/fix/convert-private-to-hash.d.ts +1 -0
- package/dist/fix/convert-private-to-hash.js +59 -0
- package/dist/fix/convert-private-to-hash.js.map +1 -0
- package/dist/fix/convert-sd-angular-symbol-names.d.ts +1 -0
- package/dist/fix/convert-sd-angular-symbol-names.js +23 -0
- package/dist/fix/convert-sd-angular-symbol-names.js.map +1 -0
- package/dist/fix/convert-sd-icon-to-fa-icon.d.ts +1 -0
- package/dist/fix/convert-sd-icon-to-fa-icon.js +80 -0
- package/dist/fix/convert-sd-icon-to-fa-icon.js.map +1 -0
- package/dist/fix/convert-sd-sheet-bindings-safety.d.ts +1 -0
- package/dist/fix/convert-sd-sheet-bindings-safety.js +57 -0
- package/dist/fix/convert-sd-sheet-bindings-safety.js.map +1 -0
- package/dist/fix/convert-select-modal-button-to-select-button.d.ts +1 -0
- package/dist/fix/convert-select-modal-button-to-select-button.js +64 -0
- package/dist/fix/convert-select-modal-button-to-select-button.js.map +1 -0
- package/dist/fix/convert-setup-cumulate-selected-keys-to-object-param.d.ts +1 -0
- package/dist/fix/convert-setup-cumulate-selected-keys-to-object-param.js +38 -0
- package/dist/fix/convert-setup-cumulate-selected-keys-to-object-param.js.map +1 -0
- package/dist/fix/convert-to-use-perms-signal.d.ts +1 -0
- package/dist/fix/convert-to-use-perms-signal.js +99 -0
- package/dist/fix/convert-to-use-perms-signal.js.map +1 -0
- package/dist/fix/core/convert-symbol.d.ts +1 -0
- package/dist/fix/core/convert-symbol.js +102 -0
- package/dist/fix/core/convert-symbol.js.map +1 -0
- package/dist/fix/core/get-ts-morph-source-files.d.ts +1 -0
- package/dist/fix/core/get-ts-morph-source-files.js +8 -0
- package/dist/fix/core/get-ts-morph-source-files.js.map +1 -0
- package/dist/fix/core/remove-named-import.d.ts +1 -0
- package/dist/fix/core/remove-named-import.js +14 -0
- package/dist/fix/core/remove-named-import.js.map +1 -0
- package/dist/fix/core/remove-symbol.d.ts +1 -0
- package/dist/fix/core/remove-symbol.js +76 -0
- package/dist/fix/core/remove-symbol.js.map +1 -0
- package/dist/fix/remove-sd-angular-symbol-names.d.ts +1 -0
- package/dist/fix/remove-sd-angular-symbol-names.js +9 -0
- package/dist/fix/remove-sd-angular-symbol-names.js.map +1 -0
- package/dist/fix/remove-unused-imports.d.ts +1 -0
- package/dist/fix/remove-unused-imports.js +42 -0
- package/dist/fix/remove-unused-imports.js.map +1 -0
- package/dist/fix/remove-unused-injects.d.ts +1 -0
- package/dist/fix/remove-unused-injects.js +38 -0
- package/dist/fix/remove-unused-injects.js.map +1 -0
- package/dist/fix/remove-unused-protected-readonly.d.ts +1 -0
- package/dist/fix/remove-unused-protected-readonly.js +58 -0
- package/dist/fix/remove-unused-protected-readonly.js.map +1 -0
- package/dist/pkg-builders/SdProjectBuildRunner.d.ts +18 -0
- package/dist/pkg-builders/SdProjectBuildRunner.js +235 -0
- package/dist/pkg-builders/SdProjectBuildRunner.js.map +1 -0
- package/dist/pkg-builders/client/SdCliNgRoutesFileGenerator.d.ts +9 -0
- package/dist/pkg-builders/client/SdCliNgRoutesFileGenerator.js +89 -0
- package/dist/pkg-builders/client/SdCliNgRoutesFileGenerator.js.map +1 -0
- package/dist/pkg-builders/client/SdClientBuildRunner.d.ts +8 -0
- package/dist/pkg-builders/client/SdClientBuildRunner.js +115 -0
- package/dist/pkg-builders/client/SdClientBuildRunner.js.map +1 -0
- package/dist/pkg-builders/client/SdNgBundler.d.ts +23 -0
- package/dist/pkg-builders/client/SdNgBundler.js +490 -0
- package/dist/pkg-builders/client/SdNgBundler.js.map +1 -0
- package/dist/pkg-builders/client/SdNgBundlerContext.d.ts +22 -0
- package/dist/pkg-builders/client/SdNgBundlerContext.js +90 -0
- package/dist/pkg-builders/client/SdNgBundlerContext.js.map +1 -0
- package/dist/pkg-builders/client/createSdNgPlugin.d.ts +14 -0
- package/dist/pkg-builders/client/createSdNgPlugin.js +143 -0
- package/dist/pkg-builders/client/createSdNgPlugin.js.map +1 -0
- package/dist/pkg-builders/commons/ScopePathSet.d.ts +7 -0
- package/dist/pkg-builders/commons/ScopePathSet.js +14 -0
- package/dist/pkg-builders/commons/ScopePathSet.js.map +1 -0
- package/dist/pkg-builders/commons/SdBuildRunnerBase.d.ts +20 -0
- package/dist/pkg-builders/commons/SdBuildRunnerBase.js +30 -0
- package/dist/pkg-builders/commons/SdBuildRunnerBase.js.map +1 -0
- package/dist/pkg-builders/lib/SdCliDbContextFileGenerator.d.ts +9 -0
- package/dist/pkg-builders/lib/SdCliDbContextFileGenerator.js +134 -0
- package/dist/pkg-builders/lib/SdCliDbContextFileGenerator.js.map +1 -0
- package/dist/pkg-builders/lib/SdCliIndexFileGenerator.d.ts +10 -0
- package/dist/pkg-builders/lib/SdCliIndexFileGenerator.js +61 -0
- package/dist/pkg-builders/lib/SdCliIndexFileGenerator.js.map +1 -0
- package/dist/pkg-builders/lib/SdJsLibBuildRunner.d.ts +8 -0
- package/dist/pkg-builders/lib/SdJsLibBuildRunner.js +45 -0
- package/dist/pkg-builders/lib/SdJsLibBuildRunner.js.map +1 -0
- package/dist/pkg-builders/lib/SdTsLibBuildRunner.d.ts +8 -0
- package/dist/pkg-builders/lib/SdTsLibBuildRunner.js +36 -0
- package/dist/pkg-builders/lib/SdTsLibBuildRunner.js.map +1 -0
- package/dist/pkg-builders/lib/SdTsLibBuilder.d.ts +9 -0
- package/dist/pkg-builders/lib/SdTsLibBuilder.js +65 -0
- package/dist/pkg-builders/lib/SdTsLibBuilder.js.map +1 -0
- package/dist/pkg-builders/server/SdServerBuildRunner.d.ts +8 -0
- package/dist/pkg-builders/server/SdServerBuildRunner.js +249 -0
- package/dist/pkg-builders/server/SdServerBuildRunner.js.map +1 -0
- package/dist/pkg-builders/server/SdServerBundler.d.ts +18 -0
- package/dist/pkg-builders/server/SdServerBundler.js +153 -0
- package/dist/pkg-builders/server/SdServerBundler.js.map +1 -0
- package/dist/pkg-builders/server/createSdServerPlugin.d.ts +14 -0
- package/dist/pkg-builders/server/createSdServerPlugin.js +63 -0
- package/dist/pkg-builders/server/createSdServerPlugin.js.map +1 -0
- package/dist/sd-cli-entry.d.ts +2 -0
- package/dist/sd-cli-entry.js +257 -0
- package/dist/sd-cli-entry.js.map +1 -0
- package/dist/sd-cli.d.ts +2 -0
- package/dist/sd-cli.js +85 -0
- package/dist/sd-cli.js.map +1 -0
- package/dist/ts-compiler/SdDepAnalyzer.d.ts +15 -0
- package/dist/ts-compiler/SdDepAnalyzer.js +300 -0
- package/dist/ts-compiler/SdDepAnalyzer.js.map +1 -0
- package/dist/ts-compiler/SdDepCache.d.ts +33 -0
- package/dist/ts-compiler/SdDepCache.js +247 -0
- package/dist/ts-compiler/SdDepCache.js.map +1 -0
- package/dist/ts-compiler/SdStyleBundler.d.ts +16 -0
- package/dist/ts-compiler/SdStyleBundler.js +118 -0
- package/dist/ts-compiler/SdStyleBundler.js.map +1 -0
- package/dist/ts-compiler/SdTsCompiler.d.ts +9 -0
- package/dist/ts-compiler/SdTsCompiler.js +407 -0
- package/dist/ts-compiler/SdTsCompiler.js.map +1 -0
- package/dist/types/build/ISdBuildMessage.d.ts +10 -0
- package/dist/types/build/ISdBuildMessage.js +2 -0
- package/dist/types/build/ISdBuildMessage.js.map +1 -0
- package/dist/types/build/ISdBuildResult.d.ts +8 -0
- package/dist/types/build/ISdBuildResult.js +2 -0
- package/dist/types/build/ISdBuildResult.js.map +1 -0
- package/dist/types/build/ISdTsCompilerOptions.d.ts +13 -0
- package/dist/types/build/ISdTsCompilerOptions.js +2 -0
- package/dist/types/build/ISdTsCompilerOptions.js.map +1 -0
- package/dist/types/build/ISdTsCompilerResult.d.ts +14 -0
- package/dist/types/build/ISdTsCompilerResult.js +2 -0
- package/dist/types/build/ISdTsCompilerResult.js.map +1 -0
- package/dist/types/build/TStylesheetBundlingResult.d.ts +12 -0
- package/dist/types/build/TStylesheetBundlingResult.js +2 -0
- package/dist/types/build/TStylesheetBundlingResult.js.map +1 -0
- package/dist/types/common-config/INpmConfig.d.ts +17 -0
- package/dist/types/common-config/INpmConfig.js +2 -0
- package/dist/types/common-config/INpmConfig.js.map +1 -0
- package/dist/types/common-config/ITsConfig.d.ts +7 -0
- package/dist/types/common-config/ITsConfig.js +2 -0
- package/dist/types/common-config/ITsConfig.js.map +1 -0
- package/dist/types/config/ISdProjectConfig.d.ts +108 -0
- package/dist/types/config/ISdProjectConfig.js +2 -0
- package/dist/types/config/ISdProjectConfig.js.map +1 -0
- package/dist/types/plugin/ISdCliNgPluginResultCache.d.ts +8 -0
- package/dist/types/plugin/ISdCliNgPluginResultCache.js +2 -0
- package/dist/types/plugin/ISdCliNgPluginResultCache.js.map +1 -0
- package/dist/types/plugin/ISdCliServerPluginResultCache.d.ts +8 -0
- package/dist/types/plugin/ISdCliServerPluginResultCache.js +2 -0
- package/dist/types/plugin/ISdCliServerPluginResultCache.js.map +1 -0
- package/dist/types/worker/ISdBuildRunnerWorkerType.d.ts +23 -0
- package/dist/types/worker/ISdBuildRunnerWorkerType.js +2 -0
- package/dist/types/worker/ISdBuildRunnerWorkerType.js.map +1 -0
- package/dist/types/worker/IServerWorkerType.d.ts +17 -0
- package/dist/types/worker/IServerWorkerType.js +2 -0
- package/dist/types/worker/IServerWorkerType.js.map +1 -0
- package/dist/utils/SdCliConvertMessageUtils.d.ts +21 -0
- package/dist/utils/SdCliConvertMessageUtils.js +139 -0
- package/dist/utils/SdCliConvertMessageUtils.js.map +1 -0
- package/dist/utils/SdCliPerformanceTimer.d.ts +9 -0
- package/dist/utils/SdCliPerformanceTimer.js +51 -0
- package/dist/utils/SdCliPerformanceTimer.js.map +1 -0
- package/dist/utils/loadProjConfAsync.d.ts +5 -0
- package/dist/utils/loadProjConfAsync.js +8 -0
- package/dist/utils/loadProjConfAsync.js.map +1 -0
- package/dist/workers/build-runner.worker.d.ts +1 -0
- package/dist/workers/build-runner.worker.js +39 -0
- package/dist/workers/build-runner.worker.js.map +1 -0
- package/dist/workers/server.worker.d.ts +1 -0
- package/dist/workers/server.worker.js +50 -0
- package/dist/workers/server.worker.js.map +1 -0
- package/package.json +5 -5
- package/src/fix/core/convert-symbol.ts +35 -16
- package/src/fix/remove-unused-protected-readonly.ts +7 -1
- package/src/pkg-builders/SdProjectBuildRunner.ts +8 -1
- package/src/pkg-builders/commons/SdBuildRunnerBase.ts +1 -1
- package/src/pkg-builders/lib/SdTsLibBuilder.ts +0 -1
- package/src/sd-cli.ts +8 -8
- package/src/ts-compiler/SdTsCompiler.ts +26 -31
- package/src/types/build/ISdTsCompilerOptions.ts +0 -1
- package/src/types/worker/ISdBuildRunnerWorkerType.ts +1 -1
- package/src/workers/build-runner.worker.ts +1 -1
|
@@ -18,11 +18,18 @@ function parseReplacements(input: Record<string, string>): SymbolReplacement[] {
|
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
function getSourceFileModule(filePath: string): string {
|
|
22
|
+
const match = filePath.match(/packages[\\/](.*?)[\\/]src[\\/]/);
|
|
23
|
+
return `@simplysm/${match![1]}`;
|
|
24
|
+
}
|
|
25
|
+
|
|
21
26
|
export default function convertSymbols(raw: Record<string, string>) {
|
|
22
27
|
const replacements = parseReplacements(raw);
|
|
23
28
|
const sourceFiles = getTsMortphSourceFiles();
|
|
24
29
|
|
|
25
30
|
for (const sourceFile of sourceFiles) {
|
|
31
|
+
const sourceFileModule = getSourceFileModule(sourceFile.getFilePath());
|
|
32
|
+
|
|
26
33
|
let changed = false;
|
|
27
34
|
|
|
28
35
|
const usedReplacements = new Set<string>(); // 실제 사용된 newModule#newName 추적
|
|
@@ -47,13 +54,16 @@ export default function convertSymbols(raw: Record<string, string>) {
|
|
|
47
54
|
|
|
48
55
|
const importModule = importDecl.getModuleSpecifierValue();
|
|
49
56
|
|
|
50
|
-
const match = replacements.find(r => r.oldModule === importModule && r.oldName === name);
|
|
51
|
-
if (!match)
|
|
57
|
+
const match = replacements.find((r) => r.oldModule === importModule && r.oldName === name);
|
|
58
|
+
if (!match || match.oldModule === sourceFileModule || match.newModule === sourceFileModule)
|
|
59
|
+
return;
|
|
52
60
|
|
|
53
61
|
identifier.replaceWithText(match.newName);
|
|
54
62
|
usedReplacements.add(`${match.newModule}#${match.newName}`);
|
|
55
63
|
changed = true;
|
|
56
|
-
console.log(
|
|
64
|
+
console.log(
|
|
65
|
+
`[ref] ${sourceFile.getBaseName()} :: ${importModule} :: ${name} → ${match.newName}`,
|
|
66
|
+
);
|
|
57
67
|
});
|
|
58
68
|
|
|
59
69
|
// 2. import 교체
|
|
@@ -64,8 +74,18 @@ export default function convertSymbols(raw: Record<string, string>) {
|
|
|
64
74
|
for (const ni of namedImports) {
|
|
65
75
|
const oldName = ni.getName();
|
|
66
76
|
|
|
67
|
-
const match = replacements.find(r => r.oldModule === specifier && r.oldName === oldName);
|
|
68
|
-
if (
|
|
77
|
+
const match = replacements.find((r) => r.oldModule === specifier && r.oldName === oldName);
|
|
78
|
+
if (
|
|
79
|
+
!match ||
|
|
80
|
+
match.oldModule === sourceFileModule ||
|
|
81
|
+
match.newModule === sourceFileModule
|
|
82
|
+
) {
|
|
83
|
+
// 기존 import 유지 기록
|
|
84
|
+
if (!existingImportMap.has(specifier)) {
|
|
85
|
+
existingImportMap.set(specifier, new Set());
|
|
86
|
+
}
|
|
87
|
+
existingImportMap.get(specifier)!.add(oldName);
|
|
88
|
+
} else {
|
|
69
89
|
ni.remove();
|
|
70
90
|
|
|
71
91
|
// 만약 모듈이 동일하다면 즉시 대체
|
|
@@ -77,13 +97,9 @@ export default function convertSymbols(raw: Record<string, string>) {
|
|
|
77
97
|
}
|
|
78
98
|
|
|
79
99
|
changed = true;
|
|
80
|
-
console.log(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (!existingImportMap.has(specifier)) {
|
|
84
|
-
existingImportMap.set(specifier, new Set());
|
|
85
|
-
}
|
|
86
|
-
existingImportMap.get(specifier)!.add(oldName);
|
|
100
|
+
console.log(
|
|
101
|
+
`[import] ${sourceFile.getBaseName()} :: ${specifier} :: ${oldName} → ${match.newName}`,
|
|
102
|
+
);
|
|
87
103
|
}
|
|
88
104
|
}
|
|
89
105
|
}
|
|
@@ -93,10 +109,13 @@ export default function convertSymbols(raw: Record<string, string>) {
|
|
|
93
109
|
const [newModule, newName] = key.split("#");
|
|
94
110
|
|
|
95
111
|
const already = existingImportMap.get(newModule)?.has(newName);
|
|
96
|
-
const existsInFile = sourceFile
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
112
|
+
const existsInFile = sourceFile
|
|
113
|
+
.getImportDeclarations()
|
|
114
|
+
.some(
|
|
115
|
+
(decl) =>
|
|
116
|
+
decl.getModuleSpecifierValue() === newModule &&
|
|
117
|
+
decl.getNamedImports().some((ni) => ni.getName() === newName),
|
|
118
|
+
);
|
|
100
119
|
|
|
101
120
|
if (already || existsInFile) continue;
|
|
102
121
|
|
|
@@ -51,7 +51,13 @@ export default function removeUnusedProtectedReadonly() {
|
|
|
51
51
|
const usedInTemplate =
|
|
52
52
|
templateText.includes(name) || new RegExp(`\\b${name}\\b`).test(templateText);
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
const identifiers = cls.getDescendantsOfKind(SyntaxKind.Identifier);
|
|
55
|
+
const usedInClass = identifiers.some((id) => {
|
|
56
|
+
if (id.getText() !== name) return false;
|
|
57
|
+
return id !== field.getNameNode();
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
if (!usedInTemplate && !usedInClass) {
|
|
55
61
|
console.log(`🧹 Removing unused field: ${name} in ${sourceFile.getBaseName()}`);
|
|
56
62
|
field.remove();
|
|
57
63
|
}
|
|
@@ -88,10 +88,11 @@ export class SdProjectBuildRunner {
|
|
|
88
88
|
{
|
|
89
89
|
pkgPath: changedPkgInfo.pkgPath,
|
|
90
90
|
projConf: opt.projConf,
|
|
91
|
+
scopePathSet: scopePathSet,
|
|
92
|
+
|
|
91
93
|
watch: true,
|
|
92
94
|
emitOnly: opt.emitOnly,
|
|
93
95
|
noEmit: opt.noEmit,
|
|
94
|
-
scopePathSet: scopePathSet,
|
|
95
96
|
},
|
|
96
97
|
]);
|
|
97
98
|
|
|
@@ -272,6 +273,11 @@ export class SdProjectBuildRunner {
|
|
|
272
273
|
}
|
|
273
274
|
|
|
274
275
|
static async buildAsync(opt: { pkgPaths: TNormPath[]; projConf: ISdProjectConfig }) {
|
|
276
|
+
const scopePathSet = await this.#getScopePathSetAsync(
|
|
277
|
+
opt.pkgPaths,
|
|
278
|
+
Object.keys(opt.projConf.localUpdates ?? {}),
|
|
279
|
+
);
|
|
280
|
+
|
|
275
281
|
const buildResults = await opt.pkgPaths.parallelAsync(async (pkgPath) => {
|
|
276
282
|
const worker = new SdWorker<ISdBuildRunnerWorkerType>(
|
|
277
283
|
import.meta.resolve("../workers/build-runner.worker"),
|
|
@@ -281,6 +287,7 @@ export class SdProjectBuildRunner {
|
|
|
281
287
|
{
|
|
282
288
|
pkgPath,
|
|
283
289
|
projConf: opt.projConf,
|
|
290
|
+
scopePathSet: scopePathSet,
|
|
284
291
|
},
|
|
285
292
|
]);
|
|
286
293
|
|
|
@@ -15,11 +15,11 @@ export abstract class SdBuildRunnerBase<T extends "server" | "library" | "client
|
|
|
15
15
|
constructor(
|
|
16
16
|
protected _pkgPath: TNormPath,
|
|
17
17
|
protected _projConf: ISdProjectConfig,
|
|
18
|
+
scopePathSet: Set<TNormPath>,
|
|
18
19
|
protected _watch: boolean,
|
|
19
20
|
protected _dev: boolean,
|
|
20
21
|
protected _emitOnly?: boolean,
|
|
21
22
|
protected _noEmit?: boolean,
|
|
22
|
-
scopePathSet?: Set<TNormPath>,
|
|
23
23
|
) {
|
|
24
24
|
this._pkgName = path.basename(_pkgPath);
|
|
25
25
|
this._pkgConf = _projConf.packages[this._pkgName] as TSdPackageConfig<T>;
|
package/src/sd-cli.ts
CHANGED
|
@@ -19,14 +19,14 @@ if (path.extname(cliPath) === ".ts") {
|
|
|
19
19
|
// .js 번들 실행 (배포본)
|
|
20
20
|
|
|
21
21
|
// 로컬 업데이트
|
|
22
|
-
if (!process.argv.includes("--noEmit")) {
|
|
23
|
-
if (!process.argv.slice(2).includes("local-update")) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
22
|
+
if (process.argv.slice(2).includes("watch") && !process.argv.slice(2).includes("--noEmit")) {
|
|
23
|
+
// if (!process.argv.slice(2).includes("local-update")) {
|
|
24
|
+
await spawnWaitAsync(`node`, [
|
|
25
|
+
"--import=specifier-resolution-node/register",
|
|
26
|
+
fileURLToPath(cliPath),
|
|
27
|
+
"local-update",
|
|
28
|
+
]);
|
|
29
|
+
// }
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
// 프로세스 실행
|
|
@@ -368,40 +368,35 @@ export class SdTsCompiler {
|
|
|
368
368
|
}
|
|
369
369
|
|
|
370
370
|
async #buildGlobalStyleAsync() {
|
|
371
|
+
if (!this.#isForAngular) return;
|
|
372
|
+
|
|
371
373
|
//-- global style
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
)
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
.relative(path.resolve(this._opt.pkgPath, "src"), this._opt.globalStyleFilePath!)
|
|
395
|
-
.replace(/\.scss$/, ".css"),
|
|
396
|
-
),
|
|
397
|
-
text: stylesheetBundlingResult.contents ?? "",
|
|
398
|
-
});
|
|
374
|
+
const globalStyleFilePath = PathUtils.norm(this._opt.pkgPath, "src/styles.scss");
|
|
375
|
+
if (this.#emittedFilesCacheMap.has(globalStyleFilePath)) return;
|
|
376
|
+
if (!FsUtils.exists(globalStyleFilePath)) return;
|
|
377
|
+
|
|
378
|
+
this.#debug(`전역 스타일 번들링 중...`);
|
|
379
|
+
|
|
380
|
+
await this.#perf.run("전역 스타일 번들링", async () => {
|
|
381
|
+
const data = await FsUtils.readFileAsync(globalStyleFilePath);
|
|
382
|
+
const stylesheetBundlingResult = await this.#styleBundler!.bundleAsync(
|
|
383
|
+
data,
|
|
384
|
+
globalStyleFilePath,
|
|
385
|
+
globalStyleFilePath,
|
|
386
|
+
);
|
|
387
|
+
const emitFileInfos = this.#emittedFilesCacheMap.getOrCreate(globalStyleFilePath, []);
|
|
388
|
+
emitFileInfos.push({
|
|
389
|
+
outAbsPath: PathUtils.norm(
|
|
390
|
+
this._opt.pkgPath,
|
|
391
|
+
path
|
|
392
|
+
.relative(path.resolve(this._opt.pkgPath, "src"), globalStyleFilePath)
|
|
393
|
+
.replace(/\.scss$/, ".css"),
|
|
394
|
+
),
|
|
395
|
+
text: stylesheetBundlingResult.contents ?? "",
|
|
399
396
|
});
|
|
397
|
+
});
|
|
400
398
|
|
|
401
|
-
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
return undefined;
|
|
399
|
+
return globalStyleFilePath;
|
|
405
400
|
}
|
|
406
401
|
|
|
407
402
|
#build(prepareResult: IPrepareResult) {
|
|
@@ -15,10 +15,10 @@ export interface ISdBuildRunnerWorkerType extends ISdWorkerType {
|
|
|
15
15
|
export interface ISdBuildRunnerInitializeRequest {
|
|
16
16
|
pkgPath: TNormPath;
|
|
17
17
|
projConf: ISdProjectConfig;
|
|
18
|
+
scopePathSet: Set<TNormPath>;
|
|
18
19
|
|
|
19
20
|
// watch
|
|
20
21
|
watch?: boolean;
|
|
21
22
|
emitOnly?: boolean;
|
|
22
23
|
noEmit?: boolean;
|
|
23
|
-
scopePathSet?: Set<TNormPath>;
|
|
24
24
|
}
|
|
@@ -50,11 +50,11 @@ createSdWorker<ISdBuildRunnerWorkerType>({
|
|
|
50
50
|
buildRunner = new buildRunnerType(
|
|
51
51
|
req.pkgPath,
|
|
52
52
|
req.projConf,
|
|
53
|
+
req.scopePathSet,
|
|
53
54
|
req.watch ?? false,
|
|
54
55
|
req.watch ? !pkgConf.forceProductionMode : false,
|
|
55
56
|
req.emitOnly,
|
|
56
57
|
req.noEmit,
|
|
57
|
-
req.scopePathSet,
|
|
58
58
|
);
|
|
59
59
|
},
|
|
60
60
|
async rebuild(modifiedFileSet?: Set<TNormPath>) {
|