@simplysm/sd-cli 7.0.236 → 7.0.239
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/bin/sd-cli.mjs +1 -1
- package/dist/build-tool/SdCliCordova.d.ts +1 -1
- package/dist/build-tool/SdCliCordova.mjs +37 -17
- package/dist/builder/SdCliClientBuilder.mjs +35 -22
- package/dist/entry-points/SdCliLocalUpdate.mjs +2 -2
- package/dist/entry-points/SdCliWorkspace.mjs +2 -2
- package/dist/worker/build-worker.mjs +1 -1
- package/lib/cordova-entry.js +18 -0
- package/package.json +7 -7
- package/src/bin/sd-cli.ts +1 -1
- package/src/build-tool/SdCliCordova.ts +259 -234
- package/src/builder/SdCliClientBuilder.ts +35 -21
- package/src/entry-points/SdCliLocalUpdate.ts +121 -121
- package/src/entry-points/SdCliWorkspace.ts +455 -455
- package/src/worker/build-worker.ts +73 -74
- package/tsconfig.json +38 -38
|
@@ -1,74 +1,73 @@
|
|
|
1
|
-
import { SdCliTsLibBuilder } from "../builder/SdCliTsLibBuilder";
|
|
2
|
-
import { SdCliJsLibBuilder } from "../builder/SdCliJsLibBuilder";
|
|
3
|
-
import { SdCliServerBuilder } from "../builder/SdCliServerBuilder";
|
|
4
|
-
import { SdCliClientBuilder } from "../builder/SdCliClientBuilder";
|
|
5
|
-
import { FsUtil, Logger, LoggerSeverity } from "@simplysm/sd-core-node";
|
|
6
|
-
import path from "path";
|
|
7
|
-
import { JsonConvert } from "@simplysm/sd-core-common";
|
|
8
|
-
import { TSdCliPackageConfig } from "../commons";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
process.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
1
|
+
import { SdCliTsLibBuilder } from "../builder/SdCliTsLibBuilder";
|
|
2
|
+
import { SdCliJsLibBuilder } from "../builder/SdCliJsLibBuilder";
|
|
3
|
+
import { SdCliServerBuilder } from "../builder/SdCliServerBuilder";
|
|
4
|
+
import { SdCliClientBuilder } from "../builder/SdCliClientBuilder";
|
|
5
|
+
import { FsUtil, Logger, LoggerSeverity } from "@simplysm/sd-core-node";
|
|
6
|
+
import path from "path";
|
|
7
|
+
import { JsonConvert } from "@simplysm/sd-core-common";
|
|
8
|
+
import { TSdCliPackageConfig } from "../commons";
|
|
9
|
+
|
|
10
|
+
if (process.env["SD_CLI_LOGGER_SEVERITY"] === "DEBUG") {
|
|
11
|
+
Logger.setConfig({
|
|
12
|
+
console: {
|
|
13
|
+
level: LoggerSeverity.debug
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
Logger.setConfig({
|
|
19
|
+
dot: true
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const type = process.argv[2] as ("build" | "watch");
|
|
24
|
+
const rootPath = process.argv[3];
|
|
25
|
+
const config = JsonConvert.parse(process.argv[4]) as TSdCliPackageConfig;
|
|
26
|
+
const workspaceRootPath = process.argv[5];
|
|
27
|
+
|
|
28
|
+
function createBuilder(): SdCliJsLibBuilder | SdCliTsLibBuilder | SdCliServerBuilder | SdCliClientBuilder {
|
|
29
|
+
const isTs = FsUtil.exists(path.resolve(rootPath, "tsconfig.json"));
|
|
30
|
+
|
|
31
|
+
if (config.type === "library") {
|
|
32
|
+
return isTs ? new SdCliTsLibBuilder(rootPath, config, workspaceRootPath) : new SdCliJsLibBuilder(rootPath);
|
|
33
|
+
}
|
|
34
|
+
else if (config.type === "server") {
|
|
35
|
+
return new SdCliServerBuilder(rootPath, config, workspaceRootPath);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return new SdCliClientBuilder(rootPath, config, workspaceRootPath);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const builder = createBuilder();
|
|
43
|
+
|
|
44
|
+
if (type === "build") {
|
|
45
|
+
builder.buildAsync()
|
|
46
|
+
.then((result) => {
|
|
47
|
+
process.send!(JsonConvert.stringify(result));
|
|
48
|
+
process.exit(0);
|
|
49
|
+
})
|
|
50
|
+
.catch((err) => {
|
|
51
|
+
// eslint-disable-next-line no-console
|
|
52
|
+
console.error(err);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
builder
|
|
58
|
+
.on("change", () => {
|
|
59
|
+
process.send!(JsonConvert.stringify({ event: "change" }));
|
|
60
|
+
})
|
|
61
|
+
.on("complete", (results) => {
|
|
62
|
+
process.send!(JsonConvert.stringify({ event: "complete", body: results }));
|
|
63
|
+
})
|
|
64
|
+
.watchAsync()
|
|
65
|
+
.then(() => {
|
|
66
|
+
process.send!(JsonConvert.stringify({ event: "ready" }));
|
|
67
|
+
})
|
|
68
|
+
.catch((err) => {
|
|
69
|
+
// eslint-disable-next-line no-console
|
|
70
|
+
console.error(err);
|
|
71
|
+
process.exit(1);
|
|
72
|
+
});
|
|
73
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"lib": [
|
|
5
|
-
"ES2020"
|
|
6
|
-
],
|
|
7
|
-
"outDir": "./dist",
|
|
8
|
-
"baseUrl": ".",
|
|
9
|
-
"paths": {
|
|
10
|
-
"@simplysm/sd-core-common": [
|
|
11
|
-
"../sd-core-common/src/index.ts"
|
|
12
|
-
],
|
|
13
|
-
"@simplysm/sd-core-node": [
|
|
14
|
-
"../sd-core-node/src/index.ts"
|
|
15
|
-
],
|
|
16
|
-
"@simplysm/sd-service-common": [
|
|
17
|
-
"../sd-service-common/src/index.ts"
|
|
18
|
-
],
|
|
19
|
-
"@simplysm/sd-service-server": [
|
|
20
|
-
"../sd-service-server/src/index.ts"
|
|
21
|
-
],
|
|
22
|
-
"@simplysm/sd-orm-common": [
|
|
23
|
-
"../sd-orm-common/src/index.ts"
|
|
24
|
-
],
|
|
25
|
-
"@simplysm/sd-orm-node": [
|
|
26
|
-
"../sd-orm-node/src/index.ts"
|
|
27
|
-
],
|
|
28
|
-
"@simplysm/sd-storage": [
|
|
29
|
-
"../sd-storage/src/index.ts"
|
|
30
|
-
]
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
"files": [
|
|
34
|
-
"src/bin/sd-cli.ts",
|
|
35
|
-
"src/index.ts",
|
|
36
|
-
"src/worker/build-worker.ts"
|
|
37
|
-
]
|
|
38
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"lib": [
|
|
5
|
+
"ES2020"
|
|
6
|
+
],
|
|
7
|
+
"outDir": "./dist",
|
|
8
|
+
"baseUrl": ".",
|
|
9
|
+
"paths": {
|
|
10
|
+
"@simplysm/sd-core-common": [
|
|
11
|
+
"../sd-core-common/src/index.ts"
|
|
12
|
+
],
|
|
13
|
+
"@simplysm/sd-core-node": [
|
|
14
|
+
"../sd-core-node/src/index.ts"
|
|
15
|
+
],
|
|
16
|
+
"@simplysm/sd-service-common": [
|
|
17
|
+
"../sd-service-common/src/index.ts"
|
|
18
|
+
],
|
|
19
|
+
"@simplysm/sd-service-server": [
|
|
20
|
+
"../sd-service-server/src/index.ts"
|
|
21
|
+
],
|
|
22
|
+
"@simplysm/sd-orm-common": [
|
|
23
|
+
"../sd-orm-common/src/index.ts"
|
|
24
|
+
],
|
|
25
|
+
"@simplysm/sd-orm-node": [
|
|
26
|
+
"../sd-orm-node/src/index.ts"
|
|
27
|
+
],
|
|
28
|
+
"@simplysm/sd-storage": [
|
|
29
|
+
"../sd-storage/src/index.ts"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"src/bin/sd-cli.ts",
|
|
35
|
+
"src/index.ts",
|
|
36
|
+
"src/worker/build-worker.ts"
|
|
37
|
+
]
|
|
38
|
+
}
|