@publish.os/nextjs 0.0.1-alpha.81 → 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/app/globals.css +1 -0
- package/compiler-assets/nextjs/defaults/group/index.tsx +50 -0
- package/compiler-assets/nextjs/defaults/group/layout.tsx +8 -8
- package/compiler-assets/nextjs/defaults/group/page.tsx +44 -43
- package/compiler-assets/nextjs/defaults/project/next.config.mjs +33 -13
- package/compiler-assets/nextjs/defaults/project/tsconfig.json.template +10 -3
- package/compiler-assets/nextjs/defaults/root/css/animation.css +131 -0
- package/compiler-assets/nextjs/defaults/root/css/components/code-block.css +18 -0
- package/compiler-assets/nextjs/defaults/root/css/components/dialog.css +4 -1
- package/compiler-assets/nextjs/defaults/root/css/components/menu.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/components/navigation-menu.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/components/popover.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/components/select.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/components/tooltip.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/shadow.css +6 -25
- package/compiler-assets/nextjs/defaults/root/css/typography.css +51 -68
- package/compiler-assets/nextjs/defaults/root/globals.css +25 -0
- package/compiler-assets/nextjs/defaults/root/{page.tsx → index.tsx} +6 -2
- package/compiler-assets/nextjs/defaults/root/layout.tsx +7 -1
- package/compiler-assets/nextjs/defaults/root/theme.css +22 -22
- package/compiler-assets/nextjs/shims/document.tsx +38 -0
- package/compiler-assets/nextjs/shims/generated-group-page.tsx +19 -2
- package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +18 -2
- package/compiler-assets/nextjs/shims/global-layout.tsx +19 -85
- 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 +143 -65
- package/compiler-assets/nextjs/shims/publish-os-theme-provider.tsx +76 -15
- package/compiler-assets/nextjs/shims/root-page.tsx +7 -1
- package/compiler-assets/nextjs/shims/site-fenced-code-block.tsx +30 -0
- package/compiler-assets/nextjs/shims/site-heading-level.tsx +14 -0
- package/compiler-assets/nextjs/shims/site-mdx-components.tsx +112 -0
- package/compiler-assets/nextjs/shims/site-mdx.tsx +17 -0
- package/compiler-assets/nextjs/shims/theme-defaults.css +41 -25
- package/dist/build-operation-5QMLXF7N.js +89 -0
- package/dist/{button-CFdx-ohV.d.ts → button-BdCScEKi.d.ts} +6 -6
- package/dist/capture-local-source-WGGDIUU2.js +258 -0
- package/dist/chunk-22RSSUNV.js +13 -0
- package/dist/chunk-4BC2L2KA.js +620 -0
- package/dist/chunk-5J3YUNRY.js +121 -0
- package/dist/chunk-5KAD7W53.js +248 -0
- package/dist/chunk-6C65KV7O.js +142 -0
- package/dist/chunk-6D2E6UMD.js +695 -0
- package/dist/chunk-7NY22B5U.js +161 -0
- package/dist/chunk-AI2UULNX.js +9 -0
- package/dist/chunk-EFO6AWXN.js +19 -0
- package/dist/chunk-F3AGNDF4.js +2377 -0
- package/dist/chunk-GBPLER5H.js +426 -0
- package/dist/chunk-IL4RJOKI.js +186 -0
- package/dist/chunk-NNBJZPFM.js +193 -0
- package/dist/chunk-ORIUWJBQ.js +58 -0
- package/dist/chunk-OXOFRXEI.js +7129 -0
- package/dist/chunk-UYGCOWRF.js +1709 -0
- package/dist/chunk-WL75GQ5M.js +80 -0
- package/dist/compiler.d.ts +54 -7
- package/dist/compiler.js +121 -13147
- 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 +27 -0
- package/dist/dev-operation-OSHHWRWK.js +1095 -0
- package/dist/framework-selection-ZVO323PK.js +11 -0
- package/dist/ide-support-CU6Z5PVR.js +16 -0
- package/dist/index.d.ts +55 -4
- 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 +401 -150
- 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 +3 -3
- package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +10 -2
- package/dist/kernel/components/blocks/nav-breadcrumb.js +22 -7
- package/dist/kernel/components/blocks/navbar.d.ts +2 -2
- package/dist/kernel/components/blocks/navbar.js +406 -65
- package/dist/kernel/components/blocks/navigation-progress.js +6 -3
- package/dist/kernel/components/blocks/next-prev.d.ts +1 -1
- package/dist/kernel/components/blocks/next-prev.js +12 -24
- package/dist/kernel/components/blocks/page-list.d.ts +1 -1
- package/dist/kernel/components/blocks/page-list.js +7 -6
- package/dist/kernel/components/blocks/search.d.ts +83 -58
- package/dist/kernel/components/blocks/search.js +554 -428
- package/dist/kernel/components/blocks/sidebar-node.d.ts +2 -2
- package/dist/kernel/components/blocks/sidebar-node.js +12 -10
- package/dist/kernel/components/blocks/sidebar.d.ts +3 -3
- package/dist/kernel/components/blocks/sidebar.js +24 -14
- package/dist/kernel/components/blocks/theme-toggle.d.ts +2 -2
- package/dist/kernel/components/blocks/theme-toggle.js +47 -1
- 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 +122 -180
- package/dist/kernel/components/mdx/components/blockquote.js +2 -2
- package/dist/kernel/components/mdx/components/callout.d.ts +5 -7
- package/dist/kernel/components/mdx/components/callout.js +67 -36
- package/dist/kernel/components/mdx/components/code-block.d.ts +5 -2
- package/dist/kernel/components/mdx/components/code-block.js +106 -5
- package/dist/kernel/components/mdx/components/copy-code-button.d.ts +8 -0
- package/dist/kernel/components/mdx/components/copy-code-button.js +61 -0
- package/dist/kernel/components/mdx/components/figure-caption.d.ts +1 -1
- package/dist/kernel/components/mdx/components/figure-caption.js +4 -3
- package/dist/kernel/components/mdx/components/figure.d.ts +6 -2
- package/dist/kernel/components/mdx/components/figure.js +24 -14
- package/dist/kernel/components/mdx/components/footnotes.js +1 -1
- package/dist/kernel/components/mdx/components/heading-copy-link.js +4 -4
- 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 +2 -2
- package/dist/kernel/components/mdx/components/image.d.ts +1 -1
- package/dist/kernel/components/mdx/components/image.js +94 -68
- package/dist/kernel/components/mdx/components/inline-code.js +2 -2
- package/dist/kernel/components/mdx/components/kbd.d.ts +2 -2
- package/dist/kernel/components/mdx/components/kbd.js +5 -4
- package/dist/kernel/components/mdx/components/link.d.ts +35 -4
- package/dist/kernel/components/mdx/components/link.js +3 -3
- package/dist/kernel/components/mdx/components/paragraph.js +2 -5
- 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 +2 -2
- package/dist/kernel/components/mdx/components/video-player.d.ts +6 -2
- package/dist/kernel/components/mdx/components/video-player.js +8 -4
- package/dist/kernel/components/mdx/components/video.d.ts +5 -3
- package/dist/kernel/components/mdx/components/video.js +8 -6
- 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 +28 -14
- package/dist/kernel/components/mdx/mdx.js +336 -63
- package/dist/kernel/components/mdx/rehype-heading-ids.d.ts +1 -0
- package/dist/kernel/components/mdx/rehype-heading-ids.js +6 -4
- 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 +6 -23
- package/dist/kernel/components/ui/breadcrumb-trail.js +2 -2
- package/dist/kernel/components/ui/breadcrumb.d.ts +11 -3
- package/dist/kernel/components/ui/breadcrumb.js +10 -8
- package/dist/kernel/components/ui/button-group.js +8 -7
- package/dist/kernel/components/ui/button.d.ts +58 -6
- package/dist/kernel/components/ui/button.js +43 -39
- package/dist/kernel/components/ui/card.d.ts +2 -2
- package/dist/kernel/components/ui/card.js +1 -1
- package/dist/kernel/components/ui/dialog.js +1 -1
- package/dist/kernel/components/ui/drawer.d.ts +3 -1
- package/dist/kernel/components/ui/drawer.js +6 -2
- 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.js +10 -17
- package/dist/kernel/components/ui/link.d.ts +11 -3
- package/dist/kernel/components/ui/link.js +12 -11
- package/dist/kernel/components/ui/menu.js +6 -6
- package/dist/kernel/components/ui/mod-key.d.ts +10 -0
- package/dist/kernel/components/ui/mod-key.js +36 -0
- package/dist/kernel/components/ui/navigation-menu.js +3 -3
- package/dist/kernel/components/ui/popover.js +1 -1
- package/dist/kernel/components/ui/progress.js +2 -2
- package/dist/kernel/components/ui/scroll-area.js +5 -5
- package/dist/kernel/components/ui/select.js +8 -11
- 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 +2 -2
- 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 +11 -24
- package/dist/kernel/defaults.registry.js +11 -26
- package/dist/kernel/routes/agent/markdown.d.ts +3 -1
- 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 +111 -81
- package/dist/kernel/routes/metadata/llms.d.ts +12 -3
- package/dist/kernel/routes/metadata/llms.js +156 -59
- 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/robots.js +2 -2
- package/dist/kernel/routes/metadata/sitemap.d.ts +26 -4
- package/dist/kernel/routes/metadata/sitemap.js +206 -38
- 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 +21 -13
- package/dist/kernel/routes/pages/leaf.d.ts +28 -1
- package/dist/kernel/routes/pages/leaf.js +25 -16
- package/dist/kernel/routes/pages/root.js +19 -13
- package/dist/keyboard-shortcuts.js +1 -1
- package/dist/resolvers/manifest-resolver.js +29 -6
- package/dist/search.d.ts +6 -7
- package/dist/search.js +52 -29
- package/dist/{sidebar-types-Bgchdfd6.d.ts → sidebar-types-DKpR27II.d.ts} +1 -1
- package/dist/theme-scope.js +1 -1
- package/dist/{types-DHBm7-j6.d.ts → types-CJWRG05y.d.ts} +20 -1
- package/dist/{types-B_b3C0U6.d.ts → types-CUtrppxt.d.ts} +8 -2
- package/dist/{types-CIwwieNw.d.ts → types-J2w_puPF.d.ts} +11 -10
- package/dist/types.d.ts +15 -6
- 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/.gitignore +1 -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 +6 -11
- package/init/seed/minimal/publish.os/docs/content/groups.mdx +6 -7
- package/init/seed/minimal/publish.os/docs/content/{theme.mdx → themes.mdx} +14 -12
- package/init/seed/minimal/publish.os/publish.os.config.json +7 -7
- package/init/seed/minimal/publish.os/theme.css +52 -24
- package/init/seed/minimal/publish.os/tsconfig.json +3 -0
- package/init/seed/minimal/seed.json +12 -2
- package/init/seed/scratch/publish.os/docs/content/get-started.mdx +6 -0
- package/init/seed/scratch/publish.os/publish.os.config.json +4 -0
- package/init/seed/scratch/seed.json +5 -0
- package/package.json +55 -44
- package/release/app/phosphor/package.json +5 -5
- package/release/app/phosphor/pnpm-lock.yaml.template +553 -377
- package/release/app/phosphor/pnpm-workspace.yaml +3 -0
- package/release/compiler/package.json +5 -3
- package/release/compiler/pnpm-lock.yaml.template +500 -303
- package/release/compiler/pnpm-workspace.yaml +3 -0
- package/release/release.json +8 -37
- package/compiler-assets/nextjs/defaults/group/leaf.tsx +0 -48
- package/dist/icons.d.ts +0 -1
- package/dist/icons.js +0 -2
- package/dist/kernel/components/blocks/design-system-preview.d.ts +0 -61
- package/dist/kernel/components/blocks/design-system-preview.js +0 -648
- 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/mdx/components/pre.d.ts +0 -6
- package/dist/kernel/components/mdx/components/pre.js +0 -18
- package/dist/kernel/components/ui/meta-key.d.ts +0 -17
- package/dist/kernel/components/ui/meta-key.js +0 -9
- package/dist/kernel/components/ui/theme-toggle.d.ts +0 -24
- package/dist/kernel/components/ui/theme-toggle.js +0 -58
- package/dist/kernel/framework-icons.d.ts +0 -1
- package/dist/kernel/framework-icons.js +0 -39
- package/dist/link-CYaCRDb6.d.ts +0 -35
- package/release/app/lucide/package.json +0 -30
- package/release/app/lucide/pnpm-lock.yaml.template +0 -2905
- package/release/app/lucide/pnpm-workspace.yaml +0 -11
- package/release/app/tabler/package.json +0 -30
- package/release/app/tabler/pnpm-lock.yaml.template +0 -2911
- package/release/app/tabler/pnpm-workspace.yaml +0 -11
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AppError
|
|
3
|
+
} from "./chunk-22RSSUNV.js";
|
|
4
|
+
|
|
5
|
+
// src/lib/compiler/release/installed-framework.ts
|
|
6
|
+
import { readFileSync } from "fs";
|
|
7
|
+
import { readFile } from "fs/promises";
|
|
8
|
+
import { dirname, join } from "path";
|
|
9
|
+
import { fileURLToPath } from "url";
|
|
10
|
+
var frameworkPackageName = "@publish.os/nextjs", exactVersion = /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-[0-9A-Za-z]+(?:\.[0-9A-Za-z]+)*)?(?:\+[0-9A-Za-z]+(?:\.[0-9A-Za-z]+)*)?$/u, sha256Digest = /^[a-f0-9]{64}$/u;
|
|
11
|
+
function record(value) {
|
|
12
|
+
if (!value || typeof value != "object" || Array.isArray(value))
|
|
13
|
+
throw new AppError({
|
|
14
|
+
code: "FRAMEWORK_RELEASE_INVALID",
|
|
15
|
+
message: "The installed framework release metadata is invalid."
|
|
16
|
+
});
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
function version(value) {
|
|
20
|
+
if (typeof value != "string" || !exactVersion.test(value))
|
|
21
|
+
throw new AppError({
|
|
22
|
+
code: "FRAMEWORK_RELEASE_INVALID",
|
|
23
|
+
message: "The installed framework release version is not exact."
|
|
24
|
+
});
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
function graphRecord(value) {
|
|
28
|
+
let graph = record(value), fields = [
|
|
29
|
+
"packageJsonSha256",
|
|
30
|
+
"pnpmWorkspaceSha256",
|
|
31
|
+
"lockfileTemplateSha256"
|
|
32
|
+
];
|
|
33
|
+
for (let field of fields)
|
|
34
|
+
if (typeof graph[field] != "string" || !sha256Digest.test(graph[field]))
|
|
35
|
+
throw new AppError({
|
|
36
|
+
code: "FRAMEWORK_RELEASE_INVALID",
|
|
37
|
+
message: `The installed framework release has an invalid ${field}.`
|
|
38
|
+
});
|
|
39
|
+
return Object.freeze({
|
|
40
|
+
packageJsonSha256: graph.packageJsonSha256,
|
|
41
|
+
pnpmWorkspaceSha256: graph.pnpmWorkspaceSha256,
|
|
42
|
+
lockfileTemplateSha256: graph.lockfileTemplateSha256
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function readInstalledFrameworkLocation() {
|
|
46
|
+
let directory = dirname(fileURLToPath(import.meta.url));
|
|
47
|
+
for (; ; ) {
|
|
48
|
+
try {
|
|
49
|
+
let manifest = record(
|
|
50
|
+
JSON.parse(readFileSync(join(directory, "package.json"), "utf8"))
|
|
51
|
+
);
|
|
52
|
+
if (manifest.name !== frameworkPackageName)
|
|
53
|
+
throw new AppError({
|
|
54
|
+
code: "FRAMEWORK_RELEASE_INVALID",
|
|
55
|
+
message: "The compiler is not inside the selected framework package."
|
|
56
|
+
});
|
|
57
|
+
return { packageRoot: directory, manifest };
|
|
58
|
+
} catch (error) {
|
|
59
|
+
if (error.code !== "ENOENT")
|
|
60
|
+
throw error instanceof AppError ? error : new AppError({
|
|
61
|
+
code: "FRAMEWORK_RELEASE_INVALID",
|
|
62
|
+
message: "The installed framework package metadata is unreadable or invalid."
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
let parent = dirname(directory);
|
|
66
|
+
if (parent === directory)
|
|
67
|
+
throw new AppError({
|
|
68
|
+
code: "FRAMEWORK_RELEASE_INVALID",
|
|
69
|
+
message: "The installed framework package metadata is missing."
|
|
70
|
+
});
|
|
71
|
+
directory = parent;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
async function readInstalledFramework() {
|
|
75
|
+
let { packageRoot, manifest } = readInstalledFrameworkLocation(), installedVersion = version(manifest.version), release;
|
|
76
|
+
try {
|
|
77
|
+
release = record(
|
|
78
|
+
JSON.parse(
|
|
79
|
+
await readFile(join(packageRoot, "release", "release.json"), "utf8")
|
|
80
|
+
)
|
|
81
|
+
);
|
|
82
|
+
} catch {
|
|
83
|
+
throw new AppError({
|
|
84
|
+
code: "FRAMEWORK_RELEASE_INVALID",
|
|
85
|
+
message: "The installed framework release metadata is unreadable or invalid."
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
let node = record(manifest.engines).node;
|
|
89
|
+
if (release.schemaVersion !== 1 || release.runtime !== "nextjs" || release.version !== installedVersion || typeof node != "string" || node.trim().length === 0 || release.node !== node)
|
|
90
|
+
throw new AppError({
|
|
91
|
+
code: "FRAMEWORK_RELEASE_INVALID",
|
|
92
|
+
message: "The installed framework release identity does not match its package."
|
|
93
|
+
});
|
|
94
|
+
let graphRecords = record(release.graphs), graphs = Object.freeze({
|
|
95
|
+
compiler: graphRecord(graphRecords.compiler),
|
|
96
|
+
"app/phosphor": graphRecord(graphRecords["app/phosphor"])
|
|
97
|
+
});
|
|
98
|
+
if ("configurableDependencies" in release)
|
|
99
|
+
throw new AppError({
|
|
100
|
+
code: "FRAMEWORK_RELEASE_INVALID",
|
|
101
|
+
message: "The installed framework still declares configurable icon dependencies."
|
|
102
|
+
});
|
|
103
|
+
return Object.freeze({
|
|
104
|
+
packageName: frameworkPackageName,
|
|
105
|
+
version: installedVersion,
|
|
106
|
+
packageRoot,
|
|
107
|
+
release: Object.freeze({
|
|
108
|
+
schemaVersion: 1,
|
|
109
|
+
runtime: "nextjs",
|
|
110
|
+
version: installedVersion,
|
|
111
|
+
node,
|
|
112
|
+
pnpm: version(release.pnpm),
|
|
113
|
+
graphs
|
|
114
|
+
})
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export {
|
|
119
|
+
readInstalledFrameworkLocation,
|
|
120
|
+
readInstalledFramework
|
|
121
|
+
};
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AppError
|
|
3
|
+
} from "./chunk-22RSSUNV.js";
|
|
4
|
+
|
|
5
|
+
// src/lib/compiler/source/assets/media-file-policy.ts
|
|
6
|
+
import { constants as fsConstants } from "fs";
|
|
7
|
+
import { open } from "fs/promises";
|
|
8
|
+
var DEFAULT_MAX_IMAGE_BYTES = 20 * 1024 * 1024, DEFAULT_MAX_VIDEO_BYTES = 20 * 1024 * 1024, DEFAULT_MAX_OTHER_BYTES = 5 * 1024 * 1024, MAX_THEME_FONT_BYTES = DEFAULT_MAX_OTHER_BYTES, MAX_MEDIA_SVG_BYTES = 256 * 1024, IGNORED_DOCUMENT_EXTENSIONS = /* @__PURE__ */ new Set(["pdf", "txt", "csv", "zip"]), THEME_IMAGE_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
9
|
+
"png",
|
|
10
|
+
"jpg",
|
|
11
|
+
"jpeg",
|
|
12
|
+
"gif",
|
|
13
|
+
"webp",
|
|
14
|
+
"avif",
|
|
15
|
+
"ico",
|
|
16
|
+
"svg"
|
|
17
|
+
]), THEME_FONT_EXTENSIONS = /* @__PURE__ */ new Set(["woff", "woff2", "ttf", "otf"]);
|
|
18
|
+
function ignoredMediaDocumentWarning(relativePath) {
|
|
19
|
+
let extension = relativePath.split(".").at(-1)?.toLowerCase() ?? "";
|
|
20
|
+
if (IGNORED_DOCUMENT_EXTENSIONS.has(extension))
|
|
21
|
+
return {
|
|
22
|
+
code: "FRAMEWORK_MEDIA_DOCUMENT_IGNORED",
|
|
23
|
+
message: `${relativePath} is ignored because this file type is not supported.`,
|
|
24
|
+
details: { file: relativePath, path: relativePath }
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function ignoredMediaPathWarning(sourcePath) {
|
|
28
|
+
return {
|
|
29
|
+
code: "FRAMEWORK_MEDIA_PATH_IGNORED",
|
|
30
|
+
message: "Hidden media file ignored.",
|
|
31
|
+
details: { file: sourcePath, path: sourcePath }
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function isHiddenMediaPath(sourcePath) {
|
|
35
|
+
return sourcePath.split(/[\\/]/u).some((segment) => segment.startsWith("."));
|
|
36
|
+
}
|
|
37
|
+
function mediaFileTooLarge(options) {
|
|
38
|
+
return new AppError({
|
|
39
|
+
code: "FRAMEWORK_MEDIA_FILE_TOO_LARGE",
|
|
40
|
+
message: `${options.relativePath} is ${options.bytes} bytes. Media files must be less than ${Math.round(options.limit / 1024 / 1024)} MB.`,
|
|
41
|
+
details: {
|
|
42
|
+
path: options.relativePath,
|
|
43
|
+
bytes: options.bytes,
|
|
44
|
+
limit: options.limit
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function mediaFileByteLimit(relativePath) {
|
|
49
|
+
let extension = relativePath.split(".").at(-1)?.toLowerCase() ?? "", imageLimit = DEFAULT_MAX_IMAGE_BYTES;
|
|
50
|
+
return ["png", "jpg", "jpeg", "gif", "webp", "avif", "ico"].includes(extension) ? imageLimit : extension === "svg" ? Math.min(imageLimit, MAX_MEDIA_SVG_BYTES) : ["mp4", "webm"].includes(extension) ? DEFAULT_MAX_VIDEO_BYTES : DEFAULT_MAX_OTHER_BYTES;
|
|
51
|
+
}
|
|
52
|
+
function themeResourceByteLimit(relativePath) {
|
|
53
|
+
let extension = relativePath.split(".").at(-1)?.toLowerCase() ?? "";
|
|
54
|
+
if (THEME_FONT_EXTENSIONS.has(extension)) return MAX_THEME_FONT_BYTES;
|
|
55
|
+
if (THEME_IMAGE_EXTENSIONS.has(extension))
|
|
56
|
+
return mediaFileByteLimit(relativePath);
|
|
57
|
+
}
|
|
58
|
+
async function readBoundedMediaFile(options) {
|
|
59
|
+
let handle = await (options.openFile ?? open)(
|
|
60
|
+
options.path,
|
|
61
|
+
fsConstants.O_RDONLY | (fsConstants.O_NOFOLLOW ?? 0) | (fsConstants.O_NONBLOCK ?? 0)
|
|
62
|
+
);
|
|
63
|
+
try {
|
|
64
|
+
let opened = await handle.stat();
|
|
65
|
+
if (!opened.isFile() || options.expectedIdentity !== void 0 && (opened.dev !== options.expectedIdentity.dev || opened.ino !== options.expectedIdentity.ino))
|
|
66
|
+
throw new AppError({
|
|
67
|
+
code: "FRAMEWORK_MEDIA_FILE_CHANGED",
|
|
68
|
+
message: `${options.relativePath} changed while media was being read`,
|
|
69
|
+
details: { path: options.relativePath }
|
|
70
|
+
});
|
|
71
|
+
if (opened.size > options.limit)
|
|
72
|
+
throw mediaFileTooLarge({
|
|
73
|
+
relativePath: options.relativePath,
|
|
74
|
+
bytes: opened.size,
|
|
75
|
+
limit: options.limit
|
|
76
|
+
});
|
|
77
|
+
let chunkSize = Math.min(64 * 1024, options.limit + 1), chunk = Buffer.allocUnsafe(Math.max(1, chunkSize)), chunks = [], bytesRead = 0;
|
|
78
|
+
for (; ; ) {
|
|
79
|
+
options.signal?.throwIfAborted();
|
|
80
|
+
let remainingWithOverflowProbe = options.limit - bytesRead + 1, { bytesRead: count } = await handle.read(
|
|
81
|
+
chunk,
|
|
82
|
+
0,
|
|
83
|
+
Math.min(chunk.length, remainingWithOverflowProbe),
|
|
84
|
+
null
|
|
85
|
+
);
|
|
86
|
+
if (options.signal?.throwIfAborted(), count === 0) break;
|
|
87
|
+
if (bytesRead += count, bytesRead > options.limit)
|
|
88
|
+
throw mediaFileTooLarge({
|
|
89
|
+
relativePath: options.relativePath,
|
|
90
|
+
bytes: bytesRead,
|
|
91
|
+
limit: options.limit
|
|
92
|
+
});
|
|
93
|
+
chunks.push(Buffer.from(chunk.subarray(0, count)));
|
|
94
|
+
}
|
|
95
|
+
let completed = await handle.stat();
|
|
96
|
+
if (completed.size > options.limit)
|
|
97
|
+
throw mediaFileTooLarge({
|
|
98
|
+
relativePath: options.relativePath,
|
|
99
|
+
bytes: completed.size,
|
|
100
|
+
limit: options.limit
|
|
101
|
+
});
|
|
102
|
+
if (completed.size !== bytesRead)
|
|
103
|
+
throw new AppError({
|
|
104
|
+
code: "FRAMEWORK_MEDIA_FILE_CHANGED",
|
|
105
|
+
message: `${options.relativePath} changed while media was being read`,
|
|
106
|
+
details: { path: options.relativePath }
|
|
107
|
+
});
|
|
108
|
+
return Buffer.concat(chunks, bytesRead);
|
|
109
|
+
} finally {
|
|
110
|
+
await handle.close();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// src/lib/compiler/source/css-imports.ts
|
|
115
|
+
function skipString(css, start) {
|
|
116
|
+
let quote = css[start];
|
|
117
|
+
for (let index = start + 1; index < css.length; index += 1)
|
|
118
|
+
if (css[index] === "\\") index += 1;
|
|
119
|
+
else if (css[index] === quote) return index + 1;
|
|
120
|
+
return css.length;
|
|
121
|
+
}
|
|
122
|
+
function maskComments(css) {
|
|
123
|
+
let result = "";
|
|
124
|
+
for (let index = 0; index < css.length; )
|
|
125
|
+
if (css[index] === '"' || css[index] === "'") {
|
|
126
|
+
let end = skipString(css, index);
|
|
127
|
+
result += css.slice(index, end), index = end;
|
|
128
|
+
} else if (css.startsWith("/*", index)) {
|
|
129
|
+
let closing = css.indexOf("*/", index + 2), end = closing < 0 ? css.length : closing + 2;
|
|
130
|
+
result += css.slice(index, end).replace(/[^\r\n]/g, " "), index = end;
|
|
131
|
+
} else
|
|
132
|
+
result += css[index], index += 1;
|
|
133
|
+
return result;
|
|
134
|
+
}
|
|
135
|
+
function decodeCssPath(value) {
|
|
136
|
+
return value.replace(/\\(?:\r\n|[\r\n\f])/g, "").replace(
|
|
137
|
+
/\\([\da-f]{1,6})[\t\n\f\r ]?|\\(.)/gi,
|
|
138
|
+
(_match, hex, escaped) => {
|
|
139
|
+
if (!hex) return escaped ?? "";
|
|
140
|
+
let codePoint = Number.parseInt(hex, 16);
|
|
141
|
+
return codePoint > 0 && codePoint <= 1114111 && !(codePoint >= 55296 && codePoint <= 57343) ? String.fromCodePoint(codePoint) : "\uFFFD";
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
function statementEnd(scan, start) {
|
|
146
|
+
let depth = 0;
|
|
147
|
+
for (let index = start; index < scan.length; index += 1)
|
|
148
|
+
if (scan[index] === '"' || scan[index] === "'")
|
|
149
|
+
index = skipString(scan, index) - 1;
|
|
150
|
+
else if (scan[index] === "\\")
|
|
151
|
+
index += 1;
|
|
152
|
+
else if (scan[index] === "(")
|
|
153
|
+
depth += 1;
|
|
154
|
+
else if (scan[index] === ")")
|
|
155
|
+
depth -= 1;
|
|
156
|
+
else {
|
|
157
|
+
if (scan[index] === ";" && depth === 0)
|
|
158
|
+
return index + 1;
|
|
159
|
+
if ((scan[index] === "{" || scan[index] === "}") && depth === 0)
|
|
160
|
+
return index;
|
|
161
|
+
}
|
|
162
|
+
return scan.length;
|
|
163
|
+
}
|
|
164
|
+
function closingParenthesis(scan, start, end) {
|
|
165
|
+
let depth = 0;
|
|
166
|
+
for (let index = start; index < end; index += 1)
|
|
167
|
+
if (scan[index] === '"' || scan[index] === "'")
|
|
168
|
+
index = skipString(scan, index) - 1;
|
|
169
|
+
else if (scan[index] === "\\")
|
|
170
|
+
index += 1;
|
|
171
|
+
else if (scan[index] === "(")
|
|
172
|
+
depth += 1;
|
|
173
|
+
else if (scan[index] === ")" && --depth === 0)
|
|
174
|
+
return index;
|
|
175
|
+
return end;
|
|
176
|
+
}
|
|
177
|
+
function importConditions({
|
|
178
|
+
css,
|
|
179
|
+
scan,
|
|
180
|
+
start,
|
|
181
|
+
end
|
|
182
|
+
}) {
|
|
183
|
+
let result = {}, tailEnd = scan[end - 1] === ";" ? end - 1 : end, cursor = start, skipWhitespace = () => {
|
|
184
|
+
for (; cursor < tailEnd && /\s/.test(scan[cursor] ?? ""); ) cursor += 1;
|
|
185
|
+
};
|
|
186
|
+
skipWhitespace();
|
|
187
|
+
let layer = /^layer(?=\(|\s|$)/i.exec(scan.slice(cursor, tailEnd));
|
|
188
|
+
if (layer) {
|
|
189
|
+
if (cursor += layer[0].length, scan[cursor] === "(") {
|
|
190
|
+
let closing = closingParenthesis(scan, cursor, tailEnd);
|
|
191
|
+
result.layer = css.slice(cursor + 1, closing).trim(), cursor = closing + 1;
|
|
192
|
+
} else
|
|
193
|
+
result.layer = !0;
|
|
194
|
+
skipWhitespace();
|
|
195
|
+
}
|
|
196
|
+
let supports = /^supports\(/i.exec(scan.slice(cursor, tailEnd));
|
|
197
|
+
if (supports) {
|
|
198
|
+
let opening = cursor + supports[0].length - 1, closing = closingParenthesis(scan, opening, tailEnd);
|
|
199
|
+
result.supports = css.slice(opening + 1, closing).trim(), cursor = closing + 1, skipWhitespace();
|
|
200
|
+
}
|
|
201
|
+
return scan.slice(cursor, tailEnd).trim() && (result.media = css.slice(cursor, tailEnd).trim()), result;
|
|
202
|
+
}
|
|
203
|
+
function cssImports({ css }) {
|
|
204
|
+
let scan = maskComments(css), pattern = /@import\s+(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^\s)]+))\s*\))/giy, imports = [];
|
|
205
|
+
for (let index = 0; index < scan.length; ) {
|
|
206
|
+
if (scan[index] === '"' || scan[index] === "'") {
|
|
207
|
+
index = skipString(scan, index);
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
if (scan[index] === "\\") {
|
|
211
|
+
index += 2;
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
pattern.lastIndex = index;
|
|
215
|
+
let match = scan[index] === "@" ? pattern.exec(scan) : null;
|
|
216
|
+
if (!match) {
|
|
217
|
+
index += 1;
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
let path = decodeCssPath(
|
|
221
|
+
match.slice(1).find((value) => value !== void 0) ?? ""
|
|
222
|
+
), end = statementEnd(scan, pattern.lastIndex);
|
|
223
|
+
imports.push({
|
|
224
|
+
path,
|
|
225
|
+
start: index,
|
|
226
|
+
end,
|
|
227
|
+
...importConditions({ css, scan, start: pattern.lastIndex, end })
|
|
228
|
+
}), index = end;
|
|
229
|
+
}
|
|
230
|
+
return imports;
|
|
231
|
+
}
|
|
232
|
+
function localCssImports({ css }) {
|
|
233
|
+
return cssImports({ css }).filter(({ path }) => path.startsWith("."));
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export {
|
|
237
|
+
MAX_MEDIA_SVG_BYTES,
|
|
238
|
+
ignoredMediaDocumentWarning,
|
|
239
|
+
ignoredMediaPathWarning,
|
|
240
|
+
isHiddenMediaPath,
|
|
241
|
+
mediaFileTooLarge,
|
|
242
|
+
mediaFileByteLimit,
|
|
243
|
+
themeResourceByteLimit,
|
|
244
|
+
readBoundedMediaFile,
|
|
245
|
+
decodeCssPath,
|
|
246
|
+
cssImports,
|
|
247
|
+
localCssImports
|
|
248
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import {
|
|
2
|
+
acquireOperationLock,
|
|
3
|
+
assertLocalDirectory,
|
|
4
|
+
assertOperationOutput,
|
|
5
|
+
markOperationOutput
|
|
6
|
+
} from "./chunk-6D2E6UMD.js";
|
|
7
|
+
import {
|
|
8
|
+
AppError
|
|
9
|
+
} from "./chunk-22RSSUNV.js";
|
|
10
|
+
|
|
11
|
+
// src/lib/compiler/lifecycle/checkout-preparation.ts
|
|
12
|
+
import { lstat, mkdir, readdir, realpath } from "fs/promises";
|
|
13
|
+
import { isAbsolute, join } from "path";
|
|
14
|
+
import { setTimeout } from "timers/promises";
|
|
15
|
+
async function withCheckoutPreparation({
|
|
16
|
+
packageRoot,
|
|
17
|
+
workspaceRoot,
|
|
18
|
+
signal,
|
|
19
|
+
prepare
|
|
20
|
+
}) {
|
|
21
|
+
signal?.throwIfAborted();
|
|
22
|
+
let selectedRoot = workspaceRoot ?? packageRoot;
|
|
23
|
+
if (!isAbsolute(selectedRoot))
|
|
24
|
+
throw new AppError({
|
|
25
|
+
code: "FRAMEWORK_LOCAL_SOURCE_INVALID",
|
|
26
|
+
message: "Checkout preparation requires an absolute checkout path."
|
|
27
|
+
});
|
|
28
|
+
let sourceRoot = await realpath(selectedRoot), sourceIdentity = await assertLocalDirectory(sourceRoot), outputRoot = join(sourceRoot, ".publish.os");
|
|
29
|
+
await mkdir(outputRoot).catch((error) => {
|
|
30
|
+
if (error.code !== "EEXIST") throw error;
|
|
31
|
+
});
|
|
32
|
+
let rootIdentity = await assertLocalDirectory(outputRoot), outputDir = join(outputRoot, "checkout-dependencies"), output = { sourceRoot, outputDir, operation: "dependencies" }, created = !1;
|
|
33
|
+
await mkdir(outputDir).then(() => {
|
|
34
|
+
created = !0;
|
|
35
|
+
}).catch((error) => {
|
|
36
|
+
if (error.code !== "EEXIST") throw error;
|
|
37
|
+
});
|
|
38
|
+
let identity = await assertLocalDirectory(outputDir);
|
|
39
|
+
if (created) {
|
|
40
|
+
if ((await readdir(outputDir)).length !== 0)
|
|
41
|
+
throw new AppError({
|
|
42
|
+
code: "FRAMEWORK_LOCAL_OUTPUT_OWNERSHIP",
|
|
43
|
+
message: `Checkout preparation metadata changed at ${outputDir}. Preserve it and inspect the owner before retrying.`
|
|
44
|
+
});
|
|
45
|
+
await markOperationOutput(output);
|
|
46
|
+
} else
|
|
47
|
+
for (let attempt = 0; ; attempt += 1) {
|
|
48
|
+
signal?.throwIfAborted(), await assertLocalDirectory(sourceRoot, sourceIdentity), await assertLocalDirectory(outputRoot, rootIdentity), await assertLocalDirectory(outputDir, identity);
|
|
49
|
+
let entries = await readdir(outputDir), published = entries.includes(".operation-owner.json");
|
|
50
|
+
published && await assertOperationOutput(output);
|
|
51
|
+
let temporary = entries.filter(
|
|
52
|
+
(name) => /^\.operation-owner-init-[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}\.tmp$/u.test(
|
|
53
|
+
name
|
|
54
|
+
)
|
|
55
|
+
);
|
|
56
|
+
if (entries.some(
|
|
57
|
+
(name) => !temporary.includes(name) && name !== ".operation-owner.json" && !(published && name === ".locks")
|
|
58
|
+
))
|
|
59
|
+
throw new AppError({
|
|
60
|
+
code: "FRAMEWORK_LOCAL_OUTPUT_OWNERSHIP",
|
|
61
|
+
message: `Checkout preparation initialization cannot be verified at ${outputDir}. Preserve its files and inspect the owner before retrying.`
|
|
62
|
+
});
|
|
63
|
+
for (let name of temporary) {
|
|
64
|
+
let entry = await lstat(join(outputDir, name)).catch(
|
|
65
|
+
(error) => {
|
|
66
|
+
if (error.code !== "ENOENT") throw error;
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
if (entry && !entry.isFile())
|
|
70
|
+
throw new AppError({
|
|
71
|
+
code: "FRAMEWORK_LOCAL_OUTPUT_OWNERSHIP",
|
|
72
|
+
message: `Checkout preparation initialization is redirected at ${join(outputDir, name)}. Preserve the marker and restore its owner before retrying.`
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
if (published && temporary.length === 0) break;
|
|
76
|
+
if (attempt >= 50)
|
|
77
|
+
throw new AppError({
|
|
78
|
+
code: "FRAMEWORK_LOCAL_OUTPUT_OWNERSHIP",
|
|
79
|
+
message: `Checkout preparation initialization did not finish at ${outputDir}. Preserve its metadata and verify the initializer stopped before retrying.`
|
|
80
|
+
});
|
|
81
|
+
await setTimeout(10, void 0, { signal });
|
|
82
|
+
}
|
|
83
|
+
let assertCurrent = async () => {
|
|
84
|
+
if (await assertLocalDirectory(sourceRoot, sourceIdentity), await assertLocalDirectory(outputRoot, rootIdentity), await assertLocalDirectory(outputDir, identity), await assertOperationOutput(output), (await readdir(outputDir)).some(
|
|
85
|
+
(name) => name !== ".operation-owner.json" && name !== ".locks"
|
|
86
|
+
))
|
|
87
|
+
throw new AppError({
|
|
88
|
+
code: "FRAMEWORK_LOCAL_LOCK_UNVERIFIED",
|
|
89
|
+
message: `Checkout preparation contains unknown files at ${outputDir}. Preserve them and inspect the owner before retrying.`
|
|
90
|
+
});
|
|
91
|
+
}, deadline = Date.now() + 36e4, release;
|
|
92
|
+
for (; ; ) {
|
|
93
|
+
signal?.throwIfAborted(), await assertCurrent();
|
|
94
|
+
try {
|
|
95
|
+
release = await acquireOperationLock({
|
|
96
|
+
sourceRoot,
|
|
97
|
+
outputRoot: outputDir,
|
|
98
|
+
operation: "dependencies",
|
|
99
|
+
signal
|
|
100
|
+
});
|
|
101
|
+
break;
|
|
102
|
+
} catch (error) {
|
|
103
|
+
if (!(error instanceof AppError) || error.code !== "FRAMEWORK_LOCAL_OPERATION_ACTIVE" || Date.now() >= deadline)
|
|
104
|
+
throw error;
|
|
105
|
+
await setTimeout(100, void 0, { signal });
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
let stopped = !0, failed = !1, failure, result;
|
|
109
|
+
try {
|
|
110
|
+
await assertCurrent(), signal?.throwIfAborted(), stopped = !1, result = await prepare(() => {
|
|
111
|
+
stopped = !0;
|
|
112
|
+
});
|
|
113
|
+
} catch (error) {
|
|
114
|
+
failed = !0, failure = error;
|
|
115
|
+
}
|
|
116
|
+
try {
|
|
117
|
+
await assertCurrent(), await release({ shutdownUnverified: !stopped });
|
|
118
|
+
} catch (error) {
|
|
119
|
+
if (!failed) throw error;
|
|
120
|
+
failure instanceof Error && (failure.cause = new AppError({
|
|
121
|
+
code: "FRAMEWORK_LOCAL_LOCK_UNVERIFIED",
|
|
122
|
+
message: `Checkout dependency lock retention failed at ${outputDir}. Preserve the metadata and verify the recorded preparer's descendants before recovery.`,
|
|
123
|
+
details: {
|
|
124
|
+
lockPath: join(outputDir, ".locks/dependencies"),
|
|
125
|
+
cause: error,
|
|
126
|
+
primaryCause: failure.cause
|
|
127
|
+
}
|
|
128
|
+
}));
|
|
129
|
+
}
|
|
130
|
+
if (failed) throw failure;
|
|
131
|
+
if (!stopped)
|
|
132
|
+
throw new AppError({
|
|
133
|
+
code: "FRAMEWORK_PROCESS_SHUTDOWN_FAILED",
|
|
134
|
+
message: `Checkout dependency preparation at ${sourceRoot} did not prove shutdown. Its lock remains protected.`,
|
|
135
|
+
fix: "Verify the recorded preparer's descendants stopped before recovering its retained lock."
|
|
136
|
+
});
|
|
137
|
+
return result;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export {
|
|
141
|
+
withCheckoutPreparation
|
|
142
|
+
};
|