@simplysm/sd-cli 13.0.72 → 13.0.75
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/README.md +62 -14
- package/dist/commands/publish.js +1 -1
- package/dist/commands/publish.js.map +1 -1
- package/package.json +4 -4
- package/src/commands/publish.ts +1 -1
- package/src/utils/replace-deps.ts +361 -361
- package/src/utils/sd-config.ts +44 -44
- package/src/utils/tailwind-config-deps.ts +98 -98
- package/src/utils/template.ts +56 -56
- package/src/utils/tsconfig.ts +127 -127
- package/src/utils/typecheck-serialization.ts +86 -86
- package/templates/init/package.json.hbs +2 -2
- package/templates/init/packages/client-admin/package.json.hbs +5 -5
- package/templates/init/packages/client-admin/src/views/home/base/employee/EmployeeSheet.tsx.hbs +3 -3
- package/templates/init/packages/client-admin/src/views/home/base/role-permission/RoleSheet.tsx.hbs +3 -3
- package/templates/init/packages/db-main/package.json.hbs +2 -2
- package/templates/init/packages/server/package.json.hbs +4 -4
- package/templates/init/tests/e2e/package.json.hbs +1 -1
- package/templates/init/tests/e2e/src/employee-crud.ts +3 -3
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import { fsExistsSync, fsReadSync } from "@simplysm/core-node";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Serialized Diagnostic that can be passed to Worker
|
|
6
|
-
*/
|
|
7
|
-
export interface SerializedDiagnostic {
|
|
8
|
-
category: number;
|
|
9
|
-
code: number;
|
|
10
|
-
messageText: string;
|
|
11
|
-
file?: {
|
|
12
|
-
fileName: string;
|
|
13
|
-
};
|
|
14
|
-
start?: number;
|
|
15
|
-
length?: number;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Convert Diagnostic to serializable form
|
|
20
|
-
* (remove circular references/functions for structured clone communication between Worker threads)
|
|
21
|
-
*/
|
|
22
|
-
export function serializeDiagnostic(diagnostic: ts.Diagnostic): SerializedDiagnostic {
|
|
23
|
-
// If DiagnosticMessageChain, flatten entire chain to preserve all context info
|
|
24
|
-
const messageText = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
|
|
25
|
-
|
|
26
|
-
return {
|
|
27
|
-
category: diagnostic.category,
|
|
28
|
-
code: diagnostic.code,
|
|
29
|
-
messageText,
|
|
30
|
-
file: diagnostic.file
|
|
31
|
-
? {
|
|
32
|
-
fileName: diagnostic.file.fileName,
|
|
33
|
-
}
|
|
34
|
-
: undefined,
|
|
35
|
-
start: diagnostic.start,
|
|
36
|
-
length: diagnostic.length,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Determine TypeScript ScriptKind from filename
|
|
42
|
-
*/
|
|
43
|
-
function getScriptKind(fileName: string): ts.ScriptKind {
|
|
44
|
-
if (fileName.endsWith(".tsx")) return ts.ScriptKind.TSX;
|
|
45
|
-
if (fileName.endsWith(".jsx")) return ts.ScriptKind.JSX;
|
|
46
|
-
if (fileName.endsWith(".js") || fileName.endsWith(".mjs") || fileName.endsWith(".cjs"))
|
|
47
|
-
return ts.ScriptKind.JS;
|
|
48
|
-
return ts.ScriptKind.TS;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Restore SerializedDiagnostic to ts.Diagnostic
|
|
53
|
-
* Reads actual file contents so source code context is displayed in formatDiagnosticsWithColorAndContext
|
|
54
|
-
* @param serialized - Serialized diagnostic information
|
|
55
|
-
* @param fileCache - File content cache (prevent duplicate reads of same file)
|
|
56
|
-
* @returns Restored ts.Diagnostic object
|
|
57
|
-
*/
|
|
58
|
-
export function deserializeDiagnostic(
|
|
59
|
-
serialized: SerializedDiagnostic,
|
|
60
|
-
fileCache: Map<string, string>,
|
|
61
|
-
): ts.Diagnostic {
|
|
62
|
-
let file: ts.SourceFile | undefined;
|
|
63
|
-
if (serialized.file != null) {
|
|
64
|
-
const fileName = serialized.file.fileName;
|
|
65
|
-
|
|
66
|
-
// Get cached file content (read and cache if not present)
|
|
67
|
-
// If file was deleted or inaccessible, treat as empty content
|
|
68
|
-
// (source code context won't be displayed but diagnostic message is shown normally)
|
|
69
|
-
if (!fileCache.has(fileName)) {
|
|
70
|
-
fileCache.set(fileName, fsExistsSync(fileName) ? fsReadSync(fileName) : "");
|
|
71
|
-
}
|
|
72
|
-
const content = fileCache.get(fileName)!;
|
|
73
|
-
|
|
74
|
-
const scriptKind = getScriptKind(fileName);
|
|
75
|
-
file = ts.createSourceFile(fileName, content, ts.ScriptTarget.Latest, false, scriptKind);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return {
|
|
79
|
-
category: serialized.category,
|
|
80
|
-
code: serialized.code,
|
|
81
|
-
messageText: serialized.messageText,
|
|
82
|
-
file,
|
|
83
|
-
start: serialized.start,
|
|
84
|
-
length: serialized.length,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { fsExistsSync, fsReadSync } from "@simplysm/core-node";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Serialized Diagnostic that can be passed to Worker
|
|
6
|
+
*/
|
|
7
|
+
export interface SerializedDiagnostic {
|
|
8
|
+
category: number;
|
|
9
|
+
code: number;
|
|
10
|
+
messageText: string;
|
|
11
|
+
file?: {
|
|
12
|
+
fileName: string;
|
|
13
|
+
};
|
|
14
|
+
start?: number;
|
|
15
|
+
length?: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Convert Diagnostic to serializable form
|
|
20
|
+
* (remove circular references/functions for structured clone communication between Worker threads)
|
|
21
|
+
*/
|
|
22
|
+
export function serializeDiagnostic(diagnostic: ts.Diagnostic): SerializedDiagnostic {
|
|
23
|
+
// If DiagnosticMessageChain, flatten entire chain to preserve all context info
|
|
24
|
+
const messageText = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
category: diagnostic.category,
|
|
28
|
+
code: diagnostic.code,
|
|
29
|
+
messageText,
|
|
30
|
+
file: diagnostic.file
|
|
31
|
+
? {
|
|
32
|
+
fileName: diagnostic.file.fileName,
|
|
33
|
+
}
|
|
34
|
+
: undefined,
|
|
35
|
+
start: diagnostic.start,
|
|
36
|
+
length: diagnostic.length,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Determine TypeScript ScriptKind from filename
|
|
42
|
+
*/
|
|
43
|
+
function getScriptKind(fileName: string): ts.ScriptKind {
|
|
44
|
+
if (fileName.endsWith(".tsx")) return ts.ScriptKind.TSX;
|
|
45
|
+
if (fileName.endsWith(".jsx")) return ts.ScriptKind.JSX;
|
|
46
|
+
if (fileName.endsWith(".js") || fileName.endsWith(".mjs") || fileName.endsWith(".cjs"))
|
|
47
|
+
return ts.ScriptKind.JS;
|
|
48
|
+
return ts.ScriptKind.TS;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Restore SerializedDiagnostic to ts.Diagnostic
|
|
53
|
+
* Reads actual file contents so source code context is displayed in formatDiagnosticsWithColorAndContext
|
|
54
|
+
* @param serialized - Serialized diagnostic information
|
|
55
|
+
* @param fileCache - File content cache (prevent duplicate reads of same file)
|
|
56
|
+
* @returns Restored ts.Diagnostic object
|
|
57
|
+
*/
|
|
58
|
+
export function deserializeDiagnostic(
|
|
59
|
+
serialized: SerializedDiagnostic,
|
|
60
|
+
fileCache: Map<string, string>,
|
|
61
|
+
): ts.Diagnostic {
|
|
62
|
+
let file: ts.SourceFile | undefined;
|
|
63
|
+
if (serialized.file != null) {
|
|
64
|
+
const fileName = serialized.file.fileName;
|
|
65
|
+
|
|
66
|
+
// Get cached file content (read and cache if not present)
|
|
67
|
+
// If file was deleted or inaccessible, treat as empty content
|
|
68
|
+
// (source code context won't be displayed but diagnostic message is shown normally)
|
|
69
|
+
if (!fileCache.has(fileName)) {
|
|
70
|
+
fileCache.set(fileName, fsExistsSync(fileName) ? fsReadSync(fileName) : "");
|
|
71
|
+
}
|
|
72
|
+
const content = fileCache.get(fileName)!;
|
|
73
|
+
|
|
74
|
+
const scriptKind = getScriptKind(fileName);
|
|
75
|
+
file = ts.createSourceFile(fileName, content, ts.ScriptTarget.Latest, false, scriptKind);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
category: serialized.category,
|
|
80
|
+
code: serialized.code,
|
|
81
|
+
messageText: serialized.messageText,
|
|
82
|
+
file,
|
|
83
|
+
start: serialized.start,
|
|
84
|
+
length: serialized.length,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"vitest": "vitest"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@simplysm/lint": "~13.0.
|
|
21
|
-
"@simplysm/sd-cli": "~13.0.
|
|
20
|
+
"@simplysm/lint": "~13.0.75",
|
|
21
|
+
"@simplysm/sd-cli": "~13.0.75",
|
|
22
22
|
"@types/node": "^20.19.35",
|
|
23
23
|
"eslint": "^9.39.3",
|
|
24
24
|
"prettier": "^3.8.1",
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"private": true,
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@{{projectName}}/db-main": "workspace:*",
|
|
9
|
-
"@simplysm/core-browser": "~13.0.
|
|
10
|
-
"@simplysm/core-common": "~13.0.
|
|
9
|
+
"@simplysm/core-browser": "~13.0.75",
|
|
10
|
+
"@simplysm/core-common": "~13.0.75",
|
|
11
11
|
"@simplysm/excel": "^13.0.71",
|
|
12
|
-
"@simplysm/orm-common": "~13.0.
|
|
13
|
-
"@simplysm/service-client": "~13.0.
|
|
14
|
-
"@simplysm/solid": "~13.0.
|
|
12
|
+
"@simplysm/orm-common": "~13.0.75",
|
|
13
|
+
"@simplysm/service-client": "~13.0.75",
|
|
14
|
+
"@simplysm/solid": "~13.0.75",
|
|
15
15
|
"@solid-primitives/event-listener": "^2.4.5",
|
|
16
16
|
"@solidjs/router": "^0.15.4",
|
|
17
17
|
"@tabler/icons-solidjs": "^3.37.1",
|
package/templates/init/packages/client-admin/src/views/home/base/employee/EmployeeSheet.tsx.hbs
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
CrudSheet,
|
|
5
5
|
type ExcelConfig,
|
|
6
6
|
FormGroup,
|
|
7
|
-
type
|
|
7
|
+
type DialogEditConfig,
|
|
8
8
|
type SortingDef,
|
|
9
9
|
TextInput,
|
|
10
10
|
useDialog,
|
|
@@ -73,7 +73,7 @@ export function EmployeeSheet() {
|
|
|
73
73
|
const { perms } = useAppStructure();
|
|
74
74
|
const employeePerms = perms.home.base.employee;
|
|
75
75
|
|
|
76
|
-
const
|
|
76
|
+
const dialogEdit: DialogEditConfig<SheetItem> = {
|
|
77
77
|
editItem: (item) =>
|
|
78
78
|
dialog.show(() => <EmployeeDetail itemId={item?.id} />, {
|
|
79
79
|
header: item ? "직원 수정" : "직원 등록",
|
|
@@ -169,7 +169,7 @@ export function EmployeeSheet() {
|
|
|
169
169
|
persistKey="employee-page"
|
|
170
170
|
editable={employeePerms.edit}
|
|
171
171
|
filterInitial=\{{ isIncludeLeft: false, isIncludeDeleted: false } as Filter}
|
|
172
|
-
|
|
172
|
+
dialogEdit={dialogEdit}
|
|
173
173
|
excel={excel}
|
|
174
174
|
lastModifiedAtProp="lastDataLog.dateTime"
|
|
175
175
|
lastModifiedByProp="lastDataLog.employeeName"
|
package/templates/init/packages/client-admin/src/views/home/base/role-permission/RoleSheet.tsx.hbs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Checkbox,
|
|
3
3
|
CrudSheet,
|
|
4
|
-
type
|
|
4
|
+
type DialogEditConfig,
|
|
5
5
|
type SortingDef,
|
|
6
6
|
TextInput,
|
|
7
7
|
useDialog,
|
|
@@ -34,7 +34,7 @@ export function RoleSheet() {
|
|
|
34
34
|
|
|
35
35
|
const rolePerms = appStructure.perms.home.base["role-permission"];
|
|
36
36
|
|
|
37
|
-
const
|
|
37
|
+
const dialogEdit: DialogEditConfig<SheetItem> = {
|
|
38
38
|
editItem: (item) =>
|
|
39
39
|
dialog.show(() => <RoleDetail itemId={item?.id} />, {
|
|
40
40
|
header: item ? "권한그룹 수정" : "권한그룹 등록",
|
|
@@ -90,7 +90,7 @@ export function RoleSheet() {
|
|
|
90
90
|
persistKey="role-sheet-page"
|
|
91
91
|
editable={rolePerms.edit}
|
|
92
92
|
filterInitial=\{{ isIncludeDeleted: false } as Filter}
|
|
93
|
-
|
|
93
|
+
dialogEdit={dialogEdit}
|
|
94
94
|
>
|
|
95
95
|
<CrudSheet.Filter<Filter>>
|
|
96
96
|
{(filter, setFilter) => (
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"private": true,
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@{{projectName}}/db-main": "workspace:*",
|
|
8
|
-
"@simplysm/core-common": "~13.0.
|
|
8
|
+
"@simplysm/core-common": "~13.0.75",
|
|
9
9
|
"@simplysm/excel": "^13.0.71",
|
|
10
|
-
"@simplysm/orm-common": "~13.0.
|
|
11
|
-
"@simplysm/orm-node": "~13.0.
|
|
12
|
-
"@simplysm/service-server": "~13.0.
|
|
10
|
+
"@simplysm/orm-common": "~13.0.75",
|
|
11
|
+
"@simplysm/orm-node": "~13.0.75",
|
|
12
|
+
"@simplysm/service-server": "~13.0.75",
|
|
13
13
|
"bcrypt": "^6.0.0",
|
|
14
14
|
"pg": "^8.19.0",
|
|
15
15
|
"pg-copy-streams": "^7.0.0"
|
|
@@ -10,7 +10,7 @@ export function employeeCrudTests(ctx: { page: Page; baseUrl: string }) {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
function dialogLocator() {
|
|
13
|
-
return ctx.page.locator("[data-
|
|
13
|
+
return ctx.page.locator("[data-dialog-panel]").last();
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
async function waitForSheetLoaded() {
|
|
@@ -25,8 +25,8 @@ export function employeeCrudTests(ctx: { page: Page; baseUrl: string }) {
|
|
|
25
25
|
async function waitForDialogClosed() {
|
|
26
26
|
await ctx.page.waitForFunction(
|
|
27
27
|
() =>
|
|
28
|
-
document.querySelectorAll("[data-
|
|
29
|
-
document.querySelectorAll("[data-
|
|
28
|
+
document.querySelectorAll("[data-dialog-panel]").length === 0 &&
|
|
29
|
+
document.querySelectorAll("[data-dialog-backdrop]").length === 0,
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
|