@simplysm/sd-cli 12.13.20 → 12.13.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/pkg-builders/client/sd-cli-ng-routes.file-generator.d.ts +1 -0
- package/dist/pkg-builders/client/sd-cli-ng-routes.file-generator.js +16 -11
- package/dist/pkg-builders/client/sd-cli-ng-routes.file-generator.js.map +1 -1
- package/dist/pkg-builders/client/sd-client.build-runner.js +7 -17
- package/dist/pkg-builders/client/sd-client.build-runner.js.map +1 -1
- package/dist/pkg-builders/client/sd-ng.bundler.js +105 -95
- package/dist/pkg-builders/client/sd-ng.bundler.js.map +1 -1
- package/dist/pkg-builders/commons/build-runner.base.d.ts +2 -1
- package/dist/pkg-builders/commons/build-runner.base.js +16 -27
- package/dist/pkg-builders/commons/build-runner.base.js.map +1 -1
- package/dist/pkg-builders/lib/sd-cli-db-context.file-generator.d.ts +1 -0
- package/dist/pkg-builders/lib/sd-cli-db-context.file-generator.js +21 -11
- package/dist/pkg-builders/lib/sd-cli-db-context.file-generator.js.map +1 -1
- package/dist/pkg-builders/lib/sd-cli-index.file-generator.d.ts +1 -0
- package/dist/pkg-builders/lib/sd-cli-index.file-generator.js +13 -10
- package/dist/pkg-builders/lib/sd-cli-index.file-generator.js.map +1 -1
- package/dist/pkg-builders/lib/sd-ts-lib.build-runner.js +11 -30
- package/dist/pkg-builders/lib/sd-ts-lib.build-runner.js.map +1 -1
- package/dist/pkg-builders/server/sd-server.bundler.js +48 -37
- package/dist/pkg-builders/server/sd-server.bundler.js.map +1 -1
- package/package.json +5 -5
- package/src/pkg-builders/client/sd-cli-ng-routes.file-generator.ts +18 -8
- package/src/pkg-builders/client/sd-client.build-runner.ts +8 -19
- package/src/pkg-builders/client/sd-ng.bundler.ts +139 -121
- package/src/pkg-builders/commons/build-runner.base.ts +62 -75
- package/src/pkg-builders/lib/sd-cli-db-context.file-generator.ts +20 -8
- package/src/pkg-builders/lib/sd-cli-index.file-generator.ts +20 -9
- package/src/pkg-builders/lib/sd-ts-lib.build-runner.ts +11 -31
- package/src/pkg-builders/server/sd-server.bundler.ts +59 -48
|
@@ -120,63 +120,74 @@ const __dirname = __path__.dirname(__filename);`.trim(),
|
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
const emitFileSet = new Set<TNormPath>();
|
|
124
123
|
let result: esbuild.BuildResult | esbuild.BuildFailure;
|
|
125
|
-
|
|
126
|
-
result = await this.#context.rebuild();
|
|
124
|
+
result = await this.#context.rebuild();
|
|
127
125
|
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
if (this._opt.noEmit) {
|
|
127
|
+
return {
|
|
128
|
+
watchFileSet: this.#resultCache.watchFileSet!,
|
|
129
|
+
affectedFileSet: this.#resultCache.affectedFileSet!,
|
|
130
|
+
results: [],
|
|
131
|
+
emitFileSet: new Set<TNormPath>(),
|
|
132
|
+
};
|
|
133
|
+
} else {
|
|
134
|
+
const emitFileSet = new Set<TNormPath>();
|
|
130
135
|
|
|
131
|
-
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
this
|
|
138
|
-
|
|
136
|
+
try {
|
|
137
|
+
const outputFiles: BuildOutputFile[] =
|
|
138
|
+
result.outputFiles?.map((file) => convertOutputFile(file, BuildOutputFileType.Root)) ??
|
|
139
|
+
[];
|
|
140
|
+
|
|
141
|
+
for (const outputFile of outputFiles) {
|
|
142
|
+
const distFilePath = PathUtils.norm(this._opt.pkgPath, outputFile.path);
|
|
143
|
+
const prevHash = this.#outputHashCache.get(distFilePath);
|
|
144
|
+
const currHash = HashUtils.get(Buffer.from(outputFile.contents));
|
|
145
|
+
if (prevHash !== currHash) {
|
|
146
|
+
FsUtils.writeFile(distFilePath, outputFile.contents);
|
|
147
|
+
this.#outputHashCache.set(distFilePath, currHash);
|
|
148
|
+
emitFileSet.add(distFilePath);
|
|
149
|
+
}
|
|
139
150
|
}
|
|
140
|
-
}
|
|
141
151
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
152
|
+
//-- copy assets
|
|
153
|
+
const assetFiles = await resolveAssets(
|
|
154
|
+
[
|
|
155
|
+
{ input: "public", glob: "**/*", output: "." },
|
|
156
|
+
...(this._opt.dev ? [{ input: "public-dev", glob: "**/*", output: "." }] : []),
|
|
157
|
+
],
|
|
158
|
+
this._opt.pkgPath,
|
|
159
|
+
);
|
|
150
160
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
+
for (const assetFile of assetFiles) {
|
|
162
|
+
const prevHash = this.#outputHashCache.get(PathUtils.norm(assetFile.source));
|
|
163
|
+
const currHash = HashUtils.get(FsUtils.readFileBuffer(assetFile.source));
|
|
164
|
+
if (prevHash !== currHash) {
|
|
165
|
+
FsUtils.copy(
|
|
166
|
+
assetFile.source,
|
|
167
|
+
path.resolve(this._opt.pkgPath, "dist", assetFile.destination),
|
|
168
|
+
);
|
|
169
|
+
this.#outputHashCache.set(PathUtils.norm(assetFile.source), currHash);
|
|
170
|
+
emitFileSet.add(PathUtils.norm(this._opt.pkgPath, "dist", assetFile.destination));
|
|
171
|
+
}
|
|
161
172
|
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
173
|
+
} catch (err) {
|
|
174
|
+
result = err;
|
|
175
|
+
for (const e of err.errors) {
|
|
176
|
+
if (e.detail != null) {
|
|
177
|
+
this.#logger.error(e.detail);
|
|
178
|
+
}
|
|
168
179
|
}
|
|
169
180
|
}
|
|
170
|
-
}
|
|
171
181
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
182
|
+
return {
|
|
183
|
+
watchFileSet: this.#resultCache.watchFileSet!,
|
|
184
|
+
affectedFileSet: this.#resultCache.affectedFileSet!,
|
|
185
|
+
results: SdCliConvertMessageUtils.convertToBuildMessagesFromEsbuild(
|
|
186
|
+
result,
|
|
187
|
+
this._opt.pkgPath,
|
|
188
|
+
),
|
|
189
|
+
emitFileSet: emitFileSet,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
181
192
|
}
|
|
182
193
|
}
|