@simplysm/sd-cli 12.8.20 → 12.8.22
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/entry/sd-cli-cordova.d.ts +30 -0
- package/dist/entry/sd-cli-cordova.js +307 -246
- package/dist/entry/sd-cli-cordova.js.map +1 -1
- package/dist/entry/sd-cli-project.d.ts +1 -1
- package/dist/entry/sd-cli-project.js +8 -9
- package/dist/entry/sd-cli-project.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/pkg-builders/client/sd-ng.bundler.d.ts +15 -1
- package/dist/pkg-builders/client/sd-ng.bundler.js +60 -70
- package/dist/pkg-builders/client/sd-ng.bundler.js.map +1 -1
- package/dist/pkg-builders/client/sd-ng.plugin-creator.js +49 -29
- package/dist/pkg-builders/client/sd-ng.plugin-creator.js.map +1 -1
- package/dist/pkg-builders/lib/sd-ts-lib.builder.js +7 -4
- package/dist/pkg-builders/lib/sd-ts-lib.builder.js.map +1 -1
- package/dist/pkg-builders/server/sd-server.bundler.js +11 -10
- package/dist/pkg-builders/server/sd-server.bundler.js.map +1 -1
- package/dist/ts-compiler/sd-ts-compiler.d.ts +25 -2
- package/dist/ts-compiler/sd-ts-compiler.js +306 -575
- package/dist/ts-compiler/sd-ts-compiler.js.map +1 -1
- package/dist/ts-compiler/sd-ts-dependency-analyzer.d.ts +6 -0
- package/dist/ts-compiler/sd-ts-dependency-analyzer.js +141 -0
- package/dist/ts-compiler/sd-ts-dependency-analyzer.js.map +1 -0
- package/dist/types/ts-compiler.types.d.ts +12 -7
- package/dist/types/worker.types.d.ts +13 -0
- package/dist/utils/sd-cli-performance-time.js +1 -1
- package/package.json +6 -8
- package/src/entry/sd-cli-cordova.ts +393 -280
- package/src/entry/sd-cli-project.ts +11 -23
- package/src/index.ts +1 -0
- package/src/pkg-builders/client/sd-ng.bundler.ts +67 -69
- package/src/pkg-builders/client/sd-ng.plugin-creator.ts +47 -27
- package/src/pkg-builders/lib/sd-ts-lib.builder.ts +14 -7
- package/src/pkg-builders/server/sd-server.bundler.ts +22 -12
- package/src/ts-compiler/sd-ts-compiler.ts +379 -704
- package/src/ts-compiler/sd-ts-dependency-analyzer.ts +185 -0
- package/src/types/ts-compiler.types.ts +11 -6
- package/src/types/worker.types.ts +7 -6
- package/src/utils/sd-cli-performance-time.ts +1 -1
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import esbuild from "esbuild";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import { FsUtils,
|
|
3
|
+
import { FsUtils, HashUtils, PathUtils, SdLogger, TNormPath } from "@simplysm/sd-core-node";
|
|
4
4
|
import { SdCliConvertMessageUtils } from "../../utils/sd-cli-convert-message.utils";
|
|
5
5
|
import { ISdCliServerPluginResultCache } from "../../types/build-plugin.types";
|
|
6
6
|
import { ISdBuildMessage } from "../../types/build.types";
|
|
7
7
|
import { createSdServerPlugin } from "./sd-server.plugin-creator";
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
BuildOutputFile,
|
|
10
|
+
BuildOutputFileType,
|
|
11
|
+
} from "@angular/build/src/tools/esbuild/bundler-context";
|
|
9
12
|
import { convertOutputFile } from "@angular/build/src/tools/esbuild/utils";
|
|
10
13
|
import { resolveAssets } from "@angular/build/src/utils/resolve-assets";
|
|
11
14
|
|
|
@@ -17,7 +20,7 @@ export class SdServerBundler {
|
|
|
17
20
|
readonly #modifiedFileSet = new Set<TNormPath>();
|
|
18
21
|
readonly #resultCache: ISdCliServerPluginResultCache = {};
|
|
19
22
|
|
|
20
|
-
readonly #
|
|
23
|
+
readonly #outputHashCache = new Map<TNormPath, string>();
|
|
21
24
|
|
|
22
25
|
constructor(
|
|
23
26
|
private readonly _opt: {
|
|
@@ -123,10 +126,11 @@ const __dirname = __path__.dirname(__filename);`.trim(),
|
|
|
123
126
|
|
|
124
127
|
for (const outputFile of outputFiles) {
|
|
125
128
|
const distFilePath = PathUtils.norm(this._opt.pkgPath, outputFile.path);
|
|
126
|
-
const
|
|
127
|
-
|
|
129
|
+
const prevHash = this.#outputHashCache.get(distFilePath);
|
|
130
|
+
const currHash = HashUtils.get(outputFile.contents);
|
|
131
|
+
if (prevHash !== currHash) {
|
|
128
132
|
FsUtils.writeFile(distFilePath, outputFile.contents);
|
|
129
|
-
this.#
|
|
133
|
+
this.#outputHashCache.set(distFilePath, currHash);
|
|
130
134
|
emitFileSet.add(distFilePath);
|
|
131
135
|
}
|
|
132
136
|
}
|
|
@@ -141,11 +145,14 @@ const __dirname = __path__.dirname(__filename);`.trim(),
|
|
|
141
145
|
);
|
|
142
146
|
|
|
143
147
|
for (const assetFile of assetFiles) {
|
|
144
|
-
const
|
|
145
|
-
const
|
|
146
|
-
if (
|
|
147
|
-
FsUtils.copy(
|
|
148
|
-
|
|
148
|
+
const prevHash = this.#outputHashCache.get(PathUtils.norm(assetFile.source));
|
|
149
|
+
const currHash = FsUtils.hash(assetFile.source);
|
|
150
|
+
if (prevHash !== currHash) {
|
|
151
|
+
FsUtils.copy(
|
|
152
|
+
assetFile.source,
|
|
153
|
+
path.resolve(this._opt.pkgPath, "dist", assetFile.destination),
|
|
154
|
+
);
|
|
155
|
+
this.#outputHashCache.set(PathUtils.norm(assetFile.source), currHash);
|
|
149
156
|
emitFileSet.add(PathUtils.norm(assetFile.destination));
|
|
150
157
|
}
|
|
151
158
|
}
|
|
@@ -162,7 +169,10 @@ const __dirname = __path__.dirname(__filename);`.trim(),
|
|
|
162
169
|
return {
|
|
163
170
|
watchFileSet: this.#resultCache.watchFileSet!,
|
|
164
171
|
affectedFileSet: this.#resultCache.affectedFileSet!,
|
|
165
|
-
results: SdCliConvertMessageUtils.convertToBuildMessagesFromEsbuild(
|
|
172
|
+
results: SdCliConvertMessageUtils.convertToBuildMessagesFromEsbuild(
|
|
173
|
+
result,
|
|
174
|
+
this._opt.pkgPath,
|
|
175
|
+
),
|
|
166
176
|
emitFileSet: emitFileSet,
|
|
167
177
|
};
|
|
168
178
|
}
|