@simplysm/sd-cli 7.0.249 → 7.0.267
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 +95 -0
- package/assets/client-files/assets/icons/icon-128x128.png +0 -0
- package/assets/client-files/assets/icons/icon-144x144.png +0 -0
- package/assets/client-files/assets/icons/icon-152x152.png +0 -0
- package/assets/client-files/assets/icons/icon-192x192.png +0 -0
- package/assets/client-files/assets/icons/icon-384x384.png +0 -0
- package/assets/client-files/assets/icons/icon-512x512.png +0 -0
- package/assets/client-files/assets/icons/icon-72x72.png +0 -0
- package/assets/client-files/assets/icons/icon-96x96.png +0 -0
- package/assets/client-files/favicon.ico +0 -0
- package/dist/bin/sd-cli.mjs +212 -15
- package/dist/build-tool/SdCliCordova.mjs +3 -3
- package/dist/build-tool/SdCliElectron.mjs +3 -2
- package/dist/build-tool/SdCliIndexFileGenerator.mjs +2 -3
- package/dist/builder/SdCliClientBuilder.d.ts +2 -0
- package/dist/builder/SdCliClientBuilder.mjs +57 -20
- package/dist/builder/SdCliServerBuilder.d.ts +2 -0
- package/dist/builder/SdCliServerBuilder.mjs +27 -13
- package/dist/builder/SdCliTsLibBuilder.mjs +18 -12
- package/dist/commons.d.ts +6 -1
- package/dist/entry-points/SdCliPrepare.mjs +34 -34
- package/dist/entry-points/SdCliProjectGenerator.d.ts +44 -0
- package/dist/entry-points/SdCliProjectGenerator.mjs +320 -0
- package/dist/entry-points/SdCliWorkspace.d.ts +6 -6
- package/dist/entry-points/SdCliWorkspace.mjs +61 -107
- package/dist/entry-points/file/base/fc_package_eslintrc.d.ts +3 -0
- package/dist/entry-points/file/base/fc_package_eslintrc.mjs +31 -0
- package/dist/entry-points/file/base/fc_package_npmconfig.d.ts +9 -0
- package/dist/entry-points/file/base/fc_package_npmconfig.mjs +32 -0
- package/dist/entry-points/file/base/fc_package_tsconfig.d.ts +5 -0
- package/dist/entry-points/file/base/fc_package_tsconfig.mjs +13 -0
- package/dist/entry-points/file/client/fc_package_AppModule.d.ts +1 -0
- package/dist/entry-points/file/client/fc_package_AppModule.mjs +37 -0
- package/dist/entry-points/file/client/fc_package_AppPage.d.ts +1 -0
- package/dist/entry-points/file/client/fc_package_AppPage.mjs +14 -0
- package/dist/entry-points/file/client/fc_package_Page.d.ts +4 -0
- package/dist/entry-points/file/client/fc_package_Page.mjs +19 -0
- package/dist/entry-points/file/client/fc_package_client_main.d.ts +1 -0
- package/dist/entry-points/file/client/fc_package_client_main.mjs +19 -0
- package/dist/entry-points/file/client/fc_package_index.d.ts +3 -0
- package/dist/entry-points/file/client/fc_package_index.mjs +88 -0
- package/dist/entry-points/file/client/fc_package_manifest.d.ts +5 -0
- package/dist/entry-points/file/client/fc_package_manifest.mjs +54 -0
- package/dist/entry-points/file/client/fc_package_polyfills.d.ts +1 -0
- package/dist/entry-points/file/client/fc_package_polyfills.mjs +11 -0
- package/dist/entry-points/file/client/fc_package_styles.d.ts +1 -0
- package/dist/entry-points/file/client/fc_package_styles.mjs +7 -0
- package/dist/entry-points/file/db/fc_package_DbContext.d.ts +3 -0
- package/dist/entry-points/file/db/fc_package_DbContext.mjs +14 -0
- package/dist/entry-points/file/db/fc_package_DbModel.d.ts +4 -0
- package/dist/entry-points/file/db/fc_package_DbModel.mjs +12 -0
- package/dist/entry-points/file/project/fc_project_editor_config.d.ts +1 -0
- package/dist/entry-points/file/project/fc_project_editor_config.mjs +22 -0
- package/dist/entry-points/file/project/fc_project_eslintrc.d.ts +1 -0
- package/dist/entry-points/file/project/fc_project_eslintrc.mjs +30 -0
- package/dist/entry-points/file/project/fc_project_gitattributes.d.ts +1 -0
- package/dist/entry-points/file/project/fc_project_gitattributes.mjs +6 -0
- package/dist/entry-points/file/project/fc_project_gitignore.d.ts +1 -0
- package/dist/entry-points/file/project/fc_project_gitignore.mjs +17 -0
- package/dist/entry-points/file/project/fc_project_npmconfig.d.ts +7 -0
- package/dist/entry-points/file/project/fc_project_npmconfig.mjs +35 -0
- package/dist/entry-points/file/project/fc_project_readme.d.ts +3 -0
- package/dist/entry-points/file/project/fc_project_readme.mjs +13 -0
- package/dist/entry-points/file/project/fc_project_simplysm.d.ts +1 -0
- package/dist/entry-points/file/project/fc_project_simplysm.mjs +2 -0
- package/dist/entry-points/file/project/fc_project_tsconfig.d.ts +1 -0
- package/dist/entry-points/file/project/fc_project_tsconfig.mjs +25 -0
- package/dist/entry-points/file/server/fc_package_server_main.d.ts +4 -0
- package/dist/entry-points/file/server/fc_package_server_main.mjs +60 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.mjs +24 -1
- package/dist/ng-tools/SdCliNgModuleGenerator.mjs +35 -36
- package/dist/packages/SdCliPackage.d.ts +1 -0
- package/dist/packages/SdCliPackage.mjs +69 -63
- package/dist/utils/SdCliBuildResultUtil.mjs +2 -2
- package/docs/client-add-page.md +8 -0
- package/docs/client-router.md +85 -0
- package/docs/client-sw.md +101 -0
- package/docs/conf-orm.md +81 -0
- package/docs/conf-usage.md +5 -0
- package/docs/lib-local-update.md +50 -0
- package/docs/lib-ts-paths.md +25 -0
- package/package.json +10 -8
- package/src/SdCliBuildResultError.ts +9 -9
- package/src/bin/sd-cli.ts +244 -15
- package/src/build-tool/SdCliCacheCompilerHost.ts +77 -77
- package/src/build-tool/SdCliCordova.ts +2 -2
- package/src/build-tool/SdCliElectron.ts +2 -1
- package/src/build-tool/SdCliGithubApi.ts +110 -110
- package/src/build-tool/SdCliIndexFileGenerator.ts +79 -80
- package/src/build-tool/SdCliNgCacheCompilerHost.ts +58 -58
- package/src/build-tool/SdCliPackageLinter.ts +74 -74
- package/src/builder/SdCliClientBuilder.ts +73 -22
- package/src/builder/SdCliJsLibBuilder.ts +70 -70
- package/src/builder/SdCliServerBuilder.ts +34 -14
- package/src/builder/SdCliTsLibBuilder.ts +450 -445
- package/src/commons.ts +6 -1
- package/src/entry-points/SdCliFileCrypto.ts +87 -87
- package/src/entry-points/SdCliPrepare.ts +55 -55
- package/src/entry-points/SdCliProjectGenerator.ts +395 -0
- package/src/entry-points/SdCliWorkspace.ts +74 -122
- package/src/entry-points/file/base/fc_package_eslintrc.ts +30 -0
- package/src/entry-points/file/base/fc_package_npmconfig.ts +43 -0
- package/src/entry-points/file/base/fc_package_tsconfig.ts +12 -0
- package/src/entry-points/file/client/fc_package_AppModule.ts +36 -0
- package/src/entry-points/file/client/fc_package_AppPage.ts +13 -0
- package/src/entry-points/file/client/fc_package_Page.ts +19 -0
- package/src/entry-points/file/client/fc_package_client_main.ts +18 -0
- package/src/entry-points/file/client/fc_package_index.ts +87 -0
- package/src/entry-points/file/client/fc_package_manifest.ts +53 -0
- package/src/entry-points/file/client/fc_package_polyfills.ts +10 -0
- package/src/entry-points/file/client/fc_package_styles.ts +6 -0
- package/src/entry-points/file/db/fc_package_DbContext.ts +14 -0
- package/src/entry-points/file/db/fc_package_DbModel.ts +11 -0
- package/src/entry-points/file/project/fc_project_editor_config.ts +21 -0
- package/src/entry-points/file/project/fc_project_eslintrc.ts +29 -0
- package/src/entry-points/file/project/fc_project_gitattributes.ts +5 -0
- package/src/entry-points/file/project/fc_project_gitignore.ts +16 -0
- package/src/entry-points/file/project/fc_project_npmconfig.ts +34 -0
- package/src/entry-points/file/project/fc_project_readme.ts +12 -0
- package/src/entry-points/file/project/fc_project_simplysm.ts +1 -0
- package/src/entry-points/file/project/fc_project_tsconfig.ts +24 -0
- package/src/entry-points/file/server/fc_package_server_main.ts +62 -0
- package/src/index.ts +55 -32
- package/src/ng-tools/SdCliNgModuleGenerator.ts +639 -640
- package/src/ng-tools/babel/SdCliBbFileMetadata.ts +568 -568
- package/src/ng-tools/babel/SdCliBbRootMetadata.ts +239 -239
- package/src/ng-tools/babel/SdCliBbUtil.ts +15 -15
- package/src/ng-tools/babel/TSdCliBbNgMetadata.ts +234 -234
- package/src/ng-tools/babel/TSdCliBbTypeMetadata.ts +177 -177
- package/src/ng-tools/commons.ts +3 -3
- package/src/ng-tools/typescript/SdCliTsFileMetadata.ts +384 -384
- package/src/ng-tools/typescript/SdCliTsRootMetadata.ts +32 -32
- package/src/ng-tools/typescript/SdCliTsUtil.ts +29 -29
- package/src/packages/SdCliPackage.ts +76 -59
- package/src/utils/SdCliBuildResultUtil.ts +76 -76
- package/src/utils/SdCliConfigUtil.ts +94 -94
- package/src/utils/SdCliNpmConfigUtil.ts +16 -16
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# 클라이언트 패키지에 ServiceWorker 기능 추가
|
|
2
|
+
|
|
3
|
+
## @angular/service-worker 의존성 추가
|
|
4
|
+
|
|
5
|
+
package.json
|
|
6
|
+
|
|
7
|
+
``` json
|
|
8
|
+
{
|
|
9
|
+
...,
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@angular/service-worker": "^13.2.0",
|
|
12
|
+
...
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 패키지 루트에 ngsw-config.json 파일 추가
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"$schema": "../../node_modules/@angular/service-worker/config/schema.json",
|
|
22
|
+
"index": "/index.html",
|
|
23
|
+
"assetGroups": [
|
|
24
|
+
{
|
|
25
|
+
"name": "app",
|
|
26
|
+
"installMode": "prefetch",
|
|
27
|
+
"resources": {
|
|
28
|
+
"files": [
|
|
29
|
+
"/favicon.ico",
|
|
30
|
+
"/index.html",
|
|
31
|
+
"/manifest.json",
|
|
32
|
+
"/*.css",
|
|
33
|
+
"/*.js"
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "assets",
|
|
39
|
+
"installMode": "lazy",
|
|
40
|
+
"updateMode": "prefetch",
|
|
41
|
+
"resources": {
|
|
42
|
+
"files": [
|
|
43
|
+
"/assets/**",
|
|
44
|
+
"/*.(eot|svg|cur|jpg|jpeg|png|webp|gif|otf|ttf|woff|woff2|ani|xlsx|pptx|docx|zip|xls|ppt|doc)"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
## ServiceWorkerModule 추가
|
|
54
|
+
|
|
55
|
+
AppModule.ts
|
|
56
|
+
|
|
57
|
+
``` ts
|
|
58
|
+
@NgModule({
|
|
59
|
+
imports: [
|
|
60
|
+
ServiceWorkerModule.register("ngsw-worker.js", {
|
|
61
|
+
enabled: process.env["NODE_ENV"] === "production",
|
|
62
|
+
registrationStrategy: "registerWhenStable:30000"
|
|
63
|
+
}),
|
|
64
|
+
...
|
|
65
|
+
]
|
|
66
|
+
})
|
|
67
|
+
export class AppModule implements DoBootstrap {
|
|
68
|
+
...
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## ServiceWorker 업데이트 체크 로직 추가
|
|
73
|
+
|
|
74
|
+
AppModule.ts
|
|
75
|
+
|
|
76
|
+
``` ts
|
|
77
|
+
@NgModule({
|
|
78
|
+
...
|
|
79
|
+
})
|
|
80
|
+
export class AppModule implements DoBootstrap {
|
|
81
|
+
...
|
|
82
|
+
|
|
83
|
+
public constructor(private readonly _swUpdate: SwUpdate) {
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
public async ngDoBootstrap(appRef: ApplicationRef): Promise<void> {
|
|
87
|
+
...
|
|
88
|
+
appRef.bootstrap(AppPage);
|
|
89
|
+
|
|
90
|
+
// 업데이트 체크 (비동기)
|
|
91
|
+
if (this._swUpdate.isEnabled) {
|
|
92
|
+
if (await this._swUpdate.checkForUpdate()) {
|
|
93
|
+
if (window.confirm("클라이언트가 업데이트되었습니다. 새로고침하시겠습니까?\n\n - 새로고침하지 않으면 몇몇 기능이 정상적으로 동작하지 않을 수 있습니다.")) {
|
|
94
|
+
await this._swUpdate.activateUpdate();
|
|
95
|
+
window.location.reload();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
package/docs/conf-orm.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# 각 패키지에 orm 설정
|
|
2
|
+
|
|
3
|
+
orm(DB)를 사용하는 모든 클라이언트 및 서버 패키지에 ORM 설정 추가
|
|
4
|
+
|
|
5
|
+
## simplysm.json 각 패키지 설정
|
|
6
|
+
|
|
7
|
+
아래 설정을 추천 예시 설정입니다.
|
|
8
|
+
|
|
9
|
+
(클라이언트/서버 패키지에만 추가, 라이브러리에는 추가하지 않음)
|
|
10
|
+
|
|
11
|
+
``` json
|
|
12
|
+
{
|
|
13
|
+
"packages": {
|
|
14
|
+
"client": {
|
|
15
|
+
...,
|
|
16
|
+
"configs": {
|
|
17
|
+
"orm": {
|
|
18
|
+
"MAIN": {
|
|
19
|
+
"dialect": "mysql",
|
|
20
|
+
"host": "localhost",
|
|
21
|
+
"port": 3306,
|
|
22
|
+
"username": "username",
|
|
23
|
+
"password": "password",
|
|
24
|
+
"defaultIsolationLevel": "READ_UNCOMMITTED"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
...
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
* [simplysm.json 사용법](conf-usage.md)
|
|
34
|
+
|
|
35
|
+
위의 옵션은, 심플리즘 라이브러리를 통해 "MAIN"이라는 이름으로 접속시, 하위 접속정보에 해당하는 DB로 접속하는 옵션입니다.
|
|
36
|
+
|
|
37
|
+
옵션값 각각의 의미는 다음과 같습니다.
|
|
38
|
+
|
|
39
|
+
* **dialect**: *[필수]* DB 컨테이너 구분 (mysql, mssql, mssql-azure)
|
|
40
|
+
* **host**: *[필수]* 접속 HOST (or IP)
|
|
41
|
+
* **port**: *[옵션]* 접속 PORT번호 (기본값: mssql=3306, mssql=1433, mssql-azure=1433)
|
|
42
|
+
* **username**: *[필수]* 인증 아이디
|
|
43
|
+
* **password**: *[필수]* 인증 비밀번호
|
|
44
|
+
* **defaultIsolationLevel**: *[옵션]* ISOLATION LEVEL, DIALECT에 따라 입력가능 정보가 다릅니다.
|
|
45
|
+
* MSSQL: REPEATABLE_READ, READ_COMMITTED(*기본값*), READ_UNCOMMITTED, SERIALIZABLE, SNAPSHOT
|
|
46
|
+
* MYSQL: REPEATABLE_READ(*기본값*), READ_COMMITTED, READ_UNCOMMITTED, SERIALIZABLE
|
|
47
|
+
* 자세한 사항은 각 Dialect 공식문서를 참고하세요.
|
|
48
|
+
|
|
49
|
+
## ORM 사용 패키지의 package.json 의존성 추가
|
|
50
|
+
|
|
51
|
+
ORM 라이브러리 의존성 추가
|
|
52
|
+
|
|
53
|
+
``` json
|
|
54
|
+
{
|
|
55
|
+
...,
|
|
56
|
+
"dependencies": {
|
|
57
|
+
...,
|
|
58
|
+
"@simplysm/sd-orm-common": "~7.0.0"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
DB 라이브러리 의존성 추가 예제
|
|
64
|
+
|
|
65
|
+
``` json
|
|
66
|
+
{
|
|
67
|
+
...,
|
|
68
|
+
"dependencies": {
|
|
69
|
+
...,
|
|
70
|
+
"@simplysm-ts/db-main": "1.0.0"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
위 의존성은 아래 상황을 가정하여 입력된 예제입니다.
|
|
76
|
+
* 프로젝트명: simplysm-ts
|
|
77
|
+
* DB패키지명: main
|
|
78
|
+
* 프로젝트버전: 1.0.0
|
|
79
|
+
|
|
80
|
+
DB 라이브러리 의존성을 추가했다면, 해당 라이브러리를 tsconfig.json에도 경로를 추가해야함
|
|
81
|
+
* [내부 라이브러리에 대한 tsconfig.json에 경로 추가](lib-ts-paths.md)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# 라이브러리 패키지 로컬업데이트 설정
|
|
2
|
+
|
|
3
|
+
라이브러리를 로컬 디렉토리에 있는 라이브러리 소스에서 자동으로 업데이트 합니다.
|
|
4
|
+
|
|
5
|
+
## 사용법
|
|
6
|
+
|
|
7
|
+
프로젝트 디렉토리의 simplysm.json 에 다음 옵션을 추가합니다.
|
|
8
|
+
|
|
9
|
+
``` json
|
|
10
|
+
{
|
|
11
|
+
"packages": {
|
|
12
|
+
...
|
|
13
|
+
},
|
|
14
|
+
...,
|
|
15
|
+
"localUpdates": {
|
|
16
|
+
"@simplysm/*": "../simplysm/packages/*"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
위 예제는 다음을 의미합니다.
|
|
21
|
+
* scope `simplysm` 안의 모든 패키지를 `../simplysm/packages/*`안의 파일로 모두 전환합니다.
|
|
22
|
+
* 즉 `node_modules/@simplysm` 폴더에 `../simplysm/packages`폴더를 복사하여 덮어씁니다.
|
|
23
|
+
|
|
24
|
+
이제 다음 명령어를 실행하면 위의 동작이 수행됩니다.
|
|
25
|
+
|
|
26
|
+
``` bat
|
|
27
|
+
:: 주의사항: 대상이되는 라이브러리는 반드시 빌드되어 있거나, 변경감지 중이여야 합니다.
|
|
28
|
+
:: sd-cli local-update --help 참고
|
|
29
|
+
sd-cli local-update
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
또한, `sd-cli watch` 를 수행할 경우에는, 로컬 라이브러리 파일이 변경되면 자동으로 해당 파일을 다시 덮어씁니다.
|
|
33
|
+
|
|
34
|
+
## (선택) package.json script 수정
|
|
35
|
+
|
|
36
|
+
로컬업데이트 사용시에는, 다음과 같이 스크립트를 수정하여, `sd-cli`가 수행되기 전에 `local-update`를 수행하는 것을 추천합니다.
|
|
37
|
+
|
|
38
|
+
``` json
|
|
39
|
+
{
|
|
40
|
+
...,
|
|
41
|
+
"scripts": {
|
|
42
|
+
"watch": "sd-cli local-update && sd-cli watch",
|
|
43
|
+
"build": "sd-cli local-update && sd-cli build",
|
|
44
|
+
"publish": "sd-cli local-update && sd-cli publish",
|
|
45
|
+
"----- utils": "",
|
|
46
|
+
"postinstall": "sd-cli local-update && sd-cli prepare"
|
|
47
|
+
},
|
|
48
|
+
...
|
|
49
|
+
}
|
|
50
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# 내부 라이브러리에 대한 tsconfig.json에 경로 추가
|
|
2
|
+
|
|
3
|
+
내부 라이브러리가 빌드되지 않더라도, IDE 에서 ts 타입을 제대로 체크하도록 tsconfig.json에 baseUrl과 paths를 추가함
|
|
4
|
+
|
|
5
|
+
패키지의 tsconfig.json
|
|
6
|
+
``` json
|
|
7
|
+
{
|
|
8
|
+
...,
|
|
9
|
+
"compilerOptions": {
|
|
10
|
+
...,
|
|
11
|
+
"baseUrl": ".",
|
|
12
|
+
"paths": {
|
|
13
|
+
...,
|
|
14
|
+
"@simplysm-ts/common": [
|
|
15
|
+
"../common/src/index.ts"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
위 예제은 아래 상황을 가정하여 입력된 예제입니다.
|
|
23
|
+
* 프로젝트명: simplysm-ts
|
|
24
|
+
* 내부 라이브러리 패키지명: common
|
|
25
|
+
* 내부 라이브러리 상대경로: "../common/src/index.ts"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysm/sd-cli",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.267",
|
|
4
4
|
"description": "심플리즘 패키지 - CLI",
|
|
5
5
|
"author": "김석래",
|
|
6
6
|
"repository": {
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"@babel/parser": "^7.17.0",
|
|
24
24
|
"@babel/types": "^7.17.0",
|
|
25
25
|
"@ngtools/webpack": "^13.2.2",
|
|
26
|
-
"@simplysm/sd-core-common": "7.0.
|
|
27
|
-
"@simplysm/sd-core-node": "7.0.
|
|
28
|
-
"@simplysm/sd-service-common": "7.0.
|
|
29
|
-
"@simplysm/sd-service-server": "7.0.
|
|
30
|
-
"@simplysm/sd-storage": "7.0.
|
|
26
|
+
"@simplysm/sd-core-common": "7.0.267",
|
|
27
|
+
"@simplysm/sd-core-node": "7.0.267",
|
|
28
|
+
"@simplysm/sd-service-common": "7.0.267",
|
|
29
|
+
"@simplysm/sd-service-server": "7.0.267",
|
|
30
|
+
"@simplysm/sd-storage": "7.0.267",
|
|
31
31
|
"browserslist": "^4.19.1",
|
|
32
32
|
"chokidar": "^3.5.3",
|
|
33
33
|
"connect": "^3.7.0",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"cordova": "^11.0.0",
|
|
36
36
|
"css-loader": "^6.6.0",
|
|
37
37
|
"electron": "^18.0.1",
|
|
38
|
-
"electron-builder": "^
|
|
38
|
+
"electron-builder": "^23.0.3",
|
|
39
39
|
"eslint": "^8.7.0",
|
|
40
40
|
"eslint-webpack-plugin": "^3.1.1",
|
|
41
41
|
"jsdom": "^19.0.0",
|
|
@@ -55,7 +55,9 @@
|
|
|
55
55
|
"typescript": "~4.5.5",
|
|
56
56
|
"webpack": "^5.68.0",
|
|
57
57
|
"xml2js": "^0.4.23",
|
|
58
|
-
"yargs": "^17.3.1"
|
|
58
|
+
"yargs": "^17.3.1",
|
|
59
|
+
"typedoc": "^0.22.15",
|
|
60
|
+
"@compodoc/compodoc": "^1.1.7"
|
|
59
61
|
},
|
|
60
62
|
"devDependencies": {
|
|
61
63
|
"@types/connect": "^3.4.35",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { SdError } from "@simplysm/sd-core-common";
|
|
2
|
-
import { ISdCliPackageBuildResult } from "./commons";
|
|
3
|
-
import { SdCliBuildResultUtil } from "./utils/SdCliBuildResultUtil";
|
|
4
|
-
|
|
5
|
-
export class SdCliBuildResultError extends SdError {
|
|
6
|
-
public constructor(buildResult: ISdCliPackageBuildResult) {
|
|
7
|
-
super(SdCliBuildResultUtil.getMessage(buildResult));
|
|
8
|
-
}
|
|
9
|
-
}
|
|
1
|
+
import { SdError } from "@simplysm/sd-core-common";
|
|
2
|
+
import { ISdCliPackageBuildResult } from "./commons";
|
|
3
|
+
import { SdCliBuildResultUtil } from "./utils/SdCliBuildResultUtil";
|
|
4
|
+
|
|
5
|
+
export class SdCliBuildResultError extends SdError {
|
|
6
|
+
public constructor(buildResult: ISdCliPackageBuildResult) {
|
|
7
|
+
super(SdCliBuildResultUtil.getMessage(buildResult));
|
|
8
|
+
}
|
|
9
|
+
}
|
package/src/bin/sd-cli.ts
CHANGED
|
@@ -10,11 +10,11 @@ import { SdCliPrepare } from "../entry-points/SdCliPrepare";
|
|
|
10
10
|
import { SdCliFileCrypto } from "../entry-points/SdCliFileCrypto";
|
|
11
11
|
import { SdCliCordova } from "../build-tool/SdCliCordova";
|
|
12
12
|
import { SdCliElectron } from "../build-tool/SdCliElectron";
|
|
13
|
+
import { SdCliProjectGenerator } from "../entry-points/SdCliProjectGenerator";
|
|
13
14
|
|
|
14
15
|
Error.stackTraceLimit = Infinity;
|
|
15
16
|
|
|
16
|
-
const argv = yargs(hideBin(process.argv))
|
|
17
|
-
.version(false)
|
|
17
|
+
const argv = (yargs(hideBin(process.argv)) as any)
|
|
18
18
|
.help("help", "도움말")
|
|
19
19
|
.alias("help", "h")
|
|
20
20
|
.options({
|
|
@@ -27,17 +27,17 @@ const argv = yargs(hideBin(process.argv))
|
|
|
27
27
|
.command(
|
|
28
28
|
"prepare",
|
|
29
29
|
"sd-cli 준비",
|
|
30
|
-
(cmd) => cmd.version(false)
|
|
30
|
+
(cmd) => cmd.version(false).hide("help").hide("debug")
|
|
31
31
|
)
|
|
32
32
|
.command(
|
|
33
33
|
"update",
|
|
34
34
|
"패키지 업데이트 (npm update)",
|
|
35
|
-
(cmd) => cmd.version(false)
|
|
35
|
+
(cmd) => cmd.version(false).hide("help").hide("debug")
|
|
36
36
|
)
|
|
37
37
|
.command(
|
|
38
38
|
"local-update",
|
|
39
39
|
"로컬 라이브러리 업데이트를 수행합니다.",
|
|
40
|
-
(cmd) => cmd.version(false)
|
|
40
|
+
(cmd) => cmd.version(false).hide("help").hide("debug")
|
|
41
41
|
.options({
|
|
42
42
|
config: {
|
|
43
43
|
type: "string",
|
|
@@ -48,7 +48,7 @@ const argv = yargs(hideBin(process.argv))
|
|
|
48
48
|
.command(
|
|
49
49
|
"watch",
|
|
50
50
|
"프로젝트의 각 패키지에 대한 변경감지 빌드를 수행합니다.",
|
|
51
|
-
(cmd) => cmd.version(false)
|
|
51
|
+
(cmd) => cmd.version(false).hide("help").hide("debug")
|
|
52
52
|
.options({
|
|
53
53
|
config: {
|
|
54
54
|
type: "string",
|
|
@@ -93,7 +93,7 @@ const argv = yargs(hideBin(process.argv))
|
|
|
93
93
|
})
|
|
94
94
|
)
|
|
95
95
|
.command(
|
|
96
|
-
"run-cordova <platform> <package>
|
|
96
|
+
"run-cordova <platform> <package> <url>",
|
|
97
97
|
"변경감지중인 플랫폼을 코도바 디바이스에 앱 형태로 띄웁니다.",
|
|
98
98
|
(cmd) => cmd
|
|
99
99
|
.positional("platform", {
|
|
@@ -115,7 +115,7 @@ const argv = yargs(hideBin(process.argv))
|
|
|
115
115
|
.command(
|
|
116
116
|
"build",
|
|
117
117
|
"프로젝트의 각 패키지에 대한 빌드를 수행합니다.",
|
|
118
|
-
(cmd) => cmd.version(false)
|
|
118
|
+
(cmd) => cmd.version(false).hide("help").hide("debug")
|
|
119
119
|
.options({
|
|
120
120
|
config: {
|
|
121
121
|
type: "string",
|
|
@@ -136,7 +136,7 @@ const argv = yargs(hideBin(process.argv))
|
|
|
136
136
|
.command(
|
|
137
137
|
"publish",
|
|
138
138
|
"프로젝트의 각 패키지를 배포합니다.",
|
|
139
|
-
(cmd) => cmd.version(false)
|
|
139
|
+
(cmd) => cmd.version(false).hide("help").hide("debug")
|
|
140
140
|
.options({
|
|
141
141
|
noBuild: {
|
|
142
142
|
type: "boolean",
|
|
@@ -162,24 +162,198 @@ const argv = yargs(hideBin(process.argv))
|
|
|
162
162
|
.command(
|
|
163
163
|
"enc-file <file>",
|
|
164
164
|
"파일을 암호화 합니다.",
|
|
165
|
-
(cmd) => cmd.version(false)
|
|
165
|
+
(cmd) => cmd.version(false).hide("help").hide("debug")
|
|
166
166
|
.positional("file", {
|
|
167
167
|
type: "string",
|
|
168
|
-
describe: "암호화할 파일명"
|
|
168
|
+
describe: "암호화할 파일명",
|
|
169
|
+
demandOption: true
|
|
169
170
|
})
|
|
170
171
|
)
|
|
171
172
|
.command(
|
|
172
173
|
"dec-file <file>",
|
|
173
174
|
"파일을 복호화 합니다.",
|
|
174
|
-
(cmd) => cmd.version(false)
|
|
175
|
+
(cmd) => cmd.version(false).hide("help").hide("debug")
|
|
175
176
|
.positional("file", {
|
|
176
177
|
type: "string",
|
|
177
|
-
describe: "암호화된 파일명"
|
|
178
|
+
describe: "암호화된 파일명",
|
|
179
|
+
demandOption: true
|
|
180
|
+
})
|
|
181
|
+
)
|
|
182
|
+
.command(
|
|
183
|
+
"init <description> <author> <gitUrl> [name]",
|
|
184
|
+
"프로젝트를 초기화 합니다.",
|
|
185
|
+
(cmd) => cmd.version(false).hide("help").hide("debug")
|
|
186
|
+
.positional("description", {
|
|
187
|
+
type: "string",
|
|
188
|
+
describe: "프로젝트 설명(=명칭)",
|
|
189
|
+
demandOption: true
|
|
190
|
+
})
|
|
191
|
+
.positional("author", {
|
|
192
|
+
type: "string",
|
|
193
|
+
describe: "작성자",
|
|
194
|
+
demandOption: true
|
|
195
|
+
})
|
|
196
|
+
.positional("gitUrl", {
|
|
197
|
+
type: "string",
|
|
198
|
+
describe: "소스코드 관리를 위한 GIT 레파지토리 URL",
|
|
199
|
+
demandOption: true
|
|
200
|
+
})
|
|
201
|
+
.positional("name", {
|
|
202
|
+
type: "string",
|
|
203
|
+
describe: "프로젝트 영문명 (기본값: 최종폴더명)"
|
|
178
204
|
})
|
|
205
|
+
.example([
|
|
206
|
+
["$0 init sample 샘플프로젝트 홍길동 https://github.com/my/sample.git"]
|
|
207
|
+
])
|
|
208
|
+
)
|
|
209
|
+
.command(
|
|
210
|
+
"add",
|
|
211
|
+
"프로젝트에 패키지/기능등을 추가합니다.",
|
|
212
|
+
(cmd) => cmd.version(false).hide("help").hide("debug")
|
|
213
|
+
.command(
|
|
214
|
+
"ts-lib <name> <description>",
|
|
215
|
+
"타입스트립트 라이브러리 패키지를 추가합니다.",
|
|
216
|
+
(cmd1) => cmd1.version(false).hide("help").hide("debug")
|
|
217
|
+
.positional("name", {
|
|
218
|
+
type: "string",
|
|
219
|
+
describe: "패키지명",
|
|
220
|
+
demandOption: true
|
|
221
|
+
})
|
|
222
|
+
.positional("description", {
|
|
223
|
+
type: "string",
|
|
224
|
+
describe: "패키지설명",
|
|
225
|
+
demandOption: true
|
|
226
|
+
})
|
|
227
|
+
.options({
|
|
228
|
+
useDom: {
|
|
229
|
+
type: "boolean",
|
|
230
|
+
describe: "DOM객체(window, document 등) 사용 여부",
|
|
231
|
+
default: false
|
|
232
|
+
},
|
|
233
|
+
isForAngular: {
|
|
234
|
+
type: "boolean",
|
|
235
|
+
describe: "Angular 라이브러리 여부 (useDom 옵션을 덮어씁니다)",
|
|
236
|
+
default: false
|
|
237
|
+
}
|
|
238
|
+
})
|
|
239
|
+
.example([
|
|
240
|
+
["$0 add ts-lib common 공통모듈"],
|
|
241
|
+
["$0 sd-cli add ts-lib client-common \"클라이언트 공통\" --useDom"]
|
|
242
|
+
])
|
|
243
|
+
)
|
|
244
|
+
.command(
|
|
245
|
+
"db-lib <name>",
|
|
246
|
+
"DB 라이브러리 패키지를 추가합니다.",
|
|
247
|
+
(cmd1) => cmd1.version(false).hide("help").hide("debug")
|
|
248
|
+
.positional("name", {
|
|
249
|
+
type: "string",
|
|
250
|
+
describe: "패키지명",
|
|
251
|
+
demandOption: true
|
|
252
|
+
})
|
|
253
|
+
.example([
|
|
254
|
+
["$0 add db-lib main"]
|
|
255
|
+
])
|
|
256
|
+
)
|
|
257
|
+
.command(
|
|
258
|
+
"db-model <dbName> <category> <name> <description>",
|
|
259
|
+
"DB 패키지에 모델를 추가합니다.",
|
|
260
|
+
(cmd1) => cmd1.version(false).hide("help").hide("debug")
|
|
261
|
+
.positional("dbName", {
|
|
262
|
+
type: "string",
|
|
263
|
+
describe: "DB 패키지 영문명 = 'DbContext'명칭",
|
|
264
|
+
demandOption: true
|
|
265
|
+
})
|
|
266
|
+
.positional("category", {
|
|
267
|
+
type: "string",
|
|
268
|
+
describe: "추가할 모델의 분류명",
|
|
269
|
+
demandOption: true
|
|
270
|
+
})
|
|
271
|
+
.positional("name", {
|
|
272
|
+
type: "string",
|
|
273
|
+
describe: "추가할 모델의 명칭 (테이블명)",
|
|
274
|
+
demandOption: true
|
|
275
|
+
})
|
|
276
|
+
.positional("description", {
|
|
277
|
+
type: "string",
|
|
278
|
+
describe: "추가할 모델의 설명 (테이블 설명)",
|
|
279
|
+
demandOption: true
|
|
280
|
+
})
|
|
281
|
+
.example([
|
|
282
|
+
["$0 add db-model main base Employee 직원"]
|
|
283
|
+
])
|
|
284
|
+
)
|
|
285
|
+
.command(
|
|
286
|
+
"server [name] [description]",
|
|
287
|
+
"서버 패키지를 추가합니다.",
|
|
288
|
+
(cmd1) => cmd1.version(false).hide("help").hide("debug")
|
|
289
|
+
.positional("name", {
|
|
290
|
+
type: "string",
|
|
291
|
+
describe: "패키지명"
|
|
292
|
+
})
|
|
293
|
+
.positional("description", {
|
|
294
|
+
type: "string",
|
|
295
|
+
describe: "패키지 설명"
|
|
296
|
+
})
|
|
297
|
+
.example([
|
|
298
|
+
["$0 add server"]
|
|
299
|
+
])
|
|
300
|
+
)
|
|
301
|
+
.command(
|
|
302
|
+
"client <name> <description> <serverName>",
|
|
303
|
+
"클라이언트 패키지를 추가합니다.",
|
|
304
|
+
(cmd1) => cmd1.version(false).hide("help").hide("debug")
|
|
305
|
+
.positional("name", {
|
|
306
|
+
type: "string",
|
|
307
|
+
describe: "패키지명",
|
|
308
|
+
demandOption: true
|
|
309
|
+
})
|
|
310
|
+
.positional("description", {
|
|
311
|
+
type: "string",
|
|
312
|
+
describe: "패키지 설명",
|
|
313
|
+
demandOption: true
|
|
314
|
+
})
|
|
315
|
+
.positional("serverName", {
|
|
316
|
+
type: "string",
|
|
317
|
+
describe: "서버 패키지명",
|
|
318
|
+
demandOption: true
|
|
319
|
+
})
|
|
320
|
+
.example([
|
|
321
|
+
["$0 add client admin 관리자 server"]
|
|
322
|
+
])
|
|
323
|
+
)
|
|
324
|
+
.command(
|
|
325
|
+
"page <pkgName> <name> [category]",
|
|
326
|
+
"패키지에 페이지를 추가합니다.",
|
|
327
|
+
(cmd1) => cmd1.version(false).hide("help").hide("debug")
|
|
328
|
+
.positional("pkgName", {
|
|
329
|
+
type: "string",
|
|
330
|
+
describe: "패키지명",
|
|
331
|
+
demandOption: true
|
|
332
|
+
})
|
|
333
|
+
.positional("name", {
|
|
334
|
+
type: "string",
|
|
335
|
+
describe: "페이지명",
|
|
336
|
+
demandOption: true
|
|
337
|
+
})
|
|
338
|
+
.positional("category", {
|
|
339
|
+
type: "string",
|
|
340
|
+
describe: "추가할 페이지의 분류명"
|
|
341
|
+
})
|
|
342
|
+
.options({
|
|
343
|
+
isRouteParent: {
|
|
344
|
+
type: "boolean",
|
|
345
|
+
describe: "router-outlet 포함 여부",
|
|
346
|
+
default: false
|
|
347
|
+
}
|
|
348
|
+
})
|
|
349
|
+
.example([
|
|
350
|
+
["$0 add page admin Employee home/base"]
|
|
351
|
+
])
|
|
352
|
+
)
|
|
179
353
|
)
|
|
180
354
|
.parseSync();
|
|
181
355
|
|
|
182
|
-
if (argv.debug) {
|
|
356
|
+
if (Boolean(argv.debug)) {
|
|
183
357
|
process.env["SD_CLI_LOGGER_SEVERITY"] = "DEBUG";
|
|
184
358
|
|
|
185
359
|
Logger.setConfig({
|
|
@@ -255,7 +429,7 @@ const logger = Logger.get(["simplysm", "sd-cli", "bin", "sd-cli"]);
|
|
|
255
429
|
optNames: argv.options ?? [],
|
|
256
430
|
pkgs: argv.packages ?? []
|
|
257
431
|
});
|
|
258
|
-
if (!argv.noBuild) {
|
|
432
|
+
if (!Boolean(argv.noBuild)) {
|
|
259
433
|
process.exit(0);
|
|
260
434
|
}
|
|
261
435
|
}
|
|
@@ -265,6 +439,61 @@ const logger = Logger.get(["simplysm", "sd-cli", "bin", "sd-cli"]);
|
|
|
265
439
|
else if (argv._[0] === "dec-file") {
|
|
266
440
|
await new SdCliFileCrypto().decryptAsync(argv.file!);
|
|
267
441
|
}
|
|
442
|
+
else if (argv._[0] === "init") {
|
|
443
|
+
await new SdCliProjectGenerator(process.cwd()).initAsync({
|
|
444
|
+
name: argv.name,
|
|
445
|
+
description: argv.description!,
|
|
446
|
+
author: argv.author,
|
|
447
|
+
gitUrl: argv.gitUrl
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
else if (argv._[0] === "add") {
|
|
451
|
+
if (argv._[1] === "ts-lib") {
|
|
452
|
+
await new SdCliProjectGenerator(process.cwd()).addTsLibAsync({
|
|
453
|
+
name: argv.name!,
|
|
454
|
+
description: argv.description!,
|
|
455
|
+
useDom: argv.useDom,
|
|
456
|
+
isForAngular: argv.isForAngular
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
else if (argv._[1] === "db-lib") {
|
|
460
|
+
await new SdCliProjectGenerator(process.cwd()).addDbLibAsync({
|
|
461
|
+
name: argv.name!
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
else if (argv._[1] === "db-model") {
|
|
465
|
+
await new SdCliProjectGenerator(process.cwd()).addDbLibModelAsync({
|
|
466
|
+
dbPkgName: argv.dbName,
|
|
467
|
+
category: argv.category,
|
|
468
|
+
name: argv.name!,
|
|
469
|
+
description: argv.description!
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
else if (argv._[1] === "page") {
|
|
473
|
+
await new SdCliProjectGenerator(process.cwd()).addPageAsync({
|
|
474
|
+
pkgName: argv.pkgName,
|
|
475
|
+
category: argv.category,
|
|
476
|
+
name: argv.name!,
|
|
477
|
+
isRouteParent: argv.isRouteParent
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
else if (argv._[1] === "server") {
|
|
481
|
+
await new SdCliProjectGenerator(process.cwd()).addServerAsync({
|
|
482
|
+
name: argv.name,
|
|
483
|
+
description: argv.description
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
else if (argv._[1] === "client") {
|
|
487
|
+
await new SdCliProjectGenerator(process.cwd()).addClientAsync({
|
|
488
|
+
name: argv.name!,
|
|
489
|
+
description: argv.description!,
|
|
490
|
+
serverName: argv.serverName
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
else {
|
|
494
|
+
throw new Error(`명령어가 잘못 되었습니다.\n\t${argv._[1]}\n`);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
268
497
|
else {
|
|
269
498
|
throw new Error(`명령어가 잘못 되었습니다.\n\t${argv._[0]}\n`);
|
|
270
499
|
}
|