@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
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/* eslint-disable no-console */
|
|
3
|
+
import { SdLogger, SdLoggerSeverity } from "@simplysm/sd-core-node";
|
|
4
|
+
import { EventEmitter } from "events";
|
|
5
|
+
import yargs from "yargs";
|
|
6
|
+
import { hideBin } from "yargs/helpers";
|
|
7
|
+
import { SdCliAiCommand } from "./entry/SdCliAiCommand";
|
|
8
|
+
import { SdCliCordova } from "./entry/SdCliCordova";
|
|
9
|
+
import { SdCliElectron } from "./entry/SdCliElectron";
|
|
10
|
+
import { SdCliLocalUpdate } from "./entry/SdCliLocalUpdate";
|
|
11
|
+
import { SdCliPostinstall } from "./entry/SdCliPostinstall";
|
|
12
|
+
import { SdCliProject } from "./entry/SdCliProject";
|
|
13
|
+
import convertPrivateToHash from "./fix/convert-private-to-hash";
|
|
14
|
+
import removeSdAngularSymbolNames from "./fix/remove-sd-angular-symbol-names";
|
|
15
|
+
import convertSdAngularSymbolNames from "./fix/convert-sd-angular-symbol-names";
|
|
16
|
+
import { removeUnusedInjects } from "./fix/remove-unused-injects";
|
|
17
|
+
import { removeUnusedImports } from "./fix/remove-unused-imports";
|
|
18
|
+
import removeUnusedProtectedReadonly from "./fix/remove-unused-protected-readonly";
|
|
19
|
+
Error.stackTraceLimit = Infinity;
|
|
20
|
+
EventEmitter.defaultMaxListeners = 0;
|
|
21
|
+
await yargs(hideBin(process.argv))
|
|
22
|
+
.help("help", "도움말")
|
|
23
|
+
.alias("help", "h")
|
|
24
|
+
.options({
|
|
25
|
+
debug: {
|
|
26
|
+
type: "boolean",
|
|
27
|
+
describe: "디버그 로그를 표시할 것인지 여부",
|
|
28
|
+
default: false,
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
.middleware((argv) => {
|
|
32
|
+
if (argv.debug) {
|
|
33
|
+
process.env["SD_DEBUG"] = "true";
|
|
34
|
+
SdLogger.setConfig({
|
|
35
|
+
console: { level: SdLoggerSeverity.debug },
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
SdLogger.setConfig({ dot: true });
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
.command("local-update", "로컬 라이브러리 업데이트를 수행합니다.", (cmd) => cmd
|
|
43
|
+
.version(false)
|
|
44
|
+
.hide("help")
|
|
45
|
+
.hide("debug")
|
|
46
|
+
.options({
|
|
47
|
+
config: {
|
|
48
|
+
string: true,
|
|
49
|
+
describe: "설정 파일 경로",
|
|
50
|
+
default: "simplysm.js",
|
|
51
|
+
},
|
|
52
|
+
options: {
|
|
53
|
+
string: true,
|
|
54
|
+
array: true,
|
|
55
|
+
describe: "옵션 설정",
|
|
56
|
+
},
|
|
57
|
+
}), async (argv) => await SdCliLocalUpdate.runAsync(argv))
|
|
58
|
+
.command("watch", "프로젝트의 각 패키지에 대한 변경감지 빌드를 수행합니다.", (cmd) => cmd
|
|
59
|
+
.version(false)
|
|
60
|
+
.hide("help")
|
|
61
|
+
.hide("debug")
|
|
62
|
+
.options({
|
|
63
|
+
config: {
|
|
64
|
+
string: true,
|
|
65
|
+
describe: "설정 파일 경로",
|
|
66
|
+
default: "simplysm.js",
|
|
67
|
+
},
|
|
68
|
+
options: {
|
|
69
|
+
string: true,
|
|
70
|
+
array: true,
|
|
71
|
+
describe: "옵션 설정",
|
|
72
|
+
},
|
|
73
|
+
packages: {
|
|
74
|
+
string: true,
|
|
75
|
+
array: true,
|
|
76
|
+
describe: "수행할 패키지 설정",
|
|
77
|
+
},
|
|
78
|
+
emitOnly: {
|
|
79
|
+
type: "boolean",
|
|
80
|
+
describe: "emit만 수행",
|
|
81
|
+
default: false,
|
|
82
|
+
},
|
|
83
|
+
noEmit: {
|
|
84
|
+
type: "boolean",
|
|
85
|
+
describe: "emit만 수행",
|
|
86
|
+
default: false,
|
|
87
|
+
},
|
|
88
|
+
}), async (argv) => await SdCliProject.watchAsync(argv))
|
|
89
|
+
.command("build", "프로젝트의 각 패키지에 대한 빌드를 수행합니다.", (cmd) => cmd
|
|
90
|
+
.version(false)
|
|
91
|
+
.hide("help")
|
|
92
|
+
.hide("debug")
|
|
93
|
+
.options({
|
|
94
|
+
config: {
|
|
95
|
+
string: true,
|
|
96
|
+
describe: "설정 파일 경로",
|
|
97
|
+
default: "simplysm.js",
|
|
98
|
+
},
|
|
99
|
+
options: {
|
|
100
|
+
string: true,
|
|
101
|
+
array: true,
|
|
102
|
+
describe: "옵션 설정",
|
|
103
|
+
},
|
|
104
|
+
packages: {
|
|
105
|
+
string: true,
|
|
106
|
+
array: true,
|
|
107
|
+
describe: "수행할 패키지 설정",
|
|
108
|
+
},
|
|
109
|
+
}), async (argv) => {
|
|
110
|
+
await SdCliProject.buildAsync(argv);
|
|
111
|
+
})
|
|
112
|
+
.command("publish", "프로젝트의 각 패키지를 배포합니다.", (cmd) => cmd
|
|
113
|
+
.version(false)
|
|
114
|
+
.hide("help")
|
|
115
|
+
.hide("debug")
|
|
116
|
+
.options({
|
|
117
|
+
noBuild: {
|
|
118
|
+
type: "boolean",
|
|
119
|
+
describe: "빌드를 하지않고 배포합니다.",
|
|
120
|
+
default: false,
|
|
121
|
+
},
|
|
122
|
+
config: {
|
|
123
|
+
type: "string",
|
|
124
|
+
describe: "설정 파일 경로",
|
|
125
|
+
default: "simplysm.js",
|
|
126
|
+
},
|
|
127
|
+
options: {
|
|
128
|
+
type: "string",
|
|
129
|
+
array: true,
|
|
130
|
+
describe: "옵션 설정",
|
|
131
|
+
},
|
|
132
|
+
packages: {
|
|
133
|
+
type: "string",
|
|
134
|
+
array: true,
|
|
135
|
+
describe: "수행할 패키지 설정",
|
|
136
|
+
},
|
|
137
|
+
}), async (argv) => {
|
|
138
|
+
await SdCliProject.publishAsync(argv);
|
|
139
|
+
process.exit(0);
|
|
140
|
+
})
|
|
141
|
+
.command("run-electron <package>", "변경감지중인 플랫폼을 ELECTRON 앱 형태로 띄웁니다.", (cmd) => cmd
|
|
142
|
+
.version(false)
|
|
143
|
+
.hide("help")
|
|
144
|
+
.hide("debug")
|
|
145
|
+
.positional("package", {
|
|
146
|
+
type: "string",
|
|
147
|
+
describe: "패키지명",
|
|
148
|
+
demandOption: true,
|
|
149
|
+
})
|
|
150
|
+
.options({
|
|
151
|
+
config: {
|
|
152
|
+
type: "string",
|
|
153
|
+
describe: "설정 파일 경로",
|
|
154
|
+
default: "simplysm.js",
|
|
155
|
+
},
|
|
156
|
+
options: {
|
|
157
|
+
type: "string",
|
|
158
|
+
array: true,
|
|
159
|
+
describe: "옵션 설정",
|
|
160
|
+
},
|
|
161
|
+
}), async (argv) => await SdCliElectron.runAsync(argv))
|
|
162
|
+
.command("build-electron-for-dev <package>", "변경감지중인 플랫폼을 ELECTRON 앱 형태로 띄웁니다.", (cmd) => cmd
|
|
163
|
+
.version(false)
|
|
164
|
+
.hide("help")
|
|
165
|
+
.hide("debug")
|
|
166
|
+
.positional("package", {
|
|
167
|
+
type: "string",
|
|
168
|
+
describe: "패키지명",
|
|
169
|
+
demandOption: true,
|
|
170
|
+
})
|
|
171
|
+
.options({
|
|
172
|
+
config: {
|
|
173
|
+
type: "string",
|
|
174
|
+
describe: "설정 파일 경로",
|
|
175
|
+
default: "simplysm.js",
|
|
176
|
+
},
|
|
177
|
+
options: {
|
|
178
|
+
type: "string",
|
|
179
|
+
array: true,
|
|
180
|
+
describe: "옵션 설정",
|
|
181
|
+
},
|
|
182
|
+
}), async (argv) => await SdCliElectron.buildForDevAsync(argv))
|
|
183
|
+
.command("run-cordova <platform> <package> [url]", "변경감지중인 플랫폼을 코도바 디바이스에 앱 형태로 띄웁니다.", (cmd) => cmd
|
|
184
|
+
.version(false)
|
|
185
|
+
.hide("help")
|
|
186
|
+
.hide("debug")
|
|
187
|
+
.positional("platform", {
|
|
188
|
+
type: "string",
|
|
189
|
+
describe: "빌드 플랫폼(android,...)",
|
|
190
|
+
demandOption: true,
|
|
191
|
+
})
|
|
192
|
+
.positional("package", {
|
|
193
|
+
type: "string",
|
|
194
|
+
describe: "패키지명",
|
|
195
|
+
demandOption: true,
|
|
196
|
+
})
|
|
197
|
+
.positional("url", {
|
|
198
|
+
type: "string",
|
|
199
|
+
describe: "Webview로 오픈할 URL",
|
|
200
|
+
demandOption: true,
|
|
201
|
+
}), async (argv) => await SdCliCordova.runWebviewOnDeviceAsync(argv))
|
|
202
|
+
.command("commit", "AI를 통해 변경사항에 대한 커밋 메시지를 작성하여, 커밋 및 푸쉬를 수행합니다.", (cmd) => cmd.version(false).hide("help").hide("debug"), async () => await SdCliAiCommand.commitAsync())
|
|
203
|
+
.command("postinstall", "설치후 자동실행할 작업", (cmd) => cmd.version(false).hide("help").hide("debug"), () => SdCliPostinstall.run())
|
|
204
|
+
.command("fix", "가능한 내용 자동 수정", (cmd) => cmd
|
|
205
|
+
.version(false)
|
|
206
|
+
.hide("help")
|
|
207
|
+
.hide("debug")
|
|
208
|
+
.options({
|
|
209
|
+
library: {
|
|
210
|
+
type: "boolean",
|
|
211
|
+
describe: "simplysm 라이브러리 픽스",
|
|
212
|
+
default: false,
|
|
213
|
+
},
|
|
214
|
+
}), (argv) => {
|
|
215
|
+
// GIT 사용중일 경우, 커밋되지 않은 수정사항이 있는지 확인
|
|
216
|
+
/*if (FsUtils.exists(path.resolve(process.cwd(), ".git"))) {
|
|
217
|
+
const gitStatusResult = await SdProcess.spawnAsync("git status");
|
|
218
|
+
if (gitStatusResult.includes("Changes") || gitStatusResult.includes("Untracked")) {
|
|
219
|
+
throw new Error("커밋되지 않은 정보가 있습니다. FIX오류시 롤백이 불가능하므로, 미리 커밋을 해놔야 합니다.\n" + gitStatusResult);
|
|
220
|
+
}
|
|
221
|
+
}*/
|
|
222
|
+
convertPrivateToHash();
|
|
223
|
+
//-- 심볼정리
|
|
224
|
+
removeSdAngularSymbolNames();
|
|
225
|
+
convertSdAngularSymbolNames();
|
|
226
|
+
//-- inject/import 정리
|
|
227
|
+
removeUnusedInjects();
|
|
228
|
+
removeUnusedProtectedReadonly();
|
|
229
|
+
removeUnusedImports();
|
|
230
|
+
if (argv.library)
|
|
231
|
+
return;
|
|
232
|
+
// convertSdSheetBindingsSafely();
|
|
233
|
+
// convertSetupCumulateSelectedKeysToObjectParam();
|
|
234
|
+
// convertExtendsSdModalBaseToInterface();
|
|
235
|
+
// convertModalShowParams();
|
|
236
|
+
// convertExtendsSdPrintTemplateBaseToInterface();
|
|
237
|
+
// convertPrintParams();
|
|
238
|
+
// convertToUsePermsSignal();
|
|
239
|
+
// convertGetMenusToUsableMenus();
|
|
240
|
+
// convertFlatPagesToUsableFlatMenus();
|
|
241
|
+
// convertSdIconToFaIcon();
|
|
242
|
+
// convertSelectModalButtonToSelectButton();
|
|
243
|
+
})
|
|
244
|
+
.strict()
|
|
245
|
+
.recommendCommands()
|
|
246
|
+
.fail((msg, err, cmd) => {
|
|
247
|
+
if (Boolean(err)) {
|
|
248
|
+
throw err;
|
|
249
|
+
}
|
|
250
|
+
console.error("지원되지 않는 명령입니다.");
|
|
251
|
+
console.error(msg);
|
|
252
|
+
console.log("\n명령어 목록:");
|
|
253
|
+
cmd.showHelp();
|
|
254
|
+
process.exit(1);
|
|
255
|
+
})
|
|
256
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jB,MAAM,GAAG,CAAC;IACZ,CAAC;IAED,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACzB,GAAG,CAAC,QAAQ,EAAE,CAAC;IACf,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC;KACD,UAAU,EAAE,CAAC"}
|
package/dist/sd-cli.d.ts
ADDED
package/dist/sd-cli.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { exec, spawn } from "child_process";
|
|
3
|
+
import os from "os";
|
|
4
|
+
import path from "path";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
6
|
+
// CLI 경로 확인
|
|
7
|
+
const cliPath = import.meta.resolve("./sd-cli-entry");
|
|
8
|
+
if (path.extname(cliPath) === ".ts") {
|
|
9
|
+
// .ts 바로실행 (개발)
|
|
10
|
+
// 현재 프로세스에 affinity 적용
|
|
11
|
+
configureProcessorAffinityAndPriority(process.pid);
|
|
12
|
+
await import(cliPath);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
// .js 번들 실행 (배포본)
|
|
16
|
+
// 로컬 업데이트
|
|
17
|
+
if (process.argv.slice(2).includes("watch") && !process.argv.slice(2).includes("--noEmit")) {
|
|
18
|
+
// if (!process.argv.slice(2).includes("local-update")) {
|
|
19
|
+
await spawnWaitAsync(`node`, [
|
|
20
|
+
"--import=specifier-resolution-node/register",
|
|
21
|
+
fileURLToPath(cliPath),
|
|
22
|
+
"local-update",
|
|
23
|
+
]);
|
|
24
|
+
// }
|
|
25
|
+
}
|
|
26
|
+
// 프로세스 실행
|
|
27
|
+
const child = spawn("node", [
|
|
28
|
+
"--import=specifier-resolution-node/register",
|
|
29
|
+
"--max-old-space-size=8192",
|
|
30
|
+
"--initial-old-space-size=2048",
|
|
31
|
+
"--max-semi-space-size=128",
|
|
32
|
+
"--stack-size=8192",
|
|
33
|
+
fileURLToPath(cliPath),
|
|
34
|
+
...process.argv.slice(2),
|
|
35
|
+
], { stdio: "inherit" });
|
|
36
|
+
// 실행된 프로세스에 Affinity 적용
|
|
37
|
+
child.on("spawn", () => {
|
|
38
|
+
if (child.pid == null)
|
|
39
|
+
return;
|
|
40
|
+
configureProcessorAffinityAndPriority(child.pid);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function configureProcessorAffinityAndPriority(pid) {
|
|
44
|
+
const cpuCount = os.cpus().length;
|
|
45
|
+
const affinityMask = calculateAffinityMask(cpuCount);
|
|
46
|
+
const commands = [
|
|
47
|
+
`$p = Get-Process -Id ${pid}`,
|
|
48
|
+
`$p.ProcessorAffinity = ${affinityMask}`,
|
|
49
|
+
`$p.PriorityClass = 'BelowNormal'`,
|
|
50
|
+
].join("; ");
|
|
51
|
+
const command = `powershell -Command "${commands}"`;
|
|
52
|
+
exec(command, (err) => {
|
|
53
|
+
if (err) {
|
|
54
|
+
// eslint-disable-next-line no-console
|
|
55
|
+
console.error("Affinity 또는 우선순위 설정 실패:", err.message);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
// ProcessorAffinity 마스크 계산 (앞 코어 빼기)
|
|
60
|
+
function calculateAffinityMask(cpuCount) {
|
|
61
|
+
const exclude = cpuCount <= 1 ? 0 : Math.ceil(cpuCount / 4); // 예: 4개당 1개 제외
|
|
62
|
+
const usableStart = exclude;
|
|
63
|
+
const usableEnd = cpuCount;
|
|
64
|
+
if (usableEnd - usableStart <= 0) {
|
|
65
|
+
throw new Error(`CPU 사용 가능 개수가 0 이하입니다 (총: ${cpuCount}, 제외: ${exclude})`);
|
|
66
|
+
}
|
|
67
|
+
let mask = 0n;
|
|
68
|
+
for (let i = usableStart; i < usableEnd; i++) {
|
|
69
|
+
mask |= 1n << BigInt(i);
|
|
70
|
+
}
|
|
71
|
+
return "0x" + mask.toString(16).toUpperCase();
|
|
72
|
+
}
|
|
73
|
+
async function spawnWaitAsync(command, args) {
|
|
74
|
+
await new Promise((resolve) => {
|
|
75
|
+
const child = spawn(command, args, {
|
|
76
|
+
cwd: process.cwd(),
|
|
77
|
+
env: { ...process.env },
|
|
78
|
+
stdio: "inherit",
|
|
79
|
+
});
|
|
80
|
+
child.on("close", () => {
|
|
81
|
+
resolve();
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=sd-cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sd-cli.js","sourceRoot":"","sources":["../src/sd-cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,YAAY;AACZ,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAEtD,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,KAAK,EAAE,CAAC;IACpC,gBAAgB;IAEhB,uBAAuB;IACvB,qCAAqC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAEnD,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC;AACxB,CAAC;KAAM,CAAC;IACN,kBAAkB;IAElB,UAAU;IACV,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3F,yDAAyD;QACzD,MAAM,cAAc,CAAC,MAAM,EAAE;YAC3B,6CAA6C;YAC7C,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AAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe;IAC5E,MAAM,WAAW,GAAG,OAAO,CAAC;IAC5B,MAAM,SAAS,GAAG,QAAQ,CAAC;IAE3B,IAAI,SAAS,GAAG,WAAW,IAAI,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,6BAA6B,QAAQ,SAAS,OAAO,GAAG,CAAC,CAAC;IAC5E,CAAC;IAED,IAAI,IAAI,GAAG,EAAE,CAAC;IAEd,KAAK,IAAI,CAAC,GAAG,WAAW,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7C,IAAI,IAAI,EAAE,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;IAC1B,CAAC;IAED,OAAO,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AAChD,CAAC;AAED,KAAK,UAAU,cAAc,CAAC,OAAe,EAAE,IAAc;IAC3D,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QAClC,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE;YACjC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;YAClB,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE;YACvB,KAAK,EAAE,SAAS;SACjB,CAAC,CAAC;QAEH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YACrB,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { SdDepCache } from "./SdDepCache";
|
|
3
|
+
import { TNormPath } from "@simplysm/sd-core-node";
|
|
4
|
+
import { NgtscProgram } from "@angular/compiler-cli";
|
|
5
|
+
import { ScopePathSet } from "../pkg-builders/commons/ScopePathSet";
|
|
6
|
+
export declare class SdDepAnalyzer {
|
|
7
|
+
static analyze(program: ts.Program, compilerHost: ts.CompilerHost, scopePathSet: ScopePathSet, cache: {
|
|
8
|
+
dep: SdDepCache;
|
|
9
|
+
type: WeakMap<ts.Node, ts.Type | undefined>;
|
|
10
|
+
prop: WeakMap<ts.Type, Map<string, ts.Symbol | undefined>>;
|
|
11
|
+
declFiles: WeakMap<ts.Symbol, TNormPath[]>;
|
|
12
|
+
ngOrg: Map<TNormPath, ts.SourceFile>;
|
|
13
|
+
}): void;
|
|
14
|
+
static analyzeAngularResources(ngProgram: NgtscProgram, scopePathSet: ScopePathSet, depCache: SdDepCache): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { PathUtils } from "@simplysm/sd-core-node";
|
|
3
|
+
import path from "path";
|
|
4
|
+
export class SdDepAnalyzer {
|
|
5
|
+
static analyze(program, compilerHost, scopePathSet, cache) {
|
|
6
|
+
const compilerOpts = program.getCompilerOptions();
|
|
7
|
+
const typeChecker = program.getTypeChecker();
|
|
8
|
+
const moduleResolutionCache = ts.createModuleResolutionCache(compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName.bind(compilerHost), compilerOpts);
|
|
9
|
+
const resolveModule = (text, base) => {
|
|
10
|
+
const res = ts.resolveModuleName(text, base, compilerOpts, compilerHost, moduleResolutionCache);
|
|
11
|
+
if (res.resolvedModule) {
|
|
12
|
+
return [PathUtils.norm(res.resolvedModule.resolvedFileName)];
|
|
13
|
+
}
|
|
14
|
+
const absPath = path.resolve(path.dirname(base), text);
|
|
15
|
+
if (!scopePathSet.inScope(absPath)) {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
else if (
|
|
19
|
+
// 지원되게할 .png등이면 그냥 가져오고 (bundling loader에 들어가는것들과 .ts, .json등)
|
|
20
|
+
// fallback일때는 absPath에 .ts, .d.ts, .js, .json 등 다붙여서 가져와야함
|
|
21
|
+
[
|
|
22
|
+
".ts",
|
|
23
|
+
".d.ts",
|
|
24
|
+
".js",
|
|
25
|
+
".json",
|
|
26
|
+
".html",
|
|
27
|
+
".scss",
|
|
28
|
+
".css",
|
|
29
|
+
".png",
|
|
30
|
+
".jpeg",
|
|
31
|
+
".jpg",
|
|
32
|
+
".jfif",
|
|
33
|
+
".gif",
|
|
34
|
+
".svg",
|
|
35
|
+
".woff",
|
|
36
|
+
".woff2",
|
|
37
|
+
".ttf",
|
|
38
|
+
".ttc",
|
|
39
|
+
".eot",
|
|
40
|
+
".ico",
|
|
41
|
+
".otf",
|
|
42
|
+
".csv",
|
|
43
|
+
".xlsx",
|
|
44
|
+
".xls",
|
|
45
|
+
".pptx",
|
|
46
|
+
".ppt",
|
|
47
|
+
".docx",
|
|
48
|
+
".doc",
|
|
49
|
+
".zip",
|
|
50
|
+
".pfx",
|
|
51
|
+
".pkl",
|
|
52
|
+
".mp3",
|
|
53
|
+
".ogg",
|
|
54
|
+
].some((ext) => absPath.endsWith(ext))) {
|
|
55
|
+
return [PathUtils.norm(absPath)];
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
return [
|
|
59
|
+
PathUtils.norm(absPath + ".ts"),
|
|
60
|
+
PathUtils.norm(absPath + ".js"),
|
|
61
|
+
PathUtils.norm(absPath + ".d.ts"),
|
|
62
|
+
PathUtils.norm(absPath + ".json"),
|
|
63
|
+
];
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const isInImportOrExport = (node) => {
|
|
67
|
+
const p = node.parent;
|
|
68
|
+
return (ts.isImportDeclaration(p) ||
|
|
69
|
+
ts.isExportDeclaration(p) ||
|
|
70
|
+
ts.isImportSpecifier(p) ||
|
|
71
|
+
ts.isExportSpecifier(p) ||
|
|
72
|
+
ts.isNamespaceImport(p));
|
|
73
|
+
};
|
|
74
|
+
const isDeclarationIdentifier = (id) => {
|
|
75
|
+
const p = id.parent;
|
|
76
|
+
return ((ts.isParameter(p) && p.name === id) ||
|
|
77
|
+
(ts.isVariableDeclaration(p) && p.name === id) ||
|
|
78
|
+
(ts.isFunctionDeclaration(p) && p.name === id) ||
|
|
79
|
+
(ts.isClassDeclaration(p) && p.name === id) ||
|
|
80
|
+
(ts.isInterfaceDeclaration(p) && p.name === id) ||
|
|
81
|
+
(ts.isTypeAliasDeclaration(p) && p.name === id) ||
|
|
82
|
+
(ts.isEnumDeclaration(p) && p.name === id) ||
|
|
83
|
+
(ts.isPropertySignature(p) && p.name === id) ||
|
|
84
|
+
(ts.isPropertyDeclaration(p) && p.name === id) ||
|
|
85
|
+
(ts.isMethodSignature(p) && p.name === id) ||
|
|
86
|
+
(ts.isMethodDeclaration(p) && p.name === id));
|
|
87
|
+
};
|
|
88
|
+
// const typeCache = new WeakMap<ts.Node, ts.Type | undefined>();
|
|
89
|
+
const getCachedType = (node) => {
|
|
90
|
+
if (cache.type.has(node))
|
|
91
|
+
return cache.type.get(node);
|
|
92
|
+
const type = typeChecker.getTypeAtLocation(node);
|
|
93
|
+
if (!type)
|
|
94
|
+
return undefined;
|
|
95
|
+
const skipMask = ts.TypeFlags.Any |
|
|
96
|
+
ts.TypeFlags.Unknown |
|
|
97
|
+
ts.TypeFlags.Never |
|
|
98
|
+
ts.TypeFlags.Null |
|
|
99
|
+
ts.TypeFlags.Undefined |
|
|
100
|
+
ts.TypeFlags.BooleanLike |
|
|
101
|
+
ts.TypeFlags.NumberLike |
|
|
102
|
+
ts.TypeFlags.StringLike |
|
|
103
|
+
ts.TypeFlags.BigIntLike |
|
|
104
|
+
ts.TypeFlags.ESSymbolLike;
|
|
105
|
+
const result = (type.flags & skipMask) !== 0 ? undefined : type;
|
|
106
|
+
cache.type.set(node, result);
|
|
107
|
+
return result;
|
|
108
|
+
};
|
|
109
|
+
// const propCache = new WeakMap<ts.Type, Map<string, ts.Symbol | undefined>>();
|
|
110
|
+
const getCachedProp = (type, name) => {
|
|
111
|
+
if (!type)
|
|
112
|
+
return undefined;
|
|
113
|
+
let map = cache.prop.get(type);
|
|
114
|
+
if (!map) {
|
|
115
|
+
map = new Map();
|
|
116
|
+
cache.prop.set(type, map);
|
|
117
|
+
}
|
|
118
|
+
if (map.has(name))
|
|
119
|
+
return map.get(name);
|
|
120
|
+
const s = type.getProperty(name);
|
|
121
|
+
map.set(name, s);
|
|
122
|
+
return s;
|
|
123
|
+
};
|
|
124
|
+
const getDeclFileNPaths = (sym) => {
|
|
125
|
+
if (!sym)
|
|
126
|
+
return [];
|
|
127
|
+
const c = cache.declFiles.get(sym);
|
|
128
|
+
if (c)
|
|
129
|
+
return c;
|
|
130
|
+
const paths = (sym.getDeclarations() ?? []).map((d) => PathUtils.norm(d.getSourceFile().fileName));
|
|
131
|
+
cache.declFiles.set(sym, paths);
|
|
132
|
+
return paths;
|
|
133
|
+
};
|
|
134
|
+
const collectDeps = (sf) => {
|
|
135
|
+
const sfNPath = PathUtils.norm(sf.fileName);
|
|
136
|
+
if (cache.dep.hasCollected(sfNPath))
|
|
137
|
+
return;
|
|
138
|
+
cache.dep.addCollected(sfNPath);
|
|
139
|
+
if (!scopePathSet.inScope(sfNPath))
|
|
140
|
+
return;
|
|
141
|
+
const visit = (node) => {
|
|
142
|
+
// --- import ... from '...'
|
|
143
|
+
if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)) {
|
|
144
|
+
const resolvedNPaths = resolveModule(node.moduleSpecifier.text, sf.fileName);
|
|
145
|
+
for (const resolvedNPath of resolvedNPaths) {
|
|
146
|
+
if (!scopePathSet.inScope(resolvedNPath))
|
|
147
|
+
continue;
|
|
148
|
+
if (node.importClause &&
|
|
149
|
+
node.importClause.namedBindings &&
|
|
150
|
+
ts.isNamedImports(node.importClause.namedBindings)) {
|
|
151
|
+
// import ... from '...'
|
|
152
|
+
for (const element of node.importClause.namedBindings.elements) {
|
|
153
|
+
cache.dep.addImport(sfNPath, resolvedNPath, element.propertyName?.text ?? element.name.text);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
cache.dep.addImport(sfNPath, resolvedNPath, 0);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
// --- export * from '...'
|
|
163
|
+
else if (ts.isExportDeclaration(node) &&
|
|
164
|
+
!node.exportClause &&
|
|
165
|
+
node.moduleSpecifier &&
|
|
166
|
+
ts.isStringLiteral(node.moduleSpecifier)) {
|
|
167
|
+
const resolvedNPaths = resolveModule(node.moduleSpecifier.text, sf.fileName);
|
|
168
|
+
for (const resolvedNPath of resolvedNPaths) {
|
|
169
|
+
if (!scopePathSet.inScope(resolvedNPath))
|
|
170
|
+
continue;
|
|
171
|
+
cache.dep.addReexport(sfNPath, resolvedNPath, 0);
|
|
172
|
+
}
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
// --- export { A as B } from '...'
|
|
176
|
+
else if (ts.isExportDeclaration(node) &&
|
|
177
|
+
node.exportClause &&
|
|
178
|
+
ts.isNamedExports(node.exportClause) &&
|
|
179
|
+
node.moduleSpecifier &&
|
|
180
|
+
ts.isStringLiteral(node.moduleSpecifier)) {
|
|
181
|
+
const resolvedNPaths = resolveModule(node.moduleSpecifier.text, sf.fileName);
|
|
182
|
+
for (const resolvedNPath of resolvedNPaths) {
|
|
183
|
+
if (!scopePathSet.inScope(resolvedNPath))
|
|
184
|
+
continue;
|
|
185
|
+
for (const element of node.exportClause.elements) {
|
|
186
|
+
const local = element.propertyName?.text ?? element.name.text;
|
|
187
|
+
const exported = element.name.text;
|
|
188
|
+
cache.dep.addReexport(sfNPath, resolvedNPath, {
|
|
189
|
+
importSymbol: local,
|
|
190
|
+
exportSymbol: exported,
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
// --- export const A = ...
|
|
197
|
+
else if (ts.isVariableStatement(node) &&
|
|
198
|
+
node.modifiers?.some((mod) => mod.kind === ts.SyntaxKind.ExportKeyword)) {
|
|
199
|
+
for (const decl of node.declarationList.declarations) {
|
|
200
|
+
if (ts.isIdentifier(decl.name)) {
|
|
201
|
+
cache.dep.addExport(sfNPath, decl.name.text);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
// --- export function/class/interface A ...
|
|
206
|
+
if ((ts.isFunctionDeclaration(node) ||
|
|
207
|
+
ts.isClassDeclaration(node) ||
|
|
208
|
+
ts.isInterfaceDeclaration(node) ||
|
|
209
|
+
ts.isTypeAliasDeclaration(node) ||
|
|
210
|
+
ts.isEnumDeclaration(node)) &&
|
|
211
|
+
node.modifiers?.some((mod) => mod.kind === ts.SyntaxKind.ExportKeyword) &&
|
|
212
|
+
node.name) {
|
|
213
|
+
cache.dep.addExport(sfNPath, node.name.text);
|
|
214
|
+
}
|
|
215
|
+
else if (ts.isIdentifier(node) &&
|
|
216
|
+
isDeclarationIdentifier(node) &&
|
|
217
|
+
!isInImportOrExport(node)) {
|
|
218
|
+
const orgValSymbol = typeChecker.getSymbolAtLocation(node);
|
|
219
|
+
let valSymbol = orgValSymbol;
|
|
220
|
+
if (orgValSymbol && orgValSymbol.flags & ts.SymbolFlags.Alias) {
|
|
221
|
+
// 현 파일 선언으로 확정되면 굳이 치환 불필요
|
|
222
|
+
const declNPaths = getDeclFileNPaths(orgValSymbol);
|
|
223
|
+
const external = declNPaths.some((declNPath) => declNPath !== sfNPath);
|
|
224
|
+
if (external) {
|
|
225
|
+
valSymbol = typeChecker.getAliasedSymbol(orgValSymbol);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
for (const declNPath of getDeclFileNPaths(valSymbol)) {
|
|
229
|
+
if (declNPath !== sfNPath && scopePathSet.inScope(declNPath)) {
|
|
230
|
+
cache.dep.addImport(sfNPath, declNPath, 0);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
else if (ts.isPropertyAccessExpression(node)) {
|
|
235
|
+
const type = getCachedType(node.expression);
|
|
236
|
+
const propSymbol = getCachedProp(type, node.name.text);
|
|
237
|
+
if (propSymbol) {
|
|
238
|
+
for (const declNPath of getDeclFileNPaths(propSymbol)) {
|
|
239
|
+
if (declNPath !== sfNPath && scopePathSet.inScope(declNPath)) {
|
|
240
|
+
cache.dep.addImport(sfNPath, declNPath, 0);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
else if (ts.isElementAccessExpression(node) &&
|
|
246
|
+
ts.isStringLiteral(node.argumentExpression)) {
|
|
247
|
+
const type = getCachedType(node.expression);
|
|
248
|
+
const propSymbol = getCachedProp(type, node.argumentExpression.text);
|
|
249
|
+
if (propSymbol) {
|
|
250
|
+
for (const declNPath of getDeclFileNPaths(propSymbol)) {
|
|
251
|
+
if (declNPath !== sfNPath && scopePathSet.inScope(declNPath)) {
|
|
252
|
+
cache.dep.addImport(sfNPath, declNPath, 0);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
ts.forEachChild(node, visit);
|
|
258
|
+
};
|
|
259
|
+
ts.forEachChild(sf, visit);
|
|
260
|
+
};
|
|
261
|
+
const getOrgSourceFile = (sf) => {
|
|
262
|
+
if (sf.fileName.endsWith(".ngtypecheck.ts")) {
|
|
263
|
+
const sfNPath = PathUtils.norm(sf.fileName);
|
|
264
|
+
let org = cache.ngOrg.get(sfNPath);
|
|
265
|
+
if (!org) {
|
|
266
|
+
const orgPath = sf.fileName.slice(0, -15) + ".ts";
|
|
267
|
+
org = program.getSourceFile(orgPath) ?? sf;
|
|
268
|
+
const realOrg = program.getSourceFile(orgPath);
|
|
269
|
+
if (realOrg)
|
|
270
|
+
cache.ngOrg.set(sfNPath, realOrg);
|
|
271
|
+
}
|
|
272
|
+
return org;
|
|
273
|
+
}
|
|
274
|
+
return sf;
|
|
275
|
+
};
|
|
276
|
+
const sourceFileSet = new Set(program
|
|
277
|
+
.getSourceFiles()
|
|
278
|
+
.filter((sf) => scopePathSet.inScope(sf.fileName))
|
|
279
|
+
.map((sf) => getOrgSourceFile(sf))
|
|
280
|
+
.filterExists());
|
|
281
|
+
for (const sf of sourceFileSet) {
|
|
282
|
+
collectDeps(sf);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
static analyzeAngularResources(ngProgram, scopePathSet, depCache) {
|
|
286
|
+
for (const sf of ngProgram.getTsProgram().getSourceFiles()) {
|
|
287
|
+
const fileNPath = PathUtils.norm(sf.fileName);
|
|
288
|
+
if (!scopePathSet.inScope(fileNPath))
|
|
289
|
+
continue;
|
|
290
|
+
const dependencies = ngProgram.compiler.getResourceDependencies(sf);
|
|
291
|
+
for (const dep of dependencies) {
|
|
292
|
+
const depNPath = PathUtils.norm(dep);
|
|
293
|
+
if (!scopePathSet.inScope(depNPath))
|
|
294
|
+
continue;
|
|
295
|
+
depCache.addImport(fileNPath, depNPath, 0);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
//# sourceMappingURL=SdDepAnalyzer.js.map
|