@publish.os/nextjs 0.0.1-alpha.90 → 0.0.1-alpha.91
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/compiler-assets/nextjs/defaults/group/layout.tsx +1 -5
- package/compiler-assets/nextjs/defaults/group/page.tsx +31 -22
- package/compiler-assets/nextjs/defaults/project/next.config.mjs +19 -10
- package/compiler-assets/nextjs/defaults/project/tsconfig.json.template +10 -0
- package/compiler-assets/nextjs/defaults/root/css/components/code-block.css +18 -0
- package/compiler-assets/nextjs/shims/document.tsx +38 -0
- package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +2 -0
- package/compiler-assets/nextjs/shims/global-layout.tsx +8 -42
- package/compiler-assets/nextjs/shims/global-not-found.tsx +69 -0
- package/compiler-assets/nextjs/shims/markdown-route.ts +2 -0
- package/compiler-assets/nextjs/shims/metadata-icons.tsx +39 -0
- package/compiler-assets/nextjs/shims/not-found-content.tsx +53 -0
- package/compiler-assets/nextjs/shims/not-found-navigation.tsx +60 -0
- package/compiler-assets/nextjs/shims/proxy.ts +126 -60
- package/compiler-assets/nextjs/shims/site-fenced-code-block.tsx +2 -6
- package/compiler-assets/nextjs/shims/site-mdx-components.tsx +28 -16
- package/compiler-assets/nextjs/shims/site-mdx.tsx +6 -1
- package/dist/{build-operation-2JAYBSKF.js → build-operation-5QMLXF7N.js} +29 -23
- package/dist/{button-c3WGnxIj.d.ts → button-BdCScEKi.d.ts} +3 -3
- package/dist/capture-local-source-WGGDIUU2.js +258 -0
- package/dist/chunk-22RSSUNV.js +13 -0
- package/dist/{chunk-WKTEO6RS.js → chunk-4BC2L2KA.js} +46 -12
- package/dist/{chunk-WDY4IK6Z.js → chunk-5J3YUNRY.js} +3 -10
- package/dist/chunk-5KAD7W53.js +248 -0
- package/dist/{chunk-DWA3ZRGW.js → chunk-6C65KV7O.js} +2 -2
- package/dist/{chunk-GGKFQ3MA.js → chunk-6D2E6UMD.js} +144 -70
- package/dist/{chunk-7OGTPSKI.js → chunk-7NY22B5U.js} +8 -3
- package/dist/chunk-EFO6AWXN.js +19 -0
- package/dist/{chunk-726GV2NF.js → chunk-F3AGNDF4.js} +100 -67
- package/dist/chunk-GBPLER5H.js +426 -0
- package/dist/chunk-IL4RJOKI.js +186 -0
- package/dist/{chunk-DLDFHU7Y.js → chunk-NNBJZPFM.js} +4 -2
- package/dist/{chunk-VO2I7MTM.js → chunk-ORIUWJBQ.js} +8 -6
- package/dist/{chunk-H6XILMZX.js → chunk-OXOFRXEI.js} +1806 -831
- package/dist/chunk-UYGCOWRF.js +1709 -0
- package/dist/{chunk-YLTOLYWM.js → chunk-WL75GQ5M.js} +6 -18
- package/dist/compiler.d.ts +15 -2
- package/dist/compiler.js +90 -21
- package/dist/components/blocks/agent-actions.d.ts +81 -0
- package/dist/components/blocks/agent-actions.js +594 -0
- package/dist/components/blocks/toc.d.ts +43 -0
- package/dist/components/blocks/toc.js +136 -0
- package/dist/components/ui/button.d.ts +5 -0
- package/dist/components/ui/button.js +94 -0
- package/dist/compose-CVBJRAF6.js +16 -0
- package/dist/config/createNextConfig.js +17 -3
- package/dist/{dev-operation-TZDVJCN7.js → dev-operation-OSHHWRWK.js} +121 -81
- package/dist/{framework-selection-X4U6Y6QC.js → framework-selection-ZVO323PK.js} +3 -2
- package/dist/ide-support-CU6Z5PVR.js +16 -0
- package/dist/index.d.ts +40 -1
- package/dist/jsx-dev-runtime.d.ts +6 -0
- package/dist/jsx-dev-runtime.js +100 -0
- package/dist/jsx-runtime.d.ts +7 -0
- package/dist/jsx-runtime.js +97 -0
- package/dist/kernel/components/blocks/AgentActions.d.ts +35 -6
- package/dist/kernel/components/blocks/AgentActions.js +383 -142
- package/dist/kernel/components/blocks/agent-actions.d.ts +5 -0
- package/dist/kernel/components/blocks/agent-actions.js +594 -0
- package/dist/kernel/components/blocks/animated-icon-swap.js +1 -1
- package/dist/kernel/components/blocks/color-palette.js +4 -4
- package/dist/kernel/components/blocks/logo-block.js +1 -1
- package/dist/kernel/components/blocks/nav-breadcrumb.js +2 -2
- package/dist/kernel/components/blocks/navbar.js +17 -17
- package/dist/kernel/components/blocks/navigation-progress.js +2 -2
- package/dist/kernel/components/blocks/next-prev.js +1 -1
- package/dist/kernel/components/blocks/page-list.js +2 -2
- package/dist/kernel/components/blocks/search.d.ts +1 -1
- package/dist/kernel/components/blocks/search.js +16 -17
- package/dist/kernel/components/blocks/sidebar-node.js +1 -1
- package/dist/kernel/components/blocks/sidebar.js +7 -4
- package/dist/kernel/components/blocks/theme-toggle.d.ts +1 -1
- package/dist/kernel/components/blocks/theme-toggle.js +5 -5
- package/dist/kernel/components/blocks/toc-client.d.ts +40 -0
- package/dist/kernel/components/blocks/toc-client.js +495 -0
- package/dist/kernel/components/blocks/toc.d.ts +19 -1
- package/dist/kernel/components/blocks/toc.js +121 -179
- package/dist/kernel/components/mdx/components/blockquote.js +1 -1
- package/dist/kernel/components/mdx/components/callout.js +1 -1
- package/dist/kernel/components/mdx/components/code-block.js +2 -2
- package/dist/kernel/components/mdx/components/copy-code-button.js +5 -4
- package/dist/kernel/components/mdx/components/figure-caption.d.ts +1 -1
- package/dist/kernel/components/mdx/components/figure-caption.js +3 -2
- package/dist/kernel/components/mdx/components/figure.d.ts +6 -2
- package/dist/kernel/components/mdx/components/figure.js +23 -13
- package/dist/kernel/components/mdx/components/footnotes.js +1 -1
- package/dist/kernel/components/mdx/components/heading-copy-link.js +1 -1
- package/dist/kernel/components/mdx/components/heading.js +6 -3
- package/dist/kernel/components/mdx/components/hr.js +2 -2
- package/dist/kernel/components/mdx/components/image-zoom.js +1 -1
- package/dist/kernel/components/mdx/components/image.d.ts +1 -1
- package/dist/kernel/components/mdx/components/image.js +21 -16
- package/dist/kernel/components/mdx/components/inline-code.js +1 -1
- package/dist/kernel/components/mdx/components/kbd.js +2 -2
- package/dist/kernel/components/mdx/components/link.d.ts +3 -3
- package/dist/kernel/components/mdx/components/link.js +2 -2
- package/dist/kernel/components/mdx/components/paragraph.js +1 -1
- package/dist/kernel/components/mdx/components/strikethrough.js +1 -1
- package/dist/kernel/components/mdx/components/table.js +2 -2
- package/dist/kernel/components/mdx/components/task-list.js +1 -1
- package/dist/kernel/components/mdx/components/video-player.d.ts +6 -2
- package/dist/kernel/components/mdx/components/video-player.js +6 -2
- package/dist/kernel/components/mdx/components/video.d.ts +5 -3
- package/dist/kernel/components/mdx/components/video.js +7 -5
- package/dist/kernel/components/mdx/error-boundary.d.ts +1 -1
- package/dist/kernel/components/mdx/error-boundary.js +2 -2
- package/dist/kernel/components/mdx/error-fallback.js +1 -1
- package/dist/kernel/components/mdx/mdx.d.ts +20 -10
- package/dist/kernel/components/mdx/mdx.js +231 -34
- package/dist/kernel/components/mdx/rehype-heading-ids.d.ts +1 -0
- package/dist/kernel/components/mdx/rehype-heading-ids.js +5 -3
- package/dist/kernel/components/mdx/types.d.ts +1 -1
- package/dist/kernel/components/next-image.d.ts +12 -0
- package/dist/kernel/components/next-image.js +61 -0
- package/dist/kernel/components/ui/accordion.js +1 -1
- package/dist/kernel/components/ui/breadcrumb-trail.d.ts +2 -2
- package/dist/kernel/components/ui/breadcrumb-trail.js +2 -2
- package/dist/kernel/components/ui/breadcrumb.d.ts +1 -1
- package/dist/kernel/components/ui/breadcrumb.js +4 -4
- package/dist/kernel/components/ui/button-group.d.ts +1 -1
- package/dist/kernel/components/ui/button-group.js +3 -3
- package/dist/kernel/components/ui/button.d.ts +56 -4
- package/dist/kernel/components/ui/button.js +43 -39
- package/dist/kernel/components/ui/card.js +1 -1
- package/dist/kernel/components/ui/dialog.js +1 -1
- package/dist/kernel/components/ui/drawer.js +1 -1
- package/dist/kernel/components/ui/input.d.ts +2 -2
- package/dist/kernel/components/ui/input.js +1 -1
- package/dist/kernel/components/ui/kbd.d.ts +1 -1
- package/dist/kernel/components/ui/kbd.js +1 -1
- package/dist/kernel/components/ui/link.d.ts +8 -2
- package/dist/kernel/components/ui/link.js +2 -2
- package/dist/kernel/components/ui/menu.js +1 -1
- package/dist/kernel/components/ui/mod-key.js +2 -2
- package/dist/kernel/components/ui/navigation-menu.js +1 -1
- package/dist/kernel/components/ui/popover.js +1 -1
- package/dist/kernel/components/ui/progress.js +1 -1
- package/dist/kernel/components/ui/scroll-area.d.ts +8 -8
- package/dist/kernel/components/ui/scroll-area.js +1 -1
- package/dist/kernel/components/ui/select.js +1 -1
- package/dist/kernel/components/ui/separator.js +1 -1
- package/dist/kernel/components/ui/table.js +1 -1
- package/dist/kernel/components/ui/tabs.js +1 -1
- package/dist/kernel/components/ui/tag.js +1 -1
- package/dist/kernel/components/ui/text.d.ts +1 -1
- package/dist/kernel/components/ui/text.js +1 -1
- package/dist/kernel/components/ui/toast.js +1 -1
- package/dist/kernel/components/ui/tooltip.js +1 -1
- package/dist/kernel/defaults.registry.d.ts +2 -15
- package/dist/kernel/defaults.registry.js +2 -17
- package/dist/kernel/routes/agent/markdown.d.ts +3 -0
- package/dist/kernel/routes/agent/markdown.js +219 -48
- package/dist/kernel/routes/layouts/group.d.ts +1 -1
- package/dist/kernel/routes/layouts/group.js +5 -7
- package/dist/kernel/routes/metadata/feed.d.ts +1 -1
- package/dist/kernel/routes/metadata/feed.js +109 -83
- package/dist/kernel/routes/metadata/llms.d.ts +11 -3
- package/dist/kernel/routes/metadata/llms.js +154 -57
- package/dist/kernel/routes/metadata/og-image.js +1 -1
- package/dist/kernel/routes/metadata/robots.d.ts +1 -1
- package/dist/kernel/routes/metadata/sitemap.d.ts +22 -3
- package/dist/kernel/routes/metadata/sitemap.js +183 -43
- package/dist/kernel/routes/not-found.d.ts +34 -0
- package/dist/kernel/routes/not-found.js +213 -0
- package/dist/kernel/routes/pages/group.d.ts +2 -2
- package/dist/kernel/routes/pages/group.js +1 -1
- package/dist/kernel/routes/pages/leaf.d.ts +30 -3
- package/dist/kernel/routes/pages/leaf.js +5 -4
- package/dist/kernel/routes/pages/root.d.ts +2 -2
- package/dist/kernel/routes/pages/root.js +1 -1
- package/dist/keyboard-shortcuts.js +1 -1
- package/dist/route-metadata-og-image-BeKKFHg7.d.ts +58 -0
- package/dist/search.js +7 -9
- package/dist/theme-scope.js +1 -1
- package/dist/{types-BzkZty3r.d.ts → types-J2w_puPF.d.ts} +1 -20
- package/dist/types-sM2g9nW0.d.ts +12 -0
- package/dist/types.d.ts +1 -0
- package/dist/utils/heading-ids.js +30 -11
- package/dist/utils/toc-selection.d.ts +7 -0
- package/dist/utils/toc-selection.js +14 -0
- package/dist/validate-local-source-SV44DBQT.js +16 -0
- package/dist/validate-publish-os-source-NZJF3TB2.js +14 -0
- package/init/seed/minimal/publish.os/assets/blog/hello-world.svg +13 -0
- package/init/seed/minimal/publish.os/assets/favicon.dark.svg +13 -0
- package/init/seed/minimal/publish.os/assets/favicon.svg +13 -0
- package/init/seed/minimal/publish.os/blog/content/hello-world.mdx +48 -0
- package/init/seed/minimal/publish.os/blog/content/series-a.mdx +11 -0
- package/init/seed/minimal/publish.os/blog/index.tsx +82 -0
- package/init/seed/minimal/publish.os/blog/layout.tsx +13 -0
- package/init/seed/minimal/publish.os/blog/page.tsx +76 -0
- package/init/seed/minimal/publish.os/components/blog/copy-link.tsx +64 -0
- package/init/seed/minimal/publish.os/docs/content/get-started.mdx +2 -3
- package/init/seed/minimal/publish.os/docs/content/groups.mdx +5 -6
- package/init/seed/minimal/publish.os/publish.os.config.json +6 -2
- package/init/seed/minimal/publish.os/theme.css +3 -3
- package/init/seed/minimal/seed.json +11 -4
- package/init/seed/scratch/publish.os/docs/content/get-started.mdx +1 -1
- package/init/seed/scratch/publish.os/publish.os.config.json +1 -1
- package/package.json +45 -20
- package/release/app/phosphor/package.json +3 -3
- package/release/app/phosphor/pnpm-lock.yaml.template +88 -75
- package/release/compiler/package.json +5 -3
- package/release/compiler/pnpm-lock.yaml.template +118 -74
- package/release/release.json +6 -6
- package/dist/button-CtzUJB8u.d.ts +0 -11
- package/dist/chunk-535TM4A5.js +0 -1455
- package/dist/chunk-B2V22WRT.js +0 -297
- package/dist/chunk-NECL5IBJ.js +0 -318
- package/dist/chunk-SVYGXXYR.js +0 -36
- package/dist/chunk-UF6ATARM.js +0 -1100
- package/dist/compose-NN23UJGC.js +0 -13
- package/dist/ide-support-ZNW7ODFY.js +0 -15
- package/dist/kernel/components/blocks/design-system-preview.d.ts +0 -61
- package/dist/kernel/components/blocks/design-system-preview.js +0 -667
- package/dist/kernel/components/blocks/link-playground.d.ts +0 -5
- package/dist/kernel/components/blocks/link-playground.js +0 -744
- package/dist/kernel/components/blocks/navigation-progress-playground.d.ts +0 -5
- package/dist/kernel/components/blocks/navigation-progress-playground.js +0 -629
- package/dist/kernel/components/ui/theme-toggle.d.ts +0 -24
- package/dist/kernel/components/ui/theme-toggle.js +0 -53
- package/dist/validate-local-source-XRL2Y7XE.js +0 -14
- package/dist/validate-publish-os-source-DAPZ4QGE.js +0 -12
- package/init/seed/minimal/publish.os/assets/favicon/favicon.dark.png +0 -0
- package/init/seed/minimal/publish.os/assets/favicon/favicon.png +0 -0
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
// src/lib/hosting/framework-paths.ts
|
|
2
|
-
var FRAMEWORK_PREFIX = "/publishos", ASSET_PREFIX = `${FRAMEWORK_PREFIX}/assets`, SITE_API_PREFIX = `${FRAMEWORK_PREFIX}/api`, PAGEFIND_PREFIX = `${ASSET_PREFIX}/pagefind`, PAGEFIND_MODULE_URL = `${PAGEFIND_PREFIX}/pagefind.js`, PAGEFIND_ENTRY_URL = `${PAGEFIND_PREFIX}/pagefind-entry.json`, IMAGE_OPTIMIZER_PATH = `${SITE_API_PREFIX}/image`, NEXT_IMAGE_OPTIMIZER_PATH = "/_next/image", OG_SERVICE_PREFIX = `${SITE_API_PREFIX}/og`, PUBLIC_ASSET_DIRECTORY = "publishos/assets", PUBLIC_FONT_DIRECTORY = `${PUBLIC_ASSET_DIRECTORY}/_publishos/fonts`, PUBLIC_PAGEFIND_DIRECTORY = `public/${PUBLIC_ASSET_DIRECTORY}/pagefind`, FRAMEWORK_PROXY_MATCHER = `/((?!${FRAMEWORK_PREFIX.slice(1)}(?:/|$)|_next/static|_next/image|_next/webpack-hmr).*)`;
|
|
3
|
-
function isFrameworkNamespacePath(pathname) {
|
|
4
|
-
return pathname === FRAMEWORK_PREFIX || pathname.startsWith(`${FRAMEWORK_PREFIX}/`);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
1
|
// src/lib/compiler/internal/path-containment.ts
|
|
8
2
|
import * as systemPath from "path";
|
|
9
3
|
function relativePath(parent, child, pathImplementation) {
|
|
@@ -25,9 +19,12 @@ function isDescendant(parent, child, pathImplementation = systemPath) {
|
|
|
25
19
|
}
|
|
26
20
|
|
|
27
21
|
// src/lib/compiler/source/source-paths.ts
|
|
22
|
+
function isOsMetadataPath(relativePath2) {
|
|
23
|
+
return relativePath2.split(/[\\/]/).includes(".DS_Store");
|
|
24
|
+
}
|
|
28
25
|
function isExcludedSourcePath(relativePath2) {
|
|
29
26
|
let segments = relativePath2.split(/[\\/]/);
|
|
30
|
-
return relativePath2 === "tsconfig.json" || segments[0] === ".publish.os" || segments.includes("publish.os");
|
|
27
|
+
return isOsMetadataPath(relativePath2) || relativePath2 === "tsconfig.json" || segments[0] === ".publish.os" || segments.includes("publish.os");
|
|
31
28
|
}
|
|
32
29
|
var ROOT_FILES = /* @__PURE__ */ new Set(["publish.os.config.json", "tsconfig.json"]), RENDERER_FILES = /* @__PURE__ */ new Set([
|
|
33
30
|
"layout.tsx",
|
|
@@ -37,7 +34,7 @@ var ROOT_FILES = /* @__PURE__ */ new Set(["publish.os.config.json", "tsconfig.js
|
|
|
37
34
|
"(index)/index.tsx",
|
|
38
35
|
"(page)/layout.tsx",
|
|
39
36
|
"(page)/page.tsx"
|
|
40
|
-
]), ROOT_DIRECTORIES = ["
|
|
37
|
+
]), ROOT_DIRECTORIES = ["assets/", "components/", "content/"], RESERVED_DIRECTORIES = /* @__PURE__ */ new Set([
|
|
41
38
|
"app",
|
|
42
39
|
"pages",
|
|
43
40
|
"node_modules",
|
|
@@ -74,18 +71,9 @@ function isApprovedPublishOsPath(path, groupFolders) {
|
|
|
74
71
|
}
|
|
75
72
|
|
|
76
73
|
export {
|
|
77
|
-
FRAMEWORK_PREFIX,
|
|
78
|
-
ASSET_PREFIX,
|
|
79
|
-
IMAGE_OPTIMIZER_PATH,
|
|
80
|
-
NEXT_IMAGE_OPTIMIZER_PATH,
|
|
81
|
-
OG_SERVICE_PREFIX,
|
|
82
|
-
PUBLIC_ASSET_DIRECTORY,
|
|
83
|
-
PUBLIC_FONT_DIRECTORY,
|
|
84
|
-
PUBLIC_PAGEFIND_DIRECTORY,
|
|
85
|
-
FRAMEWORK_PROXY_MATCHER,
|
|
86
|
-
isFrameworkNamespacePath,
|
|
87
74
|
isSameOrDescendant,
|
|
88
75
|
isDescendant,
|
|
76
|
+
isOsMetadataPath,
|
|
89
77
|
isExcludedSourcePath,
|
|
90
78
|
isReservedFrameworkPath,
|
|
91
79
|
isApprovedPublishOsPath
|
package/dist/compiler.d.ts
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
type FrameworkOperation = "validate" | "compose" | "dev" | "build";
|
|
2
|
+
type FrameworkPrivateComposition = {
|
|
3
|
+
appFiles: Array<{
|
|
4
|
+
path: string;
|
|
5
|
+
content: string;
|
|
6
|
+
}>;
|
|
7
|
+
publicPaths: string[];
|
|
8
|
+
sourceFiles: Array<{
|
|
9
|
+
path: string;
|
|
10
|
+
content: string;
|
|
11
|
+
}>;
|
|
12
|
+
};
|
|
2
13
|
type LocalOperationContext = {
|
|
3
14
|
sourceRoot: string;
|
|
4
15
|
sourceDir: string;
|
|
@@ -50,13 +61,14 @@ type FrameworkRequest = {
|
|
|
50
61
|
sourceRevision?: string;
|
|
51
62
|
/** Exact caller-owned pnpm executable. Local commands never search PATH. */
|
|
52
63
|
pnpmExecutable?: string;
|
|
53
|
-
/**
|
|
64
|
+
/** Optional generated editor support for the selected framework. */
|
|
54
65
|
ide?: {
|
|
55
66
|
finalSourceRoot?: string;
|
|
56
|
-
policy?: "preserve";
|
|
57
67
|
};
|
|
58
68
|
/** Local development origin, supplied after selecting an available port. */
|
|
59
69
|
previewUrl?: string;
|
|
70
|
+
/** App files supplied by a local maintainer launcher for checkout Dev. */
|
|
71
|
+
privateComposition?: FrameworkPrivateComposition;
|
|
60
72
|
};
|
|
61
73
|
port?: number;
|
|
62
74
|
portExplicit?: boolean;
|
|
@@ -109,6 +121,7 @@ type FrameworkResult = {
|
|
|
109
121
|
code: string;
|
|
110
122
|
message: string;
|
|
111
123
|
fix: string;
|
|
124
|
+
details?: Record<string, unknown>;
|
|
112
125
|
};
|
|
113
126
|
};
|
|
114
127
|
type RunFrameworkOptions = {
|
package/dist/compiler.js
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
withCheckoutPreparation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6C65KV7O.js";
|
|
4
4
|
import {
|
|
5
5
|
withLocalOperation
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-IL4RJOKI.js";
|
|
7
|
+
import "./chunk-6D2E6UMD.js";
|
|
8
|
+
import "./chunk-7NY22B5U.js";
|
|
9
|
+
import "./chunk-EFO6AWXN.js";
|
|
10
|
+
import "./chunk-WL75GQ5M.js";
|
|
10
11
|
import {
|
|
11
|
-
AppError,
|
|
12
12
|
readInstalledFramework
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5J3YUNRY.js";
|
|
14
|
+
import {
|
|
15
|
+
AppError
|
|
16
|
+
} from "./chunk-22RSSUNV.js";
|
|
14
17
|
|
|
15
18
|
// src/compiler.ts
|
|
16
19
|
import { realpathSync } from "fs";
|
|
@@ -40,7 +43,7 @@ function serveCompilerIpc(options) {
|
|
|
40
43
|
() => process.exit(
|
|
41
44
|
disconnected || protocolFailure ? 1 : cancellationExitCode
|
|
42
45
|
),
|
|
43
|
-
|
|
46
|
+
1e4
|
|
44
47
|
), stopTimer.unref();
|
|
45
48
|
}
|
|
46
49
|
}, disconnect = () => {
|
|
@@ -114,6 +117,54 @@ function serveCompilerIpc(options) {
|
|
|
114
117
|
process.on("message", receive), process.on("disconnect", disconnect), process.on("SIGINT", interrupt), process.on("SIGTERM", terminate);
|
|
115
118
|
}
|
|
116
119
|
|
|
120
|
+
// src/lib/compiler/diagnostic-budget.ts
|
|
121
|
+
function boundedText(value, limit = 1e3) {
|
|
122
|
+
return value.length > limit ? `${value.slice(0, limit - 3)}...` : value;
|
|
123
|
+
}
|
|
124
|
+
function boundedDiagnostic(diagnostic) {
|
|
125
|
+
let { file, ...rest } = diagnostic;
|
|
126
|
+
return {
|
|
127
|
+
...rest,
|
|
128
|
+
code: boundedText(diagnostic.code, 128),
|
|
129
|
+
message: boundedText(diagnostic.message),
|
|
130
|
+
...file !== void 0 && file.length <= 4096 ? { file } : {},
|
|
131
|
+
...diagnostic.correction === void 0 ? {} : { correction: boundedText(diagnostic.correction) },
|
|
132
|
+
...diagnostic.sourceLine === void 0 ? {} : { sourceLine: boundedText(diagnostic.sourceLine) },
|
|
133
|
+
...diagnostic.propertyPath === void 0 ? {} : { propertyPath: boundedText(diagnostic.propertyPath) }
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function createDiagnosticBudget(onEvent) {
|
|
137
|
+
let emitted = 0, omitted = 0, omittedErrors = 0, pending, finished = !1, send = (diagnostics) => {
|
|
138
|
+
diagnostics.length !== 0 && onEvent?.({ type: "diagnostics", diagnostics: { diagnostics } });
|
|
139
|
+
};
|
|
140
|
+
return {
|
|
141
|
+
emit(event) {
|
|
142
|
+
if (finished) return;
|
|
143
|
+
if (event.type !== "diagnostics") {
|
|
144
|
+
onEvent?.(event);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (event.diagnostics.diagnostics.length === 0) {
|
|
148
|
+
onEvent?.(event);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
let retained = [];
|
|
152
|
+
for (let diagnostic of event.diagnostics.diagnostics)
|
|
153
|
+
emitted < 99 ? (retained.push(boundedDiagnostic(diagnostic)), emitted += 1) : (omitted += 1, diagnostic.severity === "error" && (omittedErrors += 1), omitted === 1 && (pending = boundedDiagnostic(diagnostic)));
|
|
154
|
+
send(retained);
|
|
155
|
+
},
|
|
156
|
+
finish() {
|
|
157
|
+
finished || (finished = !0, omitted === 1 && pending && send([pending]), omitted > 1 && send([
|
|
158
|
+
{
|
|
159
|
+
code: "FRAMEWORK_DIAGNOSTICS_TRUNCATED",
|
|
160
|
+
severity: omittedErrors > 0 ? "error" : "warning",
|
|
161
|
+
message: `${omitted} additional diagnostics were omitted (${omittedErrors} ${omittedErrors === 1 ? "error" : "errors"}). Correct the reported files and repeat the command.`
|
|
162
|
+
}
|
|
163
|
+
]));
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
117
168
|
// src/compiler.ts
|
|
118
169
|
function failure(error) {
|
|
119
170
|
return { error, status: "failure", type: "result" };
|
|
@@ -149,6 +200,16 @@ async function approveComposition(options) {
|
|
|
149
200
|
});
|
|
150
201
|
}
|
|
151
202
|
async function runFramework(options) {
|
|
203
|
+
if (options.request?.operation === "dev" || options.request?.operation === "build")
|
|
204
|
+
return runFrameworkOperation(options);
|
|
205
|
+
let budget = createDiagnosticBudget(options.onEvent);
|
|
206
|
+
try {
|
|
207
|
+
return await runFrameworkOperation({ ...options, onEvent: budget.emit });
|
|
208
|
+
} finally {
|
|
209
|
+
budget.finish();
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
async function runFrameworkOperation(options) {
|
|
152
213
|
if (options.request?.protocol !== 1)
|
|
153
214
|
return failure({
|
|
154
215
|
code: "FRAMEWORK_PROTOCOL_UNSUPPORTED",
|
|
@@ -169,15 +230,15 @@ async function runFramework(options) {
|
|
|
169
230
|
});
|
|
170
231
|
try {
|
|
171
232
|
if (options.signal?.throwIfAborted(), options.request.operation === "build") {
|
|
172
|
-
let { runLocalBuild } = await import("./build-operation-
|
|
233
|
+
let { runLocalBuild } = await import("./build-operation-5QMLXF7N.js");
|
|
173
234
|
return await runLocalBuild(options);
|
|
174
235
|
}
|
|
175
236
|
if (options.request.operation === "dev") {
|
|
176
|
-
let { runDevelopment } = await import("./dev-operation-
|
|
237
|
+
let { runDevelopment } = await import("./dev-operation-OSHHWRWK.js");
|
|
177
238
|
return await runDevelopment(options);
|
|
178
239
|
}
|
|
179
240
|
options.onEvent?.({ message: "Validating source", type: "progress" });
|
|
180
|
-
let { validatePublishOsSource } = await import("./validate-publish-os-source-
|
|
241
|
+
let { validatePublishOsSource } = await import("./validate-publish-os-source-NZJF3TB2.js"), validation = await validatePublishOsSource({
|
|
181
242
|
publishOsDir: options.request.paths.source,
|
|
182
243
|
sourceIdentity: options.request.paths.originalSource ? { sourceRoot: options.request.paths.originalSource } : void 0
|
|
183
244
|
});
|
|
@@ -194,19 +255,19 @@ async function runFramework(options) {
|
|
|
194
255
|
fix: "Correct the reported source errors, then run the command again.",
|
|
195
256
|
message: "The selected source failed validation."
|
|
196
257
|
});
|
|
197
|
-
let framework = await readInstalledFramework(), { assertFrameworkSelection } = await import("./framework-selection-
|
|
258
|
+
let framework = await readInstalledFramework(), { assertFrameworkSelection } = await import("./framework-selection-ZVO323PK.js");
|
|
198
259
|
if (await assertFrameworkSelection({
|
|
199
260
|
context: options.request.context,
|
|
200
261
|
framework,
|
|
201
262
|
runtime: validation.source.config.runtime
|
|
202
263
|
}), options.request.operation === "validate" && options.request.context?.ide) {
|
|
203
|
-
let { prepareIdeSupport } = await import("./ide-support-
|
|
264
|
+
let source = validation.source, { prepareIdeSupport } = await import("./ide-support-CU6Z5PVR.js");
|
|
204
265
|
await prepareIdeSupport({
|
|
266
|
+
frameworkOptions: options,
|
|
205
267
|
publishOsDir: options.request.paths.source,
|
|
206
|
-
finalPublishOsDir: options.request.context
|
|
207
|
-
source
|
|
208
|
-
framework
|
|
209
|
-
frameworkOptions: options
|
|
268
|
+
finalPublishOsDir: options.request.context?.ide?.finalSourceRoot,
|
|
269
|
+
source,
|
|
270
|
+
framework
|
|
210
271
|
});
|
|
211
272
|
}
|
|
212
273
|
if (options.request.operation === "compose") {
|
|
@@ -223,16 +284,23 @@ async function runFramework(options) {
|
|
|
223
284
|
message: "The caller did not authorize composition."
|
|
224
285
|
});
|
|
225
286
|
options.signal?.throwIfAborted();
|
|
226
|
-
let { composeFrameworkSource } = await import("./compose-
|
|
287
|
+
let { composeFrameworkSource } = await import("./compose-CVBJRAF6.js");
|
|
227
288
|
await composeFrameworkSource({
|
|
228
289
|
request: options.request,
|
|
229
290
|
source: validation.source,
|
|
230
291
|
signal: options.signal,
|
|
231
292
|
onProgress: (message) => options.onEvent?.({ message, type: "progress" }),
|
|
232
|
-
onWarning: ({ code, message }) => options.onEvent?.({
|
|
293
|
+
onWarning: ({ code, message, file }) => options.onEvent?.({
|
|
233
294
|
type: "diagnostics",
|
|
234
295
|
diagnostics: {
|
|
235
|
-
diagnostics: [
|
|
296
|
+
diagnostics: [
|
|
297
|
+
{
|
|
298
|
+
code,
|
|
299
|
+
message,
|
|
300
|
+
severity: "warning",
|
|
301
|
+
...file ? { file } : {}
|
|
302
|
+
}
|
|
303
|
+
]
|
|
236
304
|
}
|
|
237
305
|
})
|
|
238
306
|
});
|
|
@@ -255,7 +323,8 @@ async function runFramework(options) {
|
|
|
255
323
|
}), failure({
|
|
256
324
|
code: error.code,
|
|
257
325
|
fix: error instanceof AppError && error.fix ? error.fix : frameworkRecovery(error.code),
|
|
258
|
-
message: error.message
|
|
326
|
+
message: error.message,
|
|
327
|
+
...error instanceof AppError && error.code === "FRAMEWORK_LOCAL_OUTPUT_REDIRECTED" && error.details ? { details: error.details } : {}
|
|
259
328
|
})) : failure({
|
|
260
329
|
code: "FRAMEWORK_EXECUTION_FAILED",
|
|
261
330
|
fix: "Repeat the publish.os command with --debug. Send only the sanitized report path and error code to support@publish.dev.",
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ButtonVariantProps } from '../../kernel/components/ui/button.js';
|
|
3
|
+
import { ReactNode, ComponentPropsWithoutRef } from 'react';
|
|
4
|
+
import 'class-variance-authority/types';
|
|
5
|
+
import 'class-variance-authority';
|
|
6
|
+
|
|
7
|
+
type Resolvable<T> = T | ((context: AgentActionContext) => T);
|
|
8
|
+
type AgentActionContext = {
|
|
9
|
+
pagePath: string;
|
|
10
|
+
pageUrl: string;
|
|
11
|
+
markdownPath: string;
|
|
12
|
+
markdownUrl: string;
|
|
13
|
+
markdown?: string;
|
|
14
|
+
sourceUrl?: string;
|
|
15
|
+
prompt: string;
|
|
16
|
+
};
|
|
17
|
+
type AgentActionCopyTarget = "markdown-link" | "page-link" | "page-markdown" | string;
|
|
18
|
+
type AgentActionConfig = {
|
|
19
|
+
id: string;
|
|
20
|
+
title: string;
|
|
21
|
+
icon?: ReactNode;
|
|
22
|
+
href?: Resolvable<string | undefined>;
|
|
23
|
+
target?: ComponentPropsWithoutRef<"a">["target"];
|
|
24
|
+
rel?: string;
|
|
25
|
+
openInNew?: boolean;
|
|
26
|
+
copy?: AgentActionCopyTarget;
|
|
27
|
+
disabled?: Resolvable<boolean | undefined>;
|
|
28
|
+
onSelect?: (context: AgentActionContext) => void | Promise<void>;
|
|
29
|
+
};
|
|
30
|
+
type AgentActionGroup = {
|
|
31
|
+
id: string;
|
|
32
|
+
title?: string;
|
|
33
|
+
actions: AgentActionConfig[];
|
|
34
|
+
};
|
|
35
|
+
type AgentActionsProps = ComponentPropsWithoutRef<"div"> & {
|
|
36
|
+
pagePath?: string;
|
|
37
|
+
pageUrl?: string;
|
|
38
|
+
markdownPath?: string;
|
|
39
|
+
markdownUrl?: string;
|
|
40
|
+
markdown?: string;
|
|
41
|
+
markdownRevision?: string;
|
|
42
|
+
siteUrl?: string;
|
|
43
|
+
sourceUrl?: string;
|
|
44
|
+
prompt?: string;
|
|
45
|
+
primaryAction?: AgentActionConfig;
|
|
46
|
+
actionGroups?: AgentActionGroup[];
|
|
47
|
+
buttonSize?: ButtonVariantProps["size"];
|
|
48
|
+
buttonVariant?: ButtonVariantProps["variant"];
|
|
49
|
+
menuLabel?: string;
|
|
50
|
+
markdownLinkLabel?: string;
|
|
51
|
+
showMarkdownLink?: boolean;
|
|
52
|
+
};
|
|
53
|
+
declare function AgentActionsToolbar({ className, ...props }: ComponentPropsWithoutRef<"div">): react_jsx_runtime.JSX.Element;
|
|
54
|
+
declare function AgentActionsMarkdownLink(): ReactNode;
|
|
55
|
+
declare function AgentActionsPrimaryAction({ action }: {
|
|
56
|
+
action?: AgentActionConfig;
|
|
57
|
+
}): ReactNode;
|
|
58
|
+
declare function AgentActionsFeedback(): react_jsx_runtime.JSX.Element;
|
|
59
|
+
declare function AgentActionsGroup({ title, children, }: {
|
|
60
|
+
title?: string;
|
|
61
|
+
children: ReactNode;
|
|
62
|
+
}): react_jsx_runtime.JSX.Element;
|
|
63
|
+
declare function AgentActionsItem({ action }: {
|
|
64
|
+
action: AgentActionConfig;
|
|
65
|
+
}): ReactNode;
|
|
66
|
+
declare function AgentActionsMenu({ children }: {
|
|
67
|
+
children?: ReactNode;
|
|
68
|
+
}): react_jsx_runtime.JSX.Element;
|
|
69
|
+
declare function AgentActionsRoot(props: AgentActionsProps): react_jsx_runtime.JSX.Element;
|
|
70
|
+
declare const AgentActions: typeof AgentActionsRoot & {
|
|
71
|
+
Feedback: typeof AgentActionsFeedback;
|
|
72
|
+
Group: typeof AgentActionsGroup;
|
|
73
|
+
Item: typeof AgentActionsItem;
|
|
74
|
+
MarkdownLink: typeof AgentActionsMarkdownLink;
|
|
75
|
+
Menu: typeof AgentActionsMenu;
|
|
76
|
+
PrimaryAction: typeof AgentActionsPrimaryAction;
|
|
77
|
+
Root: typeof AgentActionsRoot;
|
|
78
|
+
Toolbar: typeof AgentActionsToolbar;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export { type AgentActionConfig, type AgentActionContext, type AgentActionCopyTarget, type AgentActionGroup, AgentActions, type AgentActionsProps, AgentActionsFeedback as Feedback, AgentActionsGroup as Group, AgentActionsItem as Item, AgentActionsMarkdownLink as MarkdownLink, AgentActionsMenu as Menu, AgentActionsPrimaryAction as PrimaryAction, AgentActionsRoot as Root, AgentActionsToolbar as Toolbar };
|