@simplysm/sd-cli 12.5.21 → 12.5.23
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/{build-tools → entry}/SdCliCordova.d.ts +5 -6
- package/dist/{build-tools → entry}/SdCliCordova.js +117 -99
- package/dist/entry/SdCliCordova.js.map +1 -0
- package/dist/entry/SdCliElectron.d.ts +2 -2
- package/dist/entry/SdCliElectron.js +50 -40
- package/dist/entry/SdCliElectron.js.map +1 -1
- package/dist/entry/SdCliLocalUpdate.d.ts +1 -2
- package/dist/entry/SdCliLocalUpdate.js +26 -27
- package/dist/entry/SdCliLocalUpdate.js.map +1 -1
- package/dist/entry/SdCliProject.d.ts +1 -5
- package/dist/entry/SdCliProject.js +62 -288
- package/dist/entry/SdCliProject.js.map +1 -1
- package/dist/index.d.ts +23 -20
- package/dist/index.js +23 -20
- package/dist/index.js.map +1 -1
- package/dist/pkg-builders/SdMultiBuildRunner.d.ts +21 -0
- package/dist/pkg-builders/SdMultiBuildRunner.js +174 -0
- package/dist/pkg-builders/SdMultiBuildRunner.js.map +1 -0
- package/dist/pkg-builders/client/SdCliNgRoutesFileGenerator.d.ts +4 -0
- package/dist/{build-tools → pkg-builders/client}/SdCliNgRoutesFileGenerator.js +7 -7
- package/dist/pkg-builders/client/SdCliNgRoutesFileGenerator.js.map +1 -0
- package/dist/pkg-builders/client/SdClientBuildRunner.d.ts +20 -0
- package/dist/pkg-builders/client/SdClientBuildRunner.js +135 -0
- package/dist/pkg-builders/client/SdClientBuildRunner.js.map +1 -0
- package/dist/pkg-builders/client/SdNgBundler.d.ts +29 -0
- package/dist/{build-tools → pkg-builders/client}/SdNgBundler.js +107 -151
- package/dist/pkg-builders/client/SdNgBundler.js.map +1 -0
- package/dist/{build-tools → pkg-builders/client}/SdNgBundlerContext.d.ts +1 -2
- package/dist/{build-tools → pkg-builders/client}/SdNgBundlerContext.js +19 -45
- package/dist/pkg-builders/client/SdNgBundlerContext.js.map +1 -0
- package/dist/pkg-builders/client/createSdNgPlugin.d.ts +10 -0
- package/dist/{bundle-plugins/sdNgPlugin.js → pkg-builders/client/createSdNgPlugin.js} +32 -33
- package/dist/pkg-builders/client/createSdNgPlugin.js.map +1 -0
- package/dist/pkg-builders/lib/SdCliIndexFileGenerator.d.ts +5 -0
- package/dist/{build-tools → pkg-builders/lib}/SdCliIndexFileGenerator.js +11 -11
- package/dist/pkg-builders/lib/SdCliIndexFileGenerator.js.map +1 -0
- package/dist/pkg-builders/lib/SdJsLibBuildRunner.d.ts +16 -0
- package/dist/pkg-builders/lib/SdJsLibBuildRunner.js +81 -0
- package/dist/pkg-builders/lib/SdJsLibBuildRunner.js.map +1 -0
- package/dist/pkg-builders/lib/SdTsLibBuildRunner.d.ts +13 -0
- package/dist/pkg-builders/lib/SdTsLibBuildRunner.js +89 -0
- package/dist/pkg-builders/lib/SdTsLibBuildRunner.js.map +1 -0
- package/dist/pkg-builders/lib/SdTsLibBuilder.d.ts +14 -0
- package/dist/pkg-builders/lib/SdTsLibBuilder.js +54 -0
- package/dist/pkg-builders/lib/SdTsLibBuilder.js.map +1 -0
- package/dist/pkg-builders/server/SdServerBuildRunner.d.ts +17 -0
- package/dist/{builders/SdCliServerBuilder.js → pkg-builders/server/SdServerBuildRunner.js} +48 -53
- package/dist/pkg-builders/server/SdServerBuildRunner.js.map +1 -0
- package/dist/pkg-builders/server/SdServerBundler.d.ts +19 -0
- package/dist/{build-tools → pkg-builders/server}/SdServerBundler.js +25 -30
- package/dist/pkg-builders/server/SdServerBundler.js.map +1 -0
- package/dist/pkg-builders/server/createSdServerPlugin.d.ts +10 -0
- package/dist/pkg-builders/server/createSdServerPlugin.js +53 -0
- package/dist/pkg-builders/server/createSdServerPlugin.js.map +1 -0
- package/dist/sd-cli.js +61 -54
- package/dist/sd-cli.js.map +1 -1
- package/dist/ts-builder/SdTsCompileWorker.d.ts +9 -0
- package/dist/ts-builder/SdTsCompileWorker.js +16 -0
- package/dist/ts-builder/SdTsCompileWorker.js.map +1 -0
- package/dist/ts-builder/SdTsCompiler.d.ts +7 -0
- package/dist/ts-builder/SdTsCompiler.js +557 -0
- package/dist/ts-builder/SdTsCompiler.js.map +1 -0
- package/dist/types/build-plugin.type.d.ts +14 -0
- package/dist/types/build-plugin.type.js +2 -0
- package/dist/types/build-plugin.type.js.map +1 -0
- package/dist/types/build.type.d.ts +15 -0
- package/dist/types/build.type.js +2 -0
- package/dist/types/build.type.js.map +1 -0
- package/dist/types/common-configs.type.d.ts +22 -0
- package/dist/types/common-configs.type.js +2 -0
- package/dist/types/common-configs.type.js.map +1 -0
- package/dist/types/sd-configs.type.d.ts +99 -0
- package/dist/types/sd-configs.type.js +2 -0
- package/dist/types/sd-configs.type.js.map +1 -0
- package/dist/types/ts-compiler.type.d.ts +29 -0
- package/dist/types/ts-compiler.type.js +2 -0
- package/dist/types/ts-compiler.type.js.map +1 -0
- package/dist/types/workers.type.d.ts +49 -0
- package/dist/types/workers.type.js +2 -0
- package/dist/types/workers.type.js.map +1 -0
- package/dist/utils/SdCliConvertMessageUtil.d.ts +21 -0
- package/dist/utils/SdCliConvertMessageUtil.js +137 -0
- package/dist/utils/SdCliConvertMessageUtil.js.map +1 -0
- package/dist/workers/compile-worker.js +27 -0
- package/dist/workers/compile-worker.js.map +1 -0
- package/dist/workers/lint-worker.js +36 -0
- package/dist/workers/lint-worker.js.map +1 -0
- package/dist/workers/server-worker.d.ts +1 -0
- package/dist/workers/server-worker.js +49 -0
- package/dist/workers/server-worker.js.map +1 -0
- package/package.json +8 -11
- package/src/entry/SdCliCordova.ts +363 -0
- package/src/entry/SdCliElectron.ts +96 -69
- package/src/entry/SdCliLocalUpdate.ts +43 -44
- package/src/entry/SdCliProject.ts +72 -417
- package/src/index.ts +23 -20
- package/src/pkg-builders/SdMultiBuildRunner.ts +250 -0
- package/src/{build-tools → pkg-builders/client}/SdCliNgRoutesFileGenerator.ts +7 -7
- package/src/pkg-builders/client/SdClientBuildRunner.ts +191 -0
- package/src/{build-tools → pkg-builders/client}/SdNgBundler.ts +135 -190
- package/src/pkg-builders/client/SdNgBundlerContext.ts +111 -0
- package/src/{bundle-plugins/sdNgPlugin.ts → pkg-builders/client/createSdNgPlugin.ts} +43 -46
- package/src/{build-tools → pkg-builders/lib}/SdCliIndexFileGenerator.ts +11 -11
- package/src/pkg-builders/lib/SdJsLibBuildRunner.ts +105 -0
- package/src/pkg-builders/lib/SdTsLibBuildRunner.ts +128 -0
- package/src/pkg-builders/lib/SdTsLibBuilder.ts +69 -0
- package/src/{builders/SdCliServerBuilder.ts → pkg-builders/server/SdServerBuildRunner.ts} +66 -78
- package/src/{build-tools → pkg-builders/server}/SdServerBundler.ts +40 -41
- package/src/pkg-builders/server/createSdServerPlugin.ts +77 -0
- package/src/sd-cli.ts +197 -211
- package/src/ts-builder/SdTsCompileWorker.ts +21 -0
- package/src/ts-builder/SdTsCompiler.ts +775 -0
- package/src/types/build-plugin.type.ts +16 -0
- package/src/types/build.type.ts +17 -0
- package/src/types/common-configs.type.ts +27 -0
- package/src/types/sd-configs.type.ts +114 -0
- package/src/types/ts-compiler.type.ts +29 -0
- package/src/types/workers.type.ts +27 -0
- package/src/utils/SdCliConvertMessageUtil.ts +177 -0
- package/src/workers/compile-worker.ts +31 -0
- package/src/workers/lint-worker.ts +44 -0
- package/src/workers/server-worker.ts +52 -0
- package/tsconfig.json +7 -1
- package/dist/build-cluster.js +0 -201
- package/dist/build-cluster.js.map +0 -1
- package/dist/build-tools/SdCliCordova.js.map +0 -1
- package/dist/build-tools/SdCliIndexFileGenerator.d.ts +0 -5
- package/dist/build-tools/SdCliIndexFileGenerator.js.map +0 -1
- package/dist/build-tools/SdCliNgRoutesFileGenerator.d.ts +0 -4
- package/dist/build-tools/SdCliNgRoutesFileGenerator.js.map +0 -1
- package/dist/build-tools/SdLinter.d.ts +0 -5
- package/dist/build-tools/SdLinter.js +0 -49
- package/dist/build-tools/SdLinter.js.map +0 -1
- package/dist/build-tools/SdNgBundler.d.ts +0 -29
- package/dist/build-tools/SdNgBundler.js.map +0 -1
- package/dist/build-tools/SdNgBundlerContext.js.map +0 -1
- package/dist/build-tools/SdReactBundler.d.ts +0 -25
- package/dist/build-tools/SdReactBundler.js +0 -295
- package/dist/build-tools/SdReactBundler.js.map +0 -1
- package/dist/build-tools/SdReactBundlerContext.d.ts +0 -14
- package/dist/build-tools/SdReactBundlerContext.js +0 -59
- package/dist/build-tools/SdReactBundlerContext.js.map +0 -1
- package/dist/build-tools/SdServerBundler.d.ts +0 -20
- package/dist/build-tools/SdServerBundler.js.map +0 -1
- package/dist/build-tools/SdTsCompiler.d.ts +0 -34
- package/dist/build-tools/SdTsCompiler.js +0 -534
- package/dist/build-tools/SdTsCompiler.js.map +0 -1
- package/dist/build-tools/SdTsLibBundler.d.ts +0 -13
- package/dist/build-tools/SdTsLibBundler.js +0 -58
- package/dist/build-tools/SdTsLibBundler.js.map +0 -1
- package/dist/builders/SdCliClientBuilder.d.ts +0 -18
- package/dist/builders/SdCliClientBuilder.js +0 -172
- package/dist/builders/SdCliClientBuilder.js.map +0 -1
- package/dist/builders/SdCliJsLibLinter.d.ts +0 -13
- package/dist/builders/SdCliJsLibLinter.js +0 -60
- package/dist/builders/SdCliJsLibLinter.js.map +0 -1
- package/dist/builders/SdCliServerBuilder.d.ts +0 -15
- package/dist/builders/SdCliServerBuilder.js.map +0 -1
- package/dist/builders/SdCliTsLibBuilder.d.ts +0 -12
- package/dist/builders/SdCliTsLibBuilder.js +0 -90
- package/dist/builders/SdCliTsLibBuilder.js.map +0 -1
- package/dist/bundle-plugins/sdNgPlugin.d.ts +0 -16
- package/dist/bundle-plugins/sdNgPlugin.js.map +0 -1
- package/dist/bundle-plugins/sdReactPlugin.d.ts +0 -16
- package/dist/bundle-plugins/sdReactPlugin.js +0 -117
- package/dist/bundle-plugins/sdReactPlugin.js.map +0 -1
- package/dist/bundle-plugins/sdServerPlugin.d.ts +0 -16
- package/dist/bundle-plugins/sdServerPlugin.js +0 -63
- package/dist/bundle-plugins/sdServerPlugin.js.map +0 -1
- package/dist/commons.d.ts +0 -145
- package/dist/commons.js +0 -2
- package/dist/commons.js.map +0 -1
- package/dist/server-worker.js +0 -57
- package/dist/server-worker.js.map +0 -1
- package/dist/utils/SdCliBuildResultUtil.d.ts +0 -16
- package/dist/utils/SdCliBuildResultUtil.js +0 -54
- package/dist/utils/SdCliBuildResultUtil.js.map +0 -1
- package/src/build-cluster.ts +0 -212
- package/src/build-tools/SdCliCordova.ts +0 -340
- package/src/build-tools/SdLinter.ts +0 -65
- package/src/build-tools/SdNgBundlerContext.ts +0 -137
- package/src/build-tools/SdReactBundler.ts +0 -372
- package/src/build-tools/SdReactBundlerContext.ts +0 -71
- package/src/build-tools/SdTsCompiler.ts +0 -754
- package/src/build-tools/SdTsLibBundler.ts +0 -72
- package/src/builders/SdCliClientBuilder.ts +0 -233
- package/src/builders/SdCliJsLibLinter.ts +0 -72
- package/src/builders/SdCliTsLibBuilder.ts +0 -126
- package/src/bundle-plugins/sdReactPlugin.ts +0 -164
- package/src/bundle-plugins/sdServerPlugin.ts +0 -94
- package/src/commons.ts +0 -171
- package/src/server-worker.ts +0 -65
- package/src/utils/SdCliBuildResultUtil.ts +0 -63
- /package/dist/{build-cluster.d.ts → workers/compile-worker.d.ts} +0 -0
- /package/dist/{server-worker.d.ts → workers/lint-worker.d.ts} +0 -0
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import esbuild from "esbuild";
|
|
2
|
-
import ts from "typescript";
|
|
3
|
-
import path from "path";
|
|
4
|
-
import { ISdTsCompilerResult, SdTsCompiler } from "../build-tools/SdTsCompiler";
|
|
5
|
-
import { convertTypeScriptDiagnostic } from "@angular/build/src/tools/esbuild/angular/diagnostics";
|
|
6
|
-
|
|
7
|
-
export function sdServerPlugin(conf: {
|
|
8
|
-
pkgPath: string;
|
|
9
|
-
dev: boolean;
|
|
10
|
-
modifiedFileSet: Set<string>;
|
|
11
|
-
result: IServerPluginResultCache;
|
|
12
|
-
watchScopePaths: string[];
|
|
13
|
-
}): esbuild.Plugin {
|
|
14
|
-
return {
|
|
15
|
-
name: "sd-server-compiler",
|
|
16
|
-
setup: (build: esbuild.PluginBuild) => {
|
|
17
|
-
const compiler = new SdTsCompiler({
|
|
18
|
-
pkgPath: conf.pkgPath,
|
|
19
|
-
additionalOptions: { declaration: false },
|
|
20
|
-
isDevMode: conf.dev,
|
|
21
|
-
isForBundle: true,
|
|
22
|
-
watchScopePaths: conf.watchScopePaths
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
let buildResult: ISdTsCompilerResult;
|
|
26
|
-
|
|
27
|
-
build.onStart(async () => {
|
|
28
|
-
compiler.invalidate(conf.modifiedFileSet);
|
|
29
|
-
buildResult = await compiler.buildAsync();
|
|
30
|
-
|
|
31
|
-
conf.result.watchFileSet = buildResult.watchFileSet;
|
|
32
|
-
conf.result.affectedFileSet = buildResult.affectedFileSet;
|
|
33
|
-
conf.result.program = buildResult.program;
|
|
34
|
-
|
|
35
|
-
//-- return err/warn
|
|
36
|
-
|
|
37
|
-
return {
|
|
38
|
-
errors: buildResult.typescriptDiagnostics
|
|
39
|
-
.filter((item) => item.category === ts.DiagnosticCategory.Error)
|
|
40
|
-
.map((item) => convertTypeScriptDiagnostic(ts, item)),
|
|
41
|
-
warnings: buildResult.typescriptDiagnostics
|
|
42
|
-
.filter((item) => item.category !== ts.DiagnosticCategory.Error)
|
|
43
|
-
.map((item) => convertTypeScriptDiagnostic(ts, item)),
|
|
44
|
-
};
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
build.onLoad({ filter: /\.ts$/ }, (args) => {
|
|
48
|
-
const emittedJsFile = buildResult.emittedFilesCacheMap.get(path.normalize(args.path))?.last();
|
|
49
|
-
if (!emittedJsFile) {
|
|
50
|
-
throw new Error(`ts 빌더 결과 emit 파일이 존재하지 않습니다. ${args.path}`);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const contents = emittedJsFile.text;
|
|
54
|
-
return { contents, loader: "js" };
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
build.onLoad({ filter: /\.[cm]?js$/ }, (args) => {
|
|
58
|
-
conf.result.watchFileSet!.add(path.normalize(args.path));
|
|
59
|
-
return null;
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
build.onLoad(
|
|
63
|
-
{
|
|
64
|
-
filter: new RegExp(
|
|
65
|
-
"(" +
|
|
66
|
-
Object.keys(build.initialOptions.loader!)
|
|
67
|
-
.map((item) => "\\" + item)
|
|
68
|
-
.join("|") +
|
|
69
|
-
")$",
|
|
70
|
-
),
|
|
71
|
-
},
|
|
72
|
-
(args) => {
|
|
73
|
-
conf.result.watchFileSet!.add(path.normalize(args.path));
|
|
74
|
-
return null;
|
|
75
|
-
},
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
build.onEnd((result) => {
|
|
79
|
-
conf.result.outputFiles = result.outputFiles;
|
|
80
|
-
conf.result.metafile = result.metafile;
|
|
81
|
-
|
|
82
|
-
conf.modifiedFileSet.clear();
|
|
83
|
-
});
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export interface IServerPluginResultCache {
|
|
89
|
-
watchFileSet?: Set<string>;
|
|
90
|
-
affectedFileSet?: Set<string>;
|
|
91
|
-
outputFiles?: esbuild.OutputFile[];
|
|
92
|
-
metafile?: esbuild.Metafile;
|
|
93
|
-
program?: ts.Program;
|
|
94
|
-
}
|
package/src/commons.ts
DELETED
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
export interface INpmConfig {
|
|
2
|
-
name: string;
|
|
3
|
-
description?: string;
|
|
4
|
-
version: string;
|
|
5
|
-
workspaces?: string[];
|
|
6
|
-
|
|
7
|
-
dependencies?: Record<string, string>;
|
|
8
|
-
optionalDependencies?: Record<string, string>;
|
|
9
|
-
devDependencies?: Record<string, string>;
|
|
10
|
-
peerDependencies?: Record<string, string>;
|
|
11
|
-
peerDependenciesMeta?: Record<
|
|
12
|
-
string,
|
|
13
|
-
{
|
|
14
|
-
optional?: boolean;
|
|
15
|
-
}
|
|
16
|
-
>;
|
|
17
|
-
|
|
18
|
-
resolutions?: Record<string, string>;
|
|
19
|
-
|
|
20
|
-
scripts?: Record<string, string>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface ITsConfig {
|
|
24
|
-
files?: string[];
|
|
25
|
-
compilerOptions: { lib: string[] };
|
|
26
|
-
angularCompilerOptions?: {};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface ISdCliBuildClusterReqMessage {
|
|
30
|
-
cmd: "watch" | "build";
|
|
31
|
-
projConf: ISdCliConfig;
|
|
32
|
-
pkgPath: string;
|
|
33
|
-
// builderKey?: "web" | "electron";
|
|
34
|
-
execArgs?: string[];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface ISdCliBuildClusterResMessage {
|
|
38
|
-
req: ISdCliBuildClusterReqMessage;
|
|
39
|
-
type: "change" | "complete" | "ready";
|
|
40
|
-
result?: ISdCliBuilderResult;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface ISdCliBuilderResult {
|
|
44
|
-
affectedFilePaths: string[];
|
|
45
|
-
buildResults: ISdCliPackageBuildResult[];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface ISdCliPackageBuildResult {
|
|
49
|
-
filePath: string | undefined;
|
|
50
|
-
line: number | undefined;
|
|
51
|
-
char: number | undefined;
|
|
52
|
-
code: string | undefined;
|
|
53
|
-
severity: "error" | "warning" | "suggestion" | "message";
|
|
54
|
-
message: string;
|
|
55
|
-
type: "build" | "lint" | "style" | "check" | undefined;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface ISdCliConfig {
|
|
59
|
-
packages: Record<string, TSdCliPackageConfig | undefined>;
|
|
60
|
-
localUpdates?: Record<string, string>;
|
|
61
|
-
postPublish?: TSdCliPostPublishConfig[];
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export type TSdCliConfigFn = (isDev: boolean, opts?: string[]) => ISdCliConfig;
|
|
65
|
-
|
|
66
|
-
export type TSdCliPackageConfig = ISdCliLibPackageConfig | ISdCliServerPackageConfig | ISdCliClientPackageConfig;
|
|
67
|
-
|
|
68
|
-
export interface ISdCliLibPackageConfig {
|
|
69
|
-
type: "library";
|
|
70
|
-
publish?: "npm";
|
|
71
|
-
polyfills?: string[];
|
|
72
|
-
noGenIndex?: boolean;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export interface ISdCliServerPackageConfig {
|
|
76
|
-
type: "server";
|
|
77
|
-
externals?: string[];
|
|
78
|
-
publish?: ISdCliLocalDirectoryPublishConfig | ISdCliFtpPublishConfig;
|
|
79
|
-
configs?: Record<string, any>;
|
|
80
|
-
env?: Record<string, string>;
|
|
81
|
-
pm2?: {
|
|
82
|
-
name?: string;
|
|
83
|
-
ignoreWatchPaths?: string[];
|
|
84
|
-
noInterpreter?: boolean;
|
|
85
|
-
noStartScript?: boolean;
|
|
86
|
-
};
|
|
87
|
-
iis?: {
|
|
88
|
-
nodeExeFilePath?: string;
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export interface ISdCliClientPackageConfig {
|
|
93
|
-
type: "client";
|
|
94
|
-
server?: string | { port: number };
|
|
95
|
-
publish?: ISdCliLocalDirectoryPublishConfig | ISdCliFtpPublishConfig;
|
|
96
|
-
env?: Record<string, string>;
|
|
97
|
-
configs?: Record<string, any>;
|
|
98
|
-
noLazyRoute?: boolean;
|
|
99
|
-
forceProductionMode?: boolean;
|
|
100
|
-
|
|
101
|
-
builder?: {
|
|
102
|
-
web?: ISdCliClientBuilderWebConfig;
|
|
103
|
-
electron?: ISdCliClientBuilderElectronConfig;
|
|
104
|
-
cordova?: ISdCliClientBuilderCordovaConfig;
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export interface ISdCliLocalDirectoryPublishConfig {
|
|
109
|
-
type: "local-directory";
|
|
110
|
-
path: string;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export interface ISdCliFtpPublishConfig {
|
|
114
|
-
type: "ftp" | "ftps" | "sftp";
|
|
115
|
-
host: string;
|
|
116
|
-
port?: number;
|
|
117
|
-
path?: string;
|
|
118
|
-
user?: string;
|
|
119
|
-
pass?: string;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export interface ISdCliClientBuilderElectronConfig {
|
|
123
|
-
appId: string;
|
|
124
|
-
installerIcon?: string;
|
|
125
|
-
postInstallScript?: string;
|
|
126
|
-
// devServerHost?: string;
|
|
127
|
-
// devServerPort?: number;
|
|
128
|
-
reinstallDependencies?: string[];
|
|
129
|
-
env?: Record<string, string>;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export interface ISdCliClientBuilderWebConfig {
|
|
133
|
-
// devServerHost?: string;
|
|
134
|
-
// devServerPort?: number;
|
|
135
|
-
env?: Record<string, string>;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export interface ISdCliClientBuilderCordovaConfig {
|
|
139
|
-
appId: string;
|
|
140
|
-
appName: string;
|
|
141
|
-
plugins?: string[];
|
|
142
|
-
icon?: string;
|
|
143
|
-
debug?: boolean;
|
|
144
|
-
platform?: {
|
|
145
|
-
browser?: {};
|
|
146
|
-
android?: {
|
|
147
|
-
bundle?: boolean;
|
|
148
|
-
sign?: {
|
|
149
|
-
keystore: string;
|
|
150
|
-
storePassword: string;
|
|
151
|
-
alias: string;
|
|
152
|
-
password: string;
|
|
153
|
-
keystoreType: string;
|
|
154
|
-
};
|
|
155
|
-
sdkVersion?: number;
|
|
156
|
-
permissions?: {
|
|
157
|
-
name: string;
|
|
158
|
-
maxSdkVersion?: number;
|
|
159
|
-
}[];
|
|
160
|
-
};
|
|
161
|
-
};
|
|
162
|
-
env?: Record<string, string>;
|
|
163
|
-
browserslist?: string[];
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
export type TSdCliPostPublishConfig = ISdCliPostPublishScriptConfig;
|
|
167
|
-
|
|
168
|
-
export interface ISdCliPostPublishScriptConfig {
|
|
169
|
-
type: "script";
|
|
170
|
-
script: string;
|
|
171
|
-
}
|
package/src/server-worker.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import {EventEmitter} from "events";
|
|
2
|
-
import {Logger, LoggerSeverity} from "@simplysm/sd-core-node";
|
|
3
|
-
import path from "path";
|
|
4
|
-
import {pathToFileURL} from "url";
|
|
5
|
-
import {SdServiceServer} from "@simplysm/sd-service-server";
|
|
6
|
-
import {JsonConvert} from "@simplysm/sd-core-common";
|
|
7
|
-
|
|
8
|
-
Error.stackTraceLimit = Infinity;
|
|
9
|
-
EventEmitter.defaultMaxListeners = 0;
|
|
10
|
-
|
|
11
|
-
if (Boolean(process.env["SD_DEBUG"])) {
|
|
12
|
-
Logger.setConfig({
|
|
13
|
-
console: {
|
|
14
|
-
level: LoggerSeverity.debug
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
Logger.setConfig({
|
|
20
|
-
dot: true
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const logger = Logger.get(["simplysm", "sd-cli", "server-worker"]);
|
|
25
|
-
|
|
26
|
-
const pkgPathOrOpt = JsonConvert.parse(process.argv[2]) as (string | { port: number });
|
|
27
|
-
|
|
28
|
-
let server: SdServiceServer | undefined;
|
|
29
|
-
|
|
30
|
-
if (typeof pkgPathOrOpt === "string") {
|
|
31
|
-
const mainFilePath = path.resolve(pkgPathOrOpt, "dist/main.js");
|
|
32
|
-
const serverModule = await import(pathToFileURL(mainFilePath).href);
|
|
33
|
-
server = serverModule.default as SdServiceServer | undefined;
|
|
34
|
-
if (server === undefined) {
|
|
35
|
-
logger.error(`${mainFilePath}(0, 0): 'SdServiceServer'를 'export'해야 합니다.`);
|
|
36
|
-
process.exit();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
server = new SdServiceServer({
|
|
41
|
-
rootPath: process.cwd(),
|
|
42
|
-
services: [],
|
|
43
|
-
port: pkgPathOrOpt.port
|
|
44
|
-
});
|
|
45
|
-
server.listenAsync()
|
|
46
|
-
.catch((err) => {
|
|
47
|
-
// eslint-disable-next-line no-console
|
|
48
|
-
console.error(err);
|
|
49
|
-
process.exit(1);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
server.on("ready", () => {
|
|
55
|
-
process.send!({port: server.options.port});
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
process.on("message", (message: any) => {
|
|
59
|
-
if (message.type === "setPathProxy") {
|
|
60
|
-
server.pathProxy = message.pathProxy;
|
|
61
|
-
}
|
|
62
|
-
if (message.type === "broadcastReload") {
|
|
63
|
-
server.broadcastReload();
|
|
64
|
-
}
|
|
65
|
-
});
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import os from "os";
|
|
3
|
-
import path from "path";
|
|
4
|
-
import {ISdCliPackageBuildResult} from "../commons";
|
|
5
|
-
import {PartialMessage} from "esbuild";
|
|
6
|
-
|
|
7
|
-
export class SdCliBuildResultUtil {
|
|
8
|
-
static convertFromTsDiag(diag: ts.Diagnostic, type: "build" | "check"): ISdCliPackageBuildResult {
|
|
9
|
-
const severity = diag.category === ts.DiagnosticCategory.Error ? "error" as const
|
|
10
|
-
: diag.category === ts.DiagnosticCategory.Warning ? "warning" as const
|
|
11
|
-
: diag.category === ts.DiagnosticCategory.Suggestion ? "suggestion" as const
|
|
12
|
-
: "message" as const;
|
|
13
|
-
|
|
14
|
-
const code = `TS${diag.code}`;
|
|
15
|
-
const message = ts.flattenDiagnosticMessageText(diag.messageText, os.EOL);
|
|
16
|
-
|
|
17
|
-
const filePath = diag.file ? path.resolve(diag.file.fileName) : undefined;
|
|
18
|
-
const position = diag.file && diag.start !== undefined ? diag.file.getLineAndCharacterOfPosition(diag.start) : undefined;
|
|
19
|
-
const line = position ? position.line + 1 : undefined;
|
|
20
|
-
const char = position ? position.character + 1 : undefined;
|
|
21
|
-
|
|
22
|
-
return {
|
|
23
|
-
filePath,
|
|
24
|
-
line,
|
|
25
|
-
char,
|
|
26
|
-
code,
|
|
27
|
-
severity,
|
|
28
|
-
message,
|
|
29
|
-
type
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
static convertFromEsbuildResult(msg: PartialMessage, type: "build" | "check", severity: "warning" | "error") {
|
|
34
|
-
const filePath = msg.location?.file != null ? path.resolve(msg.location.file) : undefined;
|
|
35
|
-
const line = msg.location?.line;
|
|
36
|
-
const char = msg.location?.column;
|
|
37
|
-
const code = msg.text?.slice(0, msg.text.indexOf(":"));
|
|
38
|
-
const message = `${msg.pluginName != null ? `(${msg.pluginName}) ` : ""} ${msg.text?.slice(msg.text.indexOf(":") + 1)}`;
|
|
39
|
-
|
|
40
|
-
return {
|
|
41
|
-
filePath,
|
|
42
|
-
line,
|
|
43
|
-
char,
|
|
44
|
-
code,
|
|
45
|
-
severity,
|
|
46
|
-
message,
|
|
47
|
-
type
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
static getMessage(result: ISdCliPackageBuildResult): string {
|
|
52
|
-
let str = "";
|
|
53
|
-
if (result.filePath !== undefined) {
|
|
54
|
-
str += `${result.filePath}(${result.line ?? 0}, ${result.char ?? 0}): `;
|
|
55
|
-
}
|
|
56
|
-
if (result.code !== undefined) {
|
|
57
|
-
str += `${result.code}: `;
|
|
58
|
-
}
|
|
59
|
-
str += `(${result.type}) ${result.severity} ${result.message}`;
|
|
60
|
-
|
|
61
|
-
return str;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
File without changes
|
|
File without changes
|