@simplysm/sd-cli 13.0.71 → 13.0.74
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/init.d.ts +4 -5
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +26 -8
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/publish.js +1 -1
- package/dist/commands/publish.js.map +1 -1
- package/dist/sd-cli-entry.d.ts.map +1 -1
- package/dist/sd-cli-entry.js +0 -20
- package/dist/sd-cli-entry.js.map +1 -1
- package/package.json +4 -4
- package/src/commands/init.ts +40 -21
- package/src/commands/publish.ts +1 -1
- package/src/sd-cli-entry.ts +0 -24
- 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/{.prettierrc.yaml.hbs → .prettierrc.yaml} +1 -1
- package/templates/init/eslint.config.ts +15 -0
- package/templates/init/mise.toml +3 -0
- package/templates/init/package.json.hbs +8 -7
- package/templates/init/packages/client-admin/index.html.hbs +144 -0
- package/templates/init/packages/client-admin/package.json.hbs +26 -0
- package/templates/init/packages/client-admin/public/assets/logo-landscape.png +0 -0
- package/templates/init/packages/client-admin/public/assets/logo.png +0 -0
- package/templates/init/packages/client-admin/src/App.tsx +42 -0
- package/templates/init/packages/client-admin/src/dev/DevDialog.tsx +34 -0
- package/templates/{add-client/__CLIENT__/src/main.css.hbs → init/packages/client-admin/src/main.css} +1 -1
- package/templates/init/packages/client-admin/src/main.tsx.hbs +146 -0
- package/templates/init/packages/client-admin/src/providers/AppServiceProvider.tsx.hbs +103 -0
- package/templates/init/packages/client-admin/src/providers/AppStructureProvider.tsx +84 -0
- package/templates/init/packages/client-admin/src/providers/AuthProvider.tsx.hbs +71 -0
- package/templates/init/packages/client-admin/src/providers/configureSharedData.ts.hbs +67 -0
- package/templates/init/packages/client-admin/src/views/auth/LoginView.tsx +132 -0
- package/templates/init/packages/client-admin/src/views/home/HomeView.tsx +108 -0
- package/templates/init/packages/client-admin/src/views/home/base/employee/EmployeeDetail.tsx.hbs +262 -0
- package/templates/init/packages/client-admin/src/views/home/base/employee/EmployeeSheet.tsx.hbs +271 -0
- package/templates/init/packages/client-admin/src/views/home/base/role-permission/RoleDetail.tsx.hbs +154 -0
- package/templates/init/packages/client-admin/src/views/home/base/role-permission/RolePermissionDetail.tsx.hbs +123 -0
- package/templates/init/packages/client-admin/src/views/home/base/role-permission/RolePermissionView.tsx +52 -0
- package/templates/init/packages/client-admin/src/views/home/base/role-permission/RoleSheet.tsx.hbs +125 -0
- package/templates/init/packages/client-admin/src/views/home/main/MainView.tsx.hbs +13 -0
- package/templates/init/packages/client-admin/src/views/home/my-info/MyInfoDetail.tsx.hbs +248 -0
- package/templates/init/packages/client-admin/src/views/home/system/system-log/SystemLogSheet.tsx.hbs +169 -0
- package/templates/init/packages/client-admin/src/views/not-found/NotFoundView.tsx +15 -0
- package/templates/init/packages/client-admin/tailwind.config.ts +10 -0
- package/templates/init/packages/db-main/package.json.hbs +13 -0
- package/templates/init/packages/db-main/src/MainDbContext.ts +20 -0
- package/templates/init/packages/db-main/src/dataLogExt.ts +127 -0
- package/templates/init/packages/db-main/src/index.ts +10 -0
- package/templates/init/packages/db-main/src/tables/Employee.ts +24 -0
- package/templates/init/packages/db-main/src/tables/EmployeeConfig.ts +13 -0
- package/templates/init/packages/db-main/src/tables/Role.ts +9 -0
- package/templates/init/packages/db-main/src/tables/RolePermission.ts +13 -0
- package/templates/init/packages/db-main/src/tables/_DataLog.ts +19 -0
- package/templates/init/packages/db-main/src/tables/_Log.ts +16 -0
- package/templates/init/packages/server/package.json.hbs +20 -0
- package/templates/init/packages/server/public-dev/dev//354/264/210/352/270/260/355/231/224.xlsx +0 -0
- package/templates/init/packages/server/src/index.ts +4 -0
- package/templates/init/packages/server/src/main.ts.hbs +34 -0
- package/templates/init/packages/server/src/services/AuthService.ts.hbs +171 -0
- package/templates/init/packages/server/src/services/DevService.ts.hbs +94 -0
- package/templates/init/packages/server/src/services/EmployeeService.ts.hbs +122 -0
- package/templates/init/packages/server/src/services/RoleService.ts.hbs +59 -0
- package/templates/init/{pnpm-workspace.yaml.hbs → pnpm-workspace.yaml} +3 -1
- package/templates/init/sd.config.ts.hbs +30 -1
- package/templates/init/tests/e2e/package.json.hbs +16 -0
- package/templates/init/tests/e2e/src/e2e.spec.ts +36 -0
- package/templates/init/tests/e2e/src/employee-crud.ts +204 -0
- package/templates/init/tests/e2e/src/login.ts +61 -0
- package/templates/init/tests/e2e/vitest.setup.ts.hbs +220 -0
- package/templates/init/tsconfig.json.hbs +0 -11
- package/templates/init/{vitest.config.ts.hbs → vitest.config.ts} +16 -12
- package/dist/commands/add-client.d.ts +0 -18
- package/dist/commands/add-client.d.ts.map +0 -1
- package/dist/commands/add-client.js +0 -79
- package/dist/commands/add-client.js.map +0 -6
- package/dist/commands/add-server.d.ts +0 -18
- package/dist/commands/add-server.d.ts.map +0 -1
- package/dist/commands/add-server.js +0 -83
- package/dist/commands/add-server.js.map +0 -6
- package/dist/utils/config-editor.d.ts +0 -17
- package/dist/utils/config-editor.d.ts.map +0 -1
- package/dist/utils/config-editor.js +0 -79
- package/dist/utils/config-editor.js.map +0 -6
- package/src/commands/add-client.ts +0 -126
- package/src/commands/add-server.ts +0 -138
- package/src/utils/config-editor.ts +0 -141
- package/templates/add-client/__CLIENT__/index.html.hbs +0 -13
- package/templates/add-client/__CLIENT__/package.json.hbs +0 -16
- package/templates/add-client/__CLIENT__/src/App.tsx.hbs +0 -65
- package/templates/add-client/__CLIENT__/src/appStructure.ts.hbs +0 -20
- package/templates/add-client/__CLIENT__/src/main.tsx.hbs +0 -24
- package/templates/add-client/__CLIENT__/src/pages/HomePage.tsx.hbs +0 -9
- package/templates/add-client/__CLIENT__/tailwind.config.ts.hbs +0 -15
- package/templates/add-server/__SERVER__/package.json.hbs +0 -10
- package/templates/add-server/__SERVER__/src/main.ts.hbs +0 -14
- package/templates/init/.gitignore.hbs +0 -26
- package/templates/init/.npmrc.hbs +0 -1
- package/templates/init/eslint.config.ts.hbs +0 -5
- package/templates/init/mise.toml.hbs +0 -3
- package/tests/config-editor.spec.ts +0 -160
- /package/templates/init/{.prettierignore.hbs → .prettierignore} +0 -0
- /package/templates/{add-client/__CLIENT__ → init/packages/client-admin}/public/favicon.ico +0 -0
- /package/templates/init/{stylelint.config.ts.hbs → stylelint.config.ts} +0 -0
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
{{#if router}}
|
|
2
|
-
import type { RouteSectionProps } from "@solidjs/router";
|
|
3
|
-
import {
|
|
4
|
-
BusyProvider,
|
|
5
|
-
ClipboardProvider,
|
|
6
|
-
ConfigProvider,
|
|
7
|
-
ErrorLoggerProvider,
|
|
8
|
-
NotificationBanner,
|
|
9
|
-
NotificationProvider,
|
|
10
|
-
PwaUpdateProvider,
|
|
11
|
-
ThemeProvider,
|
|
12
|
-
} from "@simplysm/solid";
|
|
13
|
-
|
|
14
|
-
export function App(props: RouteSectionProps) {
|
|
15
|
-
return (
|
|
16
|
-
<ConfigProvider clientName="{{clientName}}">
|
|
17
|
-
<NotificationProvider>
|
|
18
|
-
<NotificationBanner />
|
|
19
|
-
<ErrorLoggerProvider>
|
|
20
|
-
<PwaUpdateProvider>
|
|
21
|
-
<ClipboardProvider>
|
|
22
|
-
<ThemeProvider>
|
|
23
|
-
<BusyProvider>{props.children}</BusyProvider>
|
|
24
|
-
</ThemeProvider>
|
|
25
|
-
</ClipboardProvider>
|
|
26
|
-
</PwaUpdateProvider>
|
|
27
|
-
</ErrorLoggerProvider>
|
|
28
|
-
</NotificationProvider>
|
|
29
|
-
</ConfigProvider>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
{{else}}
|
|
33
|
-
import {
|
|
34
|
-
BusyProvider,
|
|
35
|
-
ClipboardProvider,
|
|
36
|
-
ConfigProvider,
|
|
37
|
-
ErrorLoggerProvider,
|
|
38
|
-
NotificationBanner,
|
|
39
|
-
NotificationProvider,
|
|
40
|
-
PwaUpdateProvider,
|
|
41
|
-
ThemeProvider,
|
|
42
|
-
} from "@simplysm/solid";
|
|
43
|
-
import { HomePage } from "./pages/HomePage";
|
|
44
|
-
|
|
45
|
-
export function App() {
|
|
46
|
-
return (
|
|
47
|
-
<ConfigProvider clientName="{{clientName}}">
|
|
48
|
-
<NotificationProvider>
|
|
49
|
-
<NotificationBanner />
|
|
50
|
-
<ErrorLoggerProvider>
|
|
51
|
-
<PwaUpdateProvider>
|
|
52
|
-
<ClipboardProvider>
|
|
53
|
-
<ThemeProvider>
|
|
54
|
-
<BusyProvider>
|
|
55
|
-
<HomePage />
|
|
56
|
-
</BusyProvider>
|
|
57
|
-
</ThemeProvider>
|
|
58
|
-
</ClipboardProvider>
|
|
59
|
-
</PwaUpdateProvider>
|
|
60
|
-
</ErrorLoggerProvider>
|
|
61
|
-
</NotificationProvider>
|
|
62
|
-
</ConfigProvider>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
{{/if}}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{{#if router}}
|
|
2
|
-
import { createAppStructure } from "@simplysm/solid";
|
|
3
|
-
import { HomePage } from "./pages/HomePage";
|
|
4
|
-
|
|
5
|
-
export const appStructure = createAppStructure({
|
|
6
|
-
items: [
|
|
7
|
-
{
|
|
8
|
-
code: "home",
|
|
9
|
-
title: "홈",
|
|
10
|
-
children: [
|
|
11
|
-
{
|
|
12
|
-
code: "main",
|
|
13
|
-
title: "메인",
|
|
14
|
-
component: HomePage,
|
|
15
|
-
},
|
|
16
|
-
],
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
});
|
|
20
|
-
{{/if}}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{{#if router}}
|
|
2
|
-
import { render } from "solid-js/web";
|
|
3
|
-
import { HashRouter, Route } from "@solidjs/router";
|
|
4
|
-
import { App } from "./App";
|
|
5
|
-
import { HomePage } from "./pages/HomePage";
|
|
6
|
-
import "./main.css";
|
|
7
|
-
|
|
8
|
-
render(
|
|
9
|
-
() => (
|
|
10
|
-
<HashRouter>
|
|
11
|
-
<Route path="/" component={App}>
|
|
12
|
-
<Route path="/" component={HomePage} />
|
|
13
|
-
</Route>
|
|
14
|
-
</HashRouter>
|
|
15
|
-
),
|
|
16
|
-
document.getElementById("root")!,
|
|
17
|
-
);
|
|
18
|
-
{{else}}
|
|
19
|
-
import { render } from "solid-js/web";
|
|
20
|
-
import { App } from "./App";
|
|
21
|
-
import "./main.css";
|
|
22
|
-
|
|
23
|
-
render(() => <App />, document.getElementById("root")!);
|
|
24
|
-
{{/if}}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import simplysmPreset from "@simplysm/solid/tailwind.config";
|
|
2
|
-
|
|
3
|
-
const __dirname = new URL(".", import.meta.url).pathname
|
|
4
|
-
.replace(/^\/[^/]+\/@fs/, "")
|
|
5
|
-
.replace(/index\.ts$/, "");
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
darkMode: "class",
|
|
9
|
-
presets: [simplysmPreset],
|
|
10
|
-
content: [
|
|
11
|
-
`${__dirname}index.html`,
|
|
12
|
-
`${__dirname}src/**/*.{ts,tsx}`,
|
|
13
|
-
...simplysmPreset.content,
|
|
14
|
-
],
|
|
15
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { env } from "@simplysm/core-common";
|
|
2
|
-
import { createServiceServer } from "@simplysm/service-server";
|
|
3
|
-
|
|
4
|
-
export const server = createServiceServer({
|
|
5
|
-
rootPath: process.cwd(),
|
|
6
|
-
port: {{port}},
|
|
7
|
-
services: [],
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
// 프로덕션 모드: 정적 파일 서빙 포함하여 직접 listen
|
|
11
|
-
// Watch 모드 (env.DEV): Server Runtime Worker가 proxy 설정 후 listen 호출
|
|
12
|
-
if (!env.DEV) {
|
|
13
|
-
await server.listen();
|
|
14
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
.tmp
|
|
2
|
-
.coverage
|
|
3
|
-
.worktrees
|
|
4
|
-
|
|
5
|
-
.cache
|
|
6
|
-
node_modules
|
|
7
|
-
packages/*/.*
|
|
8
|
-
packages/*/dist
|
|
9
|
-
*.~*
|
|
10
|
-
~*.*
|
|
11
|
-
|
|
12
|
-
# TypeScript 컴파일 결과물 (소스 디렉토리에서 제외)
|
|
13
|
-
packages/*/src/**/*.js
|
|
14
|
-
packages/*/src/**/*.js.map
|
|
15
|
-
packages/*/src/**/*.d.ts
|
|
16
|
-
packages/*/src/**/*.d.ts.map
|
|
17
|
-
|
|
18
|
-
packages/*/tests/**/*.js
|
|
19
|
-
packages/*/tests/**/*.js.map
|
|
20
|
-
packages/*/tests/**/*.d.ts
|
|
21
|
-
packages/*/tests/**/*.d.ts.map
|
|
22
|
-
|
|
23
|
-
tests/**/*.js
|
|
24
|
-
tests/**/*.js.map
|
|
25
|
-
tests/**/*.d.ts
|
|
26
|
-
tests/**/*.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
side-effects-cache=false
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import { describe, test, expect, beforeEach, afterEach } from "vitest";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import fs from "fs";
|
|
4
|
-
import os from "os";
|
|
5
|
-
import {
|
|
6
|
-
addPackageToSdConfig,
|
|
7
|
-
setClientServerInSdConfig,
|
|
8
|
-
addTailwindToEslintConfig,
|
|
9
|
-
} from "../src/utils/config-editor";
|
|
10
|
-
|
|
11
|
-
describe("config-editor", () => {
|
|
12
|
-
let tmpDir: string;
|
|
13
|
-
|
|
14
|
-
beforeEach(() => {
|
|
15
|
-
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "sd-cli-test-"));
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
afterEach(() => {
|
|
19
|
-
fs.rmSync(tmpDir, { recursive: true });
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
describe("addPackageToSdConfig", () => {
|
|
23
|
-
test("adds client package to empty packages object", () => {
|
|
24
|
-
const configPath = path.join(tmpDir, "sd.config.ts");
|
|
25
|
-
fs.writeFileSync(
|
|
26
|
-
configPath,
|
|
27
|
-
[
|
|
28
|
-
'import type { SdConfigFn } from "@simplysm/sd-cli";',
|
|
29
|
-
"",
|
|
30
|
-
"const config: SdConfigFn = () => ({",
|
|
31
|
-
" packages: {},",
|
|
32
|
-
"});",
|
|
33
|
-
"",
|
|
34
|
-
"export default config;",
|
|
35
|
-
].join("\n"),
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
addPackageToSdConfig(configPath, "client-web", { target: "client" });
|
|
39
|
-
|
|
40
|
-
const result = fs.readFileSync(configPath, "utf-8");
|
|
41
|
-
expect(result).toContain('"client-web"');
|
|
42
|
-
expect(result).toContain('"client"');
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
test("adds server package to existing packages", () => {
|
|
46
|
-
const configPath = path.join(tmpDir, "sd.config.ts");
|
|
47
|
-
fs.writeFileSync(
|
|
48
|
-
configPath,
|
|
49
|
-
[
|
|
50
|
-
'import type { SdConfigFn } from "@simplysm/sd-cli";',
|
|
51
|
-
"",
|
|
52
|
-
"const config: SdConfigFn = () => ({",
|
|
53
|
-
" packages: {",
|
|
54
|
-
' "client-web": { target: "client" },',
|
|
55
|
-
" },",
|
|
56
|
-
"});",
|
|
57
|
-
"",
|
|
58
|
-
"export default config;",
|
|
59
|
-
].join("\n"),
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
addPackageToSdConfig(configPath, "server", { target: "server" });
|
|
63
|
-
|
|
64
|
-
const result = fs.readFileSync(configPath, "utf-8");
|
|
65
|
-
expect(result).toContain('"client-web"');
|
|
66
|
-
expect(result).toContain('"server"');
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
test("returns false if package already exists", () => {
|
|
70
|
-
const configPath = path.join(tmpDir, "sd.config.ts");
|
|
71
|
-
fs.writeFileSync(
|
|
72
|
-
configPath,
|
|
73
|
-
[
|
|
74
|
-
'import type { SdConfigFn } from "@simplysm/sd-cli";',
|
|
75
|
-
"",
|
|
76
|
-
"const config: SdConfigFn = () => ({",
|
|
77
|
-
" packages: {",
|
|
78
|
-
' "client-web": { target: "client" },',
|
|
79
|
-
" },",
|
|
80
|
-
"});",
|
|
81
|
-
"",
|
|
82
|
-
"export default config;",
|
|
83
|
-
].join("\n"),
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
const result = addPackageToSdConfig(configPath, "client-web", { target: "client" });
|
|
87
|
-
expect(result).toBe(false);
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
describe("setClientServerInSdConfig", () => {
|
|
92
|
-
test("adds server field to client config", () => {
|
|
93
|
-
const configPath = path.join(tmpDir, "sd.config.ts");
|
|
94
|
-
fs.writeFileSync(
|
|
95
|
-
configPath,
|
|
96
|
-
[
|
|
97
|
-
'import type { SdConfigFn } from "@simplysm/sd-cli";',
|
|
98
|
-
"",
|
|
99
|
-
"const config: SdConfigFn = () => ({",
|
|
100
|
-
" packages: {",
|
|
101
|
-
' "client-web": { target: "client" },',
|
|
102
|
-
" },",
|
|
103
|
-
"});",
|
|
104
|
-
"",
|
|
105
|
-
"export default config;",
|
|
106
|
-
].join("\n"),
|
|
107
|
-
);
|
|
108
|
-
|
|
109
|
-
setClientServerInSdConfig(configPath, "client-web", "server");
|
|
110
|
-
|
|
111
|
-
const result = fs.readFileSync(configPath, "utf-8");
|
|
112
|
-
expect(result).toContain('server: "server"');
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
describe("addTailwindToEslintConfig", () => {
|
|
117
|
-
test("adds tailwind settings to eslint config without tailwind", () => {
|
|
118
|
-
const configPath = path.join(tmpDir, "eslint.config.ts");
|
|
119
|
-
fs.writeFileSync(
|
|
120
|
-
configPath,
|
|
121
|
-
[
|
|
122
|
-
'import simplysmEslintRecommended from "@simplysm/lint/eslint-recommended";',
|
|
123
|
-
"",
|
|
124
|
-
"export default [",
|
|
125
|
-
" ...simplysmEslintRecommended,",
|
|
126
|
-
"];",
|
|
127
|
-
].join("\n"),
|
|
128
|
-
);
|
|
129
|
-
|
|
130
|
-
addTailwindToEslintConfig(configPath, "client-web");
|
|
131
|
-
|
|
132
|
-
const result = fs.readFileSync(configPath, "utf-8");
|
|
133
|
-
expect(result).toContain("tailwindcss");
|
|
134
|
-
expect(result).toContain("packages/client-web/tailwind.config.ts");
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
test("does nothing if tailwind settings already exist", () => {
|
|
138
|
-
const configPath = path.join(tmpDir, "eslint.config.ts");
|
|
139
|
-
const original = [
|
|
140
|
-
'import simplysmEslintRecommended from "@simplysm/lint/eslint-recommended";',
|
|
141
|
-
"",
|
|
142
|
-
"export default [",
|
|
143
|
-
" ...simplysmEslintRecommended,",
|
|
144
|
-
" {",
|
|
145
|
-
' files: ["**/*.{ts,tsx}"],',
|
|
146
|
-
" settings: {",
|
|
147
|
-
" tailwindcss: {",
|
|
148
|
-
' config: "packages/client-old/tailwind.config.ts",',
|
|
149
|
-
" },",
|
|
150
|
-
" },",
|
|
151
|
-
" },",
|
|
152
|
-
"];",
|
|
153
|
-
].join("\n");
|
|
154
|
-
fs.writeFileSync(configPath, original);
|
|
155
|
-
|
|
156
|
-
const result = addTailwindToEslintConfig(configPath, "client-web");
|
|
157
|
-
expect(result).toBe(false);
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|