@simplysm/sd-cli 12.5.19 → 12.5.21
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/SdNgBundler.d.ts +1 -0
- package/dist/build-tools/SdNgBundler.js +70 -57
- package/dist/build-tools/SdNgBundler.js.map +1 -1
- package/dist/build-tools/SdReactBundler.d.ts +25 -0
- package/dist/build-tools/SdReactBundler.js +295 -0
- package/dist/build-tools/SdReactBundler.js.map +1 -0
- package/dist/build-tools/SdReactBundlerContext.d.ts +14 -0
- package/dist/build-tools/SdReactBundlerContext.js +59 -0
- package/dist/build-tools/SdReactBundlerContext.js.map +1 -0
- package/dist/build-tools/SdServerBundler.d.ts +1 -0
- package/dist/build-tools/SdServerBundler.js +8 -7
- package/dist/build-tools/SdServerBundler.js.map +1 -1
- package/dist/build-tools/SdTsCompiler.d.ts +1 -0
- package/dist/build-tools/SdTsCompiler.js +355 -327
- package/dist/build-tools/SdTsCompiler.js.map +1 -1
- package/dist/build-tools/SdTsLibBundler.d.ts +1 -1
- package/dist/build-tools/SdTsLibBundler.js +2 -1
- package/dist/build-tools/SdTsLibBundler.js.map +1 -1
- package/dist/builders/SdCliClientBuilder.js +42 -20
- package/dist/builders/SdCliClientBuilder.js.map +1 -1
- package/dist/builders/SdCliServerBuilder.js +2 -1
- package/dist/builders/SdCliServerBuilder.js.map +1 -1
- package/dist/builders/SdCliTsLibBuilder.js +4 -2
- package/dist/builders/SdCliTsLibBuilder.js.map +1 -1
- package/dist/bundle-plugins/sdNgPlugin.d.ts +1 -0
- package/dist/bundle-plugins/sdNgPlugin.js +38 -23
- package/dist/bundle-plugins/sdNgPlugin.js.map +1 -1
- package/dist/bundle-plugins/sdReactPlugin.d.ts +16 -0
- package/dist/bundle-plugins/sdReactPlugin.js +117 -0
- package/dist/bundle-plugins/sdReactPlugin.js.map +1 -0
- package/dist/bundle-plugins/sdServerPlugin.d.ts +1 -0
- package/dist/bundle-plugins/sdServerPlugin.js +1 -0
- package/dist/bundle-plugins/sdServerPlugin.js.map +1 -1
- package/dist/entry/SdCliProject.js +7 -4
- package/dist/entry/SdCliProject.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/SdCliPerformanceTime.d.ts +9 -0
- package/dist/utils/SdCliPerformanceTime.js +40 -0
- package/dist/utils/SdCliPerformanceTime.js.map +1 -0
- package/package.json +13 -10
- package/src/build-tools/SdNgBundler.ts +82 -68
- package/src/build-tools/SdReactBundler.ts +372 -0
- package/src/build-tools/SdReactBundlerContext.ts +71 -0
- package/src/build-tools/SdServerBundler.ts +22 -20
- package/src/build-tools/SdTsCompiler.ts +341 -357
- package/src/build-tools/SdTsLibBundler.ts +2 -1
- package/src/builders/SdCliClientBuilder.ts +53 -29
- package/src/builders/SdCliServerBuilder.ts +5 -4
- package/src/builders/SdCliTsLibBuilder.ts +7 -4
- package/src/bundle-plugins/sdNgPlugin.ts +44 -23
- package/src/bundle-plugins/sdReactPlugin.ts +164 -0
- package/src/bundle-plugins/sdServerPlugin.ts +2 -0
- package/src/entry/SdCliProject.ts +6 -4
- package/src/index.ts +4 -0
- package/src/utils/SdCliPerformanceTime.ts +42 -0
- package/tsconfig.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {ISdCliPackageBuildResult} from "../commons";
|
|
1
|
+
import { ISdCliPackageBuildResult } from "../commons";
|
|
2
2
|
import esbuild from "esbuild";
|
|
3
3
|
import path from "path";
|
|
4
|
-
import {IServerPluginResultCache, sdServerPlugin} from "../bundle-plugins/sdServerPlugin";
|
|
4
|
+
import { IServerPluginResultCache, sdServerPlugin } from "../bundle-plugins/sdServerPlugin";
|
|
5
5
|
import ts from "typescript";
|
|
6
|
-
import {Logger} from "@simplysm/sd-core-node";
|
|
6
|
+
import { Logger } from "@simplysm/sd-core-node";
|
|
7
7
|
|
|
8
8
|
export class SdServerBundler {
|
|
9
9
|
readonly #logger = Logger.get(["simplysm", "sd-cli", "SdServerBundler"]);
|
|
@@ -13,13 +13,15 @@ export class SdServerBundler {
|
|
|
13
13
|
#modifiedFileSet = new Set<string>();
|
|
14
14
|
#resultCache: IServerPluginResultCache = {};
|
|
15
15
|
|
|
16
|
-
constructor(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
constructor(
|
|
17
|
+
private readonly _opt: {
|
|
18
|
+
dev: boolean;
|
|
19
|
+
pkgPath: string;
|
|
20
|
+
entryPoints: string[];
|
|
21
|
+
external?: string[];
|
|
22
|
+
watchScopePaths: string[];
|
|
23
|
+
},
|
|
24
|
+
) {}
|
|
23
25
|
|
|
24
26
|
public markForChanges(filePaths: string[]): void {
|
|
25
27
|
for (const filePath of filePaths) {
|
|
@@ -40,7 +42,7 @@ export class SdServerBundler {
|
|
|
40
42
|
bundle: true,
|
|
41
43
|
sourcemap: true, //this._opt.dev,
|
|
42
44
|
target: "node18",
|
|
43
|
-
mainFields: [
|
|
45
|
+
mainFields: ["es2020", "es2015", "module", "main"],
|
|
44
46
|
conditions: ["es2020", "es2015", "module"],
|
|
45
47
|
tsconfig: path.resolve(this._opt.pkgPath, "tsconfig.json"),
|
|
46
48
|
write: true,
|
|
@@ -74,7 +76,7 @@ export class SdServerBundler {
|
|
|
74
76
|
".pfx": "file",
|
|
75
77
|
".pkl": "file",
|
|
76
78
|
".mp3": "file",
|
|
77
|
-
".ogg": "file"
|
|
79
|
+
".ogg": "file",
|
|
78
80
|
},
|
|
79
81
|
platform: "node",
|
|
80
82
|
logLevel: "silent",
|
|
@@ -87,24 +89,24 @@ import { createRequire as __createRequire__ } from 'module';
|
|
|
87
89
|
|
|
88
90
|
const require = __createRequire__(import.meta.url);
|
|
89
91
|
const __filename = __fileURLToPath__(import.meta.url);
|
|
90
|
-
const __dirname = __path__.dirname(__filename);`.trim()
|
|
92
|
+
const __dirname = __path__.dirname(__filename);`.trim(),
|
|
91
93
|
},
|
|
92
94
|
plugins: [
|
|
93
95
|
sdServerPlugin({
|
|
94
96
|
modifiedFileSet: this.#modifiedFileSet,
|
|
95
97
|
dev: this._opt.dev,
|
|
96
98
|
pkgPath: this._opt.pkgPath,
|
|
97
|
-
result: this.#resultCache
|
|
99
|
+
result: this.#resultCache,
|
|
100
|
+
watchScopePaths: this._opt.watchScopePaths,
|
|
98
101
|
}),
|
|
99
|
-
]
|
|
102
|
+
],
|
|
100
103
|
});
|
|
101
104
|
}
|
|
102
105
|
|
|
103
106
|
let result: esbuild.BuildResult | esbuild.BuildFailure;
|
|
104
107
|
try {
|
|
105
108
|
result = await this.#context.rebuild();
|
|
106
|
-
}
|
|
107
|
-
catch (err) {
|
|
109
|
+
} catch (err) {
|
|
108
110
|
result = err;
|
|
109
111
|
for (const e of err.errors) {
|
|
110
112
|
if (e.detail != null) {
|
|
@@ -135,8 +137,8 @@ const __dirname = __path__.dirname(__filename);`.trim()
|
|
|
135
137
|
code: err.text.slice(0, err.text.indexOf(":")),
|
|
136
138
|
severity: "error" as const,
|
|
137
139
|
message: `(${err.pluginName}) ${err.text.slice(err.text.indexOf(":") + 1)}`,
|
|
138
|
-
}))
|
|
139
|
-
]
|
|
140
|
+
})),
|
|
141
|
+
],
|
|
140
142
|
};
|
|
141
143
|
}
|
|
142
|
-
}
|
|
144
|
+
}
|