@publish.os/nextjs 0.0.1-alpha.90 → 0.0.1-alpha.92
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/index.tsx +16 -11
- package/compiler-assets/nextjs/defaults/group/layout.tsx +6 -6
- package/compiler-assets/nextjs/defaults/group/page.tsx +36 -26
- package/compiler-assets/nextjs/defaults/project/next.config.mjs +21 -11
- 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/defaults/root/index.tsx +16 -11
- package/compiler-assets/nextjs/defaults/root/layout.tsx +7 -3
- package/compiler-assets/nextjs/shims/agent-user-agents.ts +65 -0
- package/compiler-assets/nextjs/shims/document.tsx +46 -0
- package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +5 -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 +254 -86
- 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-CJDUL4OW.js} +29 -23
- package/dist/{button-c3WGnxIj.d.ts → button-D6Xp2HBm.d.ts} +4 -4
- package/dist/capture-local-source-WGGDIUU2.js +258 -0
- package/dist/chunk-22RSSUNV.js +13 -0
- package/dist/chunk-3T4HVDSC.js +426 -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-DX7PXFCM.js +2519 -0
- package/dist/{chunk-726GV2NF.js → chunk-DZ3VWEV5.js} +950 -632
- package/dist/chunk-EFO6AWXN.js +19 -0
- package/dist/chunk-IL4RJOKI.js +186 -0
- package/dist/{chunk-H6XILMZX.js → chunk-NHSLTARU.js} +2588 -1493
- package/dist/{chunk-DLDFHU7Y.js → chunk-NNBJZPFM.js} +4 -2
- package/dist/{chunk-VO2I7MTM.js → chunk-SBMDONTV.js} +10 -7
- package/dist/{chunk-YLTOLYWM.js → chunk-WL75GQ5M.js} +6 -18
- package/dist/compiler.d.ts +15 -2
- package/dist/compiler.js +111 -23
- package/dist/components/blocks/agent-actions.d.ts +81 -0
- package/dist/components/blocks/agent-actions.js +563 -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 +4 -0
- package/dist/components/ui/button.js +94 -0
- package/dist/compose-44GJSMXD.js +16 -0
- package/dist/config/createNextConfig.js +19 -3
- package/dist/{dev-operation-TZDVJCN7.js → dev-operation-WNECBHZ5.js} +134 -84
- package/dist/{framework-selection-X4U6Y6QC.js → framework-selection-ZVO323PK.js} +3 -2
- package/dist/ide-support-TG74L4FF.js +16 -0
- package/dist/index.d.ts +151 -95
- package/dist/index.js +25 -0
- 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 +37 -8
- package/dist/kernel/components/blocks/AgentActions.js +384 -174
- package/dist/kernel/components/blocks/agent-actions.d.ts +4 -0
- package/dist/kernel/components/blocks/agent-actions.js +563 -0
- package/dist/kernel/components/blocks/animated-icon-swap.d.ts +2 -2
- package/dist/kernel/components/blocks/animated-icon-swap.js +1 -1
- package/dist/kernel/components/blocks/color-palette.d.ts +2 -2
- package/dist/kernel/components/blocks/color-palette.js +4 -4
- package/dist/kernel/components/blocks/logo-block.d.ts +2 -2
- package/dist/kernel/components/blocks/logo-block.js +1 -1
- package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +6 -5
- package/dist/kernel/components/blocks/nav-breadcrumb.js +21 -15
- package/dist/kernel/components/blocks/navbar.d.ts +5 -4
- package/dist/kernel/components/blocks/navbar.js +79 -59
- package/dist/kernel/components/blocks/navigation-progress.d.ts +2 -2
- package/dist/kernel/components/blocks/navigation-progress.js +2 -2
- package/dist/kernel/components/blocks/next-prev.d.ts +4 -4
- package/dist/kernel/components/blocks/next-prev.js +30 -7
- package/dist/kernel/components/blocks/page-list.d.ts +4 -4
- package/dist/kernel/components/blocks/page-list.js +32 -9
- package/dist/kernel/components/blocks/search.d.ts +9 -15
- package/dist/kernel/components/blocks/search.js +16 -17
- package/dist/kernel/components/blocks/sidebar-node.d.ts +3 -5
- package/dist/kernel/components/blocks/sidebar-node.js +13 -3
- package/dist/kernel/components/blocks/sidebar.d.ts +6 -7
- package/dist/kernel/components/blocks/sidebar.js +137 -28
- package/dist/kernel/components/blocks/theme-toggle.d.ts +3 -4
- 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 +20 -2
- package/dist/kernel/components/blocks/toc.js +121 -179
- package/dist/kernel/components/mdx/components/blockquote.d.ts +2 -2
- package/dist/kernel/components/mdx/components/blockquote.js +1 -1
- package/dist/kernel/components/mdx/components/callout.d.ts +3 -3
- package/dist/kernel/components/mdx/components/callout.js +1 -1
- package/dist/kernel/components/mdx/components/code-block.d.ts +2 -2
- package/dist/kernel/components/mdx/components/code-block.js +2 -2
- package/dist/kernel/components/mdx/components/copy-code-button.d.ts +2 -2
- package/dist/kernel/components/mdx/components/copy-code-button.js +5 -4
- package/dist/kernel/components/mdx/components/figure-caption.d.ts +3 -3
- package/dist/kernel/components/mdx/components/figure-caption.js +3 -2
- package/dist/kernel/components/mdx/components/figure.d.ts +8 -4
- package/dist/kernel/components/mdx/components/figure.js +23 -13
- package/dist/kernel/components/mdx/components/footnotes.d.ts +2 -2
- package/dist/kernel/components/mdx/components/footnotes.js +1 -1
- package/dist/kernel/components/mdx/components/heading-copy-link.d.ts +2 -2
- package/dist/kernel/components/mdx/components/heading-copy-link.js +1 -1
- package/dist/kernel/components/mdx/components/heading.d.ts +2 -2
- package/dist/kernel/components/mdx/components/heading.js +6 -3
- package/dist/kernel/components/mdx/components/hr.d.ts +4 -4
- package/dist/kernel/components/mdx/components/hr.js +2 -2
- package/dist/kernel/components/mdx/components/image-zoom.d.ts +3 -3
- package/dist/kernel/components/mdx/components/image-zoom.js +4 -3
- package/dist/kernel/components/mdx/components/image.d.ts +2 -2
- package/dist/kernel/components/mdx/components/image.js +22 -17
- package/dist/kernel/components/mdx/components/inline-code.d.ts +2 -2
- package/dist/kernel/components/mdx/components/inline-code.js +1 -1
- package/dist/kernel/components/mdx/components/kbd.d.ts +3 -3
- package/dist/kernel/components/mdx/components/kbd.js +2 -2
- package/dist/kernel/components/mdx/components/link.d.ts +6 -6
- package/dist/kernel/components/mdx/components/link.js +2 -2
- package/dist/kernel/components/mdx/components/paragraph.d.ts +2 -2
- package/dist/kernel/components/mdx/components/paragraph.js +1 -1
- package/dist/kernel/components/mdx/components/strikethrough.d.ts +2 -2
- package/dist/kernel/components/mdx/components/strikethrough.js +1 -1
- package/dist/kernel/components/mdx/components/table.d.ts +7 -7
- package/dist/kernel/components/mdx/components/table.js +2 -2
- package/dist/kernel/components/mdx/components/task-list.d.ts +3 -3
- package/dist/kernel/components/mdx/components/task-list.js +1 -1
- package/dist/kernel/components/mdx/components/video-player.d.ts +8 -4
- package/dist/kernel/components/mdx/components/video-player.js +6 -2
- package/dist/kernel/components/mdx/components/video.d.ts +5 -4
- package/dist/kernel/components/mdx/components/video.js +7 -5
- package/dist/kernel/components/mdx/error-boundary.d.ts +3 -4
- package/dist/kernel/components/mdx/error-boundary.js +2 -2
- package/dist/kernel/components/mdx/error-fallback.d.ts +2 -2
- package/dist/kernel/components/mdx/error-fallback.js +1 -1
- package/dist/kernel/components/mdx/mdx.d.ts +57 -16
- package/dist/kernel/components/mdx/mdx.js +232 -35
- 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.d.ts +7 -7
- package/dist/kernel/components/ui/accordion.js +1 -1
- package/dist/kernel/components/ui/breadcrumb-trail.d.ts +3 -4
- package/dist/kernel/components/ui/breadcrumb-trail.js +2 -2
- package/dist/kernel/components/ui/breadcrumb.d.ts +14 -14
- package/dist/kernel/components/ui/breadcrumb.js +4 -4
- package/dist/kernel/components/ui/button-group.d.ts +6 -6
- package/dist/kernel/components/ui/button-group.js +3 -3
- package/dist/kernel/components/ui/button.d.ts +59 -7
- package/dist/kernel/components/ui/button.js +43 -39
- package/dist/kernel/components/ui/card.d.ts +7 -7
- package/dist/kernel/components/ui/card.js +1 -1
- package/dist/kernel/components/ui/dialog.d.ts +10 -10
- package/dist/kernel/components/ui/dialog.js +1 -1
- package/dist/kernel/components/ui/drawer.d.ts +12 -12
- 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 +4 -4
- package/dist/kernel/components/ui/kbd.js +1 -1
- package/dist/kernel/components/ui/link.d.ts +11 -5
- package/dist/kernel/components/ui/link.js +2 -2
- package/dist/kernel/components/ui/menu.d.ts +22 -22
- package/dist/kernel/components/ui/menu.js +1 -1
- package/dist/kernel/components/ui/mod-key.d.ts +2 -3
- package/dist/kernel/components/ui/mod-key.js +2 -2
- package/dist/kernel/components/ui/navigation-menu.d.ts +15 -15
- package/dist/kernel/components/ui/navigation-menu.js +1 -1
- package/dist/kernel/components/ui/popover.d.ts +11 -11
- package/dist/kernel/components/ui/popover.js +1 -1
- package/dist/kernel/components/ui/progress.d.ts +7 -7
- package/dist/kernel/components/ui/progress.js +1 -1
- package/dist/kernel/components/ui/scroll-area.d.ts +9 -10
- package/dist/kernel/components/ui/scroll-area.js +1 -1
- package/dist/kernel/components/ui/select.d.ts +16 -16
- package/dist/kernel/components/ui/select.js +1 -1
- package/dist/kernel/components/ui/separator.d.ts +3 -3
- package/dist/kernel/components/ui/separator.js +1 -1
- package/dist/kernel/components/ui/table.d.ts +7 -7
- package/dist/kernel/components/ui/table.js +1 -1
- package/dist/kernel/components/ui/tabs.d.ts +12 -12
- package/dist/kernel/components/ui/tabs.js +1 -1
- package/dist/kernel/components/ui/tag.d.ts +3 -3
- package/dist/kernel/components/ui/tag.js +1 -1
- package/dist/kernel/components/ui/text.d.ts +4 -4
- package/dist/kernel/components/ui/text.js +1 -1
- package/dist/kernel/components/ui/toast.d.ts +11 -11
- package/dist/kernel/components/ui/toast.js +1 -1
- package/dist/kernel/components/ui/tooltip.d.ts +9 -9
- package/dist/kernel/components/ui/tooltip.js +1 -1
- package/dist/kernel/defaults.registry.d.ts +4 -17
- package/dist/kernel/defaults.registry.js +4 -19
- package/dist/kernel/routes/agent/markdown.d.ts +7 -0
- package/dist/kernel/routes/agent/markdown.js +229 -54
- 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 -2
- package/dist/kernel/routes/metadata/feed.js +119 -88
- package/dist/kernel/routes/metadata/llms.d.ts +3 -23
- package/dist/kernel/routes/metadata/llms.js +2 -103
- package/dist/kernel/routes/metadata/og-image.js +1 -1
- package/dist/kernel/routes/metadata/robots.d.ts +5 -3
- package/dist/kernel/routes/metadata/robots.js +4 -25
- package/dist/kernel/routes/metadata/sitemap.d.ts +36 -3
- package/dist/kernel/routes/metadata/sitemap.js +277 -49
- 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 +5 -5
- package/dist/kernel/routes/pages/group.js +11 -5
- package/dist/kernel/routes/pages/leaf.d.ts +38 -6
- package/dist/kernel/routes/pages/leaf.js +21 -12
- package/dist/kernel/routes/pages/root.d.ts +5 -5
- package/dist/kernel/routes/pages/root.js +21 -6
- package/dist/keyboard-shortcuts.d.ts +2 -2
- package/dist/keyboard-shortcuts.js +1 -1
- package/dist/manifest-types-CcVPH_jh.d.ts +83 -0
- package/dist/resolvers/manifest-resolver.d.ts +2 -2
- package/dist/resolvers/manifest-resolver.js +65 -35
- package/dist/route-metadata-og-image-BeKKFHg7.d.ts +58 -0
- package/dist/search.d.ts +2 -9
- package/dist/search.js +9 -16
- package/dist/sidebar-types-CMrMM0Nj.d.ts +105 -0
- package/dist/theme-scope.d.ts +2 -2
- package/dist/theme-scope.js +1 -1
- package/dist/types-BbqmOzLC.d.ts +168 -0
- package/dist/types-TjH1ek0X.d.ts +22 -0
- package/dist/types-sM2g9nW0.d.ts +12 -0
- package/dist/types.d.ts +117 -91
- 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-EN2GW4FR.js +16 -0
- package/dist/validate-publish-os-source-OEWQDB7B.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 +85 -0
- package/init/seed/minimal/publish.os/blog/layout.tsx +13 -0
- package/init/seed/minimal/publish.os/blog/page.tsx +91 -0
- package/init/seed/minimal/publish.os/components/blog/copy-link.tsx +64 -0
- package/init/seed/minimal/publish.os/components/blog/frontmatter.ts +41 -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 +17 -2
- package/init/seed/minimal/publish.os/theme.css +3 -3
- package/init/seed/minimal/seed.json +12 -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 +48 -23
- package/release/app/phosphor/package.json +4 -4
- package/release/app/phosphor/pnpm-lock.yaml.template +123 -184
- package/release/compiler/package.json +5 -3
- package/release/compiler/pnpm-lock.yaml.template +153 -183
- 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/sidebar-types-DKpR27II.d.ts +0 -25
- package/dist/types-BzkZty3r.d.ts +0 -147
- package/dist/types-CJWRG05y.d.ts +0 -76
- package/dist/types-CUtrppxt.d.ts +0 -69
- 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
|
@@ -2,9 +2,11 @@ import {
|
|
|
2
2
|
runtimePackageVersion
|
|
3
3
|
} from "./chunk-AI2UULNX.js";
|
|
4
4
|
import {
|
|
5
|
-
AppError,
|
|
6
5
|
readInstalledFrameworkLocation
|
|
7
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5J3YUNRY.js";
|
|
7
|
+
import {
|
|
8
|
+
AppError
|
|
9
|
+
} from "./chunk-22RSSUNV.js";
|
|
8
10
|
|
|
9
11
|
// src/lib/compiler/release/framework-selection.ts
|
|
10
12
|
import { createHash } from "crypto";
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
validatePublishOsSource
|
|
3
|
-
} from "./chunk-726GV2NF.js";
|
|
4
1
|
import {
|
|
5
2
|
assertFrameworkSelection
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NNBJZPFM.js";
|
|
4
|
+
import {
|
|
5
|
+
validatePublishOsSource
|
|
6
|
+
} from "./chunk-DZ3VWEV5.js";
|
|
7
7
|
import {
|
|
8
|
-
AppError,
|
|
9
8
|
readInstalledFramework
|
|
10
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5J3YUNRY.js";
|
|
10
|
+
import {
|
|
11
|
+
AppError
|
|
12
|
+
} from "./chunk-22RSSUNV.js";
|
|
11
13
|
|
|
12
14
|
// src/lib/compiler/lifecycle/validate-local-source.ts
|
|
13
15
|
async function validateLocalSource({
|
|
@@ -18,7 +20,8 @@ async function validateLocalSource({
|
|
|
18
20
|
options.signal?.throwIfAborted(), options.onEvent?.({ type: "progress", message: "Validating source" });
|
|
19
21
|
let validation = await validatePublishOsSource({
|
|
20
22
|
publishOsDir: sourceDir,
|
|
21
|
-
sourceIdentity: { sourceRoot }
|
|
23
|
+
sourceIdentity: { sourceRoot },
|
|
24
|
+
includeDrafts: options.request.operation === "dev"
|
|
22
25
|
});
|
|
23
26
|
if (options.signal?.throwIfAborted(), options.onEvent?.({
|
|
24
27
|
type: "diagnostics",
|
|
@@ -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";
|
|
@@ -26,7 +29,7 @@ function serveCompilerIpc(options) {
|
|
|
26
29
|
finished = !0, dispose();
|
|
27
30
|
let terminal = protocolFailure ?? result;
|
|
28
31
|
process.exitCode = disconnected || terminal.status === "failure" ? 1 : terminal.status === "cancelled" ? cancellationExitCode : 0, !(!process.connected || !process.send) && process.send(terminal, (error) => {
|
|
29
|
-
error && (process.exitCode = 1), process.connected && process.disconnect();
|
|
32
|
+
error && (process.exitCode = 1), process.connected && process.disconnect?.();
|
|
30
33
|
});
|
|
31
34
|
}, cancel = (reason, exitCode = 130) => {
|
|
32
35
|
if (!(finished || controller.signal.aborted)) {
|
|
@@ -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,72 @@ 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 total = 0, errors = 0, retained = [], finished = !1, priority = (diagnostic) => diagnostic.severity === "error" ? 2 : diagnostic.code === "CONTENT_STATUS_INVALID" ? 1 : 0, send = (diagnostics) => {
|
|
138
|
+
diagnostics.length !== 0 && onEvent?.({ type: "diagnostics", diagnostics: { diagnostics } });
|
|
139
|
+
};
|
|
140
|
+
return {
|
|
141
|
+
emit(event) {
|
|
142
|
+
if (!finished) {
|
|
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
|
+
for (let diagnostic of event.diagnostics.diagnostics) {
|
|
152
|
+
total += 1, diagnostic.severity === "error" && (errors += 1);
|
|
153
|
+
let item = boundedDiagnostic(diagnostic);
|
|
154
|
+
if (retained.length < 100)
|
|
155
|
+
retained.push(item);
|
|
156
|
+
else {
|
|
157
|
+
let lowest = retained.findIndex(
|
|
158
|
+
(existing) => priority(existing) < priority(item)
|
|
159
|
+
);
|
|
160
|
+
lowest !== -1 && retained.splice(lowest, 1, item);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
finish() {
|
|
166
|
+
if (finished) return;
|
|
167
|
+
finished = !0, retained.sort((a, b) => priority(b) - priority(a));
|
|
168
|
+
let selected = retained.slice(
|
|
169
|
+
0,
|
|
170
|
+
total > 100 ? 99 : 100
|
|
171
|
+
);
|
|
172
|
+
send(selected);
|
|
173
|
+
let omitted = total - selected.length, omittedErrors = errors - selected.filter((item) => item.severity === "error").length;
|
|
174
|
+
omitted > 0 && send([
|
|
175
|
+
{
|
|
176
|
+
code: "FRAMEWORK_DIAGNOSTICS_TRUNCATED",
|
|
177
|
+
severity: omittedErrors > 0 ? "error" : "warning",
|
|
178
|
+
message: `${omitted} additional diagnostics were omitted (${omittedErrors} ${omittedErrors === 1 ? "error" : "errors"}).`,
|
|
179
|
+
correction: "Run the build locally to see all diagnostics."
|
|
180
|
+
}
|
|
181
|
+
]);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
117
186
|
// src/compiler.ts
|
|
118
187
|
function failure(error) {
|
|
119
188
|
return { error, status: "failure", type: "result" };
|
|
@@ -149,6 +218,16 @@ async function approveComposition(options) {
|
|
|
149
218
|
});
|
|
150
219
|
}
|
|
151
220
|
async function runFramework(options) {
|
|
221
|
+
if (options.request?.operation === "dev" || options.request?.operation === "build")
|
|
222
|
+
return runFrameworkOperation(options);
|
|
223
|
+
let budget = createDiagnosticBudget(options.onEvent);
|
|
224
|
+
try {
|
|
225
|
+
return await runFrameworkOperation({ ...options, onEvent: budget.emit });
|
|
226
|
+
} finally {
|
|
227
|
+
budget.finish();
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
async function runFrameworkOperation(options) {
|
|
152
231
|
if (options.request?.protocol !== 1)
|
|
153
232
|
return failure({
|
|
154
233
|
code: "FRAMEWORK_PROTOCOL_UNSUPPORTED",
|
|
@@ -169,17 +248,18 @@ async function runFramework(options) {
|
|
|
169
248
|
});
|
|
170
249
|
try {
|
|
171
250
|
if (options.signal?.throwIfAborted(), options.request.operation === "build") {
|
|
172
|
-
let { runLocalBuild } = await import("./build-operation-
|
|
251
|
+
let { runLocalBuild } = await import("./build-operation-CJDUL4OW.js");
|
|
173
252
|
return await runLocalBuild(options);
|
|
174
253
|
}
|
|
175
254
|
if (options.request.operation === "dev") {
|
|
176
|
-
let { runDevelopment } = await import("./dev-operation-
|
|
255
|
+
let { runDevelopment } = await import("./dev-operation-WNECBHZ5.js");
|
|
177
256
|
return await runDevelopment(options);
|
|
178
257
|
}
|
|
179
258
|
options.onEvent?.({ message: "Validating source", type: "progress" });
|
|
180
|
-
let { validatePublishOsSource } = await import("./validate-publish-os-source-
|
|
259
|
+
let { validatePublishOsSource } = await import("./validate-publish-os-source-OEWQDB7B.js"), validation = await validatePublishOsSource({
|
|
181
260
|
publishOsDir: options.request.paths.source,
|
|
182
|
-
sourceIdentity: options.request.paths.originalSource ? { sourceRoot: options.request.paths.originalSource } : void 0
|
|
261
|
+
sourceIdentity: options.request.paths.originalSource ? { sourceRoot: options.request.paths.originalSource } : void 0,
|
|
262
|
+
includeDrafts: options.request.operation === "compose" && !!options.request.context?.previewUrl && !options.request.context?.hostedSite
|
|
183
263
|
});
|
|
184
264
|
if (options.signal?.throwIfAborted(), options.onEvent?.({
|
|
185
265
|
type: "diagnostics",
|
|
@@ -194,19 +274,19 @@ async function runFramework(options) {
|
|
|
194
274
|
fix: "Correct the reported source errors, then run the command again.",
|
|
195
275
|
message: "The selected source failed validation."
|
|
196
276
|
});
|
|
197
|
-
let framework = await readInstalledFramework(), { assertFrameworkSelection } = await import("./framework-selection-
|
|
277
|
+
let framework = await readInstalledFramework(), { assertFrameworkSelection } = await import("./framework-selection-ZVO323PK.js");
|
|
198
278
|
if (await assertFrameworkSelection({
|
|
199
279
|
context: options.request.context,
|
|
200
280
|
framework,
|
|
201
281
|
runtime: validation.source.config.runtime
|
|
202
282
|
}), options.request.operation === "validate" && options.request.context?.ide) {
|
|
203
|
-
let { prepareIdeSupport } = await import("./ide-support-
|
|
283
|
+
let source = validation.source, { prepareIdeSupport } = await import("./ide-support-TG74L4FF.js");
|
|
204
284
|
await prepareIdeSupport({
|
|
285
|
+
frameworkOptions: options,
|
|
205
286
|
publishOsDir: options.request.paths.source,
|
|
206
|
-
finalPublishOsDir: options.request.context
|
|
207
|
-
source
|
|
208
|
-
framework
|
|
209
|
-
frameworkOptions: options
|
|
287
|
+
finalPublishOsDir: options.request.context?.ide?.finalSourceRoot,
|
|
288
|
+
source,
|
|
289
|
+
framework
|
|
210
290
|
});
|
|
211
291
|
}
|
|
212
292
|
if (options.request.operation === "compose") {
|
|
@@ -223,16 +303,23 @@ async function runFramework(options) {
|
|
|
223
303
|
message: "The caller did not authorize composition."
|
|
224
304
|
});
|
|
225
305
|
options.signal?.throwIfAborted();
|
|
226
|
-
let { composeFrameworkSource } = await import("./compose-
|
|
306
|
+
let { composeFrameworkSource } = await import("./compose-44GJSMXD.js");
|
|
227
307
|
await composeFrameworkSource({
|
|
228
308
|
request: options.request,
|
|
229
309
|
source: validation.source,
|
|
230
310
|
signal: options.signal,
|
|
231
311
|
onProgress: (message) => options.onEvent?.({ message, type: "progress" }),
|
|
232
|
-
onWarning: ({ code, message }) => options.onEvent?.({
|
|
312
|
+
onWarning: ({ code, message, file }) => options.onEvent?.({
|
|
233
313
|
type: "diagnostics",
|
|
234
314
|
diagnostics: {
|
|
235
|
-
diagnostics: [
|
|
315
|
+
diagnostics: [
|
|
316
|
+
{
|
|
317
|
+
code,
|
|
318
|
+
message,
|
|
319
|
+
severity: "warning",
|
|
320
|
+
...file ? { file } : {}
|
|
321
|
+
}
|
|
322
|
+
]
|
|
236
323
|
}
|
|
237
324
|
})
|
|
238
325
|
});
|
|
@@ -255,7 +342,8 @@ async function runFramework(options) {
|
|
|
255
342
|
}), failure({
|
|
256
343
|
code: error.code,
|
|
257
344
|
fix: error instanceof AppError && error.fix ? error.fix : frameworkRecovery(error.code),
|
|
258
|
-
message: error.message
|
|
345
|
+
message: error.message,
|
|
346
|
+
...error instanceof AppError && error.code === "FRAMEWORK_LOCAL_OUTPUT_REDIRECTED" && error.details ? { details: error.details } : {}
|
|
259
347
|
})) : failure({
|
|
260
348
|
code: "FRAMEWORK_EXECUTION_FAILED",
|
|
261
349
|
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 from 'react';
|
|
2
|
+
import { ReactNode, ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
import { ButtonVariantProps } from '../../kernel/components/ui/button.js';
|
|
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.Element;
|
|
54
|
+
declare function AgentActionsMarkdownLink(): ReactNode;
|
|
55
|
+
declare function AgentActionsPrimaryAction({ action }: {
|
|
56
|
+
action?: AgentActionConfig;
|
|
57
|
+
}): ReactNode;
|
|
58
|
+
declare function AgentActionsFeedback(): react.JSX.Element;
|
|
59
|
+
declare function AgentActionsGroup({ title, children, }: {
|
|
60
|
+
title?: string;
|
|
61
|
+
children: ReactNode;
|
|
62
|
+
}): react.JSX.Element;
|
|
63
|
+
declare function AgentActionsItem({ action }: {
|
|
64
|
+
action: AgentActionConfig;
|
|
65
|
+
}): ReactNode;
|
|
66
|
+
declare function AgentActionsMenu({ children }: {
|
|
67
|
+
children?: ReactNode;
|
|
68
|
+
}): react.JSX.Element;
|
|
69
|
+
declare function AgentActionsRoot(props: AgentActionsProps): react.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 };
|