@simplysm/sd-cli 13.0.100 → 14.0.1
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/commands/build.js +29 -19
- package/dist/commands/build.js.map +1 -6
- package/dist/commands/check.d.ts +1 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +130 -115
- package/dist/commands/check.js.map +1 -6
- package/dist/commands/dev.d.ts +6 -7
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +24 -14
- package/dist/commands/dev.js.map +1 -6
- package/dist/commands/lint.d.ts +1 -1
- package/dist/commands/lint.js +158 -116
- package/dist/commands/lint.js.map +1 -6
- package/dist/commands/publish.d.ts.map +1 -1
- package/dist/commands/publish.js +637 -510
- package/dist/commands/publish.js.map +1 -6
- package/dist/commands/replace-deps.js +12 -12
- package/dist/commands/replace-deps.js.map +1 -6
- package/dist/commands/typecheck.d.ts +5 -30
- package/dist/commands/typecheck.d.ts.map +1 -1
- package/dist/commands/typecheck.js +144 -207
- package/dist/commands/typecheck.js.map +1 -6
- package/dist/commands/watch.d.ts +6 -4
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +25 -16
- package/dist/commands/watch.js.map +1 -6
- package/dist/engines/NgtscEngine.d.ts +47 -0
- package/dist/engines/NgtscEngine.d.ts.map +1 -0
- package/dist/engines/NgtscEngine.js +151 -0
- package/dist/engines/NgtscEngine.js.map +1 -0
- package/dist/engines/ServerEsbuildEngine.d.ts +47 -0
- package/dist/engines/ServerEsbuildEngine.d.ts.map +1 -0
- package/dist/engines/ServerEsbuildEngine.js +159 -0
- package/dist/engines/ServerEsbuildEngine.js.map +1 -0
- package/dist/engines/TscEngine.d.ts +47 -0
- package/dist/engines/TscEngine.d.ts.map +1 -0
- package/dist/engines/TscEngine.js +153 -0
- package/dist/engines/TscEngine.js.map +1 -0
- package/dist/engines/ViteEngine.d.ts +49 -0
- package/dist/engines/ViteEngine.d.ts.map +1 -0
- package/dist/engines/ViteEngine.js +161 -0
- package/dist/engines/ViteEngine.js.map +1 -0
- package/dist/engines/index.d.ts +26 -0
- package/dist/engines/index.d.ts.map +1 -0
- package/dist/engines/index.js +30 -0
- package/dist/engines/index.js.map +1 -0
- package/dist/engines/types.d.ts +77 -0
- package/dist/engines/types.d.ts.map +1 -0
- package/dist/engines/types.js +2 -0
- package/dist/engines/types.js.map +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -6
- package/dist/infra/ResultCollector.d.ts +1 -1
- package/dist/infra/ResultCollector.d.ts.map +1 -1
- package/dist/infra/ResultCollector.js +30 -27
- package/dist/infra/ResultCollector.js.map +1 -6
- package/dist/infra/SignalHandler.js +45 -42
- package/dist/infra/SignalHandler.js.map +1 -6
- package/dist/infra/WorkerManager.js +56 -53
- package/dist/infra/WorkerManager.js.map +1 -6
- package/dist/orchestrators/BuildOrchestrator.d.ts +33 -1
- package/dist/orchestrators/BuildOrchestrator.d.ts.map +1 -1
- package/dist/orchestrators/BuildOrchestrator.js +314 -309
- package/dist/orchestrators/BuildOrchestrator.js.map +1 -6
- package/dist/orchestrators/DevWatchOrchestrator.d.ts +60 -0
- package/dist/orchestrators/DevWatchOrchestrator.d.ts.map +1 -0
- package/dist/orchestrators/DevWatchOrchestrator.js +465 -0
- package/dist/orchestrators/DevWatchOrchestrator.js.map +1 -0
- package/dist/sd-cli-entry.d.ts.map +1 -1
- package/dist/sd-cli-entry.js +190 -266
- package/dist/sd-cli-entry.js.map +1 -6
- package/dist/sd-cli.js +77 -49
- package/dist/sd-cli.js.map +1 -6
- package/dist/sd-config.types.d.ts +2 -0
- package/dist/sd-config.types.d.ts.map +1 -1
- package/dist/sd-config.types.js +2 -1
- package/dist/sd-config.types.js.map +1 -6
- package/dist/utils/angular-build.d.ts +77 -0
- package/dist/utils/angular-build.d.ts.map +1 -0
- package/dist/utils/angular-build.js +84 -0
- package/dist/utils/angular-build.js.map +1 -0
- package/dist/utils/build-env.js +9 -9
- package/dist/utils/build-env.js.map +1 -6
- package/dist/utils/concurrency.d.ts +15 -0
- package/dist/utils/concurrency.d.ts.map +1 -0
- package/dist/utils/concurrency.js +38 -0
- package/dist/utils/concurrency.js.map +1 -0
- package/dist/utils/copy-public.js +104 -87
- package/dist/utils/copy-public.js.map +1 -6
- package/dist/utils/copy-src.js +49 -35
- package/dist/utils/copy-src.js.map +1 -6
- package/dist/utils/esbuild-config.d.ts +0 -29
- package/dist/utils/esbuild-config.d.ts.map +1 -1
- package/dist/utils/esbuild-config.js +151 -218
- package/dist/utils/esbuild-config.js.map +1 -6
- package/dist/utils/ngtsc-build-core.d.ts +49 -0
- package/dist/utils/ngtsc-build-core.d.ts.map +1 -0
- package/dist/utils/ngtsc-build-core.js +250 -0
- package/dist/utils/ngtsc-build-core.js.map +1 -0
- package/dist/utils/output-path-rewriter.d.ts +23 -0
- package/dist/utils/output-path-rewriter.d.ts.map +1 -0
- package/dist/utils/output-path-rewriter.js +74 -0
- package/dist/utils/output-path-rewriter.js.map +1 -0
- package/dist/utils/output-utils.js +55 -40
- package/dist/utils/output-utils.js.map +1 -6
- package/dist/utils/package-utils.d.ts +8 -0
- package/dist/utils/package-utils.d.ts.map +1 -1
- package/dist/utils/package-utils.js +103 -73
- package/dist/utils/package-utils.js.map +1 -6
- package/dist/utils/rebuild-manager.js +41 -44
- package/dist/utils/rebuild-manager.js.map +1 -6
- package/dist/utils/replace-deps.js +283 -184
- package/dist/utils/replace-deps.js.map +1 -6
- package/dist/utils/scss-compiler.d.ts +10 -0
- package/dist/utils/scss-compiler.d.ts.map +1 -0
- package/dist/utils/scss-compiler.js +36 -0
- package/dist/utils/scss-compiler.js.map +1 -0
- package/dist/utils/sd-config.js +29 -19
- package/dist/utils/sd-config.js.map +1 -6
- package/dist/utils/tsc-build.d.ts +36 -0
- package/dist/utils/tsc-build.d.ts.map +1 -0
- package/dist/utils/tsc-build.js +130 -0
- package/dist/utils/tsc-build.js.map +1 -0
- package/dist/utils/tsconfig.d.ts +7 -26
- package/dist/utils/tsconfig.d.ts.map +1 -1
- package/dist/utils/tsconfig.js +39 -64
- package/dist/utils/tsconfig.js.map +1 -6
- package/dist/utils/typecheck-non-package.d.ts +18 -0
- package/dist/utils/typecheck-non-package.d.ts.map +1 -0
- package/dist/utils/typecheck-non-package.js +64 -0
- package/dist/utils/typecheck-non-package.js.map +1 -0
- package/dist/utils/typecheck-serialization.js +58 -40
- package/dist/utils/typecheck-serialization.js.map +1 -6
- package/dist/utils/worker-events.js +48 -40
- package/dist/utils/worker-events.js.map +1 -6
- package/dist/utils/worker-utils.js +48 -28
- package/dist/utils/worker-utils.js.map +1 -6
- package/dist/vitest-plugin.d.ts +9 -0
- package/dist/vitest-plugin.d.ts.map +1 -0
- package/dist/vitest-plugin.js +85 -0
- package/dist/vitest-plugin.js.map +1 -0
- package/dist/workers/library-build.worker.d.ts +54 -0
- package/dist/workers/library-build.worker.d.ts.map +1 -0
- package/dist/workers/library-build.worker.js +97 -0
- package/dist/workers/library-build.worker.js.map +1 -0
- package/dist/workers/lint.worker.js +9 -6
- package/dist/workers/lint.worker.js.map +1 -6
- package/dist/workers/ngtsc-build.worker.d.ts +23 -0
- package/dist/workers/ngtsc-build.worker.d.ts.map +1 -0
- package/dist/workers/ngtsc-build.worker.js +98 -0
- package/dist/workers/ngtsc-build.worker.js.map +1 -0
- package/dist/workers/{server.worker.d.ts → server-build.worker.d.ts} +39 -29
- package/dist/workers/server-build.worker.d.ts.map +1 -0
- package/dist/workers/server-build.worker.js +399 -0
- package/dist/workers/server-build.worker.js.map +1 -0
- package/dist/workers/server-runtime.worker.d.ts +3 -2
- package/dist/workers/server-runtime.worker.d.ts.map +1 -1
- package/dist/workers/server-runtime.worker.js +100 -95
- package/dist/workers/server-runtime.worker.js.map +1 -6
- package/dist/workers/vite-build.worker.d.ts +56 -0
- package/dist/workers/vite-build.worker.d.ts.map +1 -0
- package/dist/workers/vite-build.worker.js +167 -0
- package/dist/workers/vite-build.worker.js.map +1 -0
- package/package.json +10 -16
- package/src/commands/check.ts +21 -3
- package/src/commands/dev.ts +10 -8
- package/src/commands/lint.ts +1 -1
- package/src/commands/publish.ts +4 -0
- package/src/commands/typecheck.ts +89 -256
- package/src/commands/watch.ts +9 -8
- package/src/engines/NgtscEngine.ts +190 -0
- package/src/engines/ServerEsbuildEngine.ts +195 -0
- package/src/engines/TscEngine.ts +189 -0
- package/src/engines/ViteEngine.ts +203 -0
- package/src/engines/index.ts +49 -0
- package/src/engines/types.ts +79 -0
- package/src/index.ts +0 -3
- package/src/infra/ResultCollector.ts +1 -1
- package/src/orchestrators/BuildOrchestrator.ts +87 -157
- package/src/orchestrators/DevWatchOrchestrator.ts +573 -0
- package/src/sd-cli-entry.ts +13 -116
- package/src/sd-config.types.ts +2 -0
- package/src/utils/angular-build.ts +157 -0
- package/src/utils/concurrency.ts +43 -0
- package/src/utils/esbuild-config.ts +1 -122
- package/src/utils/ngtsc-build-core.ts +379 -0
- package/src/utils/output-path-rewriter.ts +82 -0
- package/src/utils/package-utils.ts +20 -0
- package/src/utils/scss-compiler.ts +58 -0
- package/src/utils/tsc-build.ts +175 -0
- package/src/utils/tsconfig.ts +27 -95
- package/src/utils/typecheck-non-package.ts +87 -0
- package/src/vitest-plugin.ts +118 -0
- package/src/workers/library-build.worker.ts +153 -0
- package/src/workers/ngtsc-build.worker.ts +146 -0
- package/src/workers/server-build.worker.ts +565 -0
- package/src/workers/server-runtime.worker.ts +17 -26
- package/src/workers/vite-build.worker.ts +252 -0
- package/tests/commands/check.spec.ts +276 -0
- package/tests/commands/dev.spec.ts +53 -0
- package/tests/commands/lint.spec.ts +243 -0
- package/tests/commands/publish.spec.ts +1159 -0
- package/tests/commands/typecheck.spec.ts +294 -0
- package/tests/commands/watch.spec.ts +53 -0
- package/tests/engines/engine-selection.spec.ts +247 -0
- package/tests/engines/ngtsc-engine.spec.ts +274 -0
- package/tests/engines/server-esbuild-engine.spec.ts +256 -0
- package/tests/engines/tsc-engine.spec.ts +213 -0
- package/tests/engines/vite-engine.spec.ts +358 -0
- package/tests/infra/result-collector.spec.ts +46 -0
- package/tests/infra/signal-handler.spec.ts +32 -0
- package/tests/infra/worker-manager.spec.ts +63 -0
- package/tests/orchestrators/build-orchestrator.spec.ts +772 -0
- package/tests/orchestrators/dev-watch-orchestrator.spec.ts +1173 -0
- package/tests/sd-cli-entry.spec.ts +49 -0
- package/tests/utils/angular-build.spec.ts +251 -0
- package/tests/utils/build-env.spec.ts +33 -0
- package/tests/utils/concurrency.spec.ts +65 -0
- package/tests/utils/copy-src.spec.ts +144 -0
- package/tests/utils/esbuild-config.spec.ts +186 -0
- package/tests/utils/external-modules.spec.ts +161 -0
- package/tests/utils/ngtsc-scss-refactor.spec.ts +66 -0
- package/tests/utils/output-path-rewriter.spec.ts +165 -0
- package/tests/utils/output-utils.spec.ts +104 -0
- package/tests/utils/package-utils.spec.ts +52 -0
- package/tests/utils/rebuild-manager.spec.ts +30 -27
- package/tests/utils/replace-deps.spec.ts +69 -0
- package/tests/utils/scss-compiler.spec.ts +131 -0
- package/tests/utils/sd-config.spec.ts +77 -0
- package/tests/utils/tsc-build.spec.ts +358 -0
- package/tests/utils/tsconfig-angular.spec.ts +71 -0
- package/tests/utils/typecheck-non-package.spec.ts +120 -0
- package/tests/utils/worker-events.spec.ts +155 -0
- package/tests/utils/worker-utils.spec.ts +43 -0
- package/tests/vitest-plugin-cwd.spec.ts +68 -0
- package/tests/vitest-plugin.spec.ts +103 -0
- package/tests/workers/library-build-worker.spec.ts +258 -0
- package/tests/workers/ngtsc-build-worker.spec.ts +187 -0
- package/tests/workers/server-build-worker.spec.ts +566 -0
- package/tests/workers/server-runtime-worker.spec.ts +251 -0
- package/README.md +0 -295
- package/dist/builders/BaseBuilder.d.ts +0 -88
- package/dist/builders/BaseBuilder.d.ts.map +0 -1
- package/dist/builders/BaseBuilder.js +0 -142
- package/dist/builders/BaseBuilder.js.map +0 -6
- package/dist/builders/DtsBuilder.d.ts +0 -22
- package/dist/builders/DtsBuilder.d.ts.map +0 -1
- package/dist/builders/DtsBuilder.js +0 -72
- package/dist/builders/DtsBuilder.js.map +0 -6
- package/dist/builders/LibraryBuilder.d.ts +0 -22
- package/dist/builders/LibraryBuilder.d.ts.map +0 -1
- package/dist/builders/LibraryBuilder.js +0 -85
- package/dist/builders/LibraryBuilder.js.map +0 -6
- package/dist/builders/types.d.ts +0 -55
- package/dist/builders/types.d.ts.map +0 -1
- package/dist/builders/types.js +0 -1
- package/dist/builders/types.js.map +0 -6
- package/dist/capacitor/capacitor.d.ts +0 -151
- package/dist/capacitor/capacitor.d.ts.map +0 -1
- package/dist/capacitor/capacitor.js +0 -694
- package/dist/capacitor/capacitor.js.map +0 -6
- package/dist/commands/device.d.ts +0 -22
- package/dist/commands/device.d.ts.map +0 -1
- package/dist/commands/device.js +0 -98
- package/dist/commands/device.js.map +0 -6
- package/dist/commands/init.d.ts +0 -14
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -72
- package/dist/commands/init.js.map +0 -6
- package/dist/electron/electron.d.ts +0 -84
- package/dist/electron/electron.d.ts.map +0 -1
- package/dist/electron/electron.js +0 -263
- package/dist/electron/electron.js.map +0 -6
- package/dist/orchestrators/DevOrchestrator.d.ts +0 -83
- package/dist/orchestrators/DevOrchestrator.d.ts.map +0 -1
- package/dist/orchestrators/DevOrchestrator.js +0 -540
- package/dist/orchestrators/DevOrchestrator.js.map +0 -6
- package/dist/orchestrators/WatchOrchestrator.d.ts +0 -57
- package/dist/orchestrators/WatchOrchestrator.d.ts.map +0 -1
- package/dist/orchestrators/WatchOrchestrator.js +0 -199
- package/dist/orchestrators/WatchOrchestrator.js.map +0 -6
- package/dist/utils/tailwind-config-deps.d.ts +0 -8
- package/dist/utils/tailwind-config-deps.d.ts.map +0 -1
- package/dist/utils/tailwind-config-deps.js +0 -82
- package/dist/utils/tailwind-config-deps.js.map +0 -6
- package/dist/utils/template.d.ts +0 -14
- package/dist/utils/template.d.ts.map +0 -1
- package/dist/utils/template.js +0 -33
- package/dist/utils/template.js.map +0 -6
- package/dist/utils/vite-config.d.ts +0 -35
- package/dist/utils/vite-config.d.ts.map +0 -1
- package/dist/utils/vite-config.js +0 -259
- package/dist/utils/vite-config.js.map +0 -6
- package/dist/workers/client.worker.d.ts +0 -83
- package/dist/workers/client.worker.d.ts.map +0 -1
- package/dist/workers/client.worker.js +0 -111
- package/dist/workers/client.worker.js.map +0 -6
- package/dist/workers/dts.worker.d.ts +0 -75
- package/dist/workers/dts.worker.d.ts.map +0 -1
- package/dist/workers/dts.worker.js +0 -270
- package/dist/workers/dts.worker.js.map +0 -6
- package/dist/workers/library.worker.d.ts +0 -75
- package/dist/workers/library.worker.d.ts.map +0 -1
- package/dist/workers/library.worker.js +0 -166
- package/dist/workers/library.worker.js.map +0 -6
- package/dist/workers/server.worker.d.ts.map +0 -1
- package/dist/workers/server.worker.js +0 -482
- package/dist/workers/server.worker.js.map +0 -6
- package/src/builders/BaseBuilder.ts +0 -218
- package/src/builders/DtsBuilder.ts +0 -92
- package/src/builders/LibraryBuilder.ts +0 -110
- package/src/builders/types.ts +0 -60
- package/src/capacitor/capacitor.ts +0 -931
- package/src/commands/device.ts +0 -140
- package/src/commands/init.ts +0 -113
- package/src/electron/electron.ts +0 -362
- package/src/orchestrators/DevOrchestrator.ts +0 -744
- package/src/orchestrators/WatchOrchestrator.ts +0 -277
- package/src/utils/tailwind-config-deps.ts +0 -98
- package/src/utils/template.ts +0 -56
- package/src/utils/vite-config.ts +0 -390
- package/src/workers/client.worker.ts +0 -250
- package/src/workers/dts.worker.ts +0 -453
- package/src/workers/library.worker.ts +0 -316
- package/src/workers/server.worker.ts +0 -734
- package/templates/init/.gitignore.hbs +0 -34
- package/templates/init/.npmrc.hbs +0 -1
- package/templates/init/.prettierignore +0 -1
- package/templates/init/.prettierrc.yaml +0 -12
- package/templates/init/eslint.config.ts +0 -15
- package/templates/init/mise.toml +0 -3
- package/templates/init/package.json.hbs +0 -32
- package/templates/init/packages/client-admin/index.html.hbs +0 -144
- package/templates/init/packages/client-admin/package.json.hbs +0 -27
- 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/public/favicon.ico +0 -0
- package/templates/init/packages/client-admin/src/App.tsx +0 -42
- package/templates/init/packages/client-admin/src/dev/DevDialog.tsx +0 -34
- package/templates/init/packages/client-admin/src/events/AuthChangeEvent.ts +0 -3
- package/templates/init/packages/client-admin/src/main.css +0 -4
- package/templates/init/packages/client-admin/src/main.tsx.hbs +0 -146
- package/templates/init/packages/client-admin/src/providers/AppServiceProvider.tsx.hbs +0 -103
- package/templates/init/packages/client-admin/src/providers/AppStructureProvider.tsx +0 -84
- package/templates/init/packages/client-admin/src/providers/AuthProvider.tsx.hbs +0 -96
- package/templates/init/packages/client-admin/src/providers/configureSharedData.ts.hbs +0 -67
- package/templates/init/packages/client-admin/src/views/auth/LoginView.tsx +0 -132
- package/templates/init/packages/client-admin/src/views/home/HomeView.tsx +0 -108
- package/templates/init/packages/client-admin/src/views/home/base/employee/EmployeeDetail.tsx.hbs +0 -243
- package/templates/init/packages/client-admin/src/views/home/base/employee/EmployeeSheet.tsx.hbs +0 -271
- package/templates/init/packages/client-admin/src/views/home/base/role-permission/RoleDetail.tsx.hbs +0 -146
- package/templates/init/packages/client-admin/src/views/home/base/role-permission/RolePermissionDetail.tsx.hbs +0 -121
- package/templates/init/packages/client-admin/src/views/home/base/role-permission/RolePermissionView.tsx +0 -52
- package/templates/init/packages/client-admin/src/views/home/base/role-permission/RoleSheet.tsx.hbs +0 -125
- package/templates/init/packages/client-admin/src/views/home/main/MainView.tsx.hbs +0 -13
- package/templates/init/packages/client-admin/src/views/home/my-info/MyInfoDetail.tsx.hbs +0 -241
- package/templates/init/packages/client-admin/src/views/home/system/system-log/SystemLogSheet.tsx.hbs +0 -169
- package/templates/init/packages/client-admin/src/views/not-found/NotFoundView.tsx +0 -15
- package/templates/init/packages/client-admin/tailwind.config.ts +0 -10
- package/templates/init/packages/db-main/package.json.hbs +0 -13
- package/templates/init/packages/db-main/src/MainDbContext.ts +0 -22
- package/templates/init/packages/db-main/src/dataLogExt.ts +0 -127
- package/templates/init/packages/db-main/src/index.ts +0 -14
- package/templates/init/packages/db-main/src/tables/base/Employee.ts +0 -24
- package/templates/init/packages/db-main/src/tables/base/EmployeeConfig.ts +0 -13
- package/templates/init/packages/db-main/src/tables/base/Role.ts +0 -9
- package/templates/init/packages/db-main/src/tables/base/RolePermission.ts +0 -13
- package/templates/init/packages/db-main/src/tables/system/_DataLog.ts +0 -19
- package/templates/init/packages/db-main/src/tables/system/_Log.ts +0 -16
- package/templates/init/packages/server/package.json.hbs +0 -20
- 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 +0 -4
- package/templates/init/packages/server/src/main.ts.hbs +0 -34
- package/templates/init/packages/server/src/services/AuthService.ts.hbs +0 -171
- package/templates/init/packages/server/src/services/DevService.ts.hbs +0 -94
- package/templates/init/packages/server/src/services/EmployeeService.ts.hbs +0 -122
- package/templates/init/packages/server/src/services/RoleService.ts.hbs +0 -59
- package/templates/init/pnpm-workspace.yaml +0 -15
- package/templates/init/sd.config.ts.hbs +0 -48
- package/templates/init/tsconfig.json.hbs +0 -39
- package/templates/init/vitest.config.ts +0 -36
- package/tests/capacitor-exclude.spec.ts +0 -78
- package/tests/capacitor.spec.ts +0 -49
- package/tests/copy-src.spec.ts +0 -50
- package/tests/electron-exclude.spec.ts +0 -61
- package/tests/get-compiler-options-for-package.spec.ts +0 -80
- package/tests/get-package-source-files.spec.ts +0 -139
- package/tests/get-types-from-package-json.spec.ts +0 -92
- package/tests/infra/ResultCollector.spec.ts +0 -30
- package/tests/infra/SignalHandler.spec.ts +0 -38
- package/tests/infra/WorkerManager.spec.ts +0 -63
- package/tests/load-ignore-patterns.spec.ts +0 -163
- package/tests/load-sd-config.spec.ts +0 -100
- package/tests/package-utils.spec.ts +0 -188
- package/tests/parse-root-tsconfig.spec.ts +0 -89
- package/tests/publish-config-narrowing.spec.ts +0 -20
- package/tests/replace-deps.spec.ts +0 -308
- package/tests/run-lint.spec.ts +0 -366
- package/tests/run-typecheck.spec.ts +0 -544
- package/tests/run-watch.spec.ts +0 -76
- package/tests/sd-cli.spec.ts +0 -265
- package/tests/sd-public-dev-plugin-mime.spec.ts +0 -19
- package/tests/tailwind-config-deps.spec.ts +0 -30
- package/tests/template.spec.ts +0 -70
- package/tests/vite-config-exclude.spec.ts +0 -35
- package/tests/vite-config-outdir.spec.ts +0 -38
- package/tests/write-changed-output-files.spec.ts +0 -97
package/templates/init/packages/client-admin/src/views/home/system/system-log/SystemLogSheet.tsx.hbs
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CrudSheet,
|
|
3
|
-
DateRangePicker,
|
|
4
|
-
type ExcelConfig,
|
|
5
|
-
FormGroup,
|
|
6
|
-
type SortingDef,
|
|
7
|
-
TextInput,
|
|
8
|
-
} from "@simplysm/solid";
|
|
9
|
-
import { DateOnly, type DateTime, objGetChainValue, strIsNullOrEmpty } from "@simplysm/core-common";
|
|
10
|
-
import { expr } from "@{{projectName}}/db-main";
|
|
11
|
-
import { type ExprUnit } from "@simplysm/orm-common";
|
|
12
|
-
import { ExcelWrapper } from "@simplysm/excel";
|
|
13
|
-
import { downloadBlob } from "@simplysm/core-browser";
|
|
14
|
-
import { z } from "zod";
|
|
15
|
-
import { useAppService } from "../../../../providers/AppServiceProvider";
|
|
16
|
-
|
|
17
|
-
type SheetItem = {
|
|
18
|
-
id: number;
|
|
19
|
-
clientName?: string;
|
|
20
|
-
dateTime?: DateTime;
|
|
21
|
-
severity?: string;
|
|
22
|
-
message?: string;
|
|
23
|
-
employeeName?: string;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
type Filter = {
|
|
27
|
-
fromDate?: DateOnly;
|
|
28
|
-
toDate?: DateOnly;
|
|
29
|
-
searchText?: string;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const ITEMS_PER_PAGE = 50;
|
|
33
|
-
|
|
34
|
-
const excelWrapper = new ExcelWrapper(
|
|
35
|
-
z.object({
|
|
36
|
-
id: z.number().describe("ID"),
|
|
37
|
-
dateTime: z.custom<DateTime>().optional().describe("일시"),
|
|
38
|
-
severity: z.string().optional().describe("심각도"),
|
|
39
|
-
employeeName: z.string().optional().describe("사용자명"),
|
|
40
|
-
clientName: z.string().optional().describe("클라이언트"),
|
|
41
|
-
message: z.string().optional().describe("메시지"),
|
|
42
|
-
}),
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
export function SystemLogSheet() {
|
|
46
|
-
const appService = useAppService();
|
|
47
|
-
|
|
48
|
-
const excel: ExcelConfig<SheetItem> = {
|
|
49
|
-
download: async (items) => {
|
|
50
|
-
await using wb = await excelWrapper.write("시스템로그", items);
|
|
51
|
-
const blob = await wb.getBlob();
|
|
52
|
-
downloadBlob(blob, "시스템로그.xlsx");
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
async function search(filter: Filter, page: number | undefined, sorts: SortingDef[]) {
|
|
57
|
-
return appService.orm.connect(async (db) => {
|
|
58
|
-
let qr = db._log();
|
|
59
|
-
|
|
60
|
-
// 조회기간 필터
|
|
61
|
-
if (filter.fromDate != null || filter.toDate != null) {
|
|
62
|
-
qr = qr.where((c) => [
|
|
63
|
-
expr.between(expr.cast(c.dateTime, { type: "date" }), filter.fromDate, filter.toDate),
|
|
64
|
-
]);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// 검색어 필터
|
|
68
|
-
const searchText = filter.searchText?.trim();
|
|
69
|
-
if (!strIsNullOrEmpty(searchText)) {
|
|
70
|
-
qr = qr.search((c) => [c.clientName, c.severity, c.employee!.name], searchText);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// 페이지 수
|
|
74
|
-
const pageCount = page != null ? Math.ceil((await qr.count()) / ITEMS_PER_PAGE) : undefined;
|
|
75
|
-
|
|
76
|
-
// select + include
|
|
77
|
-
let qr2 = qr.include((c) => c.employee).select((c) => ({
|
|
78
|
-
id: c.id,
|
|
79
|
-
clientName: c.clientName,
|
|
80
|
-
dateTime: c.dateTime,
|
|
81
|
-
severity: c.severity,
|
|
82
|
-
message: c.message,
|
|
83
|
-
employeeName: c.employee?.name,
|
|
84
|
-
}));
|
|
85
|
-
|
|
86
|
-
// 정렬
|
|
87
|
-
for (const sort of sorts) {
|
|
88
|
-
qr2 = qr2.orderBy(
|
|
89
|
-
(c) => objGetChainValue(c, sort.key) as ExprUnit<any>,
|
|
90
|
-
sort.desc ? "DESC" : "ASC",
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
if (!sorts.some((s) => s.key === "id")) {
|
|
94
|
-
qr2 = qr2.orderBy((c) => c.id, "DESC");
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// 페이지네이션
|
|
98
|
-
if (page != null) {
|
|
99
|
-
qr2 = qr2.limit((page - 1) * ITEMS_PER_PAGE, ITEMS_PER_PAGE);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const items = (await qr2.result()) as SheetItem[];
|
|
103
|
-
return { items, pageCount };
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return (
|
|
108
|
-
<CrudSheet<SheetItem, Filter>
|
|
109
|
-
search={search}
|
|
110
|
-
getItemKey={(item) => item.id}
|
|
111
|
-
persistKey="system-log"
|
|
112
|
-
editable={false}
|
|
113
|
-
excel={excel}
|
|
114
|
-
>
|
|
115
|
-
<CrudSheet.Filter<Filter>>
|
|
116
|
-
{(filter, setFilter) => (
|
|
117
|
-
<>
|
|
118
|
-
<FormGroup.Item label="조회기간">
|
|
119
|
-
<DateRangePicker
|
|
120
|
-
from={filter.fromDate}
|
|
121
|
-
onFromChange={(v) => setFilter("fromDate", v)}
|
|
122
|
-
to={filter.toDate}
|
|
123
|
-
onToChange={(v) => setFilter("toDate", v)}
|
|
124
|
-
/>
|
|
125
|
-
</FormGroup.Item>
|
|
126
|
-
<FormGroup.Item label="검색어">
|
|
127
|
-
<TextInput
|
|
128
|
-
value={filter.searchText}
|
|
129
|
-
onValueChange={(v) => setFilter("searchText", v)}
|
|
130
|
-
/>
|
|
131
|
-
</FormGroup.Item>
|
|
132
|
-
</>
|
|
133
|
-
)}
|
|
134
|
-
</CrudSheet.Filter>
|
|
135
|
-
|
|
136
|
-
<CrudSheet.Column<SheetItem> key="id" header="#" fixed>
|
|
137
|
-
{({ item }) => <div class="px-2 py-1 text-right">{item.id}</div>}
|
|
138
|
-
</CrudSheet.Column>
|
|
139
|
-
|
|
140
|
-
<CrudSheet.Column<SheetItem> key="dateTime" header="일시">
|
|
141
|
-
{({ item }) => (
|
|
142
|
-
<div class="px-2 py-1">
|
|
143
|
-
{item.dateTime?.toFormatString("yyyy-MM-dd HH:mm") ?? ""}
|
|
144
|
-
</div>
|
|
145
|
-
)}
|
|
146
|
-
</CrudSheet.Column>
|
|
147
|
-
|
|
148
|
-
<CrudSheet.Column<SheetItem> key="severity" header="심각도">
|
|
149
|
-
{({ item }) => <div class="px-2 py-1">{item.severity}</div>}
|
|
150
|
-
</CrudSheet.Column>
|
|
151
|
-
|
|
152
|
-
<CrudSheet.Column<SheetItem> key="employeeName" header="사용자명">
|
|
153
|
-
{({ item }) => <div class="px-2 py-1">{item.employeeName}</div>}
|
|
154
|
-
</CrudSheet.Column>
|
|
155
|
-
|
|
156
|
-
<CrudSheet.Column<SheetItem> key="clientName" header="클라이언트">
|
|
157
|
-
{({ item }) => <div class="px-2 py-1">{item.clientName}</div>}
|
|
158
|
-
</CrudSheet.Column>
|
|
159
|
-
|
|
160
|
-
<CrudSheet.Column<SheetItem> key="message" header="메시지">
|
|
161
|
-
{({ item }) => (
|
|
162
|
-
<div class="px-2 py-1">
|
|
163
|
-
<pre class="whitespace-pre-wrap">{item.message}</pre>
|
|
164
|
-
</div>
|
|
165
|
-
)}
|
|
166
|
-
</CrudSheet.Column>
|
|
167
|
-
</CrudSheet>
|
|
168
|
-
);
|
|
169
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { A } from "@solidjs/router";
|
|
2
|
-
|
|
3
|
-
export function NotFoundView() {
|
|
4
|
-
return (
|
|
5
|
-
<div class="flex h-full items-center justify-center">
|
|
6
|
-
<div class="rounded-lg border border-base-200 bg-base-50 p-8 text-center dark:border-base-700 dark:bg-base-800">
|
|
7
|
-
<h1 class="mb-4 text-2xl font-bold">404</h1>
|
|
8
|
-
<p class="mb-4 text-base-600 dark:text-base-400">페이지를 찾을 수 없습니다.</p>
|
|
9
|
-
<A href="/home" class="text-primary-500 hover:underline">
|
|
10
|
-
홈으로 돌아가기
|
|
11
|
-
</A>
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
14
|
-
);
|
|
15
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath } from "url";
|
|
2
|
-
import simplysmPreset from "@simplysm/solid/tailwind.config";
|
|
3
|
-
|
|
4
|
-
const __dirname = fileURLToPath(new URL(".", import.meta.url));
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
darkMode: "class",
|
|
8
|
-
presets: [simplysmPreset],
|
|
9
|
-
content: [`${__dirname}index.html`, `${__dirname}src/**/*.{ts,tsx}`, ...simplysmPreset.content],
|
|
10
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { defineDbContext, type DbContextInstance } from "@simplysm/orm-common";
|
|
2
|
-
// base
|
|
3
|
-
import { Employee } from "./tables/base/Employee";
|
|
4
|
-
import { Role } from "./tables/base/Role";
|
|
5
|
-
import { RolePermission } from "./tables/base/RolePermission";
|
|
6
|
-
import { EmployeeConfig } from "./tables/base/EmployeeConfig";
|
|
7
|
-
// system
|
|
8
|
-
import { _Log } from "./tables/system/_Log";
|
|
9
|
-
import { _DataLog } from "./tables/system/_DataLog";
|
|
10
|
-
|
|
11
|
-
export const MainDbContext = defineDbContext({
|
|
12
|
-
tables: {
|
|
13
|
-
employee: Employee,
|
|
14
|
-
role: Role,
|
|
15
|
-
rolePermission: RolePermission,
|
|
16
|
-
employeeConfig: EmployeeConfig,
|
|
17
|
-
_log: _Log,
|
|
18
|
-
_dataLog: _DataLog,
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export type MainDbContext = DbContextInstance<typeof MainDbContext>;
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { DateTime } from "@simplysm/core-common";
|
|
2
|
-
import {
|
|
3
|
-
type DataRecord,
|
|
4
|
-
expr,
|
|
5
|
-
Queryable,
|
|
6
|
-
queryable,
|
|
7
|
-
type TableBuilder,
|
|
8
|
-
} from "@simplysm/orm-common";
|
|
9
|
-
import { _DataLog } from "./tables/system/_DataLog";
|
|
10
|
-
|
|
11
|
-
// ── Type Declarations ──
|
|
12
|
-
|
|
13
|
-
export interface IDataLogJoinOptions {
|
|
14
|
-
includeActions?: string[];
|
|
15
|
-
excludeActions?: string[];
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface IDataLogJoinResult {
|
|
19
|
-
action?: string;
|
|
20
|
-
dateTime?: DateTime;
|
|
21
|
-
employeeId?: number;
|
|
22
|
-
employeeName?: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface IInsertDataLogParam {
|
|
26
|
-
action: string;
|
|
27
|
-
itemId: number;
|
|
28
|
-
employeeId?: number;
|
|
29
|
-
valueJson?: string;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
declare module "@simplysm/orm-common" {
|
|
33
|
-
interface Queryable<TData extends DataRecord, TFrom extends TableBuilder<any, any> | never> {
|
|
34
|
-
joinLastDataLog(
|
|
35
|
-
opts?: IDataLogJoinOptions,
|
|
36
|
-
): Queryable<TData & { lastDataLog?: IDataLogJoinResult }, TFrom>;
|
|
37
|
-
|
|
38
|
-
joinFirstDataLog(
|
|
39
|
-
opts?: IDataLogJoinOptions,
|
|
40
|
-
): Queryable<TData & { firstDataLog?: IDataLogJoinResult }, TFrom>;
|
|
41
|
-
|
|
42
|
-
insertDataLog(log: IInsertDataLogParam): Promise<void>;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// ── Runtime: insertDataLog ──
|
|
47
|
-
|
|
48
|
-
Queryable.prototype.insertDataLog = async function (
|
|
49
|
-
this: Queryable<any, any>,
|
|
50
|
-
log: IInsertDataLogParam,
|
|
51
|
-
): Promise<void> {
|
|
52
|
-
const tableName = (this.meta.from as TableBuilder<any, any>).meta.name;
|
|
53
|
-
const dataLogQr = queryable(this.meta.db, _DataLog);
|
|
54
|
-
|
|
55
|
-
await dataLogQr().insert([
|
|
56
|
-
{
|
|
57
|
-
tableName,
|
|
58
|
-
action: log.action,
|
|
59
|
-
itemId: log.itemId,
|
|
60
|
-
valueJson: log.valueJson,
|
|
61
|
-
dateTime: new DateTime(),
|
|
62
|
-
employeeId: log.employeeId,
|
|
63
|
-
},
|
|
64
|
-
]);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
// ── Runtime: joinLastDataLog ──
|
|
68
|
-
|
|
69
|
-
Queryable.prototype.joinLastDataLog = function (
|
|
70
|
-
this: Queryable<any, any>,
|
|
71
|
-
opts?: IDataLogJoinOptions,
|
|
72
|
-
) {
|
|
73
|
-
const tableName = (this.meta.from as TableBuilder<any, any>).meta.name;
|
|
74
|
-
|
|
75
|
-
return this.joinSingle("lastDataLog", (qr, en) =>
|
|
76
|
-
qr
|
|
77
|
-
.from(_DataLog)
|
|
78
|
-
.where((dl) => [
|
|
79
|
-
expr.eq(dl.tableName, tableName),
|
|
80
|
-
expr.eq(dl.itemId, en["id"]),
|
|
81
|
-
...(opts?.includeActions ? [expr.in(dl.action, opts.includeActions)] : []),
|
|
82
|
-
...(opts?.excludeActions ? [expr.not(expr.in(dl.action, opts.excludeActions))] : []),
|
|
83
|
-
])
|
|
84
|
-
.orderBy((dl) => dl.tableName, "DESC")
|
|
85
|
-
.orderBy((dl) => dl.itemId, "DESC")
|
|
86
|
-
.orderBy((dl) => dl.dateTime, "DESC")
|
|
87
|
-
.top(1)
|
|
88
|
-
.include((dl) => dl.employee)
|
|
89
|
-
.select((dl) => ({
|
|
90
|
-
action: dl.action,
|
|
91
|
-
dateTime: dl.dateTime,
|
|
92
|
-
employeeId: dl.employeeId,
|
|
93
|
-
employeeName: dl.employee!.name,
|
|
94
|
-
})),
|
|
95
|
-
);
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
// ── Runtime: joinFirstDataLog ──
|
|
99
|
-
|
|
100
|
-
Queryable.prototype.joinFirstDataLog = function (
|
|
101
|
-
this: Queryable<any, any>,
|
|
102
|
-
opts?: IDataLogJoinOptions,
|
|
103
|
-
) {
|
|
104
|
-
const tableName = (this.meta.from as TableBuilder<any, any>).meta.name;
|
|
105
|
-
|
|
106
|
-
return this.joinSingle("firstDataLog", (qr, en) =>
|
|
107
|
-
qr
|
|
108
|
-
.from(_DataLog)
|
|
109
|
-
.where((dl) => [
|
|
110
|
-
expr.eq(dl.tableName, tableName),
|
|
111
|
-
expr.eq(dl.itemId, en["id"]),
|
|
112
|
-
...(opts?.includeActions ? [expr.in(dl.action, opts.includeActions)] : []),
|
|
113
|
-
...(opts?.excludeActions ? [expr.not(expr.in(dl.action, opts.excludeActions))] : []),
|
|
114
|
-
])
|
|
115
|
-
.orderBy((dl) => dl.tableName, "ASC")
|
|
116
|
-
.orderBy((dl) => dl.itemId, "ASC")
|
|
117
|
-
.orderBy((dl) => dl.dateTime, "ASC")
|
|
118
|
-
.top(1)
|
|
119
|
-
.include((dl) => dl.employee)
|
|
120
|
-
.select((dl) => ({
|
|
121
|
-
action: dl.action,
|
|
122
|
-
dateTime: dl.dateTime,
|
|
123
|
-
employeeId: dl.employeeId,
|
|
124
|
-
employeeName: dl.employee!.name,
|
|
125
|
-
})),
|
|
126
|
-
);
|
|
127
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// base
|
|
2
|
-
export * from "./tables/base/Role";
|
|
3
|
-
export * from "./tables/base/RolePermission";
|
|
4
|
-
export * from "./tables/base/Employee";
|
|
5
|
-
export * from "./tables/base/EmployeeConfig";
|
|
6
|
-
|
|
7
|
-
// system
|
|
8
|
-
export * from "./tables/system/_Log";
|
|
9
|
-
export * from "./tables/system/_DataLog";
|
|
10
|
-
|
|
11
|
-
export { MainDbContext } from "./MainDbContext";
|
|
12
|
-
export { expr } from "@simplysm/orm-common";
|
|
13
|
-
import "./dataLogExt";
|
|
14
|
-
export type { IDataLogJoinOptions, IDataLogJoinResult, IInsertDataLogParam } from "./dataLogExt";
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Table } from "@simplysm/orm-common";
|
|
2
|
-
import { Role } from "./Role";
|
|
3
|
-
|
|
4
|
-
export const Employee = Table("Employee")
|
|
5
|
-
.columns((c) => ({
|
|
6
|
-
id: c.bigint().autoIncrement(),
|
|
7
|
-
name: c.varchar(100),
|
|
8
|
-
email: c.varchar(200).nullable(),
|
|
9
|
-
phoneNumber: c.varchar(50).nullable(),
|
|
10
|
-
birthDate: c.date().nullable(),
|
|
11
|
-
enteringDate: c.date().nullable(),
|
|
12
|
-
leavingDate: c.date().nullable(),
|
|
13
|
-
socialSecurityNumber: c.varchar(20).nullable(),
|
|
14
|
-
payrollAccountBank: c.varchar(100).nullable(),
|
|
15
|
-
payrollAccountNumber: c.varchar(100).nullable(),
|
|
16
|
-
encryptedPassword: c.varchar(200).nullable(),
|
|
17
|
-
roleId: c.bigint().nullable(),
|
|
18
|
-
isDeleted: c.boolean().default(false),
|
|
19
|
-
}))
|
|
20
|
-
.primaryKey("id")
|
|
21
|
-
.indexes((i) => [i.index("email").unique()])
|
|
22
|
-
.relations((r) => ({
|
|
23
|
-
role: r.foreignKey(["roleId"], () => Role),
|
|
24
|
-
}));
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Table } from "@simplysm/orm-common";
|
|
2
|
-
import { Employee } from "./Employee";
|
|
3
|
-
|
|
4
|
-
export const EmployeeConfig = Table("EmployeeConfig")
|
|
5
|
-
.columns((c) => ({
|
|
6
|
-
employeeId: c.bigint(),
|
|
7
|
-
code: c.varchar(200),
|
|
8
|
-
valueJson: c.text(),
|
|
9
|
-
}))
|
|
10
|
-
.primaryKey("employeeId", "code")
|
|
11
|
-
.relations((r) => ({
|
|
12
|
-
employee: r.foreignKey(["employeeId"], () => Employee),
|
|
13
|
-
}));
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Table } from "@simplysm/orm-common";
|
|
2
|
-
import { Role } from "./Role";
|
|
3
|
-
|
|
4
|
-
export const RolePermission = Table("RolePermission")
|
|
5
|
-
.columns((c) => ({
|
|
6
|
-
roleId: c.bigint(),
|
|
7
|
-
code: c.varchar(200),
|
|
8
|
-
valueJson: c.text(),
|
|
9
|
-
}))
|
|
10
|
-
.primaryKey("roleId", "code")
|
|
11
|
-
.relations((r) => ({
|
|
12
|
-
role: r.foreignKey(["roleId"], () => Role),
|
|
13
|
-
}));
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Table } from "@simplysm/orm-common";
|
|
2
|
-
import { Employee } from "./Employee";
|
|
3
|
-
|
|
4
|
-
export const _DataLog = Table("_DataLog")
|
|
5
|
-
.columns((c) => ({
|
|
6
|
-
id: c.bigint().autoIncrement(),
|
|
7
|
-
tableName: c.varchar(200),
|
|
8
|
-
tableDescription: c.varchar(200).nullable(),
|
|
9
|
-
action: c.varchar(50),
|
|
10
|
-
itemId: c.bigint().nullable(),
|
|
11
|
-
valueJson: c.text().nullable(),
|
|
12
|
-
dateTime: c.datetime(),
|
|
13
|
-
employeeId: c.bigint().nullable(),
|
|
14
|
-
}))
|
|
15
|
-
.primaryKey("id")
|
|
16
|
-
.indexes((i) => [i.index("tableName", "itemId"), i.index("dateTime").orderBy("DESC")])
|
|
17
|
-
.relations((r) => ({
|
|
18
|
-
employee: r.foreignKey(["employeeId"], () => Employee),
|
|
19
|
-
}));
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Table } from "@simplysm/orm-common";
|
|
2
|
-
import { Employee } from "./Employee";
|
|
3
|
-
|
|
4
|
-
export const _Log = Table("_Log")
|
|
5
|
-
.columns((c) => ({
|
|
6
|
-
id: c.bigint().autoIncrement(),
|
|
7
|
-
clientName: c.varchar(200),
|
|
8
|
-
dateTime: c.datetime(),
|
|
9
|
-
severity: c.varchar(50),
|
|
10
|
-
message: c.text(),
|
|
11
|
-
employeeId: c.bigint().nullable(),
|
|
12
|
-
}))
|
|
13
|
-
.primaryKey("id")
|
|
14
|
-
.relations((r) => ({
|
|
15
|
-
employee: r.foreignKey(["employeeId"], () => Employee),
|
|
16
|
-
}));
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@{{projectName}}/server",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"private": true,
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"@{{projectName}}/db-main": "workspace:*",
|
|
8
|
-
"@simplysm/core-common": "~13.0.100",
|
|
9
|
-
"@simplysm/excel": "~13.0.100",
|
|
10
|
-
"@simplysm/orm-common": "~13.0.100",
|
|
11
|
-
"@simplysm/orm-node": "~13.0.100",
|
|
12
|
-
"@simplysm/service-server": "~13.0.100",
|
|
13
|
-
"bcrypt": "^6.0.0",
|
|
14
|
-
"pg": "^8.20.0",
|
|
15
|
-
"pg-copy-streams": "^7.0.0"
|
|
16
|
-
},
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"@types/bcrypt": "^6.0.0"
|
|
19
|
-
}
|
|
20
|
-
}
|
package/templates/init/packages/server/public-dev/dev//354/264/210/352/270/260/355/231/224.xlsx
DELETED
|
Binary file
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export type { AuthServiceMethods } from "./services/AuthService";
|
|
2
|
-
export type { IAuthResult, IAuthData } from "./services/AuthService";
|
|
3
|
-
export type { DevServiceMethods } from "./services/DevService";
|
|
4
|
-
export type { EmployeeServiceMethods } from "./services/EmployeeService";
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import { fileURLToPath } from "url";
|
|
3
|
-
import { env } from "@simplysm/core-common";
|
|
4
|
-
import { createServiceServer, getConfig, OrmService } from "@simplysm/service-server";
|
|
5
|
-
import { AuthService } from "./services/AuthService";
|
|
6
|
-
import { DevService } from "./services/DevService";
|
|
7
|
-
import { EmployeeService } from "./services/EmployeeService";
|
|
8
|
-
|
|
9
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
10
|
-
|
|
11
|
-
const config = await getConfig<Record<string, { jwtSecret: string }>>(
|
|
12
|
-
path.resolve(__dirname, ".config.json"),
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
if (config?.["auth"]?.jwtSecret == null || config["auth"].jwtSecret === "") {
|
|
16
|
-
throw new Error(
|
|
17
|
-
"Missing 'auth.jwtSecret' in .config.json. Server cannot start without JWT secret.",
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const server = createServiceServer({
|
|
22
|
-
rootPath: __dirname,
|
|
23
|
-
port: {{port}},
|
|
24
|
-
auth: config["auth"],
|
|
25
|
-
services: env.DEV
|
|
26
|
-
? [OrmService, AuthService, DevService, EmployeeService]
|
|
27
|
-
: [OrmService, AuthService, EmployeeService],
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
// 프로덕션 모드: 정적 파일 서빙 포함하여 직접 listen
|
|
31
|
-
// Watch 모드 (env.DEV): Server Runtime Worker가 proxy 설정 후 listen 호출
|
|
32
|
-
if (!env.DEV) {
|
|
33
|
-
await server.listen();
|
|
34
|
-
}
|