@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.
Files changed (108) hide show
  1. package/README.md +62 -14
  2. package/dist/commands/init.d.ts +4 -5
  3. package/dist/commands/init.d.ts.map +1 -1
  4. package/dist/commands/init.js +26 -8
  5. package/dist/commands/init.js.map +1 -1
  6. package/dist/commands/publish.js +1 -1
  7. package/dist/commands/publish.js.map +1 -1
  8. package/dist/sd-cli-entry.d.ts.map +1 -1
  9. package/dist/sd-cli-entry.js +0 -20
  10. package/dist/sd-cli-entry.js.map +1 -1
  11. package/package.json +4 -4
  12. package/src/commands/init.ts +40 -21
  13. package/src/commands/publish.ts +1 -1
  14. package/src/sd-cli-entry.ts +0 -24
  15. package/src/utils/replace-deps.ts +361 -361
  16. package/src/utils/sd-config.ts +44 -44
  17. package/src/utils/tailwind-config-deps.ts +98 -98
  18. package/src/utils/template.ts +56 -56
  19. package/src/utils/tsconfig.ts +127 -127
  20. package/src/utils/typecheck-serialization.ts +86 -86
  21. package/templates/init/{.prettierrc.yaml.hbs → .prettierrc.yaml} +1 -1
  22. package/templates/init/eslint.config.ts +15 -0
  23. package/templates/init/mise.toml +3 -0
  24. package/templates/init/package.json.hbs +8 -7
  25. package/templates/init/packages/client-admin/index.html.hbs +144 -0
  26. package/templates/init/packages/client-admin/package.json.hbs +26 -0
  27. package/templates/init/packages/client-admin/public/assets/logo-landscape.png +0 -0
  28. package/templates/init/packages/client-admin/public/assets/logo.png +0 -0
  29. package/templates/init/packages/client-admin/src/App.tsx +42 -0
  30. package/templates/init/packages/client-admin/src/dev/DevDialog.tsx +34 -0
  31. package/templates/{add-client/__CLIENT__/src/main.css.hbs → init/packages/client-admin/src/main.css} +1 -1
  32. package/templates/init/packages/client-admin/src/main.tsx.hbs +146 -0
  33. package/templates/init/packages/client-admin/src/providers/AppServiceProvider.tsx.hbs +103 -0
  34. package/templates/init/packages/client-admin/src/providers/AppStructureProvider.tsx +84 -0
  35. package/templates/init/packages/client-admin/src/providers/AuthProvider.tsx.hbs +71 -0
  36. package/templates/init/packages/client-admin/src/providers/configureSharedData.ts.hbs +67 -0
  37. package/templates/init/packages/client-admin/src/views/auth/LoginView.tsx +132 -0
  38. package/templates/init/packages/client-admin/src/views/home/HomeView.tsx +108 -0
  39. package/templates/init/packages/client-admin/src/views/home/base/employee/EmployeeDetail.tsx.hbs +262 -0
  40. package/templates/init/packages/client-admin/src/views/home/base/employee/EmployeeSheet.tsx.hbs +271 -0
  41. package/templates/init/packages/client-admin/src/views/home/base/role-permission/RoleDetail.tsx.hbs +154 -0
  42. package/templates/init/packages/client-admin/src/views/home/base/role-permission/RolePermissionDetail.tsx.hbs +123 -0
  43. package/templates/init/packages/client-admin/src/views/home/base/role-permission/RolePermissionView.tsx +52 -0
  44. package/templates/init/packages/client-admin/src/views/home/base/role-permission/RoleSheet.tsx.hbs +125 -0
  45. package/templates/init/packages/client-admin/src/views/home/main/MainView.tsx.hbs +13 -0
  46. package/templates/init/packages/client-admin/src/views/home/my-info/MyInfoDetail.tsx.hbs +248 -0
  47. package/templates/init/packages/client-admin/src/views/home/system/system-log/SystemLogSheet.tsx.hbs +169 -0
  48. package/templates/init/packages/client-admin/src/views/not-found/NotFoundView.tsx +15 -0
  49. package/templates/init/packages/client-admin/tailwind.config.ts +10 -0
  50. package/templates/init/packages/db-main/package.json.hbs +13 -0
  51. package/templates/init/packages/db-main/src/MainDbContext.ts +20 -0
  52. package/templates/init/packages/db-main/src/dataLogExt.ts +127 -0
  53. package/templates/init/packages/db-main/src/index.ts +10 -0
  54. package/templates/init/packages/db-main/src/tables/Employee.ts +24 -0
  55. package/templates/init/packages/db-main/src/tables/EmployeeConfig.ts +13 -0
  56. package/templates/init/packages/db-main/src/tables/Role.ts +9 -0
  57. package/templates/init/packages/db-main/src/tables/RolePermission.ts +13 -0
  58. package/templates/init/packages/db-main/src/tables/_DataLog.ts +19 -0
  59. package/templates/init/packages/db-main/src/tables/_Log.ts +16 -0
  60. package/templates/init/packages/server/package.json.hbs +20 -0
  61. package/templates/init/packages/server/public-dev/dev//354/264/210/352/270/260/355/231/224.xlsx +0 -0
  62. package/templates/init/packages/server/src/index.ts +4 -0
  63. package/templates/init/packages/server/src/main.ts.hbs +34 -0
  64. package/templates/init/packages/server/src/services/AuthService.ts.hbs +171 -0
  65. package/templates/init/packages/server/src/services/DevService.ts.hbs +94 -0
  66. package/templates/init/packages/server/src/services/EmployeeService.ts.hbs +122 -0
  67. package/templates/init/packages/server/src/services/RoleService.ts.hbs +59 -0
  68. package/templates/init/{pnpm-workspace.yaml.hbs → pnpm-workspace.yaml} +3 -1
  69. package/templates/init/sd.config.ts.hbs +30 -1
  70. package/templates/init/tests/e2e/package.json.hbs +16 -0
  71. package/templates/init/tests/e2e/src/e2e.spec.ts +36 -0
  72. package/templates/init/tests/e2e/src/employee-crud.ts +204 -0
  73. package/templates/init/tests/e2e/src/login.ts +61 -0
  74. package/templates/init/tests/e2e/vitest.setup.ts.hbs +220 -0
  75. package/templates/init/tsconfig.json.hbs +0 -11
  76. package/templates/init/{vitest.config.ts.hbs → vitest.config.ts} +16 -12
  77. package/dist/commands/add-client.d.ts +0 -18
  78. package/dist/commands/add-client.d.ts.map +0 -1
  79. package/dist/commands/add-client.js +0 -79
  80. package/dist/commands/add-client.js.map +0 -6
  81. package/dist/commands/add-server.d.ts +0 -18
  82. package/dist/commands/add-server.d.ts.map +0 -1
  83. package/dist/commands/add-server.js +0 -83
  84. package/dist/commands/add-server.js.map +0 -6
  85. package/dist/utils/config-editor.d.ts +0 -17
  86. package/dist/utils/config-editor.d.ts.map +0 -1
  87. package/dist/utils/config-editor.js +0 -79
  88. package/dist/utils/config-editor.js.map +0 -6
  89. package/src/commands/add-client.ts +0 -126
  90. package/src/commands/add-server.ts +0 -138
  91. package/src/utils/config-editor.ts +0 -141
  92. package/templates/add-client/__CLIENT__/index.html.hbs +0 -13
  93. package/templates/add-client/__CLIENT__/package.json.hbs +0 -16
  94. package/templates/add-client/__CLIENT__/src/App.tsx.hbs +0 -65
  95. package/templates/add-client/__CLIENT__/src/appStructure.ts.hbs +0 -20
  96. package/templates/add-client/__CLIENT__/src/main.tsx.hbs +0 -24
  97. package/templates/add-client/__CLIENT__/src/pages/HomePage.tsx.hbs +0 -9
  98. package/templates/add-client/__CLIENT__/tailwind.config.ts.hbs +0 -15
  99. package/templates/add-server/__SERVER__/package.json.hbs +0 -10
  100. package/templates/add-server/__SERVER__/src/main.ts.hbs +0 -14
  101. package/templates/init/.gitignore.hbs +0 -26
  102. package/templates/init/.npmrc.hbs +0 -1
  103. package/templates/init/eslint.config.ts.hbs +0 -5
  104. package/templates/init/mise.toml.hbs +0 -3
  105. package/tests/config-editor.spec.ts +0 -160
  106. /package/templates/init/{.prettierignore.hbs → .prettierignore} +0 -0
  107. /package/templates/{add-client/__CLIENT__ → init/packages/client-admin}/public/favicon.ico +0 -0
  108. /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,9 +0,0 @@
1
- export function HomePage() {
2
- return (
3
- <div class="flex h-full items-center justify-center">
4
- <h1 class="text-2xl font-bold text-base-700 dark:text-base-200">
5
- {{projectName}}
6
- </h1>
7
- </div>
8
- );
9
- }
@@ -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,10 +0,0 @@
1
- {
2
- "name": "@{{projectName}}/{{serverName}}",
3
- "version": "1.0.0",
4
- "type": "module",
5
- "private": true,
6
- "dependencies": {
7
- "@simplysm/core-common": "~13.0.71",
8
- "@simplysm/service-server": "~13.0.71"
9
- }
10
- }
@@ -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,5 +0,0 @@
1
- import simplysmEslintRecommended from "@simplysm/lint/eslint-recommended";
2
-
3
- export default [
4
- ...simplysmEslintRecommended,
5
- ];
@@ -1,3 +0,0 @@
1
- [tools]
2
- node = "20"
3
- pnpm = "latest"
@@ -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
- });