@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,48 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import { SyntaxKind } from "ts-morph";
|
|
3
|
+
import getTsMorphSourceFiles from "./core/get-ts-morph-source-files";
|
|
4
|
+
export function convertGetMenusToUsableMenus() {
|
|
5
|
+
const sourceFiles = getTsMorphSourceFiles();
|
|
6
|
+
let totalChanged = 0;
|
|
7
|
+
for (const sourceFile of sourceFiles) {
|
|
8
|
+
let changed = false;
|
|
9
|
+
for (const cls of sourceFile.getClasses()) {
|
|
10
|
+
const menusProp = cls.getInstanceProperty("menus")?.asKind(SyntaxKind.PropertyDeclaration);
|
|
11
|
+
if (!menusProp)
|
|
12
|
+
continue;
|
|
13
|
+
const initializer = menusProp.getInitializer()?.asKind(SyntaxKind.CallExpression);
|
|
14
|
+
if (!initializer ||
|
|
15
|
+
initializer.getFirstChildByKind(SyntaxKind.Identifier)?.getText() !== "$computed") {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
const arrowFn = initializer
|
|
19
|
+
.asKind(SyntaxKind.CallExpression)
|
|
20
|
+
?.getArguments()
|
|
21
|
+
.first()
|
|
22
|
+
?.asKind(SyntaxKind.ArrowFunction);
|
|
23
|
+
if (!arrowFn)
|
|
24
|
+
continue;
|
|
25
|
+
const body = arrowFn.getBody().asKind(SyntaxKind.CallExpression);
|
|
26
|
+
if (!body || !body.getText().includes("this._sdAppStructure.getMenus")) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const callExpr = body.asKind(SyntaxKind.CallExpression);
|
|
30
|
+
const calleeExpr = callExpr.getExpression();
|
|
31
|
+
if (calleeExpr.getKind() === SyntaxKind.PropertyAccessExpression &&
|
|
32
|
+
calleeExpr.getText() === "this._sdAppStructure.getMenus") {
|
|
33
|
+
// 수정 실행: getMenus → usableMenus
|
|
34
|
+
calleeExpr.replaceWithText("this._sdAppStructure.usableMenus");
|
|
35
|
+
changed = true;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (changed) {
|
|
39
|
+
sourceFile.saveSync();
|
|
40
|
+
totalChanged++;
|
|
41
|
+
console.log(`[updated] ${sourceFile.getBaseName()} :: menus → usableMenus 변경 완료`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
console.log(totalChanged > 0
|
|
45
|
+
? `\n[완료] usableMenus 변경 완료 (총 ${totalChanged}개)`
|
|
46
|
+
: `[완료] 변환 대상 없음`);
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=convert-get-menus-to-usable-menus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-get-menus-to-usable-menus.js","sourceRoot":"","sources":["../../src/fix/convert-get-menus-to-usable-menus.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,qBAAqB,MAAM,kCAAkC,CAAC;AAErE,MAAM,UAAU,4BAA4B;IAC1C,MAAM,WAAW,GAAG,qBAAqB,EAAE,CAAC;IAC5C,IAAI,YAAY,GAAG,CAAC,CAAC;IAErB,KAAK,MAAM,U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gBAChC,UAAU,CAAC,eAAe,CAAC,kCAAkC,CAAC,CAAC;gBAC/D,OAAO,GAAG,IAAI,CAAC;YACjB,CAAC;QACH,CAAC;QAED,IAAI,OAAO,EAAE,CAAC;YACZ,UAAU,CAAC,QAAQ,EAAE,CAAC;YACtB,YAAY,EAAE,CAAC;YACf,OAAO,CAAC,GAAG,CAAC,aAAa,UAAU,CAAC,WAAW,EAAE,+BAA+B,CAAC,CAAC;QACpF,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CACT,YAAY,GAAG,CAAC;QACd,CAAC,CAAC,+BAA+B,YAAY,IAAI;QACjD,CAAC,CAAC,eAAe,CACpB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function convertModalShowParams(): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Node, SyntaxKind } from "ts-morph";
|
|
2
|
+
import getTsMorphSourceFiles from "./core/get-ts-morph-source-files";
|
|
3
|
+
export default function convertModalShowParams() {
|
|
4
|
+
const sourceFiles = getTsMorphSourceFiles();
|
|
5
|
+
for (const sourceFile of sourceFiles) {
|
|
6
|
+
const callExprs = sourceFile
|
|
7
|
+
.getDescendantsOfKind(SyntaxKind.CallExpression)
|
|
8
|
+
.filter((callExpr) => {
|
|
9
|
+
const expr = callExpr.getExpression();
|
|
10
|
+
return (Node.isPropertyAccessExpression(expr) &&
|
|
11
|
+
expr.getName() === "showAsync" &&
|
|
12
|
+
expr.getExpression().getText() === "this._sdModal");
|
|
13
|
+
});
|
|
14
|
+
for (const callExpr of callExprs) {
|
|
15
|
+
const args = callExpr.getArguments();
|
|
16
|
+
if (args.length < 3)
|
|
17
|
+
continue; // 최소 3개는 있어야 함
|
|
18
|
+
const typeText = args[0].getText();
|
|
19
|
+
const titleText = args[1].getText();
|
|
20
|
+
const inputsText = args[2]?.getText() ?? "{}";
|
|
21
|
+
const props = [`type: ${typeText}`, `title: ${titleText}`, `inputs: ${inputsText}`];
|
|
22
|
+
const objectLiteralText = `{\n ${props.join(",\n ")}\n}`;
|
|
23
|
+
const newArgs = [`${objectLiteralText}`, ...args.slice(3).map((arg) => arg.getText())].join(", ");
|
|
24
|
+
callExpr.replaceWithText(`this._sdModal.showAsync(${newArgs})`);
|
|
25
|
+
}
|
|
26
|
+
sourceFile.saveSync();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=convert-modal-show-params.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-modal-show-params.js","sourceRoot":"","sources":["../../src/fix/convert-modal-show-params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,qBAAqB,MAAM,kCAAkC,CAAC;AAErE,MAAM,CAAC,OAAO,UAAU,sBAAsB;IAC5C,MAAM,WAAW,GAAG,qBAAqB,EAAE,CAAC;IAE5C,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACrC,MAAM,SAAS,GAAG,UAAU;aACzB,oBAAoB,CAAC,UAAU,CAAC,cAAc,CAAC;aAC/C,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;YACnB,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,EAAE,CAAC;YACtC,OAAO,CACL,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC;gBACrC,IAAI,CAAC,OAAO,EAAE,KAAK,WAAW;gBAC9B,IAAI,CAAC,aAAa,EAAE,CAAC,OAAO,EAAE,KAAK,eAAe,CACnD,CAAC;QACJ,CAAC,CAAC,CAAC;QAEL,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YACjC,MAAM,IAAI,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC;YACrC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;gBAAE,SAAS,CAAC,eAAe;YAE9C,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;YACnC,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;YACpC,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,IAAI,CAAC;YAE9C,MAAM,KAAK,GAAG,CAAC,SAAS,QAAQ,EAAE,EAAE,UAAU,SAAS,EAAE,EAAE,WAAW,UAAU,EAAE,CAAC,CAAC;YACpF,MAAM,iBAAiB,GAAG,QAAQ,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;YAE3D,MAAM,OAAO,GAAG,CAAC,GAAG,iBAAiB,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAElG,QAAQ,CAAC,eAAe,CAAC,2BAA2B,OAAO,GAAG,CAAC,CAAC;QAClE,CAAC;QAED,UAAU,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function convertPrintParams(): void;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Node, SyntaxKind } from "ts-morph";
|
|
2
|
+
import getTsMorphSourceFiles from "./core/get-ts-morph-source-files";
|
|
3
|
+
export default function convertPrintParams() {
|
|
4
|
+
const sourceFiles = getTsMorphSourceFiles();
|
|
5
|
+
for (const sourceFile of sourceFiles) {
|
|
6
|
+
const typeChecker = sourceFile.getProject().getTypeChecker();
|
|
7
|
+
const callExprs = sourceFile
|
|
8
|
+
.getDescendantsOfKind(SyntaxKind.CallExpression)
|
|
9
|
+
.filter((callExpr) => {
|
|
10
|
+
const expr = callExpr.getExpression();
|
|
11
|
+
return (Node.isPropertyAccessExpression(expr) &&
|
|
12
|
+
expr.getName() === "printAsync" &&
|
|
13
|
+
expr.getExpression().getText() === "this._sdPrint");
|
|
14
|
+
});
|
|
15
|
+
for (const callExpr of callExprs) {
|
|
16
|
+
const args = callExpr.getArguments();
|
|
17
|
+
if (args.length < 2)
|
|
18
|
+
continue;
|
|
19
|
+
const firstArg = args[0];
|
|
20
|
+
const type = typeChecker.getTypeAtLocation(firstArg);
|
|
21
|
+
// 클래스 타입인지 확인 (Symbol이 존재하고, 선언이 class인지 여부 판단)
|
|
22
|
+
const symbol = type.getSymbol();
|
|
23
|
+
const isClass = symbol?.getDeclarations().some((decl) => Node.isClassDeclaration(decl)) ?? false;
|
|
24
|
+
if (!isClass)
|
|
25
|
+
continue;
|
|
26
|
+
// 변환 처리
|
|
27
|
+
const typeText = firstArg.getText();
|
|
28
|
+
const inputsText = args[1]?.getText() ?? "{}";
|
|
29
|
+
const props = [`type: ${typeText}`, `inputs: ${inputsText}`];
|
|
30
|
+
const objectLiteralText = `{\n ${props.join(",\n ")}\n}`;
|
|
31
|
+
const newArgs = [`${objectLiteralText}`, ...args.slice(2).map((arg) => arg.getText())].join(", ");
|
|
32
|
+
callExpr.replaceWithText(`this._sdPrint.printAsync(${newArgs})`);
|
|
33
|
+
}
|
|
34
|
+
sourceFile.saveSync();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=convert-print-params.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-print-params.js","sourceRoot":"","sources":["../../src/fix/convert-print-params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,qBAAqB,MAAM,kCAAkC,CAAC;AAErE,MAAM,CAAC,OAAO,UAAU,kBAAkB;IACxC,MAAM,WAAW,GAAG,qBAAqB,EAAE,CAAC;IAE5C,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACrC,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU,EAAE,CAA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IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;YAE3D,MAAM,OAAO,GAAG,CAAC,GAAG,iBAAiB,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CACzF,IAAI,CACL,CAAC;YAEF,QAAQ,CAAC,eAAe,CAAC,4BAA4B,OAAO,GAAG,CAAC,CAAC;QACnE,CAAC;QAED,UAAU,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function convertPrivateToHash(): void;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import { Node, SyntaxKind } from "ts-morph";
|
|
3
|
+
import getTsMortphSourceFiles from "./core/get-ts-morph-source-files";
|
|
4
|
+
export default function convertPrivateToHash() {
|
|
5
|
+
const sourceFiles = getTsMortphSourceFiles();
|
|
6
|
+
for (const sourceFile of sourceFiles) {
|
|
7
|
+
let changed = false;
|
|
8
|
+
for (const classDecl of sourceFile.getClasses()) {
|
|
9
|
+
const renameMap = new Map();
|
|
10
|
+
// 1. 선언부에서 private을 #으로 바꾸고 이름 매핑 저장
|
|
11
|
+
for (const member of classDecl.getMembers()) {
|
|
12
|
+
if (Node.isPropertyDeclaration(member) ||
|
|
13
|
+
Node.isMethodDeclaration(member) ||
|
|
14
|
+
Node.isGetAccessorDeclaration(member) ||
|
|
15
|
+
Node.isSetAccessorDeclaration(member)) {
|
|
16
|
+
if (member.hasModifier(SyntaxKind.PrivateKeyword)) {
|
|
17
|
+
const nameNode = member.getNameNode();
|
|
18
|
+
if (typeof nameNode.getText !== "function")
|
|
19
|
+
continue;
|
|
20
|
+
const oldName = nameNode.getText();
|
|
21
|
+
const newName = oldName.startsWith("_") ? `#${oldName.slice(1)}` : `#${oldName}`;
|
|
22
|
+
nameNode.replaceWithText(newName);
|
|
23
|
+
member.toggleModifier("private", false);
|
|
24
|
+
renameMap.set(oldName, newName);
|
|
25
|
+
const kind = Node.isMethodDeclaration(member)
|
|
26
|
+
? "method"
|
|
27
|
+
: Node.isGetAccessorDeclaration(member) || Node.isSetAccessorDeclaration(member)
|
|
28
|
+
? "accessor"
|
|
29
|
+
: "field";
|
|
30
|
+
console.log(`[private-${kind}] ${sourceFile.getBaseName()} :: private ${oldName} → ${newName}`);
|
|
31
|
+
changed = true;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (renameMap.size === 0)
|
|
36
|
+
continue;
|
|
37
|
+
// 2. this.xxx 접근 표현식 전환
|
|
38
|
+
classDecl.forEachDescendant((node) => {
|
|
39
|
+
const propAccess = node.asKind(SyntaxKind.PropertyAccessExpression);
|
|
40
|
+
if (propAccess) {
|
|
41
|
+
const expr = propAccess.getExpression();
|
|
42
|
+
const name = propAccess.getName();
|
|
43
|
+
if (expr.getText() === "this" && renameMap.has(name)) {
|
|
44
|
+
const newName = renameMap.get(name);
|
|
45
|
+
propAccess.replaceWithText(`this.${newName}`);
|
|
46
|
+
console.log(`[ref] ${sourceFile.getBaseName()} :: this.${name} → this.${newName}`);
|
|
47
|
+
changed = true;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (changed) {
|
|
53
|
+
sourceFile.saveSync();
|
|
54
|
+
console.log(`[save] ${sourceFile.getFilePath()}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
console.log("[완료] private → ECMAScript # 멤버 변환 완료");
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=convert-private-to-hash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-private-to-hash.js","sourceRoot":"","sources":["../../src/fix/convert-private-to-hash.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAE/B,OAAO,EAA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ED,IAAI,OAAO,EAAE,CAAC;YACZ,UAAU,CAAC,QAAQ,EAAE,CAAC;YACtB,OAAO,CAAC,GAAG,CAAC,UAAU,UAAU,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function convertSdAngularSymbolNames(): void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import convertSymbols from "./core/convert-symbol";
|
|
3
|
+
export default function convertSdAngularSymbolNames() {
|
|
4
|
+
convertSymbols({
|
|
5
|
+
"@simplysm/sd-angular#useBgTheme": "@simplysm/sd-angular#setupBgTheme",
|
|
6
|
+
"@simplysm/sd-angular#canDeactivate": "@simplysm/sd-angular#setupCanDeactivate",
|
|
7
|
+
"@simplysm/sd-angular#useRipple": "@simplysm/sd-angular#setupRipple",
|
|
8
|
+
"@simplysm/sd-angular#useCumulateSelectedKeys": "@simplysm/sd-angular#setupCumulateSelectedKeys",
|
|
9
|
+
"@simplysm/sd-angular#injectQueryParamMap$": "@simplysm/sd-angular#useQueryParamMapSignal",
|
|
10
|
+
"@simplysm/sd-angular#useActivatedRouteManager": "@simplysm/sd-angular#useQueryParamMapSignal",
|
|
11
|
+
"@simplysm/sd-angular#ISdSheetColumnOrderingVM": "@simplysm/sd-angular#ISdSortingDef",
|
|
12
|
+
"@simplysm/sd-angular#ISortingDef": "@simplysm/sd-angular#ISdSortingDef",
|
|
13
|
+
"@simplysm/sd-angular#ISharedDataModalOutputResult": "@simplysm/sd-angular#ISelectModalOutputResult",
|
|
14
|
+
"@angular/core#signal": "@simplysm/sd-angular#$signal",
|
|
15
|
+
"@angular/core#computed": "@simplysm/sd-angular#$computed",
|
|
16
|
+
"@angular/core#effect": "@simplysm/sd-angular#$effect",
|
|
17
|
+
"@angular/core#afterRenderEffect": "@simplysm/sd-angular#$afterRenderEffect",
|
|
18
|
+
"@angular/core#afterRenderComputed": "@simplysm/sd-angular#$afterRenderComputed",
|
|
19
|
+
"@angular/core#resource": "@simplysm/sd-angular#$resource",
|
|
20
|
+
});
|
|
21
|
+
console.log("[완료] SdAngular 심볼 이름 변환 완료");
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=convert-sd-angular-symbol-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-sd-angular-symbol-names.js","sourceRoot":"","sources":["../../src/fix/convert-sd-angular-symbol-names.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,cAAc,MAAM,uBAAuB,CAAC;AAEnD,MAAM,CAAC,OAAO,UAAU,2BAA2B;IACjD,cAAc,CAAC;QACb,iCAAiC,EAAE,mCAAmC;QACtE,oCAAoC,EAAE,yCAAyC;QAC/E,gCAAgC,EAAE,kCAAkC;QACpE,8CAA8C,EAAE,gDAAgD;QAChG,2CAA2C,EAAE,6CAA6C;QAC1F,+CAA+C,EAAE,6CAA6C;QAC9F,+CAA+C,EAAE,oCAAoC;QACrF,kCAAkC,EAAE,oCAAoC;QACxE,mDAAmD,EAAE,+CAA+C;QAEpG,sBAAsB,EAAE,8BAA8B;QACtD,wBAAwB,EAAE,gCAAgC;QAC1D,sBAAsB,EAAE,8BAA8B;QACtD,iCAAiC,EAAE,yCAAyC;QAC5E,mCAAmC,EAAE,2CAA2C;QAChF,wBAAwB,EAAE,gCAAgC;KAC3D,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function convertSdIconToFaIcon(): void;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import { SyntaxKind } from "ts-morph";
|
|
3
|
+
import getTsMortphSourceFiles from "./core/get-ts-morph-source-files";
|
|
4
|
+
import convertSymbols from "./core/convert-symbol";
|
|
5
|
+
export default function convertSdIconToFaIcon() {
|
|
6
|
+
// 1. SdIconControl → FaIconComponent
|
|
7
|
+
convertSymbols({
|
|
8
|
+
"@simplysm/sd-angular#SdIconControl": "@fortawesome/angular-fontawesome#FaIconComponent",
|
|
9
|
+
});
|
|
10
|
+
const sourceFiles = getTsMortphSourceFiles();
|
|
11
|
+
for (const sourceFile of sourceFiles) {
|
|
12
|
+
const filePath = sourceFile.getFilePath();
|
|
13
|
+
let didChange = false;
|
|
14
|
+
const importDecls = sourceFile.getImportDeclarations();
|
|
15
|
+
for (const importDecl of importDecls) {
|
|
16
|
+
const moduleSpecifier = importDecl.getModuleSpecifierValue();
|
|
17
|
+
// 2. pro-regular-svg-icons → 개별 모듈로 분할
|
|
18
|
+
if (moduleSpecifier === "@fortawesome/pro-regular-svg-icons") {
|
|
19
|
+
const namedImports = importDecl.getNamedImports();
|
|
20
|
+
for (const namedImport of namedImports) {
|
|
21
|
+
const name = namedImport.getName(); // e.g. faLock
|
|
22
|
+
sourceFile.insertImportDeclaration(importDecl.getChildIndex(), {
|
|
23
|
+
namedImports: [name],
|
|
24
|
+
moduleSpecifier: `@fortawesome/pro-regular-svg-icons/${name}`,
|
|
25
|
+
});
|
|
26
|
+
console.log(` [아이콘 분할 import] ${name} → /${name}`);
|
|
27
|
+
}
|
|
28
|
+
importDecl.remove();
|
|
29
|
+
didChange = true;
|
|
30
|
+
}
|
|
31
|
+
// 2. free-solid-svg-icons → 개별 모듈로 분할
|
|
32
|
+
if (moduleSpecifier === "@fortawesome/free-solid-svg-icons") {
|
|
33
|
+
const namedImports = importDecl.getNamedImports();
|
|
34
|
+
for (const namedImport of namedImports) {
|
|
35
|
+
const name = namedImport.getName(); // e.g. faLock
|
|
36
|
+
sourceFile.insertImportDeclaration(importDecl.getChildIndex(), {
|
|
37
|
+
namedImports: [name],
|
|
38
|
+
moduleSpecifier: `@fortawesome/free-solid-svg-icons/${name}`,
|
|
39
|
+
});
|
|
40
|
+
console.log(` [아이콘 분할 import] ${name} → /${name}`);
|
|
41
|
+
}
|
|
42
|
+
importDecl.remove();
|
|
43
|
+
didChange = true;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// 3. 템플릿 내 sd-icon → fa-icon 및 fixedWidth 보정
|
|
47
|
+
const templates = sourceFile.getDescendantsOfKind(SyntaxKind.NoSubstitutionTemplateLiteral);
|
|
48
|
+
for (const tmpl of templates) {
|
|
49
|
+
const raw = tmpl.getLiteralText();
|
|
50
|
+
if (!raw.includes("<sd-icon"))
|
|
51
|
+
continue;
|
|
52
|
+
const replaced = raw
|
|
53
|
+
// <sd-icon ... /> → <fa-icon ... />
|
|
54
|
+
.replace(/<sd-icon\b([^>]*)\/>/g, (_, attrs) => {
|
|
55
|
+
const newAttrs = attrs
|
|
56
|
+
// 이미 바인딩된 [fixedWidth]=은 건드리지 않음
|
|
57
|
+
.replace(/\s(?<!\[)fixedWidth(?!\s*=\s*["'])/g, ' [fixedWidth]="true"')
|
|
58
|
+
.trim();
|
|
59
|
+
return `<fa-icon ${newAttrs} />`;
|
|
60
|
+
})
|
|
61
|
+
// <sd-icon ...>...</sd-icon> → <fa-icon ...>...</fa-icon>
|
|
62
|
+
.replace(/<sd-icon\b([^>]*)>([\s\S]*?)<\/sd-icon>/g, (_, attrs, inner) => {
|
|
63
|
+
const newAttrs = attrs
|
|
64
|
+
.replace(/\s(?<!\[)fixedWidth(?!\s*=\s*["'])/g, ' [fixedWidth]="true"')
|
|
65
|
+
.trim();
|
|
66
|
+
return `<fa-icon ${newAttrs}>${inner}</fa-icon>`;
|
|
67
|
+
});
|
|
68
|
+
if (replaced !== raw) {
|
|
69
|
+
tmpl.setLiteralValue(replaced);
|
|
70
|
+
console.log(`[template] ${sourceFile.getBaseName()} :: <sd-icon> → <fa-icon> 변환됨`);
|
|
71
|
+
didChange = true;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (didChange) {
|
|
75
|
+
sourceFile.saveSync();
|
|
76
|
+
console.log(`[저장 완료] ${filePath}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=convert-sd-icon-to-fa-icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-sd-icon-to-fa-icon.js","sourceRoot":"","sources":["../../src/fix/convert-sd-icon-to-fa-icon.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,sBAAsB,MAAM,kCAAkC,CAAC;AACtE,OAAO,cAAc,MAAM,uBAAuB,CAAC;AAEnD,MAAM,CAAC,OAAO,UAAU,qBAAqB;IAC3C,qCAAqC;IACrC,cAAc,CAAC;QACb,oCAAoC,EAAE,kDAAkD;KACzF,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,sBAAsB,EAAE,CAAC;IAE7C,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACrC,MAAM,QAAQ,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;QAC1C,IAAI,SAAS,GAAG,KAAK,CAAC;QAEtB,MAAM,WAAW,GAAG,UAAU,CAAC,qBAAqB,EAAE,CAAC;QAEvD,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACrC,MAAM,eAAe,GAAG,UAAU,CAAC,uBAAuB,EAAE,CAAC;YAE7D,uCAAuC;YACvC,IAAI,eAAe,KAAK,oCAAoC,EAAE,CAAC;gBAC7D,MAAM,YAAY,GAAG,UAAU,CAAC,eAAe,EAAE,CAAC;gBAElD,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;oBACvC,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC,cAAc;oBAClD,UAAU,CAAC,uBAAuB,CAAC,UAAU,CAAC,aAAa,EAAE,EAAE;wBAC7D,YAAY,EAAE,CAAC,IAAI,CAAC;wBACpB,eAAe,EAA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CAAC,qCAAqC,EAAE,sBAAsB,CAAC;qBACtE,IAAI,EAAE,CAAC;gBACV,OAAO,YAAY,QAAQ,KAAK,CAAC;YACnC,CAAC,CAAC;gBAEF,0DAA0D;iBACzD,OAAO,CAAC,0CAA0C,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;gBACvE,MAAM,QAAQ,GAAG,KAAK;qBACnB,OAAO,CAAC,qCAAqC,EAAE,sBAAsB,CAAC;qBACtE,IAAI,EAAE,CAAC;gBACV,OAAO,YAAY,QAAQ,IAAI,KAAK,YAAY,CAAC;YACnD,CAAC,CAAC,CAAC;YAEL,IAAI,QAAQ,KAAK,GAAG,EAAE,CAAC;gBACrB,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;gBAC/B,OAAO,CAAC,GAAG,CAAC,cAAc,UAAU,CAAC,WAAW,EAAE,+BAA+B,CAAC,CAAC;gBACnF,SAAS,GAAG,IAAI,CAAC;YACnB,CAAC;QACH,CAAC;QAED,IAAI,SAAS,EAAE,CAAC;YACd,UAAU,CAAC,QAAQ,EAAE,CAAC;YACtB,OAAO,CAAC,GAAG,CAAC,WAAW,QAAQ,EAAE,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function convertSdSheetBindingsSafely(): void;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import { SyntaxKind } from "ts-morph";
|
|
3
|
+
import getTsMortphSourceFiles from "./core/get-ts-morph-source-files";
|
|
4
|
+
export default function convertSdSheetBindingsSafely() {
|
|
5
|
+
const sourceFiles = getTsMortphSourceFiles();
|
|
6
|
+
for (const sourceFile of sourceFiles) {
|
|
7
|
+
for (const classDecl of sourceFile.getClasses()) {
|
|
8
|
+
const decorator = classDecl.getDecorator("Component");
|
|
9
|
+
if (!decorator)
|
|
10
|
+
continue;
|
|
11
|
+
const arg = decorator.getArguments()[0];
|
|
12
|
+
if (!arg.asKind(SyntaxKind.ObjectLiteralExpression))
|
|
13
|
+
continue;
|
|
14
|
+
const obj = arg.asKindOrThrow(SyntaxKind.ObjectLiteralExpression);
|
|
15
|
+
const templateProp = obj.getProperty("template");
|
|
16
|
+
if (!templateProp || !templateProp.isKind(SyntaxKind.PropertyAssignment))
|
|
17
|
+
continue;
|
|
18
|
+
const initializer = templateProp.getInitializer();
|
|
19
|
+
if (!initializer)
|
|
20
|
+
continue;
|
|
21
|
+
let rawTemplate;
|
|
22
|
+
if (initializer.isKind(SyntaxKind.NoSubstitutionTemplateLiteral) ||
|
|
23
|
+
initializer.isKind(SyntaxKind.StringLiteral)) {
|
|
24
|
+
rawTemplate = initializer.getLiteralText();
|
|
25
|
+
}
|
|
26
|
+
else if (initializer.isKind(SyntaxKind.TemplateExpression)) {
|
|
27
|
+
rawTemplate = initializer.getFullText().slice(1, -1);
|
|
28
|
+
}
|
|
29
|
+
else
|
|
30
|
+
continue;
|
|
31
|
+
// 정규식으로 <sd-sheet> 안에서만 바인딩 속성 치환
|
|
32
|
+
let newTemplate = rawTemplate.replace(/<sd-sheet([\s\S]*?)>/g, (match) => match
|
|
33
|
+
.replace(/\[\(page\)\]/g, "[(currentPage)]")
|
|
34
|
+
.replace(/\[pageLength\]/g, "[totalPageCount]")
|
|
35
|
+
.replace(/\[\(ordering\)\]/g, "[(sorts)]")
|
|
36
|
+
.replace(/\[pageItemCount\]/g, "[itemsPerPage]"));
|
|
37
|
+
newTemplate = newTemplate.replace(/<sd-pagination([\s\S]*?)>/g, (match) => match
|
|
38
|
+
.replace(/\[\(page\)\]/g, "[(currentPage)]")
|
|
39
|
+
.replace(/\[pageLength\]/g, "[totalPageCount]")
|
|
40
|
+
.replace(/\[displayPageLength\]/g, "[visiblePageCount]"));
|
|
41
|
+
newTemplate = newTemplate.replace(/<sd-sheet-column([\s\S]*?)>/g, (match) => match
|
|
42
|
+
.replace(/\[disableOrdering\]/g, "[disableSorting]")
|
|
43
|
+
.replace(/\sdisableOrdering/g, " disableSorting"));
|
|
44
|
+
newTemplate = newTemplate.replace(/<ng-template([\s\S]*?)>/g, (match) => match
|
|
45
|
+
.replace(/target="content"/g, "#content")
|
|
46
|
+
.replace(/target="topbar"/g, "#pageTopbar")
|
|
47
|
+
.replace(/target="bottom"/g, "#modalBottom"));
|
|
48
|
+
if (rawTemplate !== newTemplate) {
|
|
49
|
+
initializer.replaceWithText("`" + newTemplate + "`");
|
|
50
|
+
console.log(`[template-updated] ${sourceFile.getBaseName()} :: 바인딩 속성 안전하게 변경 완료`);
|
|
51
|
+
sourceFile.saveSync();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
console.log("[완료] 정규식 기반 안전한 sd-sheet 바인딩 속성 변경 완료");
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=convert-sd-sheet-bindings-safety.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-sd-sheet-bindings-safety.js","sourceRoot":"","sources":["../../src/fix/convert-sd-sheet-bindings-safety.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,sBAAsB,MAAM,kCAAkC,CAAC;AAEtE,MAAM,CAAC,OAAO,UAAU,4BAA4B;IAClD,MAAM,WAAW,GAAG,sBAAsB,EAAE,CAAC;IAE7C,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACrC,KAAK,MAAM,SAAS,IAAI,UAAU,CAAC,UAAU,EAAE,EAAE,CAAC;YAChD,MAAM,SAAS,GAAG,SAAS,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;YACtD,IAAI,CAAC,SAAS;gBAAE,SAAS;YAEzB,MAAM,GAAG,GAAG,SAAS,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC;YACxC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,u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,CAAC;iBAC3C,OAAO,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;iBAC9C,OAAO,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,CAC3D,CAAC;YAEF,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,8BAA8B,EAAE,CAAC,KAAK,EAAE,EAAE,CAC1E,KAAK;iBACF,OAAO,CAAC,sBAAsB,EAAE,kBAAkB,CAAC;iBACnD,OAAO,CAAC,oBAAoB,EAAE,iBAAiB,CAAC,CACpD,CAAC;YAEF,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,0BAA0B,EAAE,CAAC,KAAK,EAAE,EAAE,CACtE,KAAK;iBACF,OAAO,CAAC,mBAAmB,EAAE,UAAU,CAAC;iBACxC,OAAO,CAAC,kBAAkB,EAAE,aAAa,CAAC;iBAC1C,OAAO,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAC/C,CAAC;YAEF,IAAI,WAAW,KAAK,WAAW,EAAE,CAAC;gBAChC,WAAW,CAAC,eAAe,CAAC,GAAG,GAAG,WAAW,GAAG,GAAG,CAAC,CAAC;gBACrD,OAAO,CAAC,GAAG,CACT,sBAAsB,UAAU,CAAC,WAAW,EAAE,uBAAuB,CACtE,CAAC;gBACF,UAAU,CAAC,QAAQ,EAAE,CAAC;YACxB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function convertSelectModalButtonToSelectButton(): void;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import { SyntaxKind } from "ts-morph";
|
|
3
|
+
import getTsMortphSourceFiles from "./core/get-ts-morph-source-files";
|
|
4
|
+
import convertSymbols from "./core/convert-symbol";
|
|
5
|
+
export default function convertSelectModalButtonToSelectButton() {
|
|
6
|
+
// 1. SdIconControl → FaIconComponent
|
|
7
|
+
convertSymbols({
|
|
8
|
+
"@simplysm/sd-angular#SdSharedDataSelectModalButtonControl": "@simplysm/sd-angular#SdSharedDataSelectButtonControl",
|
|
9
|
+
"@simplysm/sd-angular#SdSelectModalButtonControl": "@simplysm/sd-angular#SdDataSelectButtonControl",
|
|
10
|
+
"@simplysm/sd-angular#TSelectValue": "@simplysm/sd-angular#TSelectModeValue",
|
|
11
|
+
"@simplysm/sd-angular#SdSharedDataSelectViewControl": "@simplysm/sd-angular#SdSharedDataSelectListControl",
|
|
12
|
+
});
|
|
13
|
+
const sourceFiles = getTsMortphSourceFiles();
|
|
14
|
+
for (const sourceFile of sourceFiles) {
|
|
15
|
+
const filePath = sourceFile.getFilePath();
|
|
16
|
+
let didChange = false;
|
|
17
|
+
// 3. 템플릿 내 sd-shared-data-select-modal-button → sd-shared-data-select-button
|
|
18
|
+
const templates = sourceFile.getDescendantsOfKind(SyntaxKind.NoSubstitutionTemplateLiteral);
|
|
19
|
+
for (const tmpl of templates) {
|
|
20
|
+
const raw = tmpl.getLiteralText();
|
|
21
|
+
if (raw.includes("<sd-shared-data-select-modal-button")) {
|
|
22
|
+
const replaced = raw
|
|
23
|
+
// <sd-icon ...>...</sd-icon> → <fa-icon ...>...</fa-icon>
|
|
24
|
+
.replace(/<sd-shared-data-select-modal-button\b([^>]*)>([\s\S]*?)<\/sd-shared-data-select-modal-button>/g, (_, attrs, inner) => {
|
|
25
|
+
return `<sd-shared-data-select-button ${attrs}>${inner}</sd-shared-data-select-button>`;
|
|
26
|
+
});
|
|
27
|
+
if (replaced !== raw) {
|
|
28
|
+
tmpl.setLiteralValue(replaced);
|
|
29
|
+
console.log(`[template] ${sourceFile.getBaseName()} :: <sd-shared-data-select-modal-button> → <sd-shared-data-select-button> 변환됨`);
|
|
30
|
+
didChange = true;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (raw.includes("<sd-select-modal-button")) {
|
|
34
|
+
const replaced = raw
|
|
35
|
+
// <sd-icon ...>...</sd-icon> → <fa-icon ...>...</fa-icon>
|
|
36
|
+
.replace(/<sd-select-modal-button\b([^>]*)>([\s\S]*?)<\/sd-select-modal-button>/g, (_, attrs, inner) => {
|
|
37
|
+
return `<sd-data-select-button ${attrs}>${inner}</sd-data-select-button>`;
|
|
38
|
+
});
|
|
39
|
+
if (replaced !== raw) {
|
|
40
|
+
tmpl.setLiteralValue(replaced);
|
|
41
|
+
console.log(`[template] ${sourceFile.getBaseName()} :: <sd-select-modal-button> → <sd-data-select-button> 변환됨`);
|
|
42
|
+
didChange = true;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (raw.includes("<sd-shared-data-select-view")) {
|
|
46
|
+
const replaced = raw
|
|
47
|
+
// <sd-icon ...>...</sd-icon> → <fa-icon ...>...</fa-icon>
|
|
48
|
+
.replace(/<sd-shared-data-select-view\b([^>]*)>([\s\S]*?)<\/sd-shared-data-select-view>/g, (_, attrs, inner) => {
|
|
49
|
+
return `<sd-shared-data-select-list ${attrs}>${inner}</sd-shared-data-select-list>`;
|
|
50
|
+
});
|
|
51
|
+
if (replaced !== raw) {
|
|
52
|
+
tmpl.setLiteralValue(replaced);
|
|
53
|
+
console.log(`[template] ${sourceFile.getBaseName()} :: <sd-shared-data-select-view> → <sd-shared-data-select-list> 변환됨`);
|
|
54
|
+
didChange = true;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (didChange) {
|
|
59
|
+
sourceFile.saveSync();
|
|
60
|
+
console.log(`[저장 완료] ${filePath}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=convert-select-modal-button-to-select-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-select-modal-button-to-select-button.js","sourceRoot":"","sources":["../../src/fix/convert-select-modal-button-to-select-button.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAA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
/* eslint-disable no-console */
|
|
2
|
+
import { SyntaxKind } from "ts-morph";
|
|
3
|
+
import getTsMortphSourceFiles from "./core/get-ts-morph-source-files";
|
|
4
|
+
export default function convertSetupCumulateSelectedKeysToObjectParam() {
|
|
5
|
+
const sourceFiles = getTsMortphSourceFiles();
|
|
6
|
+
for (const sourceFile of sourceFiles) {
|
|
7
|
+
let changed = false;
|
|
8
|
+
sourceFile.forEachDescendant((node) => {
|
|
9
|
+
if (node.getKind() !== SyntaxKind.CallExpression)
|
|
10
|
+
return;
|
|
11
|
+
const callExpr = node.asKindOrThrow(SyntaxKind.CallExpression);
|
|
12
|
+
const exprText = callExpr.getExpression().getText();
|
|
13
|
+
if (exprText !== "setupCumulateSelectedKeys")
|
|
14
|
+
return;
|
|
15
|
+
const args = callExpr.getArguments();
|
|
16
|
+
if (args.length !== 5)
|
|
17
|
+
return;
|
|
18
|
+
const [items, selectMode, selectedItems, selectedItemIds, keySelectorFn] = args;
|
|
19
|
+
// 객체 리터럴 생성
|
|
20
|
+
const newArgText = `{
|
|
21
|
+
items: ${items.getText()},
|
|
22
|
+
selectMode: ${selectMode.getText()},
|
|
23
|
+
selectedItems: ${selectedItems.getText()},
|
|
24
|
+
selectedItemKeys: ${selectedItemIds.getText()},
|
|
25
|
+
keySelectorFn: ${keySelectorFn.getText()}
|
|
26
|
+
}`;
|
|
27
|
+
callExpr.replaceWithText(`setupCumulateSelectedKeys(${newArgText})`);
|
|
28
|
+
changed = true;
|
|
29
|
+
console.log(`[updated] ${sourceFile.getBaseName()} :: setupCumulateSelectedKeys 인자 구조 변경`);
|
|
30
|
+
});
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
32
|
+
if (changed) {
|
|
33
|
+
sourceFile.saveSync();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
console.log("[완료] setupCumulateSelectedKeys → object parameter 구조 변환 완료");
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=convert-setup-cumulate-selected-keys-to-object-param.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-setup-cumulate-selected-keys-to-object-param.js","sourceRoot":"","sources":["../../src/fix/convert-setup-cumulate-selected-keys-to-object-param.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,sBAAsB,MAAM,kCAAkC,CAAC;AAEtE,MAAM,CAAC,OAAO,UAAU,6CAA6C;IACnE,MAAM,WAAW,GAAG,sBAAsB,EAAE,CAAC;IAE7C,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACrC,IAAI,OAAO,GAAG,KAAK,CAAC;QAEpB,UAAU,CAAC,iBAAiB,CAAC,CAAC,IAAI,EAAE,EAAE;YACpC,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,UAAU,CAAC,cAAc;gBAAE,OAAO;YAEzD,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;YAC/D,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,EAAE,CAAC,OAAO,EAAE,CAAC;YAEpD,IAAI,QAAQ,KAAK,2BAA2B;gBAAE,OAAO;YACrD,MAAM,IAAI,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC;YACrC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO;YAE9B,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,CAAC,GAAG,IAAI,CAAC;YAEhF,YAAY;YACZ,MAAM,UAAU,GAAG;iBACR,KAAK,CAAC,OAAO,EAAE;sBACV,UAAU,CAAC,OAAO,EAAE;yBACjB,aAAa,CAAC,OAAO,EAAE;4BACpB,eAAe,CAAC,OAAO,EAAE;yBAC5B,aAAa,CAAC,OAAO,EAAE;QACxC,CAAC;YAEH,QAAQ,CAAC,eAAe,CAAC,6BAA6B,UAAU,GAAG,CAAC,CAAC;YACrE,OAAO,GAAG,IAAI,CAAC;YACf,OAAO,CAAC,GAAG,CAAC,aAAa,UAAU,CAAC,WAAW,EAAE,wCAAwC,CAAC,CAAC;QAC7F,CAAC,CAAC,CAAC;QAEH,uEAAuE;QACvE,IAAI,OAAO,EAAE,CAAC;YACZ,UAAU,CAAC,QAAQ,EAAE,CAAC;QACxB,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,4DAA4D,CAAC,CAAC;AAC5E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function convertToUsePermsSignal(): void;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import { SyntaxKind, } from "ts-morph";
|
|
3
|
+
import getTsMorphSourceFiles from "./core/get-ts-morph-source-files";
|
|
4
|
+
export function convertToUsePermsSignal() {
|
|
5
|
+
const sourceFiles = getTsMorphSourceFiles();
|
|
6
|
+
let totalChanged = 0;
|
|
7
|
+
for (const sourceFile of sourceFiles) {
|
|
8
|
+
let changed = false;
|
|
9
|
+
for (const cls of sourceFile.getClasses()) {
|
|
10
|
+
try {
|
|
11
|
+
const result = processClass(cls);
|
|
12
|
+
if (result.success) {
|
|
13
|
+
changed = true;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
console.error(`[오류] ${sourceFile.getBaseName()} 클래스 처리 중 오류:`, error);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (changed) {
|
|
21
|
+
addImportIfNeeded(sourceFile);
|
|
22
|
+
sourceFile.saveSync();
|
|
23
|
+
totalChanged++;
|
|
24
|
+
console.log(`[updated] ${sourceFile.getBaseName()} :: usePermsSignal 변환 완료`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
console.log(totalChanged > 0 ? `\n[완료] 변환 완료 (총 ${totalChanged}개)` : `[완료] 변환 대상 없음`);
|
|
28
|
+
}
|
|
29
|
+
function processClass(cls) {
|
|
30
|
+
const viewCodesProp = getPropertyDeclaration(cls, "viewCodes");
|
|
31
|
+
const permsProp = getPropertyDeclaration(cls, "perms");
|
|
32
|
+
if (!viewCodesProp || !permsProp) {
|
|
33
|
+
return { success: false, reason: "필수 프로퍼티 없음" };
|
|
34
|
+
}
|
|
35
|
+
const viewCodesInit = viewCodesProp.getInitializer();
|
|
36
|
+
const permsInit = permsProp.getInitializer();
|
|
37
|
+
if (!isValidViewCodesInit(viewCodesInit) || !isValidPermsInit(permsInit)) {
|
|
38
|
+
return { success: false, reason: "초기화 값이 유효하지 않음" };
|
|
39
|
+
}
|
|
40
|
+
const permsCallExpr = permsInit;
|
|
41
|
+
const arrowFunction = getArrowFunction(permsCallExpr);
|
|
42
|
+
if (!arrowFunction) {
|
|
43
|
+
return { success: false, reason: "Arrow function을 찾을 수 없음" };
|
|
44
|
+
}
|
|
45
|
+
const callExpression = getPermsCallExpression(arrowFunction);
|
|
46
|
+
if (!callExpression) {
|
|
47
|
+
return { success: false, reason: "getViewPerms 호출을 찾을 수 없음" };
|
|
48
|
+
}
|
|
49
|
+
const args = callExpression.getArguments();
|
|
50
|
+
if (args.length !== 2) {
|
|
51
|
+
return { success: false, reason: "인자 개수가 맞지 않음" };
|
|
52
|
+
}
|
|
53
|
+
// 변환 실행
|
|
54
|
+
const viewCodesText = viewCodesInit.getText();
|
|
55
|
+
const permsText = args[1].getText();
|
|
56
|
+
permsProp.setInitializer(`usePermsSignal(${viewCodesText}, ${permsText})`);
|
|
57
|
+
viewCodesProp.remove();
|
|
58
|
+
return { success: true };
|
|
59
|
+
}
|
|
60
|
+
function getPropertyDeclaration(cls, name) {
|
|
61
|
+
const prop = cls.getInstanceProperty(name);
|
|
62
|
+
return prop?.getKind() === SyntaxKind.PropertyDeclaration ? prop : undefined;
|
|
63
|
+
}
|
|
64
|
+
function isValidViewCodesInit(init) {
|
|
65
|
+
return init?.getKind() === SyntaxKind.ArrayLiteralExpression;
|
|
66
|
+
}
|
|
67
|
+
function isValidPermsInit(init) {
|
|
68
|
+
return init?.getKind() === SyntaxKind.CallExpression;
|
|
69
|
+
}
|
|
70
|
+
function getArrowFunction(callExpr) {
|
|
71
|
+
const firstArg = callExpr.getArguments().first();
|
|
72
|
+
return firstArg?.getKind() === SyntaxKind.ArrowFunction ? firstArg : undefined;
|
|
73
|
+
}
|
|
74
|
+
function getPermsCallExpression(arrowFn) {
|
|
75
|
+
const body = arrowFn.getBody();
|
|
76
|
+
if (body.getKind() !== SyntaxKind.CallExpression) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
const callExpr = body;
|
|
80
|
+
return callExpr.getText().includes("this._sdAppStructure.getViewPerms") ? callExpr : undefined;
|
|
81
|
+
}
|
|
82
|
+
function addImportIfNeeded(sourceFile) {
|
|
83
|
+
const sdAngularImport = sourceFile.getImportDeclaration((d) => d.getModuleSpecifierValue() === "@simplysm/sd-angular");
|
|
84
|
+
if (sdAngularImport) {
|
|
85
|
+
const hasImport = sdAngularImport
|
|
86
|
+
.getNamedImports()
|
|
87
|
+
.some((n) => n.getName() === "usePermsSignal");
|
|
88
|
+
if (!hasImport) {
|
|
89
|
+
sdAngularImport.addNamedImport("usePermsSignal");
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
sourceFile.addImportDeclaration({
|
|
94
|
+
namedImports: ["usePermsSignal"],
|
|
95
|
+
moduleSpecifier: "@simplysm/sd-angular",
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=convert-to-use-perms-signal.js.map
|