@simplysm/sd-cli 12.9.35 → 12.9.37
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/fix/convert-sd-angular-symbol-names.d.ts +1 -0
- package/dist/fix/convert-sd-angular-symbol-names.js +20 -0
- package/dist/fix/convert-sd-angular-symbol-names.js.map +1 -0
- package/dist/fix/convert-sd-sheet-bindings-inInline-template.js +1 -1
- package/dist/fix/convert-sd-sheet-bindings-inInline-template.js.map +1 -1
- 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/core/convert-symbol.d.ts +1 -0
- package/dist/fix/core/convert-symbol.js +157 -0
- package/dist/fix/core/convert-symbol.js.map +1 -0
- package/dist/sd-cli-entry.js +17 -8
- package/dist/sd-cli-entry.js.map +1 -1
- package/dist/sd-cli.js +1 -0
- package/dist/sd-cli.js.map +1 -1
- package/package.json +5 -5
- package/src/fix/convert-sd-angular-symbol-names.ts +22 -0
- package/src/fix/convert-sd-sheet-bindings-inInline-template.ts +1 -1
- package/src/fix/convert-setup-cumulate-selected-keys-to-object-param.ts +44 -0
- package/src/fix/core/convert-symbol.ts +180 -0
- package/src/sd-cli-entry.ts +19 -8
- package/src/sd-cli.ts +1 -0
- package/dist/fix/convert-ordering-interface.d.ts +0 -1
- package/dist/fix/convert-ordering-interface.js +0 -46
- package/dist/fix/convert-ordering-interface.js.map +0 -1
- package/src/fix/convert-ordering-interface.ts +0 -56
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function convertSdAngularSymbolNames(): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
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#useActivateRouteManager",
|
|
10
|
+
"@simplysm/sd-angular#ISdSheetColumnOrderingVM": "@simplysm/sd-angular#ISortingDef",
|
|
11
|
+
"@angular/core#signal": "@simplysm/sd-angular#$signal",
|
|
12
|
+
"@angular/core#computed": "@simplysm/sd-angular#$computed",
|
|
13
|
+
"@angular/core#effect": "@simplysm/sd-angular#$effect",
|
|
14
|
+
"@angular/core#afterRenderEffect": "@simplysm/sd-angular#$afterRenderEffect",
|
|
15
|
+
"@angular/core#afterRenderComputed": "@simplysm/sd-angular#$afterRenderComputed",
|
|
16
|
+
"@angular/core#resource": "@simplysm/sd-angular#$resource",
|
|
17
|
+
});
|
|
18
|
+
console.log("[완료] SdAngular 심볼 이름 변환 완료");
|
|
19
|
+
}
|
|
20
|
+
//# 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,8CAA8C;QAC3F,+CAA+C,EAAE,kCAAkC;QAEnF,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"}
|
|
@@ -39,7 +39,7 @@ export default function convertSdSheetBindingsSafely() {
|
|
|
39
39
|
.replace(/\[displayPageLength\]/g, "[visiblePageCount]"));
|
|
40
40
|
newTemplate = newTemplate.replace(/<sd-sheet-column([\s\S]*?)>/g, (match) => match
|
|
41
41
|
.replace(/\[disableOrdering\]/g, "[disableSorting]")
|
|
42
|
-
.replace(/\sdisableOrdering/g, "
|
|
42
|
+
.replace(/\sdisableOrdering/g, " disableSorting"));
|
|
43
43
|
if (rawTemplate !== newTemplate) {
|
|
44
44
|
initializer.replaceWithText("`" + newTemplate + "`");
|
|
45
45
|
console.log(`[template-updated] ${sourceFile.getBaseName()} :: 바인딩 속성 안전하게 변경 완료`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-sd-sheet-bindings-inInline-template.js","sourceRoot":"","sources":["../../src/fix/convert-sd-sheet-bindings-inInline-template.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,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,CACrD,CAAC;YAEF,WAAW,GAAG,WAAW,CAAC,OAAO,CAC/B,4BAA4B,EAC5B,CAAC,KAAK,EAAE,EAAE,CACR,KAAK;iBACF,OAAO,CAAC,eAAe,EAAE,iBAAiB,CAAC;iBAC3C,OAAO,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;iBAC9C,OAAO,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,CAC7D,CAAC;YAEF,WAAW,GAAG,WAAW,CAAC,OAAO,CAC/B,8BAA8B,EAC9B,CAAC,KAAK,EAAE,EAAE,CACR,KAAK;iBACF,OAAO,CAAC,sBAAsB,EAAE,kBAAkB,CAAC;iBACnD,OAAO,CAAC,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"convert-sd-sheet-bindings-inInline-template.js","sourceRoot":"","sources":["../../src/fix/convert-sd-sheet-bindings-inInline-template.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,uBAAuB,CAAC;gBAAE,SAAS;YAE9D,MAAM,GAAG,GAAG,GAAG,CAAC,aAAa,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;YAClE,MAAM,YAAY,GAAG,GAAG,C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CAAC,OAAO,CAC/B,8BAA8B,EAC9B,CAAC,KAAK,EAAE,EAAE,CACR,KAAK;iBACF,OAAO,CAAC,sBAAsB,EAAE,kBAAkB,CAAC;iBACnD,OAAO,CAAC,oBAAoB,EAAE,iBAAiB,CAAC,CACtD,CAAC;YAEF,IAAI,WAAW,KAAK,WAAW,EAAE,CAAC;gBAChC,WAAW,CAAC,eAAe,CAAC,GAAG,GAAG,WAAW,GAAG,GAAG,CAAC,CAAC;gBACrD,OAAO,CAAC,GAAG,CAAC,sBAAsB,UAAU,CAAC,WAAW,EAAE,uBAAuB,CAAC,CAAC;gBACnF,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 convertSetupCumulateSelectedKeysToObjectParam(): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
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 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 default function convertSymbols(raw: Record<string, string>): void;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
/*import { Identifier, SyntaxKind } from "ts-morph";
|
|
3
|
+
import getTsMortphSourceFiles from "./get-ts-morph-source-files";
|
|
4
|
+
|
|
5
|
+
export default function convertSymbols(replacements: Record<string, Record<string, string | undefined> | undefined>) {
|
|
6
|
+
const sourceFiles = getTsMortphSourceFiles();
|
|
7
|
+
|
|
8
|
+
for (const sourceFile of sourceFiles) {
|
|
9
|
+
let changed = false;
|
|
10
|
+
|
|
11
|
+
// 1. 타입 참조 및 값 참조 치환
|
|
12
|
+
sourceFile.forEachDescendant((node) => {
|
|
13
|
+
if (node.getKind() !== SyntaxKind.Identifier) return;
|
|
14
|
+
if (node.getFirstAncestorByKind(SyntaxKind.ImportSpecifier)) return;
|
|
15
|
+
|
|
16
|
+
const identifier = node as Identifier;
|
|
17
|
+
const name = identifier.getText();
|
|
18
|
+
|
|
19
|
+
// 해당 이름이 어디서 import됐는지 확인
|
|
20
|
+
const symbol = identifier.getSymbol();
|
|
21
|
+
if (symbol == null) return;
|
|
22
|
+
|
|
23
|
+
const declarations = symbol.getDeclarations();
|
|
24
|
+
if (declarations.length === 0) return;
|
|
25
|
+
|
|
26
|
+
const importSpecifier = declarations[0].getFirstAncestorByKind(SyntaxKind.ImportDeclaration);
|
|
27
|
+
if (importSpecifier == null) return;
|
|
28
|
+
|
|
29
|
+
const importModule = importSpecifier.getModuleSpecifierValue();
|
|
30
|
+
const replacementRecord = replacements[importModule];
|
|
31
|
+
if (replacementRecord == null) return;
|
|
32
|
+
|
|
33
|
+
const newName = replacementRecord[name];
|
|
34
|
+
if (newName == null || newName === name) return;
|
|
35
|
+
|
|
36
|
+
identifier.replaceWithText(newName);
|
|
37
|
+
changed = true;
|
|
38
|
+
console.log(`[ref] ${sourceFile.getBaseName()} :: ${importModule} :: ${name} → ${newName}`);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// 2. import 교체
|
|
42
|
+
for (const importDecl of sourceFile.getImportDeclarations()) {
|
|
43
|
+
const specifier = importDecl.getModuleSpecifierValue();
|
|
44
|
+
const replacementRecord = replacements[specifier];
|
|
45
|
+
if (replacementRecord == null) continue;
|
|
46
|
+
|
|
47
|
+
const namedImports = importDecl.getNamedImports();
|
|
48
|
+
|
|
49
|
+
for (const ni of namedImports) {
|
|
50
|
+
const oldName = ni.getName();
|
|
51
|
+
const newName = replacementRecord[oldName];
|
|
52
|
+
if (newName == null) continue;
|
|
53
|
+
|
|
54
|
+
ni.remove();
|
|
55
|
+
importDecl.addNamedImport(newName);
|
|
56
|
+
changed = true;
|
|
57
|
+
console.log(`[import] ${sourceFile.getBaseName()} :: ${specifier} :: ${oldName} → ${newName}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (changed) {
|
|
62
|
+
sourceFile.saveSync();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}*/
|
|
66
|
+
import { SyntaxKind } from "ts-morph";
|
|
67
|
+
import getTsMortphSourceFiles from "./get-ts-morph-source-files";
|
|
68
|
+
function parseReplacements(input) {
|
|
69
|
+
return Object.entries(input).map(([oldKey, newValue]) => {
|
|
70
|
+
const [oldModule, oldName] = oldKey.split("#");
|
|
71
|
+
const [newModule, newName] = newValue.split("#");
|
|
72
|
+
return { oldModule, oldName, newModule, newName };
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
export default function convertSymbols(raw) {
|
|
76
|
+
const replacements = parseReplacements(raw);
|
|
77
|
+
const sourceFiles = getTsMortphSourceFiles();
|
|
78
|
+
for (const sourceFile of sourceFiles) {
|
|
79
|
+
let changed = false;
|
|
80
|
+
const usedReplacements = new Set(); // 실제 사용된 newModule#newName 추적
|
|
81
|
+
const existingImportMap = new Map();
|
|
82
|
+
// 1. 참조 치환 (Identifier)
|
|
83
|
+
sourceFile.forEachDescendant((node) => {
|
|
84
|
+
if (node.getKind() !== SyntaxKind.Identifier)
|
|
85
|
+
return;
|
|
86
|
+
if (node.getFirstAncestorByKind(SyntaxKind.ImportSpecifier))
|
|
87
|
+
return;
|
|
88
|
+
const identifier = node;
|
|
89
|
+
const name = identifier.getText();
|
|
90
|
+
const symbol = identifier.getSymbol();
|
|
91
|
+
if (!symbol)
|
|
92
|
+
return;
|
|
93
|
+
const declarations = symbol.getDeclarations();
|
|
94
|
+
if (declarations.length === 0)
|
|
95
|
+
return;
|
|
96
|
+
const importDecl = declarations[0].getFirstAncestorByKind(SyntaxKind.ImportDeclaration);
|
|
97
|
+
if (!importDecl)
|
|
98
|
+
return;
|
|
99
|
+
const importModule = importDecl.getModuleSpecifierValue();
|
|
100
|
+
const match = replacements.find(r => r.oldModule === importModule && r.oldName === name);
|
|
101
|
+
if (!match)
|
|
102
|
+
return;
|
|
103
|
+
identifier.replaceWithText(match.newName);
|
|
104
|
+
usedReplacements.add(`${match.newModule}#${match.newName}`);
|
|
105
|
+
changed = true;
|
|
106
|
+
console.log(`[ref] ${sourceFile.getBaseName()} :: ${importModule} :: ${name} → ${match.newName}`);
|
|
107
|
+
});
|
|
108
|
+
// 2. import 교체
|
|
109
|
+
for (const importDecl of sourceFile.getImportDeclarations()) {
|
|
110
|
+
const specifier = importDecl.getModuleSpecifierValue();
|
|
111
|
+
const namedImports = importDecl.getNamedImports();
|
|
112
|
+
for (const ni of namedImports) {
|
|
113
|
+
const oldName = ni.getName();
|
|
114
|
+
const match = replacements.find(r => r.oldModule === specifier && r.oldName === oldName);
|
|
115
|
+
if (match) {
|
|
116
|
+
ni.remove();
|
|
117
|
+
// 만약 모듈이 동일하다면 즉시 대체
|
|
118
|
+
if (match.oldModule === match.newModule) {
|
|
119
|
+
importDecl.addNamedImport(match.newName);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
// 새로 import할 목록에 기록
|
|
123
|
+
usedReplacements.add(`${match.newModule}#${match.newName}`);
|
|
124
|
+
}
|
|
125
|
+
changed = true;
|
|
126
|
+
console.log(`[import] ${sourceFile.getBaseName()} :: ${specifier} :: ${oldName} → ${match.newName}`);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
// 기존 import 유지 기록
|
|
130
|
+
if (!existingImportMap.has(specifier)) {
|
|
131
|
+
existingImportMap.set(specifier, new Set());
|
|
132
|
+
}
|
|
133
|
+
existingImportMap.get(specifier).add(oldName);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// 3. 필요 시 새 import 추가
|
|
138
|
+
for (const key of usedReplacements) {
|
|
139
|
+
const [newModule, newName] = key.split("#");
|
|
140
|
+
const already = existingImportMap.get(newModule)?.has(newName);
|
|
141
|
+
const existsInFile = sourceFile.getImportDeclarations().some(decl => decl.getModuleSpecifierValue() === newModule &&
|
|
142
|
+
decl.getNamedImports().some(ni => ni.getName() === newName));
|
|
143
|
+
if (already || existsInFile)
|
|
144
|
+
continue;
|
|
145
|
+
sourceFile.addImportDeclaration({
|
|
146
|
+
moduleSpecifier: newModule,
|
|
147
|
+
namedImports: [newName],
|
|
148
|
+
});
|
|
149
|
+
changed = true;
|
|
150
|
+
console.log(`[new-import] ${sourceFile.getBaseName()} :: ${newModule} :: ${newName}`);
|
|
151
|
+
}
|
|
152
|
+
if (changed) {
|
|
153
|
+
sourceFile.saveSync();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=convert-symbol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-symbol.js","sourceRoot":"","sources":["../../../src/fix/core/convert-symbol.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAEH,OAAO,EAAc,UAAU,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,sBAAsB,MAAM,6BAA6B,CAAC;AASjE,SAAS,iBAAiB,CAAC,KAA6B;IACtD,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,EAAE;QACtD,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/C,MAAM,CAAC,SAAS,EAA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AAE,CAAC,OAAO,CAAC;aACxB,CAAC,CAAC;YAEH,OAAO,GAAG,IAAI,CAAC;YACf,OAAO,CAAC,GAAG,CAAC,gBAAgB,UAAU,CAAC,WAAW,EAAE,OAAO,SAAS,OAAO,OAAO,EAAE,CAAC,CAAC;QACxF,CAAC;QAED,IAAI,OAAO,EAAE,CAAC;YACZ,UAAU,CAAC,QAAQ,EAAE,CAAC;QACxB,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/sd-cli-entry.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/* eslint-disable no-console */
|
|
3
|
-
import yargs from "yargs";
|
|
4
|
-
import { hideBin } from "yargs/helpers";
|
|
5
|
-
import { SdCliProject } from "./entry/sd-cli-project";
|
|
6
3
|
import { SdLogger, SdLoggerSeverity } from "@simplysm/sd-core-node";
|
|
7
4
|
import { EventEmitter } from "events";
|
|
5
|
+
import yargs from "yargs";
|
|
6
|
+
import { hideBin } from "yargs/helpers";
|
|
7
|
+
import { SdCliAiCommand } from "./entry/sd-cli-ai-command";
|
|
8
|
+
import { SdCliCordova } from "./entry/sd-cli-cordova";
|
|
8
9
|
import { SdCliElectron } from "./entry/sd-cli-electron";
|
|
9
10
|
import { SdCliLocalUpdate } from "./entry/sd-cli-local-update";
|
|
10
|
-
import { SdCliCordova } from "./entry/sd-cli-cordova";
|
|
11
|
-
import { SdCliAiCommand } from "./entry/sd-cli-ai-command";
|
|
12
11
|
import { SdCliPostinstall } from "./entry/sd-cli-postinstall";
|
|
12
|
+
import { SdCliProject } from "./entry/sd-cli-project";
|
|
13
13
|
import convertEcmaPrivateToTsPrivate from "./fix/convert-ecma-private-to-ts-private";
|
|
14
|
-
import
|
|
14
|
+
import convertSdAngularSymbolNames from "./fix/convert-sd-angular-symbol-names";
|
|
15
15
|
import convertSdSheetBindingsInInlineTemplate from "./fix/convert-sd-sheet-bindings-inInline-template";
|
|
16
|
-
import
|
|
16
|
+
import convertSetupCumulateSelectedKeysToObjectParam from "./fix/convert-setup-cumulate-selected-keys-to-object-param";
|
|
17
|
+
import prefixUnderscoreForAccessModifiers from "./fix/prefix-underscore-for-access-modifiers";
|
|
17
18
|
Error.stackTraceLimit = Infinity;
|
|
18
19
|
EventEmitter.defaultMaxListeners = 0;
|
|
19
20
|
await yargs(hideBin(process.argv))
|
|
@@ -199,10 +200,18 @@ await yargs(hideBin(process.argv))
|
|
|
199
200
|
.version(false)
|
|
200
201
|
.hide("help")
|
|
201
202
|
.hide("debug"), () => {
|
|
203
|
+
// GIT 사용중일 경우, 커밋되지 않은 수정사항이 있는지 확인
|
|
204
|
+
/*if (FsUtils.exists(path.resolve(process.cwd(), ".git"))) {
|
|
205
|
+
const gitStatusResult = await SdProcess.spawnAsync("git status");
|
|
206
|
+
if (gitStatusResult.includes("Changes") || gitStatusResult.includes("Untracked")) {
|
|
207
|
+
throw new Error("커밋되지 않은 정보가 있습니다. FIX오류시 롤백이 불가능하므로, 미리 커밋을 해놔야 합니다.\n" + gitStatusResult);
|
|
208
|
+
}
|
|
209
|
+
}*/
|
|
202
210
|
convertEcmaPrivateToTsPrivate();
|
|
203
211
|
prefixUnderscoreForAccessModifiers();
|
|
204
212
|
convertSdSheetBindingsInInlineTemplate();
|
|
205
|
-
|
|
213
|
+
convertSdAngularSymbolNames();
|
|
214
|
+
convertSetupCumulateSelectedKeysToObjectParam();
|
|
206
215
|
})
|
|
207
216
|
.strict()
|
|
208
217
|
.recommendCommands()
|
package/dist/sd-cli-entry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-cli-entry.js","sourceRoot":"","sources":["../src/sd-cli-entry.ts"],"names":[],"mappings":";AAEA,+BAA+B;AAE/B,OAAO,
|
|
1
|
+
{"version":3,"file":"sd-cli-entry.js","sourceRoot":"","sources":["../src/sd-cli-entry.ts"],"names":[],"mappings":";AAEA,+BAA+B;AAE/B,OAAO,EAAE,QAAQ,EAAE,gBAAgB,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M,CAAC;KACZ,IAAI,CAAC,OAAO,CAAC,EAChB,GAAG,EAAE;IACH,oCAAoC;IACpC;;;;;OAKG;IAEH,6BAA6B,EAAE,CAAC;IAChC,kCAAkC,EAAE,CAAC;IACrC,sCAAsC,EAAE,CAAC;IACzC,2BAA2B,EAAE,CAAC;IAC9B,6CAA6C,EAAE,CAAC;AAClD,CAAC,CACF;KACA,MAAM,EAAE;KACR,iBAAiB,EAAE;KACnB,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;IACtB,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACjB,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.js
CHANGED
|
@@ -3,6 +3,7 @@ import { spawn } from "child_process";
|
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import path from "path";
|
|
5
5
|
// 어차피 sd-worker가 fork로 되어있어서 CPU 제한 안걸리는듯..
|
|
6
|
+
// tsx사용을 해야해서 fork말고 worker로는 동작 못시킴..
|
|
6
7
|
// ProcessorAffinity 마스크 계산
|
|
7
8
|
/*function calculateAffinityMask(cpuCount: number): string {
|
|
8
9
|
const exclude = cpuCount <= 1 ? 0 : Math.ceil(cpuCount / 12); // 12개당 1개씩 뺌
|
package/dist/sd-cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-cli.js","sourceRoot":"","sources":["../src/sd-cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,4CAA4C;
|
|
1
|
+
{"version":3,"file":"sd-cli.js","sourceRoot":"","sources":["../src/sd-cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,4CAA4C;AAC5C,uCAAuC;AAGvC,2BAA2B;AAC3B;;;;;;;;;;GAUG;AAEH,wCAAwC;AACxC;uDACuD;AAEvD,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,uBAAuB;IACvB;;;;;;;SAOK;IAEL,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC;AACxB,CAAC;KACI,CAAC;IACJ,eAAe;IACf,kBAAkB;IAClB,KAAK,CACH,MAAM,EACN;QACE,6CAA6C;QAC7C,aAAa,CAAC,OAAO,CAAC;QACtB,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;KACzB,EACD,EAAE,KAAK,EAAE,SAAS,EAAE,CACrB,CAAC;IAEF;;;;;;;;;SASK;AACP,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysm/sd-cli",
|
|
3
|
-
"version": "12.9.
|
|
3
|
+
"version": "12.9.37",
|
|
4
4
|
"description": "심플리즘 패키지 - CLI",
|
|
5
5
|
"author": "김석래",
|
|
6
6
|
"repository": {
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"@angular/compiler-cli": "^19.2.11",
|
|
18
18
|
"@anthropic-ai/sdk": "^0.51.0",
|
|
19
19
|
"@electron/rebuild": "^4.0.1",
|
|
20
|
-
"@simplysm/sd-core-common": "12.9.
|
|
21
|
-
"@simplysm/sd-core-node": "12.9.
|
|
22
|
-
"@simplysm/sd-service-server": "12.9.
|
|
23
|
-
"@simplysm/sd-storage": "12.9.
|
|
20
|
+
"@simplysm/sd-core-common": "12.9.37",
|
|
21
|
+
"@simplysm/sd-core-node": "12.9.37",
|
|
22
|
+
"@simplysm/sd-service-server": "12.9.37",
|
|
23
|
+
"@simplysm/sd-storage": "12.9.37",
|
|
24
24
|
"browserslist": "^4.24.5",
|
|
25
25
|
"cordova": "^12.0.0",
|
|
26
26
|
"css-has-pseudo": "^7.0.2",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import convertSymbols from "./core/convert-symbol";
|
|
3
|
+
|
|
4
|
+
export default function convertSdAngularSymbolNames() {
|
|
5
|
+
convertSymbols({
|
|
6
|
+
"@simplysm/sd-angular#useBgTheme": "@simplysm/sd-angular#setupBgTheme",
|
|
7
|
+
"@simplysm/sd-angular#canDeactivate": "@simplysm/sd-angular#setupCanDeactivate",
|
|
8
|
+
"@simplysm/sd-angular#useRipple": "@simplysm/sd-angular#setupRipple",
|
|
9
|
+
"@simplysm/sd-angular#useCumulateSelectedKeys": "@simplysm/sd-angular#setupCumulateSelectedKeys",
|
|
10
|
+
"@simplysm/sd-angular#injectQueryParamMap$": "@simplysm/sd-angular#useActivateRouteManager",
|
|
11
|
+
"@simplysm/sd-angular#ISdSheetColumnOrderingVM": "@simplysm/sd-angular#ISortingDef",
|
|
12
|
+
|
|
13
|
+
"@angular/core#signal": "@simplysm/sd-angular#$signal",
|
|
14
|
+
"@angular/core#computed": "@simplysm/sd-angular#$computed",
|
|
15
|
+
"@angular/core#effect": "@simplysm/sd-angular#$effect",
|
|
16
|
+
"@angular/core#afterRenderEffect": "@simplysm/sd-angular#$afterRenderEffect",
|
|
17
|
+
"@angular/core#afterRenderComputed": "@simplysm/sd-angular#$afterRenderComputed",
|
|
18
|
+
"@angular/core#resource": "@simplysm/sd-angular#$resource",
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
console.log("[완료] SdAngular 심볼 이름 변환 완료");
|
|
22
|
+
}
|
|
@@ -55,7 +55,7 @@ export default function convertSdSheetBindingsSafely() {
|
|
|
55
55
|
(match) =>
|
|
56
56
|
match
|
|
57
57
|
.replace(/\[disableOrdering\]/g, "[disableSorting]")
|
|
58
|
-
.replace(/\sdisableOrdering/g, "
|
|
58
|
+
.replace(/\sdisableOrdering/g, " disableSorting"),
|
|
59
59
|
);
|
|
60
60
|
|
|
61
61
|
if (rawTemplate !== newTemplate) {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import { SyntaxKind } from "ts-morph";
|
|
3
|
+
import getTsMortphSourceFiles from "./core/get-ts-morph-source-files";
|
|
4
|
+
|
|
5
|
+
export default function convertSetupCumulateSelectedKeysToObjectParam() {
|
|
6
|
+
const sourceFiles = getTsMortphSourceFiles();
|
|
7
|
+
|
|
8
|
+
for (const sourceFile of sourceFiles) {
|
|
9
|
+
let changed = false;
|
|
10
|
+
|
|
11
|
+
sourceFile.forEachDescendant((node) => {
|
|
12
|
+
if (node.getKind() !== SyntaxKind.CallExpression) return;
|
|
13
|
+
|
|
14
|
+
const callExpr = node.asKindOrThrow(SyntaxKind.CallExpression);
|
|
15
|
+
const exprText = callExpr.getExpression().getText();
|
|
16
|
+
|
|
17
|
+
if (exprText !== "setupCumulateSelectedKeys") return;
|
|
18
|
+
const args = callExpr.getArguments();
|
|
19
|
+
if (args.length !== 5) return;
|
|
20
|
+
|
|
21
|
+
const [items, selectMode, selectedItems, selectedItemIds, keySelectorFn] = args;
|
|
22
|
+
|
|
23
|
+
// 객체 리터럴 생성
|
|
24
|
+
const newArgText = `{
|
|
25
|
+
items: ${items.getText()},
|
|
26
|
+
selectMode: ${selectMode.getText()},
|
|
27
|
+
selectedItems: ${selectedItems.getText()},
|
|
28
|
+
selectedItemKeys: ${selectedItemIds.getText()},
|
|
29
|
+
keySelectorFn: ${keySelectorFn.getText()}
|
|
30
|
+
}`;
|
|
31
|
+
|
|
32
|
+
callExpr.replaceWithText(`setupCumulateSelectedKeys(${newArgText})`);
|
|
33
|
+
changed = true;
|
|
34
|
+
console.log(`[updated] ${sourceFile.getBaseName()} :: setupCumulateSelectedKeys 인자 구조 변경`);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
38
|
+
if (changed) {
|
|
39
|
+
sourceFile.saveSync();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
console.log("[완료] setupCumulateSelectedKeys → object parameter 구조 변환 완료");
|
|
44
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
/*import { Identifier, SyntaxKind } from "ts-morph";
|
|
3
|
+
import getTsMortphSourceFiles from "./get-ts-morph-source-files";
|
|
4
|
+
|
|
5
|
+
export default function convertSymbols(replacements: Record<string, Record<string, string | undefined> | undefined>) {
|
|
6
|
+
const sourceFiles = getTsMortphSourceFiles();
|
|
7
|
+
|
|
8
|
+
for (const sourceFile of sourceFiles) {
|
|
9
|
+
let changed = false;
|
|
10
|
+
|
|
11
|
+
// 1. 타입 참조 및 값 참조 치환
|
|
12
|
+
sourceFile.forEachDescendant((node) => {
|
|
13
|
+
if (node.getKind() !== SyntaxKind.Identifier) return;
|
|
14
|
+
if (node.getFirstAncestorByKind(SyntaxKind.ImportSpecifier)) return;
|
|
15
|
+
|
|
16
|
+
const identifier = node as Identifier;
|
|
17
|
+
const name = identifier.getText();
|
|
18
|
+
|
|
19
|
+
// 해당 이름이 어디서 import됐는지 확인
|
|
20
|
+
const symbol = identifier.getSymbol();
|
|
21
|
+
if (symbol == null) return;
|
|
22
|
+
|
|
23
|
+
const declarations = symbol.getDeclarations();
|
|
24
|
+
if (declarations.length === 0) return;
|
|
25
|
+
|
|
26
|
+
const importSpecifier = declarations[0].getFirstAncestorByKind(SyntaxKind.ImportDeclaration);
|
|
27
|
+
if (importSpecifier == null) return;
|
|
28
|
+
|
|
29
|
+
const importModule = importSpecifier.getModuleSpecifierValue();
|
|
30
|
+
const replacementRecord = replacements[importModule];
|
|
31
|
+
if (replacementRecord == null) return;
|
|
32
|
+
|
|
33
|
+
const newName = replacementRecord[name];
|
|
34
|
+
if (newName == null || newName === name) return;
|
|
35
|
+
|
|
36
|
+
identifier.replaceWithText(newName);
|
|
37
|
+
changed = true;
|
|
38
|
+
console.log(`[ref] ${sourceFile.getBaseName()} :: ${importModule} :: ${name} → ${newName}`);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// 2. import 교체
|
|
42
|
+
for (const importDecl of sourceFile.getImportDeclarations()) {
|
|
43
|
+
const specifier = importDecl.getModuleSpecifierValue();
|
|
44
|
+
const replacementRecord = replacements[specifier];
|
|
45
|
+
if (replacementRecord == null) continue;
|
|
46
|
+
|
|
47
|
+
const namedImports = importDecl.getNamedImports();
|
|
48
|
+
|
|
49
|
+
for (const ni of namedImports) {
|
|
50
|
+
const oldName = ni.getName();
|
|
51
|
+
const newName = replacementRecord[oldName];
|
|
52
|
+
if (newName == null) continue;
|
|
53
|
+
|
|
54
|
+
ni.remove();
|
|
55
|
+
importDecl.addNamedImport(newName);
|
|
56
|
+
changed = true;
|
|
57
|
+
console.log(`[import] ${sourceFile.getBaseName()} :: ${specifier} :: ${oldName} → ${newName}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (changed) {
|
|
62
|
+
sourceFile.saveSync();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}*/
|
|
66
|
+
|
|
67
|
+
import { Identifier, SyntaxKind } from "ts-morph";
|
|
68
|
+
import getTsMortphSourceFiles from "./get-ts-morph-source-files";
|
|
69
|
+
|
|
70
|
+
interface SymbolReplacement {
|
|
71
|
+
oldModule: string;
|
|
72
|
+
oldName: string;
|
|
73
|
+
newModule: string;
|
|
74
|
+
newName: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function parseReplacements(input: Record<string, string>): SymbolReplacement[] {
|
|
78
|
+
return Object.entries(input).map(([oldKey, newValue]) => {
|
|
79
|
+
const [oldModule, oldName] = oldKey.split("#");
|
|
80
|
+
const [newModule, newName] = newValue.split("#");
|
|
81
|
+
return { oldModule, oldName, newModule, newName };
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export default function convertSymbols(raw: Record<string, string>) {
|
|
86
|
+
const replacements = parseReplacements(raw);
|
|
87
|
+
const sourceFiles = getTsMortphSourceFiles();
|
|
88
|
+
|
|
89
|
+
for (const sourceFile of sourceFiles) {
|
|
90
|
+
let changed = false;
|
|
91
|
+
|
|
92
|
+
const usedReplacements = new Set<string>(); // 실제 사용된 newModule#newName 추적
|
|
93
|
+
const existingImportMap: Map<string, Set<string>> = new Map();
|
|
94
|
+
|
|
95
|
+
// 1. 참조 치환 (Identifier)
|
|
96
|
+
sourceFile.forEachDescendant((node) => {
|
|
97
|
+
if (node.getKind() !== SyntaxKind.Identifier) return;
|
|
98
|
+
if (node.getFirstAncestorByKind(SyntaxKind.ImportSpecifier)) return;
|
|
99
|
+
|
|
100
|
+
const identifier = node as Identifier;
|
|
101
|
+
const name = identifier.getText();
|
|
102
|
+
|
|
103
|
+
const symbol = identifier.getSymbol();
|
|
104
|
+
if (!symbol) return;
|
|
105
|
+
|
|
106
|
+
const declarations = symbol.getDeclarations();
|
|
107
|
+
if (declarations.length === 0) return;
|
|
108
|
+
|
|
109
|
+
const importDecl = declarations[0].getFirstAncestorByKind(SyntaxKind.ImportDeclaration);
|
|
110
|
+
if (!importDecl) return;
|
|
111
|
+
|
|
112
|
+
const importModule = importDecl.getModuleSpecifierValue();
|
|
113
|
+
|
|
114
|
+
const match = replacements.find(r => r.oldModule === importModule && r.oldName === name);
|
|
115
|
+
if (!match) return;
|
|
116
|
+
|
|
117
|
+
identifier.replaceWithText(match.newName);
|
|
118
|
+
usedReplacements.add(`${match.newModule}#${match.newName}`);
|
|
119
|
+
changed = true;
|
|
120
|
+
console.log(`[ref] ${sourceFile.getBaseName()} :: ${importModule} :: ${name} → ${match.newName}`);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
// 2. import 교체
|
|
124
|
+
for (const importDecl of sourceFile.getImportDeclarations()) {
|
|
125
|
+
const specifier = importDecl.getModuleSpecifierValue();
|
|
126
|
+
const namedImports = importDecl.getNamedImports();
|
|
127
|
+
|
|
128
|
+
for (const ni of namedImports) {
|
|
129
|
+
const oldName = ni.getName();
|
|
130
|
+
|
|
131
|
+
const match = replacements.find(r => r.oldModule === specifier && r.oldName === oldName);
|
|
132
|
+
if (match) {
|
|
133
|
+
ni.remove();
|
|
134
|
+
|
|
135
|
+
// 만약 모듈이 동일하다면 즉시 대체
|
|
136
|
+
if (match.oldModule === match.newModule) {
|
|
137
|
+
importDecl.addNamedImport(match.newName);
|
|
138
|
+
} else {
|
|
139
|
+
// 새로 import할 목록에 기록
|
|
140
|
+
usedReplacements.add(`${match.newModule}#${match.newName}`);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
changed = true;
|
|
144
|
+
console.log(`[import] ${sourceFile.getBaseName()} :: ${specifier} :: ${oldName} → ${match.newName}`);
|
|
145
|
+
} else {
|
|
146
|
+
// 기존 import 유지 기록
|
|
147
|
+
if (!existingImportMap.has(specifier)) {
|
|
148
|
+
existingImportMap.set(specifier, new Set());
|
|
149
|
+
}
|
|
150
|
+
existingImportMap.get(specifier)!.add(oldName);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// 3. 필요 시 새 import 추가
|
|
156
|
+
for (const key of usedReplacements) {
|
|
157
|
+
const [newModule, newName] = key.split("#");
|
|
158
|
+
|
|
159
|
+
const already = existingImportMap.get(newModule)?.has(newName);
|
|
160
|
+
const existsInFile = sourceFile.getImportDeclarations().some(decl =>
|
|
161
|
+
decl.getModuleSpecifierValue() === newModule &&
|
|
162
|
+
decl.getNamedImports().some(ni => ni.getName() === newName)
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
if (already || existsInFile) continue;
|
|
166
|
+
|
|
167
|
+
sourceFile.addImportDeclaration({
|
|
168
|
+
moduleSpecifier: newModule,
|
|
169
|
+
namedImports: [newName],
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
changed = true;
|
|
173
|
+
console.log(`[new-import] ${sourceFile.getBaseName()} :: ${newModule} :: ${newName}`);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (changed) {
|
|
177
|
+
sourceFile.saveSync();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
package/src/sd-cli-entry.ts
CHANGED
|
@@ -2,21 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
/* eslint-disable no-console */
|
|
4
4
|
|
|
5
|
-
import yargs from "yargs";
|
|
6
|
-
import { hideBin } from "yargs/helpers";
|
|
7
|
-
import { SdCliProject } from "./entry/sd-cli-project";
|
|
8
5
|
import { SdLogger, SdLoggerSeverity } from "@simplysm/sd-core-node";
|
|
9
6
|
import { EventEmitter } from "events";
|
|
7
|
+
import yargs from "yargs";
|
|
8
|
+
import { hideBin } from "yargs/helpers";
|
|
9
|
+
import { SdCliAiCommand } from "./entry/sd-cli-ai-command";
|
|
10
|
+
import { SdCliCordova } from "./entry/sd-cli-cordova";
|
|
10
11
|
import { SdCliElectron } from "./entry/sd-cli-electron";
|
|
11
12
|
import { SdCliLocalUpdate } from "./entry/sd-cli-local-update";
|
|
12
|
-
import { SdCliCordova } from "./entry/sd-cli-cordova";
|
|
13
|
-
import { SdCliAiCommand } from "./entry/sd-cli-ai-command";
|
|
14
13
|
import { SdCliPostinstall } from "./entry/sd-cli-postinstall";
|
|
14
|
+
import { SdCliProject } from "./entry/sd-cli-project";
|
|
15
15
|
import convertEcmaPrivateToTsPrivate from "./fix/convert-ecma-private-to-ts-private";
|
|
16
|
-
import
|
|
16
|
+
import convertSdAngularSymbolNames from "./fix/convert-sd-angular-symbol-names";
|
|
17
17
|
import convertSdSheetBindingsInInlineTemplate
|
|
18
18
|
from "./fix/convert-sd-sheet-bindings-inInline-template";
|
|
19
|
-
import
|
|
19
|
+
import convertSetupCumulateSelectedKeysToObjectParam
|
|
20
|
+
from "./fix/convert-setup-cumulate-selected-keys-to-object-param";
|
|
21
|
+
import prefixUnderscoreForAccessModifiers from "./fix/prefix-underscore-for-access-modifiers";
|
|
20
22
|
|
|
21
23
|
Error.stackTraceLimit = Infinity;
|
|
22
24
|
EventEmitter.defaultMaxListeners = 0;
|
|
@@ -253,10 +255,19 @@ await yargs(hideBin(process.argv))
|
|
|
253
255
|
.hide("help")
|
|
254
256
|
.hide("debug"),
|
|
255
257
|
() => {
|
|
258
|
+
// GIT 사용중일 경우, 커밋되지 않은 수정사항이 있는지 확인
|
|
259
|
+
/*if (FsUtils.exists(path.resolve(process.cwd(), ".git"))) {
|
|
260
|
+
const gitStatusResult = await SdProcess.spawnAsync("git status");
|
|
261
|
+
if (gitStatusResult.includes("Changes") || gitStatusResult.includes("Untracked")) {
|
|
262
|
+
throw new Error("커밋되지 않은 정보가 있습니다. FIX오류시 롤백이 불가능하므로, 미리 커밋을 해놔야 합니다.\n" + gitStatusResult);
|
|
263
|
+
}
|
|
264
|
+
}*/
|
|
265
|
+
|
|
256
266
|
convertEcmaPrivateToTsPrivate();
|
|
257
267
|
prefixUnderscoreForAccessModifiers();
|
|
258
268
|
convertSdSheetBindingsInInlineTemplate();
|
|
259
|
-
|
|
269
|
+
convertSdAngularSymbolNames();
|
|
270
|
+
convertSetupCumulateSelectedKeysToObjectParam();
|
|
260
271
|
},
|
|
261
272
|
)
|
|
262
273
|
.strict()
|
package/src/sd-cli.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function convertOrderingInterface(): void;
|
|
@@ -1,46 +0,0 @@
|
|
|
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 convertOrderingInterface() {
|
|
5
|
-
const sourceFiles = getTsMortphSourceFiles();
|
|
6
|
-
for (const sourceFile of sourceFiles) {
|
|
7
|
-
let changed = false;
|
|
8
|
-
// 1. import 교체
|
|
9
|
-
for (const importDecl of sourceFile.getImportDeclarations()) {
|
|
10
|
-
if (importDecl.getModuleSpecifierValue() !== "@simplysm/sd-angular")
|
|
11
|
-
continue;
|
|
12
|
-
const namedImports = importDecl.getNamedImports();
|
|
13
|
-
let hasOld = false;
|
|
14
|
-
let hasNew = false;
|
|
15
|
-
for (const ni of namedImports) {
|
|
16
|
-
const name = ni.getName();
|
|
17
|
-
if (name === "ISdSheetColumnOrderingVM") {
|
|
18
|
-
ni.remove(); // ← ✅ 이 방식으로 제거
|
|
19
|
-
hasOld = true;
|
|
20
|
-
}
|
|
21
|
-
if (name === "ISortingDef") {
|
|
22
|
-
hasNew = true;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (hasOld && !hasNew) {
|
|
26
|
-
importDecl.addNamedImport("ISortingDef");
|
|
27
|
-
changed = true;
|
|
28
|
-
console.log(`[import-updated] ${sourceFile.getBaseName()} :: import 교체 완료`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
// 2. 타입 참조 교체
|
|
32
|
-
sourceFile.forEachDescendant((node) => {
|
|
33
|
-
if (node.getKind() === SyntaxKind.TypeReference &&
|
|
34
|
-
node.getText() === "ISdSheetColumnOrderingVM") {
|
|
35
|
-
node.replaceWithText("ISortingDef");
|
|
36
|
-
changed = true;
|
|
37
|
-
console.log(`[type-replaced] ${sourceFile.getBaseName()} :: 타입 참조 변경`);
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
if (changed) {
|
|
41
|
-
sourceFile.saveSync();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
console.log("[완료] ISdSheetColumnOrderingVM → ISortingDef 변환 완료");
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=convert-ordering-interface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convert-ordering-interface.js","sourceRoot":"","sources":["../../src/fix/convert-ordering-interface.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,wBAAwB;IAC9C,MAAM,WAAW,GAAG,sBAAsB,EAAE,CAAC;IAE7C,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACrC,IAAI,OAAO,GAAG,KAAK,CAAC;QAEpB,eAAe;QACf,KAAK,MAAM,UAAU,IAAI,UAAU,CAAC,qBAAqB,EAAE,EAAE,CAAC;YAC5D,IAAI,UAAU,CAAC,uBAAuB,EAAE,KAAK,sBAAsB;gBAAE,SAAS;YAE9E,MAAM,YAAY,GAAG,UAAU,CAAC,eAAe,EAAE,CAAC;YAElD,IAAI,MAAM,GAAG,KAAK,CAAC;YACnB,IAAI,MAAM,GAAG,KAAK,CAAC;YAEnB,KAAK,MAAM,EAAE,IAAI,YAAY,EAAE,CAAC;gBAC9B,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;gBAC1B,IAAI,IAAI,KAAK,0BAA0B,EAAE,CAAC;oBACxC,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,gBAAgB;oBAC7B,MAAM,GAAG,IAAI,CAAC;gBAChB,CAAC;gBACD,IAAI,IAAI,KAAK,aAAa,EAAE,CAAC;oBAC3B,MAAM,GAAG,IAAI,CAAC;gBAChB,CAAC;YACH,CAAC;YAED,IAAI,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;gBACtB,UAAU,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;gBACzC,OAAO,GAAG,IAAI,CAAC;gBACf,OAAO,CAAC,GAAG,CAAC,oBAAoB,UAAU,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;YAC9E,CAAC;QACH,CAAC;QAED,cAAc;QACd,UAAU,CAAC,iBAAiB,CAAC,CAAC,IAAI,EAAE,EAAE;YACpC,IACE,IAAI,CAAC,OAAO,EAAE,KAAK,UAAU,CAAC,aAAa;gBAC3C,IAAI,CAAC,OAAO,EAAE,KAAK,0BAA0B,EAC7C,CAAC;gBACD,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;gBACpC,OAAO,GAAG,IAAI,CAAC;gBACf,OAAO,CAAC,GAAG,CAAC,mBAAmB,UAAU,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;YACzE,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,IAAI,OAAO,EAAE,CAAC;YACZ,UAAU,CAAC,QAAQ,EAAE,CAAC;QACxB,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,mDAAmD,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
|
-
import { SyntaxKind } from "ts-morph";
|
|
3
|
-
import getTsMortphSourceFiles from "./core/get-ts-morph-source-files";
|
|
4
|
-
|
|
5
|
-
export default function convertOrderingInterface() {
|
|
6
|
-
const sourceFiles = getTsMortphSourceFiles();
|
|
7
|
-
|
|
8
|
-
for (const sourceFile of sourceFiles) {
|
|
9
|
-
let changed = false;
|
|
10
|
-
|
|
11
|
-
// 1. import 교체
|
|
12
|
-
for (const importDecl of sourceFile.getImportDeclarations()) {
|
|
13
|
-
if (importDecl.getModuleSpecifierValue() !== "@simplysm/sd-angular") continue;
|
|
14
|
-
|
|
15
|
-
const namedImports = importDecl.getNamedImports();
|
|
16
|
-
|
|
17
|
-
let hasOld = false;
|
|
18
|
-
let hasNew = false;
|
|
19
|
-
|
|
20
|
-
for (const ni of namedImports) {
|
|
21
|
-
const name = ni.getName();
|
|
22
|
-
if (name === "ISdSheetColumnOrderingVM") {
|
|
23
|
-
ni.remove(); // ← ✅ 이 방식으로 제거
|
|
24
|
-
hasOld = true;
|
|
25
|
-
}
|
|
26
|
-
if (name === "ISortingDef") {
|
|
27
|
-
hasNew = true;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (hasOld && !hasNew) {
|
|
32
|
-
importDecl.addNamedImport("ISortingDef");
|
|
33
|
-
changed = true;
|
|
34
|
-
console.log(`[import-updated] ${sourceFile.getBaseName()} :: import 교체 완료`);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// 2. 타입 참조 교체
|
|
39
|
-
sourceFile.forEachDescendant((node) => {
|
|
40
|
-
if (
|
|
41
|
-
node.getKind() === SyntaxKind.TypeReference &&
|
|
42
|
-
node.getText() === "ISdSheetColumnOrderingVM"
|
|
43
|
-
) {
|
|
44
|
-
node.replaceWithText("ISortingDef");
|
|
45
|
-
changed = true;
|
|
46
|
-
console.log(`[type-replaced] ${sourceFile.getBaseName()} :: 타입 참조 변경`);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
if (changed) {
|
|
51
|
-
sourceFile.saveSync();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
console.log("[완료] ISdSheetColumnOrderingVM → ISortingDef 변환 완료");
|
|
56
|
-
}
|