@faapi/faapi 0.0.0-canary.ede2e84 → 0.0.0-canary.f08a14e
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 +7 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +36 -1
- package/dist/index.js +290 -283
- package/dist/index.js.map +1 -1
- package/package.json +7 -4
package/dist/cli/index.js
CHANGED
|
@@ -4267,6 +4267,11 @@ function createSseWriter() {
|
|
|
4267
4267
|
const text = encodeSseEvent(event);
|
|
4268
4268
|
controller.enqueue(encoder.encode(text));
|
|
4269
4269
|
},
|
|
4270
|
+
sendRaw(chunk) {
|
|
4271
|
+
if (closed || !controller) return;
|
|
4272
|
+
const bytes = typeof chunk === "string" ? encoder.encode(chunk) : chunk;
|
|
4273
|
+
controller.enqueue(bytes);
|
|
4274
|
+
},
|
|
4270
4275
|
sendError(error) {
|
|
4271
4276
|
if (closed || !controller) return;
|
|
4272
4277
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -6164,12 +6169,11 @@ async function buildCommand(options) {
|
|
|
6164
6169
|
console.log("\n[6/6] Generating entry file...");
|
|
6165
6170
|
const mainPath = path16.resolve(rootDir, outdir, "main.js");
|
|
6166
6171
|
const createProdAppArgs = options?.dist && options.dist !== DEFAULT_DIST2 ? `{ dist: '${outdir}' }` : "";
|
|
6167
|
-
const listenArgs = options?.port ? String(options.port) : "";
|
|
6168
6172
|
const mainContent = `// \u7531 faapi build \u81EA\u52A8\u751F\u6210\uFF0C\u8BF7\u52FF\u624B\u52A8\u7F16\u8F91
|
|
6169
6173
|
import { createProdApp } from '@faapi/faapi';
|
|
6170
6174
|
|
|
6171
6175
|
const app = await createProdApp(${createProdAppArgs});
|
|
6172
|
-
await app.listen(
|
|
6176
|
+
await app.listen();
|
|
6173
6177
|
`;
|
|
6174
6178
|
await fs11.promises.writeFile(mainPath, mainContent, "utf-8");
|
|
6175
6179
|
console.log(` Written to ${mainPath}`);
|
|
@@ -6783,7 +6787,7 @@ cli.command("").alias("dev").option("--port <number>", "\u670D\u52A1\u7AEF\u53E3
|
|
|
6783
6787
|
const { devCommand: devCommand2 } = await Promise.resolve().then(() => (init_devCommand(), devCommand_exports));
|
|
6784
6788
|
await devCommand2(options);
|
|
6785
6789
|
});
|
|
6786
|
-
cli.command("build", "Build for production").option("--
|
|
6790
|
+
cli.command("build", "Build for production").option("--dist <dir>", "\u4EA7\u7269\u8F93\u51FA\u76EE\u5F55\uFF0C\u9ED8\u8BA4 dist").action(async (options) => {
|
|
6787
6791
|
const { buildCommand: buildCommand2 } = await Promise.resolve().then(() => (init_buildCommand(), buildCommand_exports));
|
|
6788
6792
|
await buildCommand2(options);
|
|
6789
6793
|
});
|