@faapi/faapi 0.0.0-canary.4e89b9b → 0.0.0-canary.991c0b8
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/cli/index.js +18 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -235,7 +235,7 @@ async function compileDevRoutes(options) {
|
|
|
235
235
|
const plugins = buildAliasPlugins(rootDir);
|
|
236
236
|
const esbuild = await import("esbuild");
|
|
237
237
|
const outbase = path3.resolve(rootDir, APP_DIR2);
|
|
238
|
-
await esbuild.build({
|
|
238
|
+
const result = await esbuild.build({
|
|
239
239
|
entryPoints,
|
|
240
240
|
outdir: absDist,
|
|
241
241
|
outbase,
|
|
@@ -245,8 +245,19 @@ async function compileDevRoutes(options) {
|
|
|
245
245
|
sourcemap: true,
|
|
246
246
|
packages: "external",
|
|
247
247
|
plugins,
|
|
248
|
-
logLevel
|
|
248
|
+
logLevel,
|
|
249
|
+
write: false
|
|
249
250
|
});
|
|
251
|
+
if (result.outputFiles) {
|
|
252
|
+
await Promise.all(
|
|
253
|
+
result.outputFiles.map(async (file) => {
|
|
254
|
+
await fs3.promises.mkdir(path3.dirname(file.path), { recursive: true });
|
|
255
|
+
const tmp = `${file.path}.tmp-${process.pid}-${Math.random().toString(36).slice(2)}`;
|
|
256
|
+
await fs3.promises.writeFile(tmp, file.contents);
|
|
257
|
+
await fs3.promises.rename(tmp, file.path);
|
|
258
|
+
})
|
|
259
|
+
);
|
|
260
|
+
}
|
|
250
261
|
return { compiledFiles: entryPoints };
|
|
251
262
|
}
|
|
252
263
|
var APP_DIR2;
|
|
@@ -4267,6 +4278,11 @@ function createSseWriter() {
|
|
|
4267
4278
|
const text = encodeSseEvent(event);
|
|
4268
4279
|
controller.enqueue(encoder.encode(text));
|
|
4269
4280
|
},
|
|
4281
|
+
sendRaw(chunk) {
|
|
4282
|
+
if (closed || !controller) return;
|
|
4283
|
+
const bytes = typeof chunk === "string" ? encoder.encode(chunk) : chunk;
|
|
4284
|
+
controller.enqueue(bytes);
|
|
4285
|
+
},
|
|
4270
4286
|
sendError(error) {
|
|
4271
4287
|
if (closed || !controller) return;
|
|
4272
4288
|
const message = error instanceof Error ? error.message : String(error);
|