veryfront 0.1.984 → 0.1.986
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/LICENSE +16 -4
- package/NOTICE +2 -0
- package/esm/cli/commands/build/command.js +1 -1
- package/esm/cli/commands/build/handler.d.ts.map +1 -1
- package/esm/cli/commands/build/handler.js +3 -1
- package/esm/cli/commands/dev/handler.d.ts.map +1 -1
- package/esm/cli/commands/dev/handler.js +3 -1
- package/esm/cli/commands/knowledge/parser.d.ts.map +1 -1
- package/esm/cli/commands/knowledge/parser.js +2 -1
- package/esm/cli/commands/serve/handler.d.ts.map +1 -1
- package/esm/cli/commands/serve/handler.js +3 -1
- package/esm/cli/commands/start/handler.d.ts.map +1 -1
- package/esm/cli/commands/start/handler.js +3 -1
- package/esm/cli/main.js +0 -17
- package/esm/cli/router.d.ts.map +1 -1
- package/esm/cli/router.js +67 -98
- package/esm/cli/shared/default-contracts.d.ts +3 -0
- package/esm/cli/shared/default-contracts.d.ts.map +1 -0
- package/esm/cli/shared/default-contracts.js +19 -0
- package/esm/cli/shared/ensure-content-processor.d.ts +9 -1
- package/esm/cli/shared/ensure-content-processor.d.ts.map +1 -1
- package/esm/cli/shared/ensure-content-processor.js +23 -2
- package/esm/cli/shared/server-startup.d.ts.map +1 -1
- package/esm/cli/shared/server-startup.js +7 -4
- package/esm/deno.d.ts +3 -0
- package/esm/deno.js +5 -2
- package/esm/src/agent/hosted/veryfront-cloud-agent-service.d.ts.map +1 -1
- package/esm/src/agent/hosted/veryfront-cloud-agent-service.js +7 -5
- package/esm/src/agent/service/auth.d.ts.map +1 -1
- package/esm/src/agent/service/auth.js +2 -2
- package/esm/src/extensions/builtin-extensions.d.ts +9 -1
- package/esm/src/extensions/builtin-extensions.d.ts.map +1 -1
- package/esm/src/extensions/builtin-extensions.js +138 -54
- package/esm/src/extensions/first-party-import.d.ts +25 -0
- package/esm/src/extensions/first-party-import.d.ts.map +1 -0
- package/esm/src/extensions/first-party-import.js +120 -0
- package/esm/src/html/styles-builder/tailwind-compiler-cache.d.ts.map +1 -1
- package/esm/src/html/styles-builder/tailwind-compiler-cache.js +2 -1
- package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
- package/esm/src/internal-agents/run-stream.js +2 -1
- package/esm/src/provider/local/local-engine.d.ts.map +1 -1
- package/esm/src/provider/local/local-engine.js +7 -4
- package/esm/src/provider/types.d.ts +1 -0
- package/esm/src/provider/types.d.ts.map +1 -1
- package/esm/src/provider/types.js +1 -1
- package/esm/src/proxy/main.js +4 -1
- package/esm/src/testing/init.js +18 -4
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +18 -94
- package/esm/extensions/ext-auth-jwt/src/index.d.ts +0 -39
- package/esm/extensions/ext-auth-jwt/src/index.d.ts.map +0 -1
- package/esm/extensions/ext-auth-jwt/src/index.js +0 -123
- package/esm/extensions/ext-bundler-esbuild/src/binary.d.ts +0 -7
- package/esm/extensions/ext-bundler-esbuild/src/binary.d.ts.map +0 -1
- package/esm/extensions/ext-bundler-esbuild/src/binary.js +0 -143
- package/esm/extensions/ext-bundler-esbuild/src/es-module-lexer.d.ts +0 -17
- package/esm/extensions/ext-bundler-esbuild/src/es-module-lexer.d.ts.map +0 -1
- package/esm/extensions/ext-bundler-esbuild/src/es-module-lexer.js +0 -29
- package/esm/extensions/ext-bundler-esbuild/src/esbuild-bundler.d.ts +0 -20
- package/esm/extensions/ext-bundler-esbuild/src/esbuild-bundler.d.ts.map +0 -1
- package/esm/extensions/ext-bundler-esbuild/src/esbuild-bundler.js +0 -98
- package/esm/extensions/ext-bundler-esbuild/src/index.d.ts +0 -19
- package/esm/extensions/ext-bundler-esbuild/src/index.d.ts.map +0 -1
- package/esm/extensions/ext-bundler-esbuild/src/index.js +0 -40
- package/esm/extensions/ext-bundler-esbuild/src/plugin-adapter.d.ts +0 -14
- package/esm/extensions/ext-bundler-esbuild/src/plugin-adapter.d.ts.map +0 -1
- package/esm/extensions/ext-bundler-esbuild/src/plugin-adapter.js +0 -55
- package/esm/extensions/ext-bundler-esbuild/src/runtime.d.ts +0 -4
- package/esm/extensions/ext-bundler-esbuild/src/runtime.d.ts.map +0 -1
- package/esm/extensions/ext-bundler-esbuild/src/runtime.js +0 -43
- package/esm/extensions/ext-content-mdx/src/compiler/markdown-compile.d.ts +0 -3
- package/esm/extensions/ext-content-mdx/src/compiler/markdown-compile.d.ts.map +0 -1
- package/esm/extensions/ext-content-mdx/src/compiler/markdown-compile.js +0 -99
- package/esm/extensions/ext-content-mdx/src/compiler/mdx-compile.d.ts +0 -3
- package/esm/extensions/ext-content-mdx/src/compiler/mdx-compile.d.ts.map +0 -1
- package/esm/extensions/ext-content-mdx/src/compiler/mdx-compile.js +0 -53
- package/esm/extensions/ext-content-mdx/src/index.d.ts +0 -30
- package/esm/extensions/ext-content-mdx/src/index.d.ts.map +0 -1
- package/esm/extensions/ext-content-mdx/src/index.js +0 -55
- package/esm/extensions/ext-content-mdx/src/plugins/plugin-loader.d.ts +0 -4
- package/esm/extensions/ext-content-mdx/src/plugins/plugin-loader.d.ts.map +0 -1
- package/esm/extensions/ext-content-mdx/src/plugins/plugin-loader.js +0 -18
- package/esm/extensions/ext-content-mdx/src/plugins/rehype-node-positions.d.ts +0 -20
- package/esm/extensions/ext-content-mdx/src/plugins/rehype-node-positions.d.ts.map +0 -1
- package/esm/extensions/ext-content-mdx/src/plugins/rehype-node-positions.js +0 -45
- package/esm/extensions/ext-content-mdx/src/plugins/remark-headings.d.ts +0 -4
- package/esm/extensions/ext-content-mdx/src/plugins/remark-headings.d.ts.map +0 -1
- package/esm/extensions/ext-content-mdx/src/plugins/remark-headings.js +0 -69
- package/esm/extensions/ext-content-mdx/src/plugins/remark-mdx-utils.d.ts +0 -14
- package/esm/extensions/ext-content-mdx/src/plugins/remark-mdx-utils.d.ts.map +0 -1
- package/esm/extensions/ext-content-mdx/src/plugins/remark-mdx-utils.js +0 -191
- package/esm/extensions/ext-css-tailwind/src/index.d.ts +0 -9
- package/esm/extensions/ext-css-tailwind/src/index.d.ts.map +0 -1
- package/esm/extensions/ext-css-tailwind/src/index.js +0 -71
- package/esm/extensions/ext-db-sqlite/src/index.d.ts +0 -15
- package/esm/extensions/ext-db-sqlite/src/index.d.ts.map +0 -1
- package/esm/extensions/ext-db-sqlite/src/index.js +0 -38
- package/esm/extensions/ext-document-kreuzberg/src/index.d.ts +0 -9
- package/esm/extensions/ext-document-kreuzberg/src/index.d.ts.map +0 -1
- package/esm/extensions/ext-document-kreuzberg/src/index.js +0 -81
- package/esm/extensions/ext-document-kreuzberg/src/kreuzberg.d.ts +0 -3
- package/esm/extensions/ext-document-kreuzberg/src/kreuzberg.d.ts.map +0 -1
- package/esm/extensions/ext-document-kreuzberg/src/kreuzberg.js +0 -67
- package/esm/extensions/ext-document-kreuzberg/src/runtime.d.ts +0 -3
- package/esm/extensions/ext-document-kreuzberg/src/runtime.d.ts.map +0 -1
- package/esm/extensions/ext-document-kreuzberg/src/runtime.js +0 -26
- package/esm/extensions/ext-document-kreuzberg/src/upload-extraction-worker.js +0 -20
- package/esm/extensions/ext-observability-opentelemetry/src/index.d.ts +0 -56
- package/esm/extensions/ext-observability-opentelemetry/src/index.d.ts.map +0 -1
- package/esm/extensions/ext-observability-opentelemetry/src/index.js +0 -338
- package/esm/extensions/ext-parser-babel/src/index.d.ts +0 -27
- package/esm/extensions/ext-parser-babel/src/index.d.ts.map +0 -1
- package/esm/extensions/ext-parser-babel/src/index.js +0 -82
- package/esm/extensions/ext-parser-babel/src/inject-node-positions.d.ts +0 -16
- package/esm/extensions/ext-parser-babel/src/inject-node-positions.d.ts.map +0 -1
- package/esm/extensions/ext-parser-babel/src/inject-node-positions.js +0 -129
- package/esm/extensions/ext-sandbox-shell-tools/src/index.d.ts +0 -16
- package/esm/extensions/ext-sandbox-shell-tools/src/index.d.ts.map +0 -1
- package/esm/extensions/ext-sandbox-shell-tools/src/index.js +0 -29
package/LICENSE
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
Apache License
|
|
2
3
|
Version 2.0, January 2004
|
|
3
4
|
http://www.apache.org/licenses/
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
"Contribution" shall mean any work of authorship, including
|
|
49
50
|
the original version of the Work and any modifications or additions
|
|
50
51
|
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
53
|
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
54
|
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
55
|
means any form of electronic, verbal, or written communication sent
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
62
|
|
|
62
63
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
65
|
subsequently incorporated within the Work.
|
|
65
66
|
|
|
66
67
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
@@ -106,7 +107,7 @@
|
|
|
106
107
|
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
108
|
distribution, then any Derivative Works that You distribute must
|
|
108
109
|
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
111
|
pertain to any part of the Derivative Works, in at least one
|
|
111
112
|
of the following places: within a NOTICE text file distributed
|
|
112
113
|
as part of the Derivative Works; within the Source form or
|
|
@@ -175,7 +176,18 @@
|
|
|
175
176
|
|
|
176
177
|
END OF TERMS AND CONDITIONS
|
|
177
178
|
|
|
178
|
-
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
179
191
|
|
|
180
192
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
193
|
you may not use this file except in compliance with the License.
|
package/NOTICE
ADDED
|
@@ -22,7 +22,7 @@ export function buildCommand(options) {
|
|
|
22
22
|
}
|
|
23
23
|
const adapter = await runtime.get();
|
|
24
24
|
await getConfig(options.projectDir, adapter);
|
|
25
|
-
ensureBuiltinContentProcessor();
|
|
25
|
+
await ensureBuiltinContentProcessor();
|
|
26
26
|
if (isJsonMode()) {
|
|
27
27
|
streamJsonLine({ type: "step", name: "config", status: "completed" });
|
|
28
28
|
streamJsonLine({ type: "step", name: "build", status: "started" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/build/handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAQ3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;GAa9B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;GAAiC,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;GAWzB,CAAC;AAEH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/build/handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAQ3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;GAa9B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;GAAiC,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;GAWzB,CAAC;AAEH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BxE"}
|
|
@@ -3,8 +3,8 @@ import { bold, cyan, dim, green, yellow } from "../../ui/index.js";
|
|
|
3
3
|
import { join } from "../../../src/platform/compat/path/index.js";
|
|
4
4
|
import { cliLogger } from "../../utils/index.js";
|
|
5
5
|
import { cwd } from "../../../src/platform/index.js";
|
|
6
|
-
import { buildCommand } from "./command.js";
|
|
7
6
|
import { CommonArgs, createArgParser, parseArgsOrThrow } from "../../shared/args.js";
|
|
7
|
+
import { ensureCliBundlerContracts } from "../../shared/default-contracts.js";
|
|
8
8
|
import { exitProcess, showLogo } from "../../utils/index.js";
|
|
9
9
|
/**
|
|
10
10
|
* Schema factory for build command arguments
|
|
@@ -40,12 +40,14 @@ export const parseBuildArgs = createArgParser(BuildArgsSchema, {
|
|
|
40
40
|
export async function handleBuildCommand(args) {
|
|
41
41
|
showLogo();
|
|
42
42
|
const opts = parseArgsOrThrow(parseBuildArgs, "build", args);
|
|
43
|
+
await ensureCliBundlerContracts();
|
|
43
44
|
const projectDir = cwd();
|
|
44
45
|
const preset = opts.preset?.toLowerCase();
|
|
45
46
|
if (preset === "embedded") {
|
|
46
47
|
await handleEmbeddedBuild(projectDir, opts.output);
|
|
47
48
|
return;
|
|
48
49
|
}
|
|
50
|
+
const { buildCommand } = await import("./command.js");
|
|
49
51
|
await buildCommand({
|
|
50
52
|
projectDir,
|
|
51
53
|
outputDir: opts.output,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/dev/handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAaxD,eAAO,MAAM,YAAY;;;;;GAKvB,CAAC;AAwBH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/dev/handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAaxD,eAAO,MAAM,YAAY;;;;;GAKvB,CAAC;AAwBH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBtE"}
|
|
@@ -6,9 +6,9 @@ import { isAbsolute, join } from "../../../src/platform/compat/path/index.js";
|
|
|
6
6
|
import { cwd, setEnv } from "../../../src/platform/index.js";
|
|
7
7
|
import { createFileSystem } from "../../../src/platform/index.js";
|
|
8
8
|
import { cliLogger, DEFAULT_DEV_SERVER_PORT } from "../../utils/index.js";
|
|
9
|
-
import { devCommand } from "./index.js";
|
|
10
9
|
import { clearAllLocalCaches } from "../../../src/transforms/mdx/esm-module-loader/cache/index.js";
|
|
11
10
|
import { createArgParser, parseArgsOrThrow } from "../../shared/args.js";
|
|
11
|
+
import { ensureCliBundlerContracts } from "../../shared/default-contracts.js";
|
|
12
12
|
const getDevArgsSchema = defineSchema((v) => v.object({
|
|
13
13
|
port: v.number().default(DEFAULT_DEV_SERVER_PORT),
|
|
14
14
|
project: v.string().optional(),
|
|
@@ -40,6 +40,7 @@ async function resolveProjectDir(projectArg) {
|
|
|
40
40
|
}
|
|
41
41
|
export async function handleDevCommand(args) {
|
|
42
42
|
const opts = parseArgsOrThrow(parseDevArgs, "dev", args);
|
|
43
|
+
await ensureCliBundlerContracts();
|
|
43
44
|
const projectDir = await resolveProjectDir(opts.project);
|
|
44
45
|
// Enable verbose logging when --debug flag is passed
|
|
45
46
|
if (opts.debug) {
|
|
@@ -47,6 +48,7 @@ export async function handleDevCommand(args) {
|
|
|
47
48
|
}
|
|
48
49
|
// Clear stale ESM caches to prevent module resolution issues from previous runs
|
|
49
50
|
await clearAllLocalCaches();
|
|
51
|
+
const { devCommand } = await import("./index.js");
|
|
50
52
|
const { done } = await devCommand({
|
|
51
53
|
port: opts.port,
|
|
52
54
|
projectDir,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/knowledge/parser.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,IAAI,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,mBAAmB,GAAG,CAChC,KAAK,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,KAC1C,OAAO,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/knowledge/parser.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,IAAI,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,mBAAmB,GAAG,CAChC,KAAK,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,KAC1C,OAAO,CAAC,MAAM,CAAC,CAAC;AAQrB,MAAM,WAAW,uBAAuB;IACtC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;CAC3C;AAqFD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG3D;AA+PD,wBAAsB,kBAAkB,CAAC,KAAK,EAAE;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,EAAE,IAAI,GAAE,uBAA4B,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAgBrE;AAED,wBAAsB,mBAAmB,CAAC,KAAK,EAAE;IAC/C,KAAK,EAAE,oBAAoB,EAAE,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;CACnB,EAAE,IAAI,GAAE,uBAA4B,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAoEvE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as dntShim from "../../../_dnt.shims.js";
|
|
2
2
|
import { basename, extname, join } from "../../../src/platform/compat/path/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { importFirstPartyExtensionModule } from "../../../src/extensions/first-party-import.js";
|
|
4
4
|
const CODE_FENCE = "`".repeat(3);
|
|
5
5
|
const TEXT_FILE_EXTENSIONS = new Set([
|
|
6
6
|
".c",
|
|
@@ -274,6 +274,7 @@ function buildSummary(sourceType, stats) {
|
|
|
274
274
|
}
|
|
275
275
|
async function defaultExtractDocumentText(input) {
|
|
276
276
|
const bytes = await dntShim.Deno.readFile(input.filePath);
|
|
277
|
+
const { KreuzbergDocumentExtractor } = await importFirstPartyExtensionModule("ext-document-kreuzberg", "@veryfront/ext-document-kreuzberg");
|
|
277
278
|
const extractor = new KreuzbergDocumentExtractor();
|
|
278
279
|
return await extractor.extractInWorker(bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength), input.mimeType);
|
|
279
280
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/serve/handler.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAgBxD,eAAO,MAAM,cAAc;;;;;;;;GAQzB,CAAC;AAEH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/serve/handler.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAgBxD,eAAO,MAAM,cAAc;;;;;;;;GAQzB,CAAC;AAEH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAaxE"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineSchema, lazySchema } from "../../../src/schemas/index.js";
|
|
2
2
|
import { DEFAULT_DEV_SERVER_PORT } from "../../utils/index.js";
|
|
3
|
-
import { serveCommand } from "./command.js";
|
|
4
3
|
import { ServerModeSchema } from "../../shared/types.js";
|
|
5
4
|
import { createArgParser, parseArgsOrThrow } from "../../shared/args.js";
|
|
5
|
+
import { ensureCliBundlerContracts } from "../../shared/default-contracts.js";
|
|
6
6
|
const getServeArgsSchema = defineSchema((v) => v.object({
|
|
7
7
|
mode: ServerModeSchema.default("production"),
|
|
8
8
|
port: v.number().default(DEFAULT_DEV_SERVER_PORT),
|
|
@@ -24,6 +24,8 @@ export const parseServeArgs = createArgParser(ServeArgsSchema, {
|
|
|
24
24
|
});
|
|
25
25
|
export async function handleServeCommand(args) {
|
|
26
26
|
const opts = parseArgsOrThrow(parseServeArgs, "serve", args);
|
|
27
|
+
await ensureCliBundlerContracts();
|
|
28
|
+
const { serveCommand } = await import("./command.js");
|
|
27
29
|
await serveCommand({
|
|
28
30
|
mode: opts.mode,
|
|
29
31
|
port: opts.port,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/start/handler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAcxD,eAAO,MAAM,cAAc;;;;GAIzB,CAAC;AAEH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/start/handler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAcxD,eAAO,MAAM,cAAc;;;;GAIzB,CAAC;AAEH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CASxE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineSchema, lazySchema } from "../../../src/schemas/index.js";
|
|
2
|
-
import { startCommand } from "./command.js";
|
|
3
2
|
import { createArgParser, parseArgsOrThrow } from "../../shared/args.js";
|
|
3
|
+
import { ensureCliBundlerContracts } from "../../shared/default-contracts.js";
|
|
4
4
|
const DEFAULT_START_PORT = 8080;
|
|
5
5
|
const getStartArgsSchema = defineSchema((v) => v.object({
|
|
6
6
|
port: v.number().default(DEFAULT_START_PORT),
|
|
@@ -15,6 +15,8 @@ export const parseStartArgs = createArgParser(StartArgsSchema, {
|
|
|
15
15
|
});
|
|
16
16
|
export async function handleStartCommand(args) {
|
|
17
17
|
const opts = parseArgsOrThrow(parseStartArgs, "start", args);
|
|
18
|
+
await ensureCliBundlerContracts();
|
|
19
|
+
const { startCommand } = await import("./command.js");
|
|
18
20
|
await startCommand({
|
|
19
21
|
port: opts.port,
|
|
20
22
|
projectPath: opts.project ?? null,
|
package/esm/cli/main.js
CHANGED
|
@@ -13,23 +13,6 @@
|
|
|
13
13
|
import "../_dnt.polyfills.js";
|
|
14
14
|
import * as dntShim from "../_dnt.shims.js";
|
|
15
15
|
await import("../src/platform/compat/esbuild-init.js");
|
|
16
|
-
// Register default contracts shipped with the binary so CLI startup and
|
|
17
|
-
// bootstrap paths can resolve them before project extensions load.
|
|
18
|
-
{
|
|
19
|
-
const { register } = await import("../src/extensions/contracts.js");
|
|
20
|
-
const { tryResolve } = await import("../src/extensions/index.js");
|
|
21
|
-
if (!tryResolve("SchemaValidator")) {
|
|
22
|
-
const { createZodAdapter } = await import("../extensions/ext-schema-zod/src/index.js");
|
|
23
|
-
register("SchemaValidator", createZodAdapter());
|
|
24
|
-
}
|
|
25
|
-
if (!tryResolve("Bundler") || !tryResolve("ModuleLexer")) {
|
|
26
|
-
const { EsbuildBundler, EsModuleLexer } = await import("../extensions/ext-bundler-esbuild/src/index.js");
|
|
27
|
-
if (!tryResolve("Bundler"))
|
|
28
|
-
register("Bundler", new EsbuildBundler());
|
|
29
|
-
if (!tryResolve("ModuleLexer"))
|
|
30
|
-
register("ModuleLexer", new EsModuleLexer());
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
16
|
// All imports below must be dynamic to ensure esbuild init completes first
|
|
34
17
|
const { getArgs } = await import("../src/platform/index.js");
|
|
35
18
|
const { hasEnvLoaded, loadEnv, markEnvLoaded, supportsEnvFiles } = await import("../src/utils/env-loader.js");
|
package/esm/cli/router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/cli/router.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/cli/router.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AA6HpD;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAkIlE"}
|
package/esm/cli/router.js
CHANGED
|
@@ -6,52 +6,10 @@
|
|
|
6
6
|
import * as dntShim from "../_dnt.shims.js";
|
|
7
7
|
import { cliErrorBoundary } from "../src/errors/index.js";
|
|
8
8
|
import { cliLogger, VERSION } from "./utils/index.js";
|
|
9
|
-
import { handleAnalyzeChunksCommand } from "./commands/analyze-chunks/handler.js";
|
|
10
|
-
import { handleBuildCommand } from "./commands/build/handler.js";
|
|
11
|
-
import { handleCleanCommand } from "./commands/clean/handler.js";
|
|
12
|
-
import { handleDemoCommand } from "./commands/demo/handler.js";
|
|
13
|
-
import { handleDeployCommand } from "./commands/deploy/handler.js";
|
|
14
|
-
import { handleDevCommand } from "./commands/dev/handler.js";
|
|
15
|
-
import { handleDoctorCommand } from "./commands/doctor/handler.js";
|
|
16
|
-
import { handleExtensionCommand } from "./commands/extension/handler.js";
|
|
17
|
-
import { handleGenerateCommand } from "./commands/generate/handler.js";
|
|
18
|
-
import { handleInitCommand } from "./commands/init/handler.js";
|
|
19
|
-
import { handleInstallCommand, handleUninstallCommand } from "./commands/install/handler.js";
|
|
20
|
-
import { handleIssuesCommand } from "./commands/issues/index.js";
|
|
21
|
-
import { handleLockCommand } from "./commands/lock/handler.js";
|
|
22
|
-
import { handleMCPCommand } from "./commands/mcp/handler.js";
|
|
23
|
-
import { handleMergeCommand } from "./commands/merge/handler.js";
|
|
24
|
-
import { handlePullCommand } from "./commands/pull/index.js";
|
|
25
|
-
import { handlePushCommand } from "./commands/push/index.js";
|
|
26
|
-
import { handleUploadsCommand } from "./commands/uploads/index.js";
|
|
27
|
-
import { handleFilesCommand } from "./commands/files/index.js";
|
|
28
|
-
import { handleKnowledgeCommand } from "./commands/knowledge/index.js";
|
|
29
|
-
import { handleRoutesCommand } from "./commands/routes/handler.js";
|
|
30
|
-
import { handleScheduleCommand } from "./commands/schedule/handler.js";
|
|
31
|
-
import { handleSchedulesCommand } from "./commands/schedules/handler.js";
|
|
32
|
-
import { handleServeCommand } from "./commands/serve/handler.js";
|
|
33
|
-
import { handleStartCommand } from "./commands/start/handler.js";
|
|
34
|
-
import { handleStudioCommand } from "./commands/studio/handler.js";
|
|
35
|
-
import { handleStylesCommand } from "./commands/styles/handler.js";
|
|
36
|
-
import { handleUpCommand } from "./commands/up/index.js";
|
|
37
|
-
import { handleTaskCommand } from "./commands/task/handler.js";
|
|
38
|
-
import { handleEvalCommand } from "./commands/eval/handler.js";
|
|
39
|
-
import { handleWorkflowCommand } from "./commands/workflow/handler.js";
|
|
40
|
-
import { handleWorkerCommand } from "./commands/worker/handler.js";
|
|
41
|
-
import { handleSchemaCommand } from "./commands/schema/handler.js";
|
|
42
|
-
import { handleTestCommand } from "./commands/test/handler.js";
|
|
43
|
-
import { handleLintCommand } from "./commands/lint/handler.js";
|
|
44
|
-
import { handleSkillsCommand } from "./commands/skills/handler.js";
|
|
45
|
-
import { handleConfigCommand } from "./commands/config/handler.js";
|
|
46
|
-
import { handleOpenCommand } from "./commands/open/handler.js";
|
|
47
|
-
import { handleCompletionsCommand } from "./commands/completions/handler.js";
|
|
48
|
-
import { handleWebhookCommand } from "./commands/webhook/handler.js";
|
|
49
|
-
import { handleWebhooksCommand } from "./commands/webhooks/handler.js";
|
|
50
|
-
import { login, logout, whoami } from "./auth/index.js";
|
|
51
|
-
import { parseLoginMethod } from "./auth/utils.js";
|
|
52
9
|
import { showCommandHelp, showMainHelp } from "./help/index.js";
|
|
53
10
|
import { setColorOverride } from "./ui/colors.js";
|
|
54
11
|
import { exitProcess, setQuietMode, setVerboseMode } from "./utils/index.js";
|
|
12
|
+
import { ensureCliSchemaValidator } from "./shared/default-contracts.js";
|
|
55
13
|
import { createErrorEnvelope, createSuccessEnvelope, isJsonMode, outputJson, setJsonMode, setOutputPath, } from "./shared/json-output.js";
|
|
56
14
|
import { detectCI, setNonInteractive } from "./shared/interactive.js";
|
|
57
15
|
/**
|
|
@@ -59,32 +17,32 @@ import { detectCI, setNonInteractive } from "./shared/interactive.js";
|
|
|
59
17
|
* Aliases (e.g. "preview" → serve, "g" → generate) are duplicate entries.
|
|
60
18
|
*/
|
|
61
19
|
const commands = {
|
|
62
|
-
"init": handleInitCommand,
|
|
63
|
-
"dev": handleDevCommand,
|
|
64
|
-
"build": handleBuildCommand,
|
|
65
|
-
"preview": handleServeCommand,
|
|
66
|
-
"serve": handleServeCommand,
|
|
67
|
-
"doctor": handleDoctorCommand,
|
|
68
|
-
"clean": handleCleanCommand,
|
|
69
|
-
"analyze-chunks": handleAnalyzeChunksCommand,
|
|
70
|
-
"routes": handleRoutesCommand,
|
|
71
|
-
"studio": handleStudioCommand,
|
|
72
|
-
"styles": handleStylesCommand,
|
|
73
|
-
"lock": handleLockCommand,
|
|
74
|
-
"generate": handleGenerateCommand,
|
|
75
|
-
"g": handleGenerateCommand,
|
|
76
|
-
"pull": handlePullCommand,
|
|
77
|
-
"push": handlePushCommand,
|
|
78
|
-
"uploads": handleUploadsCommand,
|
|
79
|
-
"files": handleFilesCommand,
|
|
80
|
-
"knowledge": handleKnowledgeCommand,
|
|
81
|
-
"merge": handleMergeCommand,
|
|
82
|
-
"deploy": handleDeployCommand,
|
|
83
|
-
"up": handleUpCommand,
|
|
84
|
-
"schedule": handleScheduleCommand,
|
|
85
|
-
"schedules": handleSchedulesCommand,
|
|
86
|
-
"login": async (args) => {
|
|
87
|
-
const { parseProvider } = await import("./auth/utils.js");
|
|
20
|
+
"init": async () => (await import("./commands/init/handler.js")).handleInitCommand,
|
|
21
|
+
"dev": async () => (await import("./commands/dev/handler.js")).handleDevCommand,
|
|
22
|
+
"build": async () => (await import("./commands/build/handler.js")).handleBuildCommand,
|
|
23
|
+
"preview": async () => (await import("./commands/serve/handler.js")).handleServeCommand,
|
|
24
|
+
"serve": async () => (await import("./commands/serve/handler.js")).handleServeCommand,
|
|
25
|
+
"doctor": async () => (await import("./commands/doctor/handler.js")).handleDoctorCommand,
|
|
26
|
+
"clean": async () => (await import("./commands/clean/handler.js")).handleCleanCommand,
|
|
27
|
+
"analyze-chunks": async () => (await import("./commands/analyze-chunks/handler.js")).handleAnalyzeChunksCommand,
|
|
28
|
+
"routes": async () => (await import("./commands/routes/handler.js")).handleRoutesCommand,
|
|
29
|
+
"studio": async () => (await import("./commands/studio/handler.js")).handleStudioCommand,
|
|
30
|
+
"styles": async () => (await import("./commands/styles/handler.js")).handleStylesCommand,
|
|
31
|
+
"lock": async () => (await import("./commands/lock/handler.js")).handleLockCommand,
|
|
32
|
+
"generate": async () => (await import("./commands/generate/handler.js")).handleGenerateCommand,
|
|
33
|
+
"g": async () => (await import("./commands/generate/handler.js")).handleGenerateCommand,
|
|
34
|
+
"pull": async () => (await import("./commands/pull/index.js")).handlePullCommand,
|
|
35
|
+
"push": async () => (await import("./commands/push/index.js")).handlePushCommand,
|
|
36
|
+
"uploads": async () => (await import("./commands/uploads/index.js")).handleUploadsCommand,
|
|
37
|
+
"files": async () => (await import("./commands/files/index.js")).handleFilesCommand,
|
|
38
|
+
"knowledge": async () => (await import("./commands/knowledge/index.js")).handleKnowledgeCommand,
|
|
39
|
+
"merge": async () => (await import("./commands/merge/handler.js")).handleMergeCommand,
|
|
40
|
+
"deploy": async () => (await import("./commands/deploy/handler.js")).handleDeployCommand,
|
|
41
|
+
"up": async () => (await import("./commands/up/index.js")).handleUpCommand,
|
|
42
|
+
"schedule": async () => (await import("./commands/schedule/handler.js")).handleScheduleCommand,
|
|
43
|
+
"schedules": async () => (await import("./commands/schedules/handler.js")).handleSchedulesCommand,
|
|
44
|
+
"login": async () => async (args) => {
|
|
45
|
+
const { parseLoginMethod, parseProvider } = await import("./auth/utils.js");
|
|
88
46
|
const provider = parseProvider(args);
|
|
89
47
|
if (provider === "anthropic") {
|
|
90
48
|
const { loginAnthropic } = await import("./auth/providers/anthropic.js");
|
|
@@ -96,9 +54,10 @@ const commands = {
|
|
|
96
54
|
await loginOpenAI(args["base-url"]);
|
|
97
55
|
return;
|
|
98
56
|
}
|
|
57
|
+
const { login } = await import("./auth/index.js");
|
|
99
58
|
await login(parseLoginMethod(args));
|
|
100
59
|
},
|
|
101
|
-
"logout": async (args) => {
|
|
60
|
+
"logout": async () => async (args) => {
|
|
102
61
|
const { parseProvider } = await import("./auth/utils.js");
|
|
103
62
|
const provider = parseProvider(args);
|
|
104
63
|
if (provider) {
|
|
@@ -108,31 +67,33 @@ const commands = {
|
|
|
108
67
|
logSuccess(`${provider} API key removed`);
|
|
109
68
|
return;
|
|
110
69
|
}
|
|
70
|
+
const { logout } = await import("./auth/index.js");
|
|
111
71
|
await logout();
|
|
112
72
|
},
|
|
113
|
-
"whoami": async () => {
|
|
73
|
+
"whoami": async () => async () => {
|
|
74
|
+
const { whoami } = await import("./auth/index.js");
|
|
114
75
|
await whoami();
|
|
115
76
|
},
|
|
116
|
-
"install": handleInstallCommand,
|
|
117
|
-
"uninstall": handleUninstallCommand,
|
|
118
|
-
"demo": handleDemoCommand,
|
|
119
|
-
"extension": handleExtensionCommand,
|
|
120
|
-
"mcp": handleMCPCommand,
|
|
121
|
-
"issues": handleIssuesCommand,
|
|
122
|
-
"start": handleStartCommand,
|
|
123
|
-
"task": handleTaskCommand,
|
|
124
|
-
"eval": handleEvalCommand,
|
|
125
|
-
"workflow": handleWorkflowCommand,
|
|
126
|
-
"worker": handleWorkerCommand,
|
|
127
|
-
"schema": handleSchemaCommand,
|
|
128
|
-
"test": handleTestCommand,
|
|
129
|
-
"lint": handleLintCommand,
|
|
130
|
-
"skills": handleSkillsCommand,
|
|
131
|
-
"config": handleConfigCommand,
|
|
132
|
-
"open": handleOpenCommand,
|
|
133
|
-
"completions": handleCompletionsCommand,
|
|
134
|
-
"webhook": handleWebhookCommand,
|
|
135
|
-
"webhooks": handleWebhooksCommand,
|
|
77
|
+
"install": async () => (await import("./commands/install/handler.js")).handleInstallCommand,
|
|
78
|
+
"uninstall": async () => (await import("./commands/install/handler.js")).handleUninstallCommand,
|
|
79
|
+
"demo": async () => (await import("./commands/demo/handler.js")).handleDemoCommand,
|
|
80
|
+
"extension": async () => (await import("./commands/extension/handler.js")).handleExtensionCommand,
|
|
81
|
+
"mcp": async () => (await import("./commands/mcp/handler.js")).handleMCPCommand,
|
|
82
|
+
"issues": async () => (await import("./commands/issues/index.js")).handleIssuesCommand,
|
|
83
|
+
"start": async () => (await import("./commands/start/handler.js")).handleStartCommand,
|
|
84
|
+
"task": async () => (await import("./commands/task/handler.js")).handleTaskCommand,
|
|
85
|
+
"eval": async () => (await import("./commands/eval/handler.js")).handleEvalCommand,
|
|
86
|
+
"workflow": async () => (await import("./commands/workflow/handler.js")).handleWorkflowCommand,
|
|
87
|
+
"worker": async () => (await import("./commands/worker/handler.js")).handleWorkerCommand,
|
|
88
|
+
"schema": async () => (await import("./commands/schema/handler.js")).handleSchemaCommand,
|
|
89
|
+
"test": async () => (await import("./commands/test/handler.js")).handleTestCommand,
|
|
90
|
+
"lint": async () => (await import("./commands/lint/handler.js")).handleLintCommand,
|
|
91
|
+
"skills": async () => (await import("./commands/skills/handler.js")).handleSkillsCommand,
|
|
92
|
+
"config": async () => (await import("./commands/config/handler.js")).handleConfigCommand,
|
|
93
|
+
"open": async () => (await import("./commands/open/handler.js")).handleOpenCommand,
|
|
94
|
+
"completions": async () => (await import("./commands/completions/handler.js")).handleCompletionsCommand,
|
|
95
|
+
"webhook": async () => (await import("./commands/webhook/handler.js")).handleWebhookCommand,
|
|
96
|
+
"webhooks": async () => (await import("./commands/webhooks/handler.js")).handleWebhooksCommand,
|
|
136
97
|
};
|
|
137
98
|
/**
|
|
138
99
|
* Show help for a specific command or main help
|
|
@@ -215,8 +176,15 @@ export async function routeCommand(args) {
|
|
|
215
176
|
exitProcess(0);
|
|
216
177
|
return;
|
|
217
178
|
}
|
|
218
|
-
|
|
219
|
-
|
|
179
|
+
if (command === "help") {
|
|
180
|
+
const topic = args._[1];
|
|
181
|
+
showHelp(typeof topic === "string" ? topic : undefined);
|
|
182
|
+
await updateCheck;
|
|
183
|
+
exitProcess(0);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
const loader = command ? commands[command] : undefined;
|
|
187
|
+
if (command && !loader) {
|
|
220
188
|
const { suggestCommand } = await import("./shared/suggest.js");
|
|
221
189
|
const { COMMANDS } = await import("./help/command-definitions.js");
|
|
222
190
|
// Use canonical command names from help registry (excludes aliases like "g", "preview")
|
|
@@ -247,11 +215,12 @@ export async function routeCommand(args) {
|
|
|
247
215
|
return;
|
|
248
216
|
}
|
|
249
217
|
await cliErrorBoundary(async () => {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
218
|
+
const handlerLoader = loader ?? commands.start;
|
|
219
|
+
if (!handlerLoader)
|
|
220
|
+
throw new Error("Start command is not registered");
|
|
221
|
+
await ensureCliSchemaValidator();
|
|
222
|
+
const handler = await handlerLoader();
|
|
223
|
+
await handler(args);
|
|
255
224
|
}, {
|
|
256
225
|
onError: async (error) => {
|
|
257
226
|
if (!isJsonMode()) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-contracts.d.ts","sourceRoot":"","sources":["../../../src/cli/shared/default-contracts.ts"],"names":[],"mappings":"AAGA,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC,CAO9D;AAED,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC,CAgB/D"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { register, tryResolve } from "../../src/extensions/contracts.js";
|
|
2
|
+
import { importFirstPartyExtensionModule } from "../../src/extensions/first-party-import.js";
|
|
3
|
+
export async function ensureCliSchemaValidator() {
|
|
4
|
+
if (tryResolve("SchemaValidator"))
|
|
5
|
+
return;
|
|
6
|
+
const { createZodAdapter } = await importFirstPartyExtensionModule("ext-schema-zod", "@veryfront/ext-schema-zod");
|
|
7
|
+
register("SchemaValidator", createZodAdapter());
|
|
8
|
+
}
|
|
9
|
+
export async function ensureCliBundlerContracts() {
|
|
10
|
+
if (tryResolve("Bundler") && tryResolve("ModuleLexer"))
|
|
11
|
+
return;
|
|
12
|
+
const { EsbuildBundler, EsModuleLexer } = await importFirstPartyExtensionModule("ext-bundler-esbuild", "@veryfront/ext-bundler-esbuild").catch((error) => {
|
|
13
|
+
throw new Error(`Veryfront CLI requires @veryfront/ext-bundler-esbuild for bundling. Install @veryfront/ext-bundler-esbuild alongside veryfront. ${error instanceof Error ? error.message : String(error)}`);
|
|
14
|
+
});
|
|
15
|
+
if (!tryResolve("Bundler"))
|
|
16
|
+
register("Bundler", new EsbuildBundler());
|
|
17
|
+
if (!tryResolve("ModuleLexer"))
|
|
18
|
+
register("ModuleLexer", new EsModuleLexer());
|
|
19
|
+
}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Start loading ext-mdx before the server accepts requests. Registration must
|
|
3
|
+
* still happen after server start (bootstrap `reset()` clears the contract
|
|
4
|
+
* registry), but with the module already loaded the post-start await in
|
|
5
|
+
* `ensureBuiltinContentProcessor` resolves without an I/O gap, so no request
|
|
6
|
+
* can observe a missing ContentProcessor contract in between.
|
|
7
|
+
*/
|
|
8
|
+
export declare function prefetchBuiltinContentProcessor(): void;
|
|
1
9
|
/**
|
|
2
10
|
* The CLI ships ext-mdx baked in so the compiled binary can render MDX/Markdown
|
|
3
11
|
* pages out of the box. Library consumers (programmatic `startProductionServer`)
|
|
@@ -6,5 +14,5 @@
|
|
|
6
14
|
* must run *after* the server-start (or `getConfig`) call returns. We skip
|
|
7
15
|
* registration when a user-provided extension already supplied the contract.
|
|
8
16
|
*/
|
|
9
|
-
export declare function ensureBuiltinContentProcessor(): void
|
|
17
|
+
export declare function ensureBuiltinContentProcessor(): Promise<void>;
|
|
10
18
|
//# sourceMappingURL=ensure-content-processor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensure-content-processor.d.ts","sourceRoot":"","sources":["../../../src/cli/shared/ensure-content-processor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ensure-content-processor.d.ts","sourceRoot":"","sources":["../../../src/cli/shared/ensure-content-processor.ts"],"names":[],"mappings":"AAsBA;;;;;;GAMG;AACH,wBAAgB,+BAA+B,IAAI,IAAI,CAItD;AAED;;;;;;;GAOG;AACH,wBAAsB,6BAA6B,IAAI,OAAO,CAAC,IAAI,CAAC,CAInE"}
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import { tryResolve } from "../../src/extensions/index.js";
|
|
2
2
|
import { register } from "../../src/extensions/contracts.js";
|
|
3
|
-
import {
|
|
3
|
+
import { importFirstPartyExtensionModule } from "../../src/extensions/first-party-import.js";
|
|
4
|
+
let contentMdxModulePromise;
|
|
5
|
+
function loadContentMdxModule() {
|
|
6
|
+
contentMdxModulePromise ??= importFirstPartyExtensionModule("ext-content-mdx", "@veryfront/ext-content-mdx").catch((error) => {
|
|
7
|
+
contentMdxModulePromise = undefined;
|
|
8
|
+
throw error;
|
|
9
|
+
});
|
|
10
|
+
return contentMdxModulePromise;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Start loading ext-mdx before the server accepts requests. Registration must
|
|
14
|
+
* still happen after server start (bootstrap `reset()` clears the contract
|
|
15
|
+
* registry), but with the module already loaded the post-start await in
|
|
16
|
+
* `ensureBuiltinContentProcessor` resolves without an I/O gap, so no request
|
|
17
|
+
* can observe a missing ContentProcessor contract in between.
|
|
18
|
+
*/
|
|
19
|
+
export function prefetchBuiltinContentProcessor() {
|
|
20
|
+
loadContentMdxModule().catch(() => {
|
|
21
|
+
// Errors surface in ensureBuiltinContentProcessor, which awaits the same load.
|
|
22
|
+
});
|
|
23
|
+
}
|
|
4
24
|
/**
|
|
5
25
|
* The CLI ships ext-mdx baked in so the compiled binary can render MDX/Markdown
|
|
6
26
|
* pages out of the box. Library consumers (programmatic `startProductionServer`)
|
|
@@ -9,8 +29,9 @@ import { MdxContentProcessor } from "../../extensions/ext-content-mdx/src/index.
|
|
|
9
29
|
* must run *after* the server-start (or `getConfig`) call returns. We skip
|
|
10
30
|
* registration when a user-provided extension already supplied the contract.
|
|
11
31
|
*/
|
|
12
|
-
export function ensureBuiltinContentProcessor() {
|
|
32
|
+
export async function ensureBuiltinContentProcessor() {
|
|
13
33
|
if (tryResolve("ContentProcessor"))
|
|
14
34
|
return;
|
|
35
|
+
const { MdxContentProcessor } = await loadContentMdxModule();
|
|
15
36
|
register("ContentProcessor", new MdxContentProcessor());
|
|
16
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-startup.d.ts","sourceRoot":"","sources":["../../../src/cli/shared/server-startup.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,cAAc,EACd,qBAAqB,EAEtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"server-startup.d.ts","sourceRoot":"","sources":["../../../src/cli/shared/server-startup.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,cAAc,EACd,qBAAqB,EAEtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAalE,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,WAAW,CAAC;IACpB,kBAAkB,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACjE,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAcD,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC,CAuB5D;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAYrD;AAED,MAAM,WAAW,+BAA+B;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,WAAW,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,+BAA+B,GACvC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC,CAoD5D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getEnv, runtime, setEnv } from "../../src/platform/index.js";
|
|
2
2
|
import { startDevServer, startProductionServer, } from "../../src/server/index.js";
|
|
3
|
-
import { ensureBuiltinContentProcessor } from "./ensure-content-processor.js";
|
|
3
|
+
import { ensureBuiltinContentProcessor, prefetchBuiltinContentProcessor, } from "./ensure-content-processor.js";
|
|
4
4
|
import { join } from "../../src/platform/compat/path/index.js";
|
|
5
5
|
import { parseReleaseAssetManifest } from "../../src/release-assets/index.js";
|
|
6
6
|
import { clearReleaseAssetManifestCache, configureReleaseAssetManifestFetcher, } from "../../src/release-assets/index.js";
|
|
@@ -24,6 +24,7 @@ export async function startCliProxyModeServer(options) {
|
|
|
24
24
|
if (!getEnv("NODE_ENV") && !getEnv("DENO_ENV")) {
|
|
25
25
|
setEnv("NODE_ENV", "development");
|
|
26
26
|
}
|
|
27
|
+
prefetchBuiltinContentProcessor();
|
|
27
28
|
const result = await startProductionServer({
|
|
28
29
|
port: options.port,
|
|
29
30
|
projectDir: options.projectDir,
|
|
@@ -33,7 +34,7 @@ export async function startCliProxyModeServer(options) {
|
|
|
33
34
|
defaultProjectId: options.defaultProjectId,
|
|
34
35
|
discoveryConfig: buildDiscoveryConfig(options),
|
|
35
36
|
});
|
|
36
|
-
ensureBuiltinContentProcessor();
|
|
37
|
+
await ensureBuiltinContentProcessor();
|
|
37
38
|
return result;
|
|
38
39
|
}
|
|
39
40
|
export async function startCliDevServer(options) {
|
|
@@ -44,8 +45,9 @@ export async function startCliDevServer(options) {
|
|
|
44
45
|
enableFastRefresh: options.enableFastRefresh,
|
|
45
46
|
signal: options.signal,
|
|
46
47
|
};
|
|
48
|
+
prefetchBuiltinContentProcessor();
|
|
47
49
|
const result = await startDevServer(devOptions);
|
|
48
|
-
ensureBuiltinContentProcessor();
|
|
50
|
+
await ensureBuiltinContentProcessor();
|
|
49
51
|
return result;
|
|
50
52
|
}
|
|
51
53
|
export async function startCliProductionServer(options) {
|
|
@@ -86,8 +88,9 @@ export async function startCliProductionServer(options) {
|
|
|
86
88
|
// through `/_veryfront/rsc/module?` for non-local deployments, so no
|
|
87
89
|
// `localProjects` entry is required for the compiled binary to work.
|
|
88
90
|
};
|
|
91
|
+
prefetchBuiltinContentProcessor();
|
|
89
92
|
const result = await startProductionServer(serverOptions);
|
|
90
|
-
ensureBuiltinContentProcessor();
|
|
93
|
+
await ensureBuiltinContentProcessor();
|
|
91
94
|
return {
|
|
92
95
|
...result,
|
|
93
96
|
stop: async () => {
|