@simplysm/sd-cli 12.9.40 → 12.9.42
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.
|
@@ -1,68 +1,3 @@
|
|
|
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
1
|
import { SyntaxKind } from "ts-morph";
|
|
67
2
|
import getTsMortphSourceFiles from "./get-ts-morph-source-files";
|
|
68
3
|
function parseReplacements(input) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-symbol.js","sourceRoot":"","sources":["../../../src/fix/core/convert-symbol.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"convert-symbol.js","sourceRoot":"","sources":["../../../src/fix/core/convert-symbol.ts"],"names":[],"mappings":"AAAA,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,QAA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O,CAAC,CAC5D,CAAC;YAEF,IAAI,OAAO,IAAI,YAAY;gBAAE,SAAS;YAEtC,UAAU,CAAC,oBAAoB,CAAC;gBAC9B,eAAe,EAAE,SAAS;gBAC1B,YAAY,EAAE,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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysm/sd-cli",
|
|
3
|
-
"version": "12.9.
|
|
3
|
+
"version": "12.9.42",
|
|
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.42",
|
|
21
|
+
"@simplysm/sd-core-node": "12.9.42",
|
|
22
|
+
"@simplysm/sd-service-server": "12.9.42",
|
|
23
|
+
"@simplysm/sd-storage": "12.9.42",
|
|
24
24
|
"browserslist": "^4.24.5",
|
|
25
25
|
"cordova": "^12.0.0",
|
|
26
26
|
"css-has-pseudo": "^7.0.2",
|
|
@@ -1,69 +1,3 @@
|
|
|
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
1
|
import { Identifier, SyntaxKind } from "ts-morph";
|
|
68
2
|
import getTsMortphSourceFiles from "./get-ts-morph-source-files";
|
|
69
3
|
|