blume 2.0.1 → 2.0.3
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/CHANGELOG.md +147 -0
- package/dist/cli/{chunk-qwsrynx5.js → chunk-1d7ve1dm.js} +38 -19
- package/dist/cli/{chunk-qwsrynx5.js.map → chunk-1d7ve1dm.js.map} +4 -4
- package/dist/cli/{chunk-s6jhgk0q.js → chunk-2eytanqx.js} +2 -2
- package/dist/cli/{chunk-kdp5q7ke.js → chunk-2hsdwb9n.js} +18 -19
- package/dist/cli/{chunk-kdp5q7ke.js.map → chunk-2hsdwb9n.js.map} +2 -2
- package/dist/cli/{chunk-hdpx1tax.js → chunk-2z928egk.js} +5 -5
- package/dist/cli/{chunk-jwyddg7y.js → chunk-35d4wj9f.js} +30 -24
- package/dist/cli/chunk-35d4wj9f.js.map +15 -0
- package/dist/cli/{chunk-ah61y8py.js → chunk-364znk6q.js} +2 -2
- package/dist/cli/{chunk-jts8mvcz.js → chunk-3em5wd2y.js} +25 -6
- package/dist/cli/{chunk-jts8mvcz.js.map → chunk-3em5wd2y.js.map} +3 -3
- package/dist/cli/{chunk-s1p84fyh.js → chunk-5f86nr5m.js} +63 -22
- package/dist/cli/chunk-5f86nr5m.js.map +11 -0
- package/dist/cli/{chunk-2hn4b8z7.js → chunk-5m5nmvyq.js} +170 -76
- package/dist/cli/chunk-5m5nmvyq.js.map +13 -0
- package/dist/cli/{chunk-epjnccmv.js → chunk-5xvm6tfj.js} +18 -15
- package/dist/cli/chunk-5xvm6tfj.js.map +10 -0
- package/dist/cli/{chunk-fz5wtpmh.js → chunk-6dsbexzp.js} +18 -15
- package/dist/cli/chunk-6dsbexzp.js.map +10 -0
- package/dist/cli/{chunk-vtk4a6dg.js → chunk-8ktnccpt.js} +1 -1
- package/dist/cli/{chunk-6hsn950k.js → chunk-9t7a85s3.js} +178 -48
- package/dist/cli/chunk-9t7a85s3.js.map +10 -0
- package/dist/cli/{chunk-fxypxtvm.js → chunk-a58773jm.js} +2 -2
- package/dist/cli/{chunk-mb2919y2.js → chunk-acanzt5p.js} +17 -6
- package/dist/cli/chunk-acanzt5p.js.map +10 -0
- package/dist/cli/{chunk-27g6wdth.js → chunk-akbpwfxc.js} +90 -26
- package/dist/cli/chunk-akbpwfxc.js.map +10 -0
- package/dist/cli/{chunk-wm7js3j9.js → chunk-b07cmahc.js} +2 -2
- package/dist/cli/{chunk-wgm7m9qk.js → chunk-c8chx29p.js} +179 -51
- package/dist/cli/chunk-c8chx29p.js.map +36 -0
- package/dist/cli/{chunk-qs4q5p4e.js → chunk-crgn1q09.js} +32 -14
- package/dist/cli/chunk-crgn1q09.js.map +10 -0
- package/dist/cli/chunk-e04dxsz1.js +39 -0
- package/dist/cli/chunk-e04dxsz1.js.map +10 -0
- package/dist/cli/{chunk-yt5n7ppj.js → chunk-ey84smr6.js} +17 -7
- package/dist/cli/chunk-ey84smr6.js.map +10 -0
- package/dist/cli/{chunk-f2z5v128.js → chunk-g4hq16wv.js} +14 -15
- package/dist/cli/{chunk-f2z5v128.js.map → chunk-g4hq16wv.js.map} +2 -2
- package/dist/cli/{chunk-fa25z98p.js → chunk-ga0pf4aj.js} +9 -8
- package/dist/cli/chunk-ga0pf4aj.js.map +11 -0
- package/dist/cli/{chunk-kpf8rrjc.js → chunk-hm3vjy5s.js} +109 -58
- package/dist/cli/chunk-hm3vjy5s.js.map +19 -0
- package/dist/cli/{chunk-fs23ddbb.js → chunk-j85vccga.js} +625 -750
- package/dist/cli/chunk-j85vccga.js.map +36 -0
- package/dist/cli/{chunk-ch6g3ar0.js → chunk-p3v96n38.js} +6 -6
- package/dist/cli/{chunk-ch6g3ar0.js.map → chunk-p3v96n38.js.map} +3 -3
- package/dist/cli/{chunk-q5163e60.js → chunk-p73c0m7w.js} +21 -19
- package/dist/cli/chunk-p73c0m7w.js.map +11 -0
- package/dist/cli/{chunk-dh8cwk36.js → chunk-pehfxfta.js} +24 -9
- package/dist/cli/chunk-pehfxfta.js.map +10 -0
- package/dist/cli/{chunk-qkqwkpte.js → chunk-pv29h0wf.js} +3688 -1313
- package/dist/cli/chunk-pv29h0wf.js.map +190 -0
- package/dist/cli/{chunk-6vm74dry.js → chunk-q58y5e6a.js} +10 -10
- package/dist/cli/{chunk-6vm74dry.js.map → chunk-q58y5e6a.js.map} +3 -3
- package/dist/cli/{chunk-zxcczpyx.js → chunk-r20tn01b.js} +1 -1
- package/dist/cli/{chunk-m3vmjgmq.js → chunk-r9rcc4w7.js} +16 -8
- package/dist/cli/chunk-r9rcc4w7.js.map +10 -0
- package/dist/cli/{chunk-5shv93fd.js → chunk-tkacnehg.js} +2 -2
- package/dist/cli/{chunk-zxh4d9vy.js → chunk-tzmab476.js} +4 -4
- package/dist/cli/{chunk-yw7dm696.js → chunk-vg9r4eb9.js} +24 -11
- package/dist/cli/chunk-vg9r4eb9.js.map +14 -0
- package/dist/cli/{chunk-79jhk4py.js → chunk-wrr3j9w9.js} +260 -132
- package/dist/cli/chunk-wrr3j9w9.js.map +35 -0
- package/dist/cli/{chunk-6crbhc3x.js → chunk-yfyb25rh.js} +54 -27
- package/dist/cli/chunk-yfyb25rh.js.map +14 -0
- package/dist/cli/index.js +162 -35
- package/dist/cli/index.js.map +4 -4
- package/dist/types/ai/agent-surface.d.ts +32 -0
- package/dist/types/ai/api-catalog.d.ts +7 -1
- package/dist/types/ai/ask-context.d.ts +7 -0
- package/dist/types/ai/component-markdown.d.ts +4 -4
- package/dist/types/ai/link-headers.d.ts +8 -1
- package/dist/types/ai/openapi-components.d.ts +5 -2
- package/dist/types/ai/relative-links.d.ts +11 -4
- package/dist/types/ai/skills.d.ts +4 -1
- package/dist/types/ai/static-expression.d.ts +28 -0
- package/dist/types/ai/tar.d.ts +1 -3
- package/dist/types/analytics/databuddy.d.ts +43 -0
- package/dist/types/analytics/index.d.ts +4 -0
- package/dist/types/analytics/one-dollar-stats.d.ts +48 -0
- package/dist/types/analytics/schema.d.ts +28 -0
- package/dist/types/astro/integration.d.ts +3 -2
- package/dist/types/cli/env.d.ts +5 -0
- package/dist/types/cli/init/scaffold.d.ts +19 -3
- package/dist/types/cli/init/starter-spec.d.ts +11 -0
- package/dist/types/core/base-path.d.ts +24 -1
- package/dist/types/core/config-input.d.ts +13 -11
- package/dist/types/core/config.d.ts +2 -2
- package/dist/types/core/directive-diagnostics.d.ts +12 -0
- package/dist/types/core/graph.d.ts +2 -0
- package/dist/types/core/heading-markers.d.ts +5 -7
- package/dist/types/core/i18n-ui.d.ts +31 -0
- package/dist/types/core/i18n.d.ts +9 -1
- package/dist/types/core/last-modified.d.ts +10 -0
- package/dist/types/core/links.d.ts +3 -1
- package/dist/types/core/load-module.d.ts +10 -0
- package/dist/types/core/locale-links.d.ts +12 -2
- package/dist/types/core/meta.d.ts +13 -1
- package/dist/types/core/nav-diagnostics.d.ts +10 -0
- package/dist/types/core/navigation.d.ts +38 -0
- package/dist/types/core/ordering-prefix.d.ts +4 -0
- package/dist/types/core/safe-links.d.ts +3 -1
- package/dist/types/core/schema.d.ts +59 -13
- package/dist/types/core/sources/github-releases.d.ts +5 -0
- package/dist/types/core/sources/lower.d.ts +38 -13
- package/dist/types/core/sources/normalize.d.ts +23 -2
- package/dist/types/core/sources/remote.d.ts +11 -1
- package/dist/types/core/sources/resolve.d.ts +12 -0
- package/dist/types/core/sources/types.d.ts +31 -0
- package/dist/types/core/sources/watch.d.ts +12 -5
- package/dist/types/core/standard-schema.d.ts +5 -0
- package/dist/types/core/types.d.ts +9 -0
- package/dist/types/deploy/adapters/node.d.ts +5 -2
- package/dist/types/deploy/adapters/types.d.ts +7 -0
- package/dist/types/deploy/artifacts.d.ts +6 -4
- package/dist/types/deploy/cloudflare-negotiation.d.ts +3 -2
- package/dist/types/deploy/headers.d.ts +36 -7
- package/dist/types/deploy/node-headers.d.ts +43 -8
- package/dist/types/deploy/platforms/netlify.d.ts +27 -2
- package/dist/types/deploy/platforms/node.d.ts +6 -5
- package/dist/types/deploy/platforms/types.d.ts +15 -0
- package/dist/types/deploy/platforms/vercel.d.ts +3 -2
- package/dist/types/deploy/redirects.d.ts +31 -15
- package/dist/types/deploy/vercel-negotiation.d.ts +3 -2
- package/dist/types/markdown/directives.d.ts +62 -0
- package/dist/types/markdown/features.d.ts +21 -0
- package/dist/types/markdown/mdast.d.ts +63 -0
- package/dist/types/openapi/asyncapi.d.ts +4 -2
- package/dist/types/openapi/model.d.ts +20 -6
- package/dist/types/search/sync/algolia.d.ts +3 -1
- package/docs/01-quickstart.mdx +3 -2
- package/docs/02-deployment.mdx +20 -9
- package/docs/08-faq.mdx +10 -3
- package/docs/advanced/changelog.mdx +1 -1
- package/docs/advanced/custom-pages.mdx +7 -5
- package/docs/cli/audit.mdx +19 -3
- package/docs/cli/doctor.mdx +2 -2
- package/docs/cli/evals.mdx +4 -4
- package/docs/cli/index.mdx +4 -1
- package/docs/cli/translate.mdx +4 -4
- package/docs/cli/version.mdx +1 -1
- package/docs/configuration/analytics.mdx +42 -2
- package/docs/configuration/assistant.mdx +1 -1
- package/docs/configuration/customization.mdx +6 -3
- package/docs/configuration/index.mdx +5 -3
- package/docs/configuration/search.mdx +2 -2
- package/docs/content/components.mdx +2 -2
- package/docs/content/frontmatter.mdx +5 -1
- package/docs/content/i18n.mdx +3 -1
- package/docs/content/index.mdx +8 -4
- package/docs/content/islands.mdx +1 -1
- package/docs/content/meta.mdx +7 -3
- package/docs/content/navigation.mdx +29 -4
- package/docs/content/sources.mdx +18 -16
- package/docs/content/syntax.mdx +14 -0
- package/docs/content/versioning.mdx +2 -1
- package/docs/discoverability/agent-discovery.mdx +22 -8
- package/docs/discoverability/index.mdx +4 -3
- package/docs/discoverability/llms-txt.mdx +2 -5
- package/docs/discoverability/markdown.mdx +6 -4
- package/docs/discoverability/mcp.mdx +4 -0
- package/docs/discoverability/metadata.mdx +3 -2
- package/docs/discoverability/open-graph.mdx +8 -4
- package/docs/discoverability/rss.mdx +4 -2
- package/docs/references/asyncapi.mdx +2 -2
- package/docs/references/graphql.mdx +2 -2
- package/docs/references/openapi.mdx +6 -4
- package/package.json +1 -1
- package/skills/blume-migrate/SKILL.md +6 -6
- package/skills/blume-migrate/references/docusaurus.md +6 -6
- package/skills/blume-migrate/references/fumadocs.md +1 -1
- package/skills/blume-migrate/references/mintlify.md +3 -3
- package/skills/blume-migrate/references/monorepo.md +1 -1
- package/skills/blume-migrate/references/nextra.md +2 -2
- package/skills/blume-migrate/references/starlight.md +5 -5
- package/skills/blume-migrate/scripts/mintlify-codemod.mjs +9 -4
- package/skills/blume-update-docs/references/audit-checklist.md +1 -1
- package/src/ai/agent-readability.ts +2 -2
- package/src/ai/agent-surface.ts +56 -0
- package/src/ai/ai-catalog.ts +6 -2
- package/src/ai/api/handlers.ts +2 -2
- package/src/ai/api/spec.ts +17 -4
- package/src/ai/api-catalog.ts +13 -3
- package/src/ai/ask-context.ts +14 -2
- package/src/ai/ask-data.ts +26 -12
- package/src/ai/changelog-markdown.ts +2 -2
- package/src/ai/component-markdown.ts +43 -37
- package/src/ai/link-headers.ts +22 -8
- package/src/ai/llms.ts +22 -10
- package/src/ai/markdown.ts +23 -11
- package/src/ai/mcp/discovery.ts +2 -2
- package/src/ai/mcp/query.ts +2 -2
- package/src/ai/mcp/server.ts +80 -9
- package/src/ai/openapi-components.ts +22 -6
- package/src/ai/relative-links.ts +99 -15
- package/src/ai/serializers.ts +2 -1
- package/src/ai/skills.ts +14 -1
- package/src/ai/static-expression.ts +416 -0
- package/src/ai/tar.ts +139 -12
- package/src/ai/visibility.ts +45 -14
- package/src/analytics/databuddy.ts +67 -0
- package/src/analytics/head.ts +8 -0
- package/src/analytics/index.ts +7 -0
- package/src/analytics/one-dollar-stats.ts +86 -0
- package/src/analytics/posthog.ts +21 -3
- package/src/analytics/schema.ts +4 -0
- package/src/astro/generate.ts +72 -28
- package/src/astro/include-hmr.ts +31 -12
- package/src/astro/include-refresh.ts +19 -8
- package/src/astro/integration.ts +108 -14
- package/src/astro/runtime-modules.ts +28 -13
- package/src/astro/templates.ts +139 -57
- package/src/audit/catalog.ts +2 -2
- package/src/audit/checks/assets.ts +25 -5
- package/src/audit/checks/content.ts +20 -2
- package/src/audit/checks/i18n.ts +46 -8
- package/src/audit/checks/indexability.ts +39 -19
- package/src/audit/checks/links.ts +22 -1
- package/src/audit/checks/llms.ts +6 -3
- package/src/audit/checks/network.ts +3 -1
- package/src/audit/checks/og-image.ts +10 -0
- package/src/audit/checks/robots.ts +6 -1
- package/src/audit/checks/sitemap.ts +56 -31
- package/src/audit/checks/social.ts +21 -2
- package/src/audit/crawl.ts +88 -15
- package/src/audit/graph.ts +3 -1
- package/src/audit/report.ts +54 -17
- package/src/audit/run.ts +13 -9
- package/src/audit/snapshot.ts +5 -0
- package/src/audit/types.ts +18 -0
- package/src/audit/url.ts +37 -6
- package/src/cli/args.ts +32 -0
- package/src/cli/build-failure.ts +50 -0
- package/src/cli/commands/audit.ts +11 -1
- package/src/cli/commands/build.ts +19 -5
- package/src/cli/commands/check.ts +2 -0
- package/src/cli/commands/doctor.ts +3 -1
- package/src/cli/commands/eval.ts +20 -18
- package/src/cli/commands/init.ts +15 -5
- package/src/cli/commands/preview.ts +15 -0
- package/src/cli/commands/sync.ts +2 -0
- package/src/cli/commands/translate.ts +18 -18
- package/src/cli/commands/upgrade.ts +11 -0
- package/src/cli/commands/validate.ts +3 -1
- package/src/cli/dev-lock.ts +157 -37
- package/src/cli/eject-scripts.ts +32 -7
- package/src/cli/env.ts +12 -1
- package/src/cli/init/scaffold.ts +117 -11
- package/src/cli/init/starter-spec.ts +235 -0
- package/src/cli/report-format.ts +11 -6
- package/src/components/colors.ts +19 -0
- package/src/components/content/AccordionItem.astro +26 -22
- package/src/components/content/Badge.astro +7 -12
- package/src/components/content/Card.astro +2 -2
- package/src/components/content/Component.astro +11 -5
- package/src/components/content/Expandable.astro +5 -1
- package/src/components/content/Frame.astro +2 -7
- package/src/components/content/GithubInfo.astro +12 -2
- package/src/components/content/Prompt.astro +2 -7
- package/src/components/content/Tab.astro +0 -1
- package/src/components/content/Tabs.astro +58 -5
- package/src/components/content/Tile.astro +1 -1
- package/src/components/content/Tooltip.astro +69 -7
- package/src/components/content/Tree.astro +7 -2
- package/src/components/content/TypeTable.astro +10 -5
- package/src/components/content/Update.astro +8 -2
- package/src/components/content/auto-type-table.ts +4 -1
- package/src/components/content/badge-color.ts +20 -0
- package/src/components/content/base-href.ts +14 -22
- package/src/components/content/inline-markdown.ts +27 -7
- package/src/components/copy-feedback.ts +35 -8
- package/src/components/islands/assistant.tsx +37 -6
- package/src/components/islands/base-path.ts +47 -10
- package/src/components/islands/hooks.ts +42 -21
- package/src/components/islands/webmcp.ts +16 -10
- package/src/components/layout/Banner.astro +23 -4
- package/src/components/layout/Breadcrumbs.astro +5 -2
- package/src/components/layout/DiscoveryLinks.astro +9 -5
- package/src/components/layout/Header.astro +23 -10
- package/src/components/layout/LanguageSwitcher.astro +2 -2
- package/src/components/layout/Logo.astro +5 -0
- package/src/components/layout/NavSelector.astro +8 -3
- package/src/components/layout/NavTabMenu.astro +133 -0
- package/src/components/layout/NavTree.astro +31 -12
- package/src/components/layout/NavTreeCache.astro +5 -2
- package/src/components/layout/NavTreeScript.astro +45 -5
- package/src/components/layout/PageActions.astro +4 -3
- package/src/components/layout/PageLayout.astro +28 -13
- package/src/components/layout/Pagination.astro +3 -3
- package/src/components/layout/ReferenceLayout.astro +4 -1
- package/src/components/layout/RootLayout.astro +25 -12
- package/src/components/layout/Search.astro +38 -14
- package/src/components/layout/VersionBanner.astro +2 -2
- package/src/components/layout/analytics-client.ts +14 -0
- package/src/components/layout/toc-active.ts +41 -0
- package/src/components/layout/toc-element.ts +8 -14
- package/src/components/openapi/ApiTagOperations.astro +2 -2
- package/src/components/openapi/AsyncApiOperation.astro +7 -4
- package/src/components/openapi/GraphqlChip.astro +2 -2
- package/src/components/openapi/GraphqlType.astro +11 -3
- package/src/components/openapi/MessageComposer.astro +1 -1
- package/src/components/openapi/Operation.astro +23 -5
- package/src/components/openapi/PanelTabs.astro +4 -1
- package/src/components/openapi/Playground.astro +8 -2
- package/src/components/openapi/RequestPanel.astro +13 -6
- package/src/components/openapi/SchemaProperty.astro +11 -33
- package/src/components/openapi/SchemaTable.astro +34 -52
- package/src/components/openapi/async.ts +38 -6
- package/src/components/openapi/helpers.ts +100 -12
- package/src/components/openapi/message-composer.ts +14 -1
- package/src/components/openapi/message-model.ts +12 -2
- package/src/components/openapi/message.ts +21 -3
- package/src/components/openapi/operation-model.ts +119 -17
- package/src/components/openapi/panel.ts +31 -5
- package/src/components/openapi/param-style.ts +181 -0
- package/src/components/openapi/playground-client.ts +110 -23
- package/src/components/openapi/playground-schema.ts +25 -6
- package/src/components/openapi/request.ts +192 -26
- package/src/components/openapi/schema-tree.ts +209 -0
- package/src/components/openapi/snippets.ts +113 -19
- package/src/components/openapi/validate-json.ts +1 -1
- package/src/components/openapi/ws-client.ts +18 -2
- package/src/core/base-path.ts +69 -8
- package/src/core/config-input.ts +13 -11
- package/src/core/config.ts +18 -4
- package/src/core/diagnostics.ts +219 -30
- package/src/core/directive-diagnostics.ts +99 -0
- package/src/core/frontmatter.ts +21 -18
- package/src/core/graph.ts +120 -11
- package/src/core/heading-markers.ts +5 -18
- package/src/core/i18n-ui.ts +39 -2
- package/src/core/i18n.ts +44 -5
- package/src/core/last-modified.ts +25 -3
- package/src/core/links.ts +7 -4
- package/src/core/load-module.ts +20 -0
- package/src/core/locale-links.ts +22 -18
- package/src/core/manifest.ts +3 -2
- package/src/core/meta.ts +89 -12
- package/src/core/nav-diagnostics.ts +56 -1
- package/src/core/navigation.ts +272 -83
- package/src/core/ordering-prefix.ts +27 -0
- package/src/core/project-graph.ts +50 -6
- package/src/core/safe-href.ts +53 -1
- package/src/core/safe-links.ts +11 -2
- package/src/core/schema.ts +94 -18
- package/src/core/sources/assets.ts +83 -41
- package/src/core/sources/contentful-rich-text.ts +28 -20
- package/src/core/sources/contentful.ts +25 -12
- package/src/core/sources/filesystem.ts +25 -3
- package/src/core/sources/github-releases.ts +131 -11
- package/src/core/sources/lexical.ts +30 -20
- package/src/core/sources/lower.ts +276 -56
- package/src/core/sources/mdx-remote.ts +52 -16
- package/src/core/sources/normalize.ts +456 -119
- package/src/core/sources/notion.ts +77 -34
- package/src/core/sources/obsidian.ts +40 -9
- package/src/core/sources/payload.ts +1 -0
- package/src/core/sources/portable-text.ts +85 -49
- package/src/core/sources/remote.ts +18 -2
- package/src/core/sources/resolve.ts +52 -33
- package/src/core/sources/sanity.ts +1 -0
- package/src/core/sources/strapi-blocks.ts +28 -19
- package/src/core/sources/strapi.ts +1 -0
- package/src/core/sources/types.ts +31 -0
- package/src/core/sources/watch.ts +20 -7
- package/src/core/standard-schema.ts +10 -6
- package/src/core/types.ts +9 -0
- package/src/core/ui-packs/ar.ts +13 -0
- package/src/core/ui-packs/bg.ts +13 -0
- package/src/core/ui-packs/bn.ts +13 -0
- package/src/core/ui-packs/ca.ts +13 -0
- package/src/core/ui-packs/cs.ts +13 -0
- package/src/core/ui-packs/da.ts +13 -0
- package/src/core/ui-packs/de.ts +13 -0
- package/src/core/ui-packs/el.ts +13 -0
- package/src/core/ui-packs/es.ts +13 -0
- package/src/core/ui-packs/fa.ts +13 -0
- package/src/core/ui-packs/fi.ts +13 -0
- package/src/core/ui-packs/fr.ts +13 -0
- package/src/core/ui-packs/he.ts +13 -0
- package/src/core/ui-packs/hi.ts +13 -0
- package/src/core/ui-packs/hr.ts +13 -0
- package/src/core/ui-packs/hu.ts +13 -0
- package/src/core/ui-packs/id.ts +13 -0
- package/src/core/ui-packs/it.ts +13 -0
- package/src/core/ui-packs/ja.ts +13 -0
- package/src/core/ui-packs/ko.ts +13 -0
- package/src/core/ui-packs/nl.ts +13 -0
- package/src/core/ui-packs/no.ts +13 -0
- package/src/core/ui-packs/pl.ts +13 -0
- package/src/core/ui-packs/pt-br.ts +13 -0
- package/src/core/ui-packs/pt.ts +13 -0
- package/src/core/ui-packs/ro.ts +13 -0
- package/src/core/ui-packs/ru.ts +13 -0
- package/src/core/ui-packs/sk.ts +13 -0
- package/src/core/ui-packs/sr.ts +13 -0
- package/src/core/ui-packs/sv.ts +13 -0
- package/src/core/ui-packs/th.ts +13 -0
- package/src/core/ui-packs/tr.ts +13 -0
- package/src/core/ui-packs/uk.ts +13 -0
- package/src/core/ui-packs/vi.ts +13 -0
- package/src/core/ui-packs/zh-tw.ts +13 -0
- package/src/core/ui-packs/zh.ts +13 -0
- package/src/core/version-cut.ts +69 -17
- package/src/core/versions.ts +4 -1
- package/src/deploy/adapters/node.ts +5 -2
- package/src/deploy/adapters/registry.ts +2 -1
- package/src/deploy/adapters/types.ts +13 -1
- package/src/deploy/artifacts.ts +52 -11
- package/src/deploy/cloudflare-negotiation.ts +27 -16
- package/src/deploy/headers.ts +75 -55
- package/src/deploy/node-headers.ts +148 -27
- package/src/deploy/platforms/cloudflare.ts +13 -3
- package/src/deploy/platforms/netlify.ts +83 -5
- package/src/deploy/platforms/node.ts +8 -5
- package/src/deploy/platforms/static.ts +2 -0
- package/src/deploy/platforms/types.ts +15 -0
- package/src/deploy/platforms/vercel.ts +10 -3
- package/src/deploy/redirects.ts +68 -21
- package/src/deploy/robots.ts +2 -2
- package/src/deploy/rss.ts +4 -3
- package/src/deploy/sitemap.ts +7 -5
- package/src/deploy/vercel-negotiation.ts +35 -3
- package/src/eval/agents.ts +10 -2
- package/src/eval/run.ts +25 -0
- package/src/markdown/base-links.ts +74 -29
- package/src/markdown/directives.ts +242 -36
- package/src/markdown/features.ts +17 -0
- package/src/markdown/index.ts +13 -9
- package/src/markdown/mdast.ts +5 -2
- package/src/markdown/relative-links.ts +15 -27
- package/src/markdown/route-snapshot.ts +37 -0
- package/src/og/card.ts +149 -9
- package/src/og/derive.ts +156 -5
- package/src/og/index.ts +1 -0
- package/src/openapi/asyncapi.ts +4 -2
- package/src/openapi/graphql-build.ts +28 -2
- package/src/openapi/model.ts +99 -27
- package/src/openapi/proxy.ts +63 -10
- package/src/openapi/render-mdx.ts +51 -3
- package/src/registry/eject.ts +297 -43
- package/src/search/adapters/version-scope.ts +30 -0
- package/src/search/documents.ts +89 -27
- package/src/search/popular.ts +2 -1
- package/src/search/sync/algolia.ts +36 -2
- package/src/seo/jsonld.ts +7 -3
- package/src/sources/registry.ts +5 -0
- package/src/theme/entry.ts +11 -4
- package/src/translate/agents.ts +6 -1
- package/src/translate/ledger.ts +26 -3
- package/src/translate/meta.ts +76 -24
- package/src/translate/run.ts +14 -8
- package/src/translate/validate.ts +14 -2
- package/src/translate/work-list.ts +91 -19
- package/src/upgrade/upgrade.ts +36 -4
- package/dist/cli/chunk-27g6wdth.js.map +0 -10
- package/dist/cli/chunk-2hn4b8z7.js.map +0 -12
- package/dist/cli/chunk-6crbhc3x.js.map +0 -14
- package/dist/cli/chunk-6hsn950k.js.map +0 -10
- package/dist/cli/chunk-79jhk4py.js.map +0 -35
- package/dist/cli/chunk-82bbrxdn.js +0 -51
- package/dist/cli/chunk-82bbrxdn.js.map +0 -10
- package/dist/cli/chunk-abh8yjkn.js +0 -31
- package/dist/cli/chunk-abh8yjkn.js.map +0 -10
- package/dist/cli/chunk-ce574jw2.js +0 -23
- package/dist/cli/chunk-ce574jw2.js.map +0 -10
- package/dist/cli/chunk-dh8cwk36.js.map +0 -10
- package/dist/cli/chunk-epjnccmv.js.map +0 -10
- package/dist/cli/chunk-fa25z98p.js.map +0 -11
- package/dist/cli/chunk-fs23ddbb.js.map +0 -35
- package/dist/cli/chunk-fz5wtpmh.js.map +0 -10
- package/dist/cli/chunk-jwyddg7y.js.map +0 -15
- package/dist/cli/chunk-kpf8rrjc.js.map +0 -19
- package/dist/cli/chunk-m3vmjgmq.js.map +0 -10
- package/dist/cli/chunk-mb2919y2.js.map +0 -10
- package/dist/cli/chunk-q5163e60.js.map +0 -11
- package/dist/cli/chunk-qkqwkpte.js.map +0 -182
- package/dist/cli/chunk-qs4q5p4e.js.map +0 -10
- package/dist/cli/chunk-s1p84fyh.js.map +0 -10
- package/dist/cli/chunk-wgm7m9qk.js.map +0 -36
- package/dist/cli/chunk-yt5n7ppj.js.map +0 -10
- package/dist/cli/chunk-yw7dm696.js.map +0 -14
- /package/dist/cli/{chunk-s6jhgk0q.js.map → chunk-2eytanqx.js.map} +0 -0
- /package/dist/cli/{chunk-hdpx1tax.js.map → chunk-2z928egk.js.map} +0 -0
- /package/dist/cli/{chunk-ah61y8py.js.map → chunk-364znk6q.js.map} +0 -0
- /package/dist/cli/{chunk-vtk4a6dg.js.map → chunk-8ktnccpt.js.map} +0 -0
- /package/dist/cli/{chunk-fxypxtvm.js.map → chunk-a58773jm.js.map} +0 -0
- /package/dist/cli/{chunk-wm7js3j9.js.map → chunk-b07cmahc.js.map} +0 -0
- /package/dist/cli/{chunk-zxcczpyx.js.map → chunk-r20tn01b.js.map} +0 -0
- /package/dist/cli/{chunk-5shv93fd.js.map → chunk-tkacnehg.js.map} +0 -0
- /package/dist/cli/{chunk-zxh4d9vy.js.map → chunk-tzmab476.js.map} +0 -0
|
@@ -5,36 +5,40 @@ import {
|
|
|
5
5
|
BlumeError,
|
|
6
6
|
countBySeverity,
|
|
7
7
|
logger,
|
|
8
|
-
flushStdout,
|
|
9
8
|
reportDiagnostics
|
|
10
9
|
} from "./index.js";
|
|
11
10
|
import {
|
|
12
11
|
AGENTS
|
|
13
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-1d7ve1dm.js";
|
|
14
13
|
import {
|
|
15
|
-
frontmatter_default,
|
|
16
14
|
i18nEnabled,
|
|
17
15
|
localeCodes,
|
|
18
16
|
localeTargetPath,
|
|
17
|
+
frontmatter_default,
|
|
19
18
|
folderMetaSchema,
|
|
20
19
|
scanBody,
|
|
21
20
|
createModuleLoader
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import"./chunk-jts8mvcz.js";
|
|
24
|
-
import {
|
|
25
|
-
scanProject
|
|
26
|
-
} from "./chunk-fs23ddbb.js";
|
|
21
|
+
} from "./chunk-pv29h0wf.js";
|
|
27
22
|
import {
|
|
28
23
|
seconds,
|
|
29
24
|
money,
|
|
30
25
|
duration,
|
|
31
26
|
DISALLOWED_TOOLS,
|
|
32
27
|
runAgentHeadless,
|
|
28
|
+
CODEX_LOCKDOWN,
|
|
33
29
|
readAgentOutput
|
|
34
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-ga0pf4aj.js";
|
|
35
31
|
import {
|
|
36
32
|
writeTextAtomic
|
|
37
33
|
} from "./chunk-jq5n4avg.js";
|
|
34
|
+
import {
|
|
35
|
+
findFolderMetaFiles,
|
|
36
|
+
scanProject
|
|
37
|
+
} from "./chunk-j85vccga.js";
|
|
38
|
+
import"./chunk-3em5wd2y.js";
|
|
39
|
+
import {
|
|
40
|
+
parseTimeoutSeconds
|
|
41
|
+
} from "./chunk-e04dxsz1.js";
|
|
38
42
|
|
|
39
43
|
// src/cli/commands/translate.ts
|
|
40
44
|
import { defineCommand } from "citty";
|
|
@@ -58,6 +62,7 @@ var codexArgs = (lastMessagePath) => [
|
|
|
58
62
|
"--ephemeral",
|
|
59
63
|
"--sandbox",
|
|
60
64
|
"read-only",
|
|
65
|
+
...CODEX_LOCKDOWN,
|
|
61
66
|
"--output-last-message",
|
|
62
67
|
lastMessagePath,
|
|
63
68
|
"-"
|
|
@@ -78,11 +83,15 @@ var emptyLedger = () => ({
|
|
|
78
83
|
files: {},
|
|
79
84
|
version: 1
|
|
80
85
|
});
|
|
81
|
-
var hashSource = (text) => createHash("sha256").update(text
|
|
86
|
+
var hashSource = (text) => createHash("sha256").update(text.replaceAll(`\r
|
|
87
|
+
`, `
|
|
88
|
+
`)).digest("hex").slice(0, 16);
|
|
89
|
+
var CONFLICT_MARKER = /^(?:<{7}|={7}|>{7})(?:[ \r]|$)/mu;
|
|
82
90
|
var readLedger = async (root) => {
|
|
91
|
+
const path = join(root, LEDGER_FILE);
|
|
83
92
|
let raw;
|
|
84
93
|
try {
|
|
85
|
-
raw = await readFile(
|
|
94
|
+
raw = await readFile(path, "utf-8");
|
|
86
95
|
} catch {
|
|
87
96
|
return emptyLedger();
|
|
88
97
|
}
|
|
@@ -90,6 +99,15 @@ var readLedger = async (root) => {
|
|
|
90
99
|
try {
|
|
91
100
|
data = JSON.parse(raw);
|
|
92
101
|
} catch {
|
|
102
|
+
if (CONFLICT_MARKER.test(raw)) {
|
|
103
|
+
throw new BlumeError({
|
|
104
|
+
code: "BLUME_TRANSLATE_LEDGER_CONFLICT",
|
|
105
|
+
file: path,
|
|
106
|
+
message: `${LEDGER_FILE} has unresolved merge-conflict markers, so it can't say which translations are current.`,
|
|
107
|
+
severity: "error",
|
|
108
|
+
suggestion: `Resolve the merge conflict in ${LEDGER_FILE}, then rerun.`
|
|
109
|
+
});
|
|
110
|
+
}
|
|
93
111
|
return emptyLedger();
|
|
94
112
|
}
|
|
95
113
|
const parsed = ledgerSchema.safeParse(data);
|
|
@@ -340,47 +358,57 @@ var createProgressRenderer = (options) => {
|
|
|
340
358
|
};
|
|
341
359
|
|
|
342
360
|
// src/translate/run.ts
|
|
343
|
-
import { existsSync } from "node:fs";
|
|
361
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
344
362
|
import { mkdtemp, readFile as readFile3 } from "node:fs/promises";
|
|
345
363
|
import { tmpdir } from "node:os";
|
|
346
364
|
import pLimit from "p-limit";
|
|
347
365
|
import pMap from "p-map";
|
|
348
|
-
import { join as join3 } from "pathe";
|
|
366
|
+
import { dirname as dirname2, join as join3 } from "pathe";
|
|
349
367
|
|
|
350
368
|
// src/translate/meta.ts
|
|
369
|
+
import { existsSync } from "node:fs";
|
|
351
370
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
352
371
|
import { dirname, join as join2, relative } from "pathe";
|
|
353
|
-
|
|
354
|
-
var META_FILES =
|
|
372
|
+
var META_NAMES = ["meta.ts", "meta.js", "meta.mjs"];
|
|
373
|
+
var META_FILES = META_NAMES.map((name) => `**/${name}`);
|
|
355
374
|
var isFactoryModule = (value) => typeof value === "function";
|
|
356
|
-
var metaTargetPath = (meta, locale
|
|
375
|
+
var metaTargetPath = (meta, locale, i18n, folders) => {
|
|
376
|
+
const dir = join2(meta.contentRoot, dirname(localeTargetPath(join2(meta.dir, "meta.ts"), ".ts", locale, i18n, folders)));
|
|
377
|
+
const existing = META_NAMES.find((name) => existsSync(join2(dir, name)));
|
|
378
|
+
return join2(dir, existing ?? "meta.ts");
|
|
379
|
+
};
|
|
357
380
|
var discoverTranslatableMeta = async (project) => {
|
|
358
381
|
const { i18n } = project.config;
|
|
359
382
|
if (!i18n || i18n.parser !== "dir") {
|
|
360
383
|
return { diagnostics: [], metas: [] };
|
|
361
384
|
}
|
|
362
385
|
const localeDirs = new Set(i18n.locales.flatMap((locale) => locale.code === i18n.defaultLocale ? [] : [locale.code.toLowerCase()]));
|
|
386
|
+
const versionDirs = new Set(project.config.versions?.archived.map((version) => version.id));
|
|
363
387
|
const load = createModuleLoader();
|
|
364
388
|
const metas = [];
|
|
365
389
|
const diagnostics = [];
|
|
366
|
-
const roots = project.sources.flatMap((source) => source.staged || !source.contentRoot ? [] : [
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
390
|
+
const roots = project.sources.flatMap((source) => source.staged || !source.contentRoot ? [] : [
|
|
391
|
+
{
|
|
392
|
+
contentRoot: source.contentRoot,
|
|
393
|
+
exclude: source.exclude,
|
|
394
|
+
include: source.include
|
|
395
|
+
}
|
|
396
|
+
]);
|
|
397
|
+
for (const { contentRoot, exclude, include } of roots) {
|
|
398
|
+
const files = await findFolderMetaFiles({ exclude, include, root: contentRoot }, META_FILES);
|
|
374
399
|
for (const file of files.toSorted()) {
|
|
375
400
|
const dir = relative(contentRoot, dirname(file));
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
401
|
+
const [head] = dir.split("/");
|
|
402
|
+
if (head && (localeDirs.has(head.toLowerCase()) || versionDirs.has(head))) {
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
405
|
+
let mod;
|
|
406
|
+
try {
|
|
407
|
+
mod = await load(file);
|
|
408
|
+
} catch {
|
|
378
409
|
continue;
|
|
379
410
|
}
|
|
380
|
-
const
|
|
381
|
-
readFile2(file, "utf-8"),
|
|
382
|
-
load(file)
|
|
383
|
-
]);
|
|
411
|
+
const raw = await readFile2(file, "utf-8");
|
|
384
412
|
if (isFactoryModule(mod)) {
|
|
385
413
|
diagnostics.push({
|
|
386
414
|
code: "BLUME_TRANSLATE_META_FACTORY",
|
|
@@ -517,7 +545,7 @@ var pinHeadingAnchors = (sourceText, translatedText) => {
|
|
|
517
545
|
};
|
|
518
546
|
|
|
519
547
|
// src/translate/validate.ts
|
|
520
|
-
var FRONTMATTER_OPEN =
|
|
548
|
+
var FRONTMATTER_OPEN = /^?---\r?\n/u;
|
|
521
549
|
var FENCE_LINE = /^\s*(?:```|~~~)/u;
|
|
522
550
|
var stripOuterFence = (text) => {
|
|
523
551
|
const trimmed = text.trim();
|
|
@@ -549,7 +577,8 @@ var ensureTrailingNewline = (text) => text.endsWith(`
|
|
|
549
577
|
`) ? text : `${text}
|
|
550
578
|
`;
|
|
551
579
|
var validateTranslation = (sourceText, agentText) => {
|
|
552
|
-
const
|
|
580
|
+
const sourceIsFenced = stripOuterFence(sourceText) !== sourceText.trim();
|
|
581
|
+
const candidate = sourceIsFenced && countFenceLines(agentText) <= countFenceLines(sourceText) ? agentText.trim() : stripOuterFence(agentText);
|
|
553
582
|
if (candidate === "") {
|
|
554
583
|
return { ok: false, reason: "agent returned empty output" };
|
|
555
584
|
}
|
|
@@ -622,7 +651,7 @@ var parseMetaTitles = (agentText, expectedKeys) => {
|
|
|
622
651
|
};
|
|
623
652
|
|
|
624
653
|
// src/translate/run.ts
|
|
625
|
-
var
|
|
654
|
+
var metaKey = (meta) => dirname2(meta.sourceRel);
|
|
626
655
|
var invokeAgent = async (context, prompt, index) => {
|
|
627
656
|
const messagePath = join3(context.dir, `message-${index}.txt`);
|
|
628
657
|
const result = await context.run(context.bin, translateAgentArgs(context.kind, messagePath), { cwd: context.dir, prompt, timeoutMs: context.timeoutMs });
|
|
@@ -644,7 +673,7 @@ var runPageItem = async (item, index, context, ledger) => {
|
|
|
644
673
|
return done("translated");
|
|
645
674
|
}
|
|
646
675
|
const target = context.targets.get(item.locale);
|
|
647
|
-
const previousTranslation =
|
|
676
|
+
const previousTranslation = existsSync2(item.targetPath) ? await readFile3(item.targetPath, "utf-8") : undefined;
|
|
648
677
|
const output = await invokeAgent(context, pagePrompt(sourceText, target, context.source, previousTranslation), index);
|
|
649
678
|
if (output.isError) {
|
|
650
679
|
return done("failed", output.detail ?? "agent failed", output.costUsd);
|
|
@@ -666,7 +695,7 @@ var runMetaItem = async (item, index, context, ledger) => {
|
|
|
666
695
|
item,
|
|
667
696
|
status
|
|
668
697
|
});
|
|
669
|
-
const titles = Object.fromEntries(item.entries.map((entry) => [
|
|
698
|
+
const titles = Object.fromEntries(item.entries.map((entry) => [metaKey(entry.meta), entry.meta.title]));
|
|
670
699
|
const target = context.targets.get(item.locale);
|
|
671
700
|
const output = await invokeAgent(context, metaPrompt(titles, target, context.source), index);
|
|
672
701
|
if (output.isError) {
|
|
@@ -674,7 +703,7 @@ var runMetaItem = async (item, index, context, ledger) => {
|
|
|
674
703
|
}
|
|
675
704
|
const parsed = parseMetaTitles(output.text, Object.keys(titles));
|
|
676
705
|
for (const entry of item.entries) {
|
|
677
|
-
const translated = parsed.titles[
|
|
706
|
+
const translated = parsed.titles[metaKey(entry.meta)];
|
|
678
707
|
if (translated === undefined) {
|
|
679
708
|
continue;
|
|
680
709
|
}
|
|
@@ -765,10 +794,23 @@ var runTranslate = async (options) => {
|
|
|
765
794
|
};
|
|
766
795
|
|
|
767
796
|
// src/translate/work-list.ts
|
|
768
|
-
import { existsSync as
|
|
797
|
+
import { existsSync as existsSync3, readdirSync } from "node:fs";
|
|
769
798
|
import { readFile as readFile4 } from "node:fs/promises";
|
|
770
|
-
import {
|
|
799
|
+
import { extname, join as join4, relative as relative2 } from "pathe";
|
|
771
800
|
var PAGE_EXTENSIONS = new Set([".md", ".mdx"]);
|
|
801
|
+
var rootFolders = () => {
|
|
802
|
+
const read = new Map;
|
|
803
|
+
return (contentRoot) => {
|
|
804
|
+
const cached = read.get(contentRoot);
|
|
805
|
+
if (cached) {
|
|
806
|
+
return cached;
|
|
807
|
+
}
|
|
808
|
+
const names = readdirSync(contentRoot);
|
|
809
|
+
read.set(contentRoot, names);
|
|
810
|
+
return names;
|
|
811
|
+
};
|
|
812
|
+
};
|
|
813
|
+
var scanForTranslation = (root) => scanProject(root, { mode: "dev" });
|
|
772
814
|
var translatablePages = (project, i18n) => {
|
|
773
815
|
const rootsByName = new Map(project.sources.flatMap((source) => source.staged || !source.contentRoot ? [] : [[source.name, source.contentRoot]]));
|
|
774
816
|
const seen = new Set;
|
|
@@ -809,6 +851,7 @@ var partialWorkItems = async (universe, project, i18n, ledger, targetLocales, fo
|
|
|
809
851
|
}
|
|
810
852
|
const { root } = project.context;
|
|
811
853
|
const pagePaths = new Set(project.graph.pages.flatMap((page) => page.sourcePath ? [page.sourcePath] : []));
|
|
854
|
+
const folders = rootFolders();
|
|
812
855
|
const partials = new Map;
|
|
813
856
|
for (const { page, contentRoot } of universe) {
|
|
814
857
|
for (const partial of page.includes ?? []) {
|
|
@@ -825,7 +868,7 @@ var partialWorkItems = async (universe, project, i18n, ledger, targetLocales, fo
|
|
|
825
868
|
const verbatim = !PAGE_EXTENSIONS.has(ext.toLowerCase());
|
|
826
869
|
const contentRel = relative2(contentRoot, partialPath);
|
|
827
870
|
for (const locale of targetLocales) {
|
|
828
|
-
const targetPath = join4(contentRoot, localeTargetPath(contentRel, ext, locale, i18n));
|
|
871
|
+
const targetPath = join4(contentRoot, localeTargetPath(contentRel, ext, locale, i18n, folders(contentRoot)));
|
|
829
872
|
const item = (status) => {
|
|
830
873
|
const partialItem = {
|
|
831
874
|
kind: "page",
|
|
@@ -842,7 +885,7 @@ var partialWorkItems = async (universe, project, i18n, ledger, targetLocales, fo
|
|
|
842
885
|
return partialItem;
|
|
843
886
|
};
|
|
844
887
|
const stamp = ledger.files[sourceRel]?.[locale];
|
|
845
|
-
const outcome = classifyPair(
|
|
888
|
+
const outcome = classifyPair(existsSync3(targetPath), stamp, hash, force);
|
|
846
889
|
if (outcome === "untracked") {
|
|
847
890
|
work.untracked.push({ hash, kind: "page", locale, sourceRel });
|
|
848
891
|
} else if (outcome === "current") {
|
|
@@ -854,6 +897,18 @@ var partialWorkItems = async (universe, project, i18n, ledger, targetLocales, fo
|
|
|
854
897
|
}
|
|
855
898
|
return work;
|
|
856
899
|
};
|
|
900
|
+
var existingTranslations = (project) => {
|
|
901
|
+
const writableSources = new Set(project.sources.flatMap((source) => source.staged || !source.contentRoot ? [] : [source.name]));
|
|
902
|
+
const translated = new Map;
|
|
903
|
+
for (const page of project.graph.pages) {
|
|
904
|
+
const key = `${page.translationKey}\x00${page.locale}`;
|
|
905
|
+
if (page.fallback || translated.has(key)) {
|
|
906
|
+
continue;
|
|
907
|
+
}
|
|
908
|
+
translated.set(key, page.sourcePath && writableSources.has(page.source.name) ? page.sourcePath : undefined);
|
|
909
|
+
}
|
|
910
|
+
return translated;
|
|
911
|
+
};
|
|
857
912
|
var computeWorkList = async (project, ledger, options = {}) => {
|
|
858
913
|
const { i18n } = project.config;
|
|
859
914
|
if (!i18n) {
|
|
@@ -867,20 +922,22 @@ var computeWorkList = async (project, ledger, options = {}) => {
|
|
|
867
922
|
};
|
|
868
923
|
}
|
|
869
924
|
const targetLocales = localeCodes(i18n).filter((code) => code !== i18n.defaultLocale && (options.locales === undefined || options.locales.includes(code)));
|
|
870
|
-
const translated =
|
|
925
|
+
const translated = existingTranslations(project);
|
|
871
926
|
const { root } = project.context;
|
|
872
927
|
const knownSources = new Set;
|
|
873
928
|
const untracked = [];
|
|
874
929
|
const pageItems = [];
|
|
875
930
|
let upToDate = 0;
|
|
876
931
|
const universe = translatablePages(project, i18n);
|
|
932
|
+
const folders = rootFolders();
|
|
877
933
|
for (const { page, contentRoot, ext, sourcePath } of universe) {
|
|
878
934
|
const sourceRel = relative2(root, sourcePath);
|
|
879
935
|
knownSources.add(sourceRel);
|
|
880
936
|
const hash = hashSource(await readFile4(sourcePath, "utf-8"));
|
|
881
937
|
const contentRel = relative2(contentRoot, sourcePath);
|
|
882
938
|
for (const locale of targetLocales) {
|
|
883
|
-
const
|
|
939
|
+
const key = `${page.translationKey}\x00${locale}`;
|
|
940
|
+
const targetPath = translated.get(key) ?? join4(contentRoot, localeTargetPath(contentRel, ext, locale, i18n, folders(contentRoot)));
|
|
884
941
|
const item = (status) => ({
|
|
885
942
|
kind: "page",
|
|
886
943
|
locale,
|
|
@@ -890,7 +947,7 @@ var computeWorkList = async (project, ledger, options = {}) => {
|
|
|
890
947
|
targetPath,
|
|
891
948
|
targetRel: relative2(root, targetPath)
|
|
892
949
|
});
|
|
893
|
-
const exists = translated.has(
|
|
950
|
+
const exists = translated.has(key);
|
|
894
951
|
const stamp = ledger.files[sourceRel]?.[locale];
|
|
895
952
|
const outcome = classifyPair(exists, stamp, hash, options.force === true);
|
|
896
953
|
if (outcome === "untracked") {
|
|
@@ -915,14 +972,14 @@ var computeWorkList = async (project, ledger, options = {}) => {
|
|
|
915
972
|
const entries = [];
|
|
916
973
|
for (const source of meta.metas) {
|
|
917
974
|
knownSources.add(source.sourceRel);
|
|
918
|
-
const
|
|
919
|
-
const exists =
|
|
975
|
+
const targetPath = metaTargetPath(source, locale, i18n, folders(source.contentRoot));
|
|
976
|
+
const exists = existsSync3(targetPath);
|
|
920
977
|
const hash = hashSource(source.raw);
|
|
921
978
|
const stamp = ledger.files[source.sourceRel]?.[locale];
|
|
922
979
|
const entry = (status) => ({
|
|
923
980
|
meta: source,
|
|
924
981
|
status,
|
|
925
|
-
targetPath
|
|
982
|
+
targetPath
|
|
926
983
|
});
|
|
927
984
|
const outcome = classifyPair(exists, stamp, hash, options.force === true);
|
|
928
985
|
if (outcome === "untracked") {
|
|
@@ -972,11 +1029,7 @@ var parseFlags = (args) => {
|
|
|
972
1029
|
logger.error("Pass --codex or --claude to choose the agent CLI that translates.");
|
|
973
1030
|
process.exit(1);
|
|
974
1031
|
}
|
|
975
|
-
const timeoutS = args.timeout
|
|
976
|
-
if (!Number.isInteger(timeoutS) || timeoutS <= 0) {
|
|
977
|
-
logger.error(`Invalid --timeout "${args.timeout}" (whole seconds).`);
|
|
978
|
-
process.exit(1);
|
|
979
|
-
}
|
|
1032
|
+
const timeoutS = parseTimeoutSeconds(args.timeout, DEFAULT_TIMEOUT_S);
|
|
980
1033
|
const concurrency = args.concurrency === undefined ? DEFAULT_CONCURRENCY : Number(args.concurrency);
|
|
981
1034
|
if (!Number.isInteger(concurrency) || concurrency < 1 || concurrency > MAX_CONCURRENCY) {
|
|
982
1035
|
logger.error(`Invalid --concurrency "${args.concurrency}" (use 1..${MAX_CONCURRENCY}).`);
|
|
@@ -1049,7 +1102,7 @@ var translateCommand = defineCommand({
|
|
|
1049
1102
|
const root = process.cwd();
|
|
1050
1103
|
const { agent, concurrency, timeoutS } = parseFlags(args);
|
|
1051
1104
|
try {
|
|
1052
|
-
const project = await
|
|
1105
|
+
const project = await scanForTranslation(root);
|
|
1053
1106
|
if (!i18nEnabled(project.config)) {
|
|
1054
1107
|
logger.error("i18n is not configured — add `i18n.locales` to blume.config to use `blume translate`.");
|
|
1055
1108
|
process.exit(1);
|
|
@@ -1080,8 +1133,7 @@ var translateCommand = defineCommand({
|
|
|
1080
1133
|
process.stdout.write(checkReportJson(workList));
|
|
1081
1134
|
}
|
|
1082
1135
|
if (hasDrift(workList)) {
|
|
1083
|
-
|
|
1084
|
-
process.exit(1);
|
|
1136
|
+
process.exitCode = 1;
|
|
1085
1137
|
}
|
|
1086
1138
|
return;
|
|
1087
1139
|
}
|
|
@@ -1122,8 +1174,7 @@ var translateCommand = defineCommand({
|
|
|
1122
1174
|
process.stdout.write(translateReportJson(result, workList));
|
|
1123
1175
|
}
|
|
1124
1176
|
if (result.counts.failed > 0 || result.counts.partial > 0) {
|
|
1125
|
-
|
|
1126
|
-
process.exit(1);
|
|
1177
|
+
process.exitCode = 1;
|
|
1127
1178
|
}
|
|
1128
1179
|
} catch (error) {
|
|
1129
1180
|
if (error instanceof BlumeError) {
|
|
@@ -1142,5 +1193,5 @@ export {
|
|
|
1142
1193
|
translateCommand
|
|
1143
1194
|
};
|
|
1144
1195
|
|
|
1145
|
-
//# debugId=
|
|
1146
|
-
//# sourceMappingURL=chunk-
|
|
1196
|
+
//# debugId=FFF735A581A85E1364756E2164756E21
|
|
1197
|
+
//# sourceMappingURL=chunk-hm3vjy5s.js.map
|