@simplysm/sd-cli 7.0.249 → 7.0.263
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 +48 -0
- package/dist/bin/sd-cli.mjs +171 -13
- package/dist/build-tool/SdCliElectron.mjs +3 -2
- package/dist/builder/SdCliClientBuilder.mjs +11 -7
- package/dist/builder/SdCliTsLibBuilder.mjs +18 -12
- package/dist/commons.d.ts +6 -1
- package/dist/entry-points/SdCliProjectGenerator.d.ts +37 -0
- package/dist/entry-points/SdCliProjectGenerator.mjs +288 -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 +4 -0
- package/dist/entry-points/file/base/fc_package_tsconfig.mjs +12 -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 +34 -0
- package/dist/entry-points/file/client/fc_package_appicons.d.ts +1 -0
- package/dist/entry-points/file/client/fc_package_appicons.mjs +6 -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 +12 -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 +26 -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/packages/SdCliPackage.d.ts +1 -0
- package/dist/packages/SdCliPackage.mjs +68 -62
- package/dist/utils/SdCliBuildResultUtil.mjs +2 -2
- package/package.json +10 -8
- package/src/bin/sd-cli.ts +198 -12
- package/src/build-tool/SdCliElectron.ts +2 -1
- package/src/builder/SdCliClientBuilder.ts +13 -7
- package/src/builder/SdCliJsLibBuilder.ts +70 -70
- package/src/builder/SdCliTsLibBuilder.ts +450 -445
- package/src/commons.ts +6 -1
- package/src/entry-points/SdCliProjectGenerator.ts +353 -0
- package/src/entry-points/SdCliWorkspace.ts +74 -122
- package/src/entry-points/file/assets/assets/icons/icon-128x128.png +0 -0
- package/src/entry-points/file/assets/assets/icons/icon-144x144.png +0 -0
- package/src/entry-points/file/assets/assets/icons/icon-152x152.png +0 -0
- package/src/entry-points/file/assets/assets/icons/icon-192x192.png +0 -0
- package/src/entry-points/file/assets/assets/icons/icon-384x384.png +0 -0
- package/src/entry-points/file/assets/assets/icons/icon-512x512.png +0 -0
- package/src/entry-points/file/assets/assets/icons/icon-72x72.png +0 -0
- package/src/entry-points/file/assets/assets/icons/icon-96x96.png +0 -0
- package/src/entry-points/file/assets/favicon.ico +0 -0
- 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 +11 -0
- package/src/entry-points/file/client/fc_package_AppModule.ts +36 -0
- package/src/entry-points/file/client/fc_package_AppPage.ts +33 -0
- package/src/entry-points/file/client/fc_package_appicons.ts +5 -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 +11 -0
- package/src/entry-points/file/project/fc_project_simplysm.ts +1 -0
- package/src/entry-points/file/project/fc_project_tsconfig.ts +25 -0
- package/src/entry-points/file/server/fc_package_server_main.ts +62 -0
- package/src/index.ts +23 -0
- package/src/packages/SdCliPackage.ts +75 -58
- package/src/utils/SdCliBuildResultUtil.ts +76 -76
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { ISdCliPackageBuildResult } from "../commons";
|
|
2
|
-
import { EventEmitter } from "events";
|
|
3
|
-
import { FsUtil, Logger, SdFsWatcher } from "@simplysm/sd-core-node";
|
|
4
|
-
import path from "path";
|
|
5
|
-
import { SdCliPackageLinter } from "../build-tool/SdCliPackageLinter";
|
|
6
|
-
|
|
7
|
-
export class SdCliJsLibBuilder extends EventEmitter {
|
|
8
|
-
private readonly _logger = Logger.get(["simplysm", "sd-cli", this.constructor.name]);
|
|
9
|
-
|
|
10
|
-
private readonly _linter: SdCliPackageLinter;
|
|
11
|
-
|
|
12
|
-
public constructor(private readonly _rootPath: string) {
|
|
13
|
-
super();
|
|
14
|
-
this._linter = new SdCliPackageLinter(this._rootPath);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
public override on(event: "change", listener: () => void): this;
|
|
18
|
-
public override on(event: "complete", listener: (results: ISdCliPackageBuildResult[]) => void): this;
|
|
19
|
-
public override on(event: string | symbol, listener: (...args: any[]) => void): this {
|
|
20
|
-
return super.on(event, listener);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
public async watchAsync(): Promise<void> {
|
|
24
|
-
this.emit("change");
|
|
25
|
-
|
|
26
|
-
const relatedPaths = await this.getRelatedPathsAsync();
|
|
27
|
-
const watcher = SdFsWatcher.watch(relatedPaths);
|
|
28
|
-
watcher.onChange({}, async (changedInfos) => {
|
|
29
|
-
const changeFilePaths = changedInfos.filter((item) => ["add", "change", "unlink"].includes(item.event)).map((item) => item.path);
|
|
30
|
-
if (changeFilePaths.length === 0) return;
|
|
31
|
-
|
|
32
|
-
this._logger.debug("파일 변경 감지");
|
|
33
|
-
this.emit("change");
|
|
34
|
-
const watchBuildResults: ISdCliPackageBuildResult[] = [];
|
|
35
|
-
|
|
36
|
-
const lintFilePaths = changedInfos.filter((item) => ["add", "change"].includes(item.event)).map((item) => item.path);
|
|
37
|
-
if (lintFilePaths.length > 0) {
|
|
38
|
-
watchBuildResults.push(...await this._linter.lintAsync(lintFilePaths));
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const watchRelatedPaths = await this.getRelatedPathsAsync();
|
|
42
|
-
watcher.add(watchRelatedPaths);
|
|
43
|
-
|
|
44
|
-
this.emit("complete", watchBuildResults);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
// 빌드
|
|
48
|
-
const buildResults = await this._linter.lintAsync(relatedPaths);
|
|
49
|
-
|
|
50
|
-
this.emit("complete", buildResults);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
public async buildAsync(): Promise<ISdCliPackageBuildResult[]> {
|
|
54
|
-
const relatedPaths = await this.getRelatedPathsAsync();
|
|
55
|
-
return await this._linter.lintAsync(relatedPaths);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
private async getRelatedPathsAsync(): Promise<string[]> {
|
|
59
|
-
const mySourceGlobPath = path.resolve(this._rootPath, "**", "+(*.js|*.cjs|*.mjs)");
|
|
60
|
-
const mySourceFilePaths = await FsUtil.globAsync(mySourceGlobPath, {
|
|
61
|
-
ignore: [
|
|
62
|
-
"**/node_modules/**",
|
|
63
|
-
"**/dist/**",
|
|
64
|
-
"**/.*/**"
|
|
65
|
-
]
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
return [...mySourceFilePaths, path.resolve(this._rootPath, ".eslintrc.cjs")].distinct();
|
|
69
|
-
}
|
|
70
|
-
}
|
|
1
|
+
import { ISdCliPackageBuildResult } from "../commons";
|
|
2
|
+
import { EventEmitter } from "events";
|
|
3
|
+
import { FsUtil, Logger, SdFsWatcher } from "@simplysm/sd-core-node";
|
|
4
|
+
import path from "path";
|
|
5
|
+
import { SdCliPackageLinter } from "../build-tool/SdCliPackageLinter";
|
|
6
|
+
|
|
7
|
+
export class SdCliJsLibBuilder extends EventEmitter {
|
|
8
|
+
private readonly _logger = Logger.get(["simplysm", "sd-cli", this.constructor.name]);
|
|
9
|
+
|
|
10
|
+
private readonly _linter: SdCliPackageLinter;
|
|
11
|
+
|
|
12
|
+
public constructor(private readonly _rootPath: string) {
|
|
13
|
+
super();
|
|
14
|
+
this._linter = new SdCliPackageLinter(this._rootPath);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public override on(event: "change", listener: () => void): this;
|
|
18
|
+
public override on(event: "complete", listener: (results: ISdCliPackageBuildResult[]) => void): this;
|
|
19
|
+
public override on(event: string | symbol, listener: (...args: any[]) => void): this {
|
|
20
|
+
return super.on(event, listener);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public async watchAsync(): Promise<void> {
|
|
24
|
+
this.emit("change");
|
|
25
|
+
|
|
26
|
+
const relatedPaths = await this.getRelatedPathsAsync();
|
|
27
|
+
const watcher = SdFsWatcher.watch(relatedPaths);
|
|
28
|
+
watcher.onChange({}, async (changedInfos) => {
|
|
29
|
+
const changeFilePaths = changedInfos.filter((item) => ["add", "change", "unlink"].includes(item.event)).map((item) => item.path);
|
|
30
|
+
if (changeFilePaths.length === 0) return;
|
|
31
|
+
|
|
32
|
+
this._logger.debug("파일 변경 감지");
|
|
33
|
+
this.emit("change");
|
|
34
|
+
const watchBuildResults: ISdCliPackageBuildResult[] = [];
|
|
35
|
+
|
|
36
|
+
const lintFilePaths = changedInfos.filter((item) => ["add", "change"].includes(item.event)).map((item) => item.path);
|
|
37
|
+
if (lintFilePaths.length > 0) {
|
|
38
|
+
watchBuildResults.push(...await this._linter.lintAsync(lintFilePaths));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const watchRelatedPaths = await this.getRelatedPathsAsync();
|
|
42
|
+
watcher.add(watchRelatedPaths);
|
|
43
|
+
|
|
44
|
+
this.emit("complete", watchBuildResults);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// 빌드
|
|
48
|
+
const buildResults = await this._linter.lintAsync(relatedPaths);
|
|
49
|
+
|
|
50
|
+
this.emit("complete", buildResults);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public async buildAsync(): Promise<ISdCliPackageBuildResult[]> {
|
|
54
|
+
const relatedPaths = await this.getRelatedPathsAsync();
|
|
55
|
+
return await this._linter.lintAsync(relatedPaths);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
private async getRelatedPathsAsync(): Promise<string[]> {
|
|
59
|
+
const mySourceGlobPath = path.resolve(this._rootPath, "**", "+(*.js|*.cjs|*.mjs)");
|
|
60
|
+
const mySourceFilePaths = await FsUtil.globAsync(mySourceGlobPath, {
|
|
61
|
+
ignore: [
|
|
62
|
+
"**/node_modules/**",
|
|
63
|
+
"**/dist/**",
|
|
64
|
+
"**/.*/**"
|
|
65
|
+
]
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
return [...mySourceFilePaths, path.resolve(this._rootPath, ".eslintrc.cjs")].distinct();
|
|
69
|
+
}
|
|
70
|
+
}
|