@simplysm/sd-cli 11.0.40 → 11.1.2
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-cluster.d.ts +1 -1
- package/dist/build-cluster.js +181 -181
- package/dist/build-tools/SdCliCordova.d.ts +21 -21
- package/dist/build-tools/SdCliCordova.js +217 -217
- package/dist/build-tools/SdCliIndexFileGenerator.d.ts +5 -5
- package/dist/build-tools/SdCliIndexFileGenerator.js +50 -50
- package/dist/build-tools/SdCliNgRoutesFileGenerator.d.ts +4 -4
- package/dist/build-tools/SdCliNgRoutesFileGenerator.js +57 -57
- package/dist/build-tools/SdLinter.d.ts +5 -5
- package/dist/build-tools/SdLinter.js +54 -54
- package/dist/build-tools/SdNgBundler.d.ts +34 -35
- package/dist/build-tools/SdNgBundler.js +534 -533
- package/dist/build-tools/SdNgBundler.js.map +1 -1
- package/dist/build-tools/SdNgBundlerContext.d.ts +15 -16
- package/dist/build-tools/SdNgBundlerContext.js +97 -97
- package/dist/build-tools/SdNgBundlerContext.js.map +1 -1
- package/dist/build-tools/SdTsBundler.d.ts +15 -15
- package/dist/build-tools/SdTsBundler.js +87 -87
- package/dist/build-tools/SdTsCompiler.d.ts +29 -29
- package/dist/build-tools/SdTsCompiler.js +227 -227
- package/dist/builders/SdCliClientBuilder.d.ts +18 -18
- package/dist/builders/SdCliClientBuilder.js +129 -129
- package/dist/builders/SdCliJsLibLinter.d.ts +14 -14
- package/dist/builders/SdCliJsLibLinter.js +59 -59
- package/dist/builders/SdCliServerBuilder.d.ts +20 -20
- package/dist/builders/SdCliServerBuilder.js +215 -215
- package/dist/builders/SdCliTsLibBuilder.d.ts +17 -17
- package/dist/builders/SdCliTsLibBuilder.js +79 -79
- package/dist/commons.d.ts +132 -132
- package/dist/commons.js +1 -1
- package/dist/entry/SdCliElectron.d.ts +12 -12
- package/dist/entry/SdCliElectron.js +99 -99
- package/dist/entry/SdCliLocalUpdate.d.ts +12 -12
- package/dist/entry/SdCliLocalUpdate.js +90 -90
- package/dist/entry/SdCliProject.d.ts +26 -26
- package/dist/entry/SdCliProject.js +477 -477
- package/dist/index.d.ts +19 -19
- package/dist/index.js +19 -19
- package/dist/sd-cli.d.ts +2 -2
- package/dist/sd-cli.js +210 -210
- package/dist/server-worker.d.ts +1 -1
- package/dist/server-worker.js +38 -38
- package/dist/utils/SdCliBuildResultUtil.d.ts +6 -6
- package/dist/utils/SdCliBuildResultUtil.js +37 -37
- package/dist/utils/SdMemoryLoadResultCache.d.ts +10 -9
- package/dist/utils/SdMemoryLoadResultCache.js +36 -34
- package/dist/utils/SdMemoryLoadResultCache.js.map +1 -1
- package/dist/utils/SdSourceFileCache.d.ts +6 -6
- package/dist/utils/SdSourceFileCache.js +21 -14
- package/dist/utils/SdSourceFileCache.js.map +1 -1
- package/package.json +18 -18
- package/src/build-tools/SdNgBundler.ts +30 -36
- package/src/build-tools/SdNgBundlerContext.ts +11 -11
- package/src/utils/SdMemoryLoadResultCache.ts +4 -1
- package/src/utils/SdSourceFileCache.ts +10 -3
package/dist/build-cluster.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/dist/build-cluster.js
CHANGED
|
@@ -1,182 +1,182 @@
|
|
|
1
|
-
import cluster from "node:cluster";
|
|
2
|
-
import { FsUtil, Logger, LoggerSeverity } from "@simplysm/sd-core-node";
|
|
3
|
-
import path from "path";
|
|
4
|
-
import { SdCliJsLibLinter } from "./builders/SdCliJsLibLinter";
|
|
5
|
-
import { EventEmitter } from "events";
|
|
6
|
-
import { NeverEntryError } from "@simplysm/sd-core-common";
|
|
7
|
-
import { SdCliServerBuilder } from "./builders/SdCliServerBuilder";
|
|
8
|
-
import { SdCliClientBuilder } from "./builders/SdCliClientBuilder";
|
|
9
|
-
import { SdCliTsLibBuilder } from "./builders/SdCliTsLibBuilder";
|
|
10
|
-
Error.stackTraceLimit = Infinity;
|
|
11
|
-
EventEmitter.defaultMaxListeners = 0;
|
|
12
|
-
if (Boolean(process.env["SD_DEBUG"])) {
|
|
13
|
-
Logger.setConfig({
|
|
14
|
-
console: {
|
|
15
|
-
level: LoggerSeverity.debug
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
Logger.setConfig({
|
|
21
|
-
dot: true
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
const logger = Logger.get(["simplysm", "sd-cli", "build-cluster"]);
|
|
25
|
-
if (cluster.isPrimary) {
|
|
26
|
-
cluster.schedulingPolicy = cluster.SCHED_RR;
|
|
27
|
-
logger.debug(`메인 프로세스 ${process.pid} 시작`);
|
|
28
|
-
cluster.on("exit", (worker, code) => {
|
|
29
|
-
logger.debug(`워커 프로세스 ${worker.process.pid} 종료 (code: ${code})`);
|
|
30
|
-
});
|
|
31
|
-
cluster.on("message", (worker, message) => {
|
|
32
|
-
sendMessage(message);
|
|
33
|
-
});
|
|
34
|
-
process.on("message", (message) => {
|
|
35
|
-
cluster.fork({
|
|
36
|
-
"SD_CLUSTER_MESSAGE": JSON.stringify(message)
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
process.send("ready");
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
const message = JSON.parse(process.env["SD_CLUSTER_MESSAGE"]);
|
|
43
|
-
const pkgConf = message.projConf.packages[path.basename(message.pkgPath)];
|
|
44
|
-
if (message.cmd === "watch") {
|
|
45
|
-
// [library] javascript
|
|
46
|
-
if (pkgConf.type === "library" && !FsUtil.exists(path.resolve(message.pkgPath, "tsconfig.json"))) {
|
|
47
|
-
await new SdCliJsLibLinter(message.pkgPath)
|
|
48
|
-
.on("change", () => {
|
|
49
|
-
sendMessage({
|
|
50
|
-
type: "change",
|
|
51
|
-
req: message
|
|
52
|
-
});
|
|
53
|
-
})
|
|
54
|
-
.on("complete", (result) => {
|
|
55
|
-
sendMessage({
|
|
56
|
-
type: "complete",
|
|
57
|
-
result,
|
|
58
|
-
req: message
|
|
59
|
-
});
|
|
60
|
-
})
|
|
61
|
-
.watchAsync();
|
|
62
|
-
sendMessage({
|
|
63
|
-
type: "ready",
|
|
64
|
-
req: message
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
// [library] typescript
|
|
68
|
-
else if (pkgConf.type === "library" && FsUtil.exists(path.resolve(message.pkgPath, "tsconfig.json"))) {
|
|
69
|
-
await new SdCliTsLibBuilder(message.projConf, message.pkgPath)
|
|
70
|
-
.on("change", () => {
|
|
71
|
-
sendMessage({
|
|
72
|
-
type: "change",
|
|
73
|
-
req: message
|
|
74
|
-
});
|
|
75
|
-
})
|
|
76
|
-
.on("complete", (result) => {
|
|
77
|
-
sendMessage({
|
|
78
|
-
type: "complete",
|
|
79
|
-
result,
|
|
80
|
-
req: message
|
|
81
|
-
});
|
|
82
|
-
})
|
|
83
|
-
.watchAsync();
|
|
84
|
-
sendMessage({
|
|
85
|
-
type: "ready",
|
|
86
|
-
req: message
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
// [server]
|
|
90
|
-
else if (pkgConf.type === "server") {
|
|
91
|
-
await new SdCliServerBuilder(message.projConf, message.pkgPath)
|
|
92
|
-
.on("change", () => {
|
|
93
|
-
sendMessage({
|
|
94
|
-
type: "change",
|
|
95
|
-
req: message
|
|
96
|
-
});
|
|
97
|
-
})
|
|
98
|
-
.on("complete", (result) => {
|
|
99
|
-
sendMessage({
|
|
100
|
-
type: "complete",
|
|
101
|
-
result,
|
|
102
|
-
req: message
|
|
103
|
-
});
|
|
104
|
-
})
|
|
105
|
-
.watchAsync();
|
|
106
|
-
sendMessage({
|
|
107
|
-
type: "ready",
|
|
108
|
-
req: message
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
// [client]
|
|
112
|
-
else if (pkgConf.type === "client") {
|
|
113
|
-
await new SdCliClientBuilder(message.projConf, message.pkgPath)
|
|
114
|
-
.on("change", () => {
|
|
115
|
-
sendMessage({
|
|
116
|
-
type: "change",
|
|
117
|
-
req: message
|
|
118
|
-
});
|
|
119
|
-
})
|
|
120
|
-
.on("complete", (result) => {
|
|
121
|
-
sendMessage({
|
|
122
|
-
type: "complete",
|
|
123
|
-
result,
|
|
124
|
-
req: message
|
|
125
|
-
});
|
|
126
|
-
})
|
|
127
|
-
.watchAsync();
|
|
128
|
-
sendMessage({
|
|
129
|
-
type: "ready",
|
|
130
|
-
req: message
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
throw new NeverEntryError();
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
else { // build
|
|
138
|
-
// [library] javascript
|
|
139
|
-
if (pkgConf.type === "library" && !FsUtil.exists(path.resolve(message.pkgPath, "tsconfig.json"))) {
|
|
140
|
-
const result = await new SdCliJsLibLinter(message.pkgPath).buildAsync();
|
|
141
|
-
sendMessage({
|
|
142
|
-
type: "complete",
|
|
143
|
-
result,
|
|
144
|
-
req: message
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
// [library] typescript
|
|
148
|
-
else if (pkgConf.type === "library" && FsUtil.exists(path.resolve(message.pkgPath, "tsconfig.json"))) {
|
|
149
|
-
const result = await new SdCliTsLibBuilder(message.projConf, message.pkgPath).buildAsync();
|
|
150
|
-
sendMessage({
|
|
151
|
-
type: "complete",
|
|
152
|
-
result,
|
|
153
|
-
req: message
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
// [server]
|
|
157
|
-
else if (pkgConf.type === "server") {
|
|
158
|
-
const result = await new SdCliServerBuilder(message.projConf, message.pkgPath).buildAsync();
|
|
159
|
-
sendMessage({
|
|
160
|
-
type: "complete",
|
|
161
|
-
result,
|
|
162
|
-
req: message
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
// [client]
|
|
166
|
-
else if (pkgConf.type === "client") {
|
|
167
|
-
const result = await new SdCliClientBuilder(message.projConf, message.pkgPath).buildAsync();
|
|
168
|
-
sendMessage({
|
|
169
|
-
type: "complete",
|
|
170
|
-
result,
|
|
171
|
-
req: message
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
throw new NeverEntryError();
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
function sendMessage(message) {
|
|
180
|
-
process.send(message);
|
|
181
|
-
}
|
|
1
|
+
import cluster from "node:cluster";
|
|
2
|
+
import { FsUtil, Logger, LoggerSeverity } from "@simplysm/sd-core-node";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import { SdCliJsLibLinter } from "./builders/SdCliJsLibLinter";
|
|
5
|
+
import { EventEmitter } from "events";
|
|
6
|
+
import { NeverEntryError } from "@simplysm/sd-core-common";
|
|
7
|
+
import { SdCliServerBuilder } from "./builders/SdCliServerBuilder";
|
|
8
|
+
import { SdCliClientBuilder } from "./builders/SdCliClientBuilder";
|
|
9
|
+
import { SdCliTsLibBuilder } from "./builders/SdCliTsLibBuilder";
|
|
10
|
+
Error.stackTraceLimit = Infinity;
|
|
11
|
+
EventEmitter.defaultMaxListeners = 0;
|
|
12
|
+
if (Boolean(process.env["SD_DEBUG"])) {
|
|
13
|
+
Logger.setConfig({
|
|
14
|
+
console: {
|
|
15
|
+
level: LoggerSeverity.debug
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
Logger.setConfig({
|
|
21
|
+
dot: true
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
const logger = Logger.get(["simplysm", "sd-cli", "build-cluster"]);
|
|
25
|
+
if (cluster.isPrimary) {
|
|
26
|
+
cluster.schedulingPolicy = cluster.SCHED_RR;
|
|
27
|
+
logger.debug(`메인 프로세스 ${process.pid} 시작`);
|
|
28
|
+
cluster.on("exit", (worker, code) => {
|
|
29
|
+
logger.debug(`워커 프로세스 ${worker.process.pid} 종료 (code: ${code})`);
|
|
30
|
+
});
|
|
31
|
+
cluster.on("message", (worker, message) => {
|
|
32
|
+
sendMessage(message);
|
|
33
|
+
});
|
|
34
|
+
process.on("message", (message) => {
|
|
35
|
+
cluster.fork({
|
|
36
|
+
"SD_CLUSTER_MESSAGE": JSON.stringify(message)
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
process.send("ready");
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
const message = JSON.parse(process.env["SD_CLUSTER_MESSAGE"]);
|
|
43
|
+
const pkgConf = message.projConf.packages[path.basename(message.pkgPath)];
|
|
44
|
+
if (message.cmd === "watch") {
|
|
45
|
+
// [library] javascript
|
|
46
|
+
if (pkgConf.type === "library" && !FsUtil.exists(path.resolve(message.pkgPath, "tsconfig.json"))) {
|
|
47
|
+
await new SdCliJsLibLinter(message.pkgPath)
|
|
48
|
+
.on("change", () => {
|
|
49
|
+
sendMessage({
|
|
50
|
+
type: "change",
|
|
51
|
+
req: message
|
|
52
|
+
});
|
|
53
|
+
})
|
|
54
|
+
.on("complete", (result) => {
|
|
55
|
+
sendMessage({
|
|
56
|
+
type: "complete",
|
|
57
|
+
result,
|
|
58
|
+
req: message
|
|
59
|
+
});
|
|
60
|
+
})
|
|
61
|
+
.watchAsync();
|
|
62
|
+
sendMessage({
|
|
63
|
+
type: "ready",
|
|
64
|
+
req: message
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
// [library] typescript
|
|
68
|
+
else if (pkgConf.type === "library" && FsUtil.exists(path.resolve(message.pkgPath, "tsconfig.json"))) {
|
|
69
|
+
await new SdCliTsLibBuilder(message.projConf, message.pkgPath)
|
|
70
|
+
.on("change", () => {
|
|
71
|
+
sendMessage({
|
|
72
|
+
type: "change",
|
|
73
|
+
req: message
|
|
74
|
+
});
|
|
75
|
+
})
|
|
76
|
+
.on("complete", (result) => {
|
|
77
|
+
sendMessage({
|
|
78
|
+
type: "complete",
|
|
79
|
+
result,
|
|
80
|
+
req: message
|
|
81
|
+
});
|
|
82
|
+
})
|
|
83
|
+
.watchAsync();
|
|
84
|
+
sendMessage({
|
|
85
|
+
type: "ready",
|
|
86
|
+
req: message
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
// [server]
|
|
90
|
+
else if (pkgConf.type === "server") {
|
|
91
|
+
await new SdCliServerBuilder(message.projConf, message.pkgPath)
|
|
92
|
+
.on("change", () => {
|
|
93
|
+
sendMessage({
|
|
94
|
+
type: "change",
|
|
95
|
+
req: message
|
|
96
|
+
});
|
|
97
|
+
})
|
|
98
|
+
.on("complete", (result) => {
|
|
99
|
+
sendMessage({
|
|
100
|
+
type: "complete",
|
|
101
|
+
result,
|
|
102
|
+
req: message
|
|
103
|
+
});
|
|
104
|
+
})
|
|
105
|
+
.watchAsync();
|
|
106
|
+
sendMessage({
|
|
107
|
+
type: "ready",
|
|
108
|
+
req: message
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
// [client]
|
|
112
|
+
else if (pkgConf.type === "client") {
|
|
113
|
+
await new SdCliClientBuilder(message.projConf, message.pkgPath)
|
|
114
|
+
.on("change", () => {
|
|
115
|
+
sendMessage({
|
|
116
|
+
type: "change",
|
|
117
|
+
req: message
|
|
118
|
+
});
|
|
119
|
+
})
|
|
120
|
+
.on("complete", (result) => {
|
|
121
|
+
sendMessage({
|
|
122
|
+
type: "complete",
|
|
123
|
+
result,
|
|
124
|
+
req: message
|
|
125
|
+
});
|
|
126
|
+
})
|
|
127
|
+
.watchAsync();
|
|
128
|
+
sendMessage({
|
|
129
|
+
type: "ready",
|
|
130
|
+
req: message
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
throw new NeverEntryError();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
else { // build
|
|
138
|
+
// [library] javascript
|
|
139
|
+
if (pkgConf.type === "library" && !FsUtil.exists(path.resolve(message.pkgPath, "tsconfig.json"))) {
|
|
140
|
+
const result = await new SdCliJsLibLinter(message.pkgPath).buildAsync();
|
|
141
|
+
sendMessage({
|
|
142
|
+
type: "complete",
|
|
143
|
+
result,
|
|
144
|
+
req: message
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
// [library] typescript
|
|
148
|
+
else if (pkgConf.type === "library" && FsUtil.exists(path.resolve(message.pkgPath, "tsconfig.json"))) {
|
|
149
|
+
const result = await new SdCliTsLibBuilder(message.projConf, message.pkgPath).buildAsync();
|
|
150
|
+
sendMessage({
|
|
151
|
+
type: "complete",
|
|
152
|
+
result,
|
|
153
|
+
req: message
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
// [server]
|
|
157
|
+
else if (pkgConf.type === "server") {
|
|
158
|
+
const result = await new SdCliServerBuilder(message.projConf, message.pkgPath).buildAsync();
|
|
159
|
+
sendMessage({
|
|
160
|
+
type: "complete",
|
|
161
|
+
result,
|
|
162
|
+
req: message
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
// [client]
|
|
166
|
+
else if (pkgConf.type === "client") {
|
|
167
|
+
const result = await new SdCliClientBuilder(message.projConf, message.pkgPath).buildAsync();
|
|
168
|
+
sendMessage({
|
|
169
|
+
type: "complete",
|
|
170
|
+
result,
|
|
171
|
+
req: message
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
throw new NeverEntryError();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
function sendMessage(message) {
|
|
180
|
+
process.send(message);
|
|
181
|
+
}
|
|
182
182
|
//# sourceMappingURL=build-cluster.js.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { ISdCliClientBuilderCordovaConfig } from "../commons";
|
|
2
|
-
import { Logger } from "@simplysm/sd-core-node";
|
|
3
|
-
export declare class SdCliCordova {
|
|
4
|
-
private readonly _opt;
|
|
5
|
-
protected readonly _logger: Logger;
|
|
6
|
-
private readonly _platforms;
|
|
7
|
-
private readonly _npmConfig;
|
|
8
|
-
constructor(_opt: {
|
|
9
|
-
pkgPath: string;
|
|
10
|
-
config: ISdCliClientBuilderCordovaConfig;
|
|
11
|
-
cordovaPath: string;
|
|
12
|
-
});
|
|
13
|
-
private _execAsync;
|
|
14
|
-
initializeAsync(): Promise<void>;
|
|
15
|
-
buildAsync(outPath: string): Promise<void>;
|
|
16
|
-
static runWebviewOnDeviceAsync(opt: {
|
|
17
|
-
platform: string;
|
|
18
|
-
pkgName: string;
|
|
19
|
-
url?: string;
|
|
20
|
-
}): Promise<void>;
|
|
21
|
-
}
|
|
1
|
+
import { ISdCliClientBuilderCordovaConfig } from "../commons";
|
|
2
|
+
import { Logger } from "@simplysm/sd-core-node";
|
|
3
|
+
export declare class SdCliCordova {
|
|
4
|
+
private readonly _opt;
|
|
5
|
+
protected readonly _logger: Logger;
|
|
6
|
+
private readonly _platforms;
|
|
7
|
+
private readonly _npmConfig;
|
|
8
|
+
constructor(_opt: {
|
|
9
|
+
pkgPath: string;
|
|
10
|
+
config: ISdCliClientBuilderCordovaConfig;
|
|
11
|
+
cordovaPath: string;
|
|
12
|
+
});
|
|
13
|
+
private _execAsync;
|
|
14
|
+
initializeAsync(): Promise<void>;
|
|
15
|
+
buildAsync(outPath: string): Promise<void>;
|
|
16
|
+
static runWebviewOnDeviceAsync(opt: {
|
|
17
|
+
platform: string;
|
|
18
|
+
pkgName: string;
|
|
19
|
+
url?: string;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
}
|