@forumulate/cli 0.12.2 → 0.13.0

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.
Files changed (64) hide show
  1. package/dist/api/operations.json +1 -1
  2. package/dist/api-base.d.ts.map +1 -1
  3. package/dist/api-base.js +3 -1
  4. package/dist/api-base.js.map +1 -1
  5. package/dist/commands/completion.d.ts.map +1 -1
  6. package/dist/commands/completion.js +13 -0
  7. package/dist/commands/completion.js.map +1 -1
  8. package/dist/commands/groups-community.d.ts.map +1 -1
  9. package/dist/commands/groups-community.js +9 -0
  10. package/dist/commands/groups-community.js.map +1 -1
  11. package/dist/commands/groups-org.d.ts.map +1 -1
  12. package/dist/commands/groups-org.js +5 -0
  13. package/dist/commands/groups-org.js.map +1 -1
  14. package/dist/commands/resource.js +16 -1
  15. package/dist/commands/resource.js.map +1 -1
  16. package/dist/heartbeat-command.d.ts +31 -0
  17. package/dist/heartbeat-command.d.ts.map +1 -0
  18. package/dist/heartbeat-command.js +90 -0
  19. package/dist/heartbeat-command.js.map +1 -0
  20. package/dist/help-commands.d.ts +1 -1
  21. package/dist/help-commands.d.ts.map +1 -1
  22. package/dist/help-commands.js +9 -2
  23. package/dist/help-commands.js.map +1 -1
  24. package/dist/help.d.ts +1 -1
  25. package/dist/help.d.ts.map +1 -1
  26. package/dist/help.js +5 -0
  27. package/dist/help.js.map +1 -1
  28. package/dist/plan/body-env.d.ts +5 -0
  29. package/dist/plan/body-env.d.ts.map +1 -0
  30. package/dist/plan/body-env.js +46 -0
  31. package/dist/plan/body-env.js.map +1 -0
  32. package/dist/plan/command.d.ts +6 -0
  33. package/dist/plan/command.d.ts.map +1 -1
  34. package/dist/plan/command.js +60 -3
  35. package/dist/plan/command.js.map +1 -1
  36. package/dist/plan/document.d.ts +19 -3
  37. package/dist/plan/document.d.ts.map +1 -1
  38. package/dist/plan/document.js +108 -8
  39. package/dist/plan/document.js.map +1 -1
  40. package/dist/plan/markdown-dir.d.ts +12 -8
  41. package/dist/plan/markdown-dir.d.ts.map +1 -1
  42. package/dist/plan/markdown-dir.js +104 -17
  43. package/dist/plan/markdown-dir.js.map +1 -1
  44. package/dist/plan/output.d.ts +15 -0
  45. package/dist/plan/output.d.ts.map +1 -1
  46. package/dist/plan/output.js +40 -3
  47. package/dist/plan/output.js.map +1 -1
  48. package/dist/publish/extras.js +6 -4
  49. package/dist/publish/extras.js.map +1 -1
  50. package/dist/publish/rewrite.d.ts +12 -1
  51. package/dist/publish/rewrite.d.ts.map +1 -1
  52. package/dist/publish/rewrite.js +32 -13
  53. package/dist/publish/rewrite.js.map +1 -1
  54. package/dist/run.d.ts +2 -0
  55. package/dist/run.d.ts.map +1 -1
  56. package/dist/run.js +7 -0
  57. package/dist/run.js.map +1 -1
  58. package/dist/version.d.ts +1 -1
  59. package/dist/version.js +1 -1
  60. package/dist/whoami.d.ts +1 -1
  61. package/dist/whoami.d.ts.map +1 -1
  62. package/dist/whoami.js +1 -1
  63. package/dist/whoami.js.map +1 -1
  64. package/package.json +2 -2
package/dist/help.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  /** `forumulate help`. The resource groups print their own (`forumulate spaces --help`). */
2
- export declare const HELP = "forumulate \u2014 Forumulate command-line interface\n\nUsage:\n forumulate <command> [args]\n\nCommands:\n login [--token <pat>] Store a token for this API, so every other\n command stops needing FORUMULATE_TOKEN in\n the environment\n logout Forget the stored token\n whoami [--json] Who you are, and WHICH token: its source (--token,\n FORUMULATE_TOKEN or credentials.json), id, name,\n last 4, expiry, narrowing and the API base\n auth status [--json] The same report, for scripts\n config set|get|unset|list Defaults: org, space, library, api-version\n (`forumulate config set org acme`)\n\nEvery API operation:\n api list [--tag t] [--search w] Discover operations and their summaries\n [--refresh] ...from the live API's spec, not the bundled one\n api describe <operationId> Parameters and body schema, as flags\n api <operationId> [args] [flags] Call it: --<param> value, --data @f.json,\n api <METHOD> <path> [flags] --field a.b=v, --paginate, --json\n\nResources (each: <group> --help lists its verbs and the operation each calls):\n Org: orgs | members | invites | groups | roles | service-accounts (bots)\n tokens (pats) | keys | integration-tokens (int-tokens)\n webhooks | extensions | audit\n Spaces: spaces | snapshots | shape | domains | assets | space-types (types)\n Docs: items (pages) | docs | collections | versions | change-requests (crs)\n openapi | sdks | github (git)\n Content: blog | forum | changelog | roadmap | status | events | course\n careers | forms (blog/forum/changelog/status: translations \u2026)\n CMS: libraries | entries | media | releases | environments (envs)\n Site: theme | sites | reader\n Jobs: jobs | backups | imports | manifest (starters take --wait [--timeout s])\n search <query...> [--org] e.g. spaces create Docs --slug docs --type DOCS\n items create --space docs --file a.md --publish\n docs schedule set <pageId> <when> --space docs\n webhooks deliveries <id>; webhooks replay <id> <d>\n --out <file> where a file answer goes (SDK archive, PDF, CSV export)\n cache purge --space <s> [--page p] Drop cached copies (web tier + every CDN); deletes\n nothing\n completion bash|zsh|fish Shell completion script\n\nOlder forms, unchanged:\n orgs List your organizations\n spaces <orgId> List spaces in an org\n items <orgId> <spaceId> List what is in a space, with where each\n piece's content lives\n search <orgId> <query...> Unified search across docs/forum/blog\n dev <folder> Preview a folder of Markdown locally, rendered\n by your space's own renderer; reloads on save.\n --org <id> --space <id> [--port 4321] [--site <your docs URL>]\n publish <folder> --org <o> --space <s>\n Publish a folder of Markdown: one folder per\n collection, front matter, assets, order,\n and a forumulate.yaml manifest for space,\n site, theme, OpenAPI and monitors. Re-runs\n change only what changed, then read back.\n --org <id|slug> --space <id|slug> (or org:/space: in the manifest)\n --dry-run print the plan, write nothing (no token needed for a\n public space)\n --prune remove pages/posts/collections with no file (to the trash)\n --only a,b just these slugs, files, folders, or manifest parts\n (site, theme, settings, openapi, monitors)\n --force re-send every page even if it looks unchanged\n --no-verify skip the read-back --pace <ms> gap between writes\n --manifest <file> a manifest somewhere else\n --diff print the changed paragraphs and fields of each update\n --purge page|space|none what to drop from the cache (default page),\n reported per CDN\n --json one summary: created, updated, unchanged, trashed, purged,\n verify, diffUrl (the run is recorded; publish.completed fires)\n Pages edited in the studio since the last publish are not overwritten\n without --force. Full reference: forumulate publish --help\n sync <folder> Content as code: the same folder publish,\n PLAN BY DEFAULT. Posts (blog), pages\n (docs, custom, legal), FAQ questions,\n changelog releases and blog categories,\n matched by slug; images uploaded once by\n content hash; README, LICENSE, _drafts/,\n dotfiles skipped. Guide:\n https://forumulate.com/guides/content-as-code\n --apply write the plan (then read it back)\n --prune also remove what has no file (to the trash)\n --diff print the changed paragraphs and fields of each update\n --org, --space, --only, --force, --no-verify, --pace, --manifest, --json\n as for publish\n plan [forumulate.yaml] The whole site as one document (version: 2):\n spaces and their SEO, languages, front doors,\n contact form and About parts, Markdown pages\n with locale twins, redirects, sites. Prints\n the diff; writes nothing. --check exits 1\n when it is not empty. Full reference:\n forumulate plan --help\n apply [forumulate.yaml] Carry that plan out, idempotently, every\n write read back; --prune also removes what\n the manifest wrote and no longer declares\n check links [folder] Broken internal links, #anchors, pictures and\n (--external) outside links in a folder, before\n publishing; exit 1 when any is broken\n --space <s> [--org <o>] the same report for a published space\n --allow-redirect <hosts> --ignore <text> --json\n publish <folder> --preview <name> Send the change to a preview link instead of\n publishing it (--comment posts it on the PR)\n publish <orgId> <spaceId> <pageId> (deprecated) Publish a page \u2014 use items publish\n publish <orgId> <spaceId> <dir> (deprecated) \u2014 use publish <dir> --org --space\n domains <orgId> <spaceId> List this space's domains and their state\n domains verify <orgId> <spaceId> <hostname>\n Re-run verification and say what is missing\n snapshot <orgId> <spaceId> <label> Create a space version snapshot\n content types --library <id|slug> TypeScript for a content library's model:\n collections, globals, the block union\n [--org <id|slug>] [--out forumulate.d.ts] [--preview] [--schema <file>]\n [--check] fail (exit 1) when the file is out of date, write nothing\n content pull --library <id|slug> Write the model to forumulate.content.json\n [--format json|payload] [--out <file>] (payload: forumulate.payload.ts)\n content push [file] Show the diff against the library, then\n apply it as a new model version\n [--library \u2026] [--dry-run] [--yes] [--force]\n [--rename type.field=new | block:hero.field=new | library:field=new]\n [--rename-type old=new] [--rename-block old=new]\n import <payload|contentful|sanity|strapi|wordpress> <export path>\n Bring another CMS's content into a library:\n model, media, entries, references (always\n shows a dry run first)\n Re-running updates entries a\n previous import made. strapi takes a\n folder or an unencrypted export .tar.gz\n --library <id|slug> [--org \u2026] [--dry-run] [--yes]\n [--config payload.config.ts] (payload) the config that becomes the model\n [--publish source|all|none] what to publish (default: what was live)\n [--allow-model-removals] [--pace <ms>] [--base-url <url>] (strapi uploads)\n translations (alias i18n) Every translation capability, one vocabulary\n locales list|add|relabel|remove|set a space's (--space) or library's\n (--library) languages; set es=Espa\u00F1ol fr [--prune] is exact\n status each piece \u00D7 language: missing/draft/published/outdated\n [--locale es,fr] [--fail-on missing,outdated] (exit 1)\n pull one Markdown file per piece per language \u2192 [--out translations]\n [--locale \u2026] [--only slug,\u2026] [--include-missing] (stubs)\n push [dir] diff the files against the API, write what changed [--dry-run]\n auto machine-translate with YOUR DeepL/AI key --locale es\n [--state missing,outdated] [--only \u2026] [--force] [--publish]\n [--library \u2026 --entry id,\u2026] [--dry-run]\n labels pull|push [file] chrome words (--site <id> | --space \u2026)\n overrides pull|push [file] org UI string overrides [--prune]\n [--format json|xliff] for labels and overrides\n item-locale <itemId> <locale|none> correct a piece's declared language\n remove <pieceId> <locale> one translation (--yes)\n entry <entryId> <locale> a library entry's twin [--fields f.json]\n name <locale> <name\u2026> a space's (or --collection's) name\n switcher get|set <f.json> the org's reader language switcher\n provider status|connect|disconnect your DeepL key (DEEPL_API_KEY)\n conformance <collectionUrl> Run the Content Sync Protocol suite against\n any platform's collection endpoint\n validate [dir] Check forumulate.yaml, front matter and $schema\n files against the published schemas, with\n did-you-mean hints. --json; exit 2 if invalid\n doctor <readerUrl> | --site <s> Check a live site from the outside: health,\n canonical on both addresses, sitemap, cache\n consistency, root redirect, descriptions,\n llms.txt, favicon, consent tag, white-label\n leaks. --json; exit 1 on any FAIL\n help [command] Show this help, or a command's own\n (every command also takes --help)\n\nEnvironment:\n FORUMULATE_TOKEN Personal Access Token (Bearer). Overrides a stored one, so\n CI keeps working exactly as it did; --token overrides it.\n Mint one at\n https://forumulate.com/account/tokens\n FORUMULATE_URL The site (default https://forumulate.com); the API is its\n /api, i.e. https://forumulate.com/api. A value already\n ending in /api is used as-is.\n FORUMULATE_API_URL Exact API base, for a local API with no /api prefix\n (http://localhost:4000). Wins over FORUMULATE_URL.\n FORUMULATE_ORG, FORUMULATE_SPACE, FORUMULATE_LIBRARY\n Defaults for --org, --space and --library; they beat\n `forumulate config set`, a flag beats both.\n FORUMULATE_API_VERSION\n Forumulate-Version for api/resource commands\n (default: the SDK's current version).\n\nThe SDK (ForumulateClient.fromEnv) and the MCP server (@forumulate/mcp) read\nthe same variables. Guide: https://forumulate.com/guides/api-tokens-and-scopes\n\nEvery FORUMULATE_* variable not listed above is reported (with the one you\nprobably meant) by `forumulate whoami` and on any authentication failure.\n\nFlags:\n --json Emit raw JSON instead of a formatted summary (stdout only;\n progress and warnings go to stderr)\n --out <file> Write stdout to a file (never truncated; non-zero exit if the\n write fails). content/translations use --out for their own file\n --jsonl With --paginate: one JSON row per line, streamed\n --token <pat> The token for this run, on every command. Precedence:\n --token, then FORUMULATE_TOKEN, then credentials.json. On an\n operation with a `token` parameter of its own (registries\n set, github connect, domains acme-challenge) the flag is that\n parameter; set FORUMULATE_TOKEN for the PAT there\n --dry-run (api, resources) print the request instead of sending it\n --dry-run Plan the work and write nothing (publish of a directory)\n --version Print the CLI version\n\nExit status:\n 0 ok 1 failed (verification mismatch, doctor FAIL) 2 usage\n 3 auth (no token, 401, token not allowed) 4 not found\n 5 conflict (409/412, edited in the studio since your last publish)\n";
2
+ export declare const HELP = "forumulate \u2014 Forumulate command-line interface\n\nUsage:\n forumulate <command> [args]\n\nCommands:\n login [--token <pat>] Store a token for this API, so every other\n command stops needing FORUMULATE_TOKEN in\n the environment\n logout Forget the stored token\n whoami [--json] Who you are, and WHICH token: its source (--token,\n FORUMULATE_TOKEN or credentials.json), id, name,\n last 4, expiry, narrowing and the API base\n auth status [--json] The same report, for scripts\n config set|get|unset|list Defaults: org, space, library, api-version\n (`forumulate config set org acme`)\n\nEvery API operation:\n api list [--tag t] [--search w] Discover operations and their summaries\n [--refresh] ...from the live API's spec, not the bundled one\n api describe <operationId> Parameters and body schema, as flags\n api <operationId> [args] [flags] Call it: --<param> value, --data @f.json,\n api <METHOD> <path> [flags] --field a.b=v, --paginate, --json\n\nResources (each: <group> --help lists its verbs and the operation each calls):\n Org: orgs | members | invites | groups | roles | service-accounts (bots)\n tokens (pats) | keys | integration-tokens (int-tokens)\n webhooks | extensions | audit\n Spaces: spaces | snapshots | shape | domains | assets | space-types (types)\n Docs: items (pages) | docs | collections | versions | change-requests (crs)\n openapi | sdks | github (git)\n Content: blog | forum | changelog | roadmap | status | events | course\n careers | forms (blog/forum/changelog/status: translations \u2026)\n CMS: libraries | entries | media | releases | environments (envs)\n Site: theme | sites | reader\n Jobs: jobs | backups | imports | manifest (starters take --wait [--timeout s])\n search <query...> [--org] e.g. spaces create Docs --slug docs --type DOCS\n items create --space docs --file a.md --publish\n docs schedule set <pageId> <when> --space docs\n webhooks deliveries <id>; webhooks replay <id> <d>\n --out <file> where a file answer goes (SDK archive, PDF, CSV export)\n cache purge --space <s> [--page p] Drop cached copies (web tier + every CDN); deletes\n nothing\n completion bash|zsh|fish Shell completion script\n\nOlder forms, unchanged:\n orgs List your organizations\n spaces <orgId> List spaces in an org\n items <orgId> <spaceId> List what is in a space, with where each\n piece's content lives\n search <orgId> <query...> Unified search across docs/forum/blog\n dev <folder> Preview a folder of Markdown locally, rendered\n by your space's own renderer; reloads on save.\n --org <id> --space <id> [--port 4321] [--site <your docs URL>]\n publish <folder> --org <o> --space <s>\n Publish a folder of Markdown: one folder per\n collection, front matter, assets, order,\n and a forumulate.yaml manifest for space,\n site, theme, OpenAPI and monitors. Re-runs\n change only what changed, then read back.\n --org <id|slug> --space <id|slug> (or org:/space: in the manifest)\n --dry-run print the plan, write nothing (no token needed for a\n public space)\n --prune remove pages/posts/collections with no file (to the trash)\n --only a,b just these slugs, files, folders, or manifest parts\n (site, theme, settings, openapi, monitors)\n --force re-send every page even if it looks unchanged\n --no-verify skip the read-back --pace <ms> gap between writes\n --manifest <file> a manifest somewhere else\n --diff print the changed paragraphs and fields of each update\n --purge page|space|none what to drop from the cache (default page),\n reported per CDN\n --json one summary: created, updated, unchanged, trashed, purged,\n verify, diffUrl (the run is recorded; publish.completed fires)\n Pages edited in the studio since the last publish are not overwritten\n without --force. Full reference: forumulate publish --help\n sync <folder> Content as code: the same folder publish,\n PLAN BY DEFAULT. Posts (blog), pages\n (docs, custom, legal), FAQ questions,\n changelog releases and blog categories,\n matched by slug; images uploaded once by\n content hash; README, LICENSE, _drafts/,\n dotfiles skipped. Guide:\n https://forumulate.com/guides/content-as-code\n --apply write the plan (then read it back)\n --prune also remove what has no file (to the trash)\n --diff print the changed paragraphs and fields of each update\n --org, --space, --only, --force, --no-verify, --pace, --manifest, --json\n as for publish\n plan [forumulate.yaml] The whole site as one document (version: 2):\n spaces and their SEO, languages, front doors,\n contact form and About parts, Markdown pages\n with locale twins, redirects, sites. Prints\n the diff; writes nothing. --check exits 1\n when it is not empty. Full reference:\n forumulate plan --help\n apply [forumulate.yaml] Carry that plan out, idempotently, every\n write read back; --prune also removes what\n the manifest wrote and no longer declares\n --secrets-file <p> keeps the shown-once keys (0600);\n the output redacts them\n heartbeat ping <monitor> [--fail] Report a job's pass to a heartbeat monitor\n (--message <why> with --fail); forumulate heartbeat --help\n check links [folder] Broken internal links, #anchors, pictures and\n (--external) outside links in a folder, before\n publishing; exit 1 when any is broken\n --space <s> [--org <o>] the same report for a published space\n --allow-redirect <hosts> --ignore <text> --json\n publish <folder> --preview <name> Send the change to a preview link instead of\n publishing it (--comment posts it on the PR)\n publish <orgId> <spaceId> <pageId> (deprecated) Publish a page \u2014 use items publish\n publish <orgId> <spaceId> <dir> (deprecated) \u2014 use publish <dir> --org --space\n domains <orgId> <spaceId> List this space's domains and their state\n domains verify <orgId> <spaceId> <hostname>\n Re-run verification and say what is missing\n snapshot <orgId> <spaceId> <label> Create a space version snapshot\n content types --library <id|slug> TypeScript for a content library's model:\n collections, globals, the block union\n [--org <id|slug>] [--out forumulate.d.ts] [--preview] [--schema <file>]\n [--check] fail (exit 1) when the file is out of date, write nothing\n content pull --library <id|slug> Write the model to forumulate.content.json\n [--format json|payload] [--out <file>] (payload: forumulate.payload.ts)\n content push [file] Show the diff against the library, then\n apply it as a new model version\n [--library \u2026] [--dry-run] [--yes] [--force]\n [--rename type.field=new | block:hero.field=new | library:field=new]\n [--rename-type old=new] [--rename-block old=new]\n import <payload|contentful|sanity|strapi|wordpress> <export path>\n Bring another CMS's content into a library:\n model, media, entries, references (always\n shows a dry run first)\n Re-running updates entries a\n previous import made. strapi takes a\n folder or an unencrypted export .tar.gz\n --library <id|slug> [--org \u2026] [--dry-run] [--yes]\n [--config payload.config.ts] (payload) the config that becomes the model\n [--publish source|all|none] what to publish (default: what was live)\n [--allow-model-removals] [--pace <ms>] [--base-url <url>] (strapi uploads)\n translations (alias i18n) Every translation capability, one vocabulary\n locales list|add|relabel|remove|set a space's (--space) or library's\n (--library) languages; set es=Espa\u00F1ol fr [--prune] is exact\n status each piece \u00D7 language: missing/draft/published/outdated\n [--locale es,fr] [--fail-on missing,outdated] (exit 1)\n pull one Markdown file per piece per language \u2192 [--out translations]\n [--locale \u2026] [--only slug,\u2026] [--include-missing] (stubs)\n push [dir] diff the files against the API, write what changed [--dry-run]\n auto machine-translate with YOUR DeepL/AI key --locale es\n [--state missing,outdated] [--only \u2026] [--force] [--publish]\n [--library \u2026 --entry id,\u2026] [--dry-run]\n labels pull|push [file] chrome words (--site <id> | --space \u2026)\n overrides pull|push [file] org UI string overrides [--prune]\n [--format json|xliff] for labels and overrides\n item-locale <itemId> <locale|none> correct a piece's declared language\n remove <pieceId> <locale> one translation (--yes)\n entry <entryId> <locale> a library entry's twin [--fields f.json]\n name <locale> <name\u2026> a space's (or --collection's) name\n switcher get|set <f.json> the org's reader language switcher\n provider status|connect|disconnect your DeepL key (DEEPL_API_KEY)\n conformance <collectionUrl> Run the Content Sync Protocol suite against\n any platform's collection endpoint\n validate [dir] Check forumulate.yaml, front matter and $schema\n files against the published schemas, with\n did-you-mean hints. --json; exit 2 if invalid\n doctor <readerUrl> | --site <s> Check a live site from the outside: health,\n canonical on both addresses, sitemap, cache\n consistency, root redirect, descriptions,\n llms.txt, favicon, consent tag, white-label\n leaks. --json; exit 1 on any FAIL\n help [command] Show this help, or a command's own\n (every command also takes --help)\n\nEnvironment:\n FORUMULATE_TOKEN Personal Access Token (Bearer). Overrides a stored one, so\n CI keeps working exactly as it did; --token overrides it.\n Mint one at\n https://forumulate.com/account/tokens\n FORUMULATE_URL The site (default https://forumulate.com); the API is its\n /api, i.e. https://forumulate.com/api. A value already\n ending in /api is used as-is.\n FORUMULATE_API_URL Exact API base, for a local API with no /api prefix\n (http://localhost:4000). Wins over FORUMULATE_URL.\n FORUMULATE_API is read as the same thing.\n FORUMULATE_ORG, FORUMULATE_SPACE, FORUMULATE_LIBRARY\n Defaults for --org, --space and --library; they beat\n `forumulate config set`, a flag beats both.\n FORUMULATE_API_VERSION\n Forumulate-Version for api/resource commands\n (default: the SDK's current version).\n\nThe SDK (ForumulateClient.fromEnv) and the MCP server (@forumulate/mcp) read\nthe same variables. Guide: https://forumulate.com/guides/api-tokens-and-scopes\n\nEvery FORUMULATE_* variable not listed above is reported (with the one you\nprobably meant) by `forumulate whoami` and on any authentication failure.\n\nFlags:\n --json Emit raw JSON instead of a formatted summary (stdout only;\n progress and warnings go to stderr)\n --out <file> Write stdout to a file (never truncated; non-zero exit if the\n write fails). content/translations use --out for their own file\n --jsonl With --paginate: one JSON row per line, streamed\n --token <pat> The token for this run, on every command. Precedence:\n --token, then FORUMULATE_TOKEN, then credentials.json. On an\n operation with a `token` parameter of its own (registries\n set, github connect, domains acme-challenge) the flag is that\n parameter; set FORUMULATE_TOKEN for the PAT there\n --dry-run (api, resources) print the request instead of sending it\n --dry-run Plan the work and write nothing (publish of a directory)\n --version Print the CLI version\n\nExit status:\n 0 ok 1 failed (verification mismatch, doctor FAIL) 2 usage\n 3 auth (no token, 401, token not allowed) 4 not found\n 5 conflict (409/412, edited in the studio since your last publish)\n";
3
3
  //# sourceMappingURL=help.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,eAAO,MAAM,IAAI,+0bAiNhB,CAAC"}
1
+ {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,eAAO,MAAM,IAAI,0tcAsNhB,CAAC"}
package/dist/help.js CHANGED
@@ -101,6 +101,10 @@ Older forms, unchanged:
101
101
  apply [forumulate.yaml] Carry that plan out, idempotently, every
102
102
  write read back; --prune also removes what
103
103
  the manifest wrote and no longer declares
104
+ --secrets-file <p> keeps the shown-once keys (0600);
105
+ the output redacts them
106
+ heartbeat ping <monitor> [--fail] Report a job's pass to a heartbeat monitor
107
+ (--message <why> with --fail); forumulate heartbeat --help
104
108
  check links [folder] Broken internal links, #anchors, pictures and
105
109
  (--external) outside links in a folder, before
106
110
  publishing; exit 1 when any is broken
@@ -179,6 +183,7 @@ Environment:
179
183
  ending in /api is used as-is.
180
184
  FORUMULATE_API_URL Exact API base, for a local API with no /api prefix
181
185
  (http://localhost:4000). Wins over FORUMULATE_URL.
186
+ FORUMULATE_API is read as the same thing.
182
187
  FORUMULATE_ORG, FORUMULATE_SPACE, FORUMULATE_LIBRARY
183
188
  Defaults for --org, --space and --library; they beat
184
189
  \`forumulate config set\`, a flag beats both.
package/dist/help.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":";;;AAAA,2FAA2F;AAC9E,QAAA,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiNnB,CAAC"}
1
+ {"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":";;;AAAA,2FAA2F;AAC9E,QAAA,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsNnB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare function substituteBody(text: string, env: NodeJS.ProcessEnv): {
2
+ text: string;
3
+ unset: string[];
4
+ };
5
+ //# sourceMappingURL=body-env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"body-env.d.ts","sourceRoot":"","sources":["../../src/plan/body-env.ts"],"names":[],"mappings":"AAaA,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CA6BtG"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.substituteBody = substituteBody;
4
+ /**
5
+ * `${NAME}` in a page body (Watchtower W-F9): legal pages carry deploy-specific
6
+ * values (a consent site id, a contact address) and each product ran its own
7
+ * `envsubst` before `apply`. Opt-in per page (`env: true` in front matter or on
8
+ * the manifest's `pages` entry) because a docs page that prints `${HOME}` is
9
+ * content. Fenced blocks and inline code are never touched, for the same reason.
10
+ *
11
+ * An unset name is left as written and reported; a name set to the empty
12
+ * string becomes the empty string. The command refuses to APPLY while any is
13
+ * unset (`--allow-unset-env` overrides), so a literal never goes live by accident.
14
+ */
15
+ const REF = /\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g;
16
+ function substituteBody(text, env) {
17
+ const unset = new Set();
18
+ const sub = (s) => s.replace(REF, (all, name) => {
19
+ const v = env[name];
20
+ if (v === undefined) {
21
+ unset.add(name);
22
+ return all;
23
+ }
24
+ return v;
25
+ });
26
+ let fence = null;
27
+ const lines = text.split('\n').map((line) => {
28
+ const f = /^\s*(`{3,}|~{3,})/.exec(line);
29
+ if (fence) {
30
+ if (f && f[1].startsWith(fence[0]) && f[1].length >= fence.length)
31
+ fence = null;
32
+ return line;
33
+ }
34
+ if (f) {
35
+ fence = f[1];
36
+ return line;
37
+ }
38
+ // Odd pieces of the split are inline code spans.
39
+ return line
40
+ .split(/(`+[^`]*`+)/)
41
+ .map((part, i) => (i % 2 ? part : sub(part)))
42
+ .join('');
43
+ });
44
+ return { text: lines.join('\n'), unset: [...unset] };
45
+ }
46
+ //# sourceMappingURL=body-env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"body-env.js","sourceRoot":"","sources":["../../src/plan/body-env.ts"],"names":[],"mappings":";;AAaA,wCA6BC;AA1CD;;;;;;;;;;GAUG;AACH,MAAM,GAAG,GAAG,iCAAiC,CAAC;AAE9C,SAAgB,cAAc,CAAC,IAAY,EAAE,GAAsB;IACjE,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CACxB,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,IAAY,EAAE,EAAE;QACnC,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;QACpB,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;YACpB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAChB,OAAO,GAAG,CAAC;QACb,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;IACL,IAAI,KAAK,GAAkB,IAAI,CAAC;IAChC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC1C,MAAM,CAAC,GAAG,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM;gBAAE,KAAK,GAAG,IAAI,CAAC;YACnF,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,CAAC,EAAE,CAAC;YACN,KAAK,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC;YACd,OAAO,IAAI,CAAC;QACd,CAAC;QACD,iDAAiD;QACjD,OAAO,IAAI;aACR,KAAK,CAAC,aAAa,CAAC;aACpB,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;aAC5C,IAAI,CAAC,EAAE,CAAC,CAAC;IACd,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC;AACvD,CAAC"}
@@ -27,8 +27,12 @@ export interface PlanFlags {
27
27
  /** `plan --check`: exit 1 when the plan is not empty (drift detection in CI). */
28
28
  check: boolean;
29
29
  verbose: boolean;
30
+ /** apply: publish pages whose `${NAME}` is unset as written, instead of refusing. */
31
+ allowUnsetEnv?: boolean;
30
32
  /** Changed pages per apply request. */
31
33
  batch: number;
34
+ /** `apply --secrets-file`: where every shown-once value goes (mode 0600); stdout redacts them either way. */
35
+ secretsFile?: string;
32
36
  }
33
37
  export interface PlanCliDeps {
34
38
  client: ApiClient;
@@ -40,6 +44,8 @@ export interface PlanCliDeps {
40
44
  }
41
45
  type Body = Record<string, unknown>;
42
46
  export declare function runPlanCommand(flags: PlanFlags, deps: PlanCliDeps): Promise<number>;
47
+ /** Why `--secrets-file` cannot be used, or null. An existing file must already be private. */
48
+ export declare function secretsFileProblem(path: string): string | null;
43
49
  export declare function hasChanges(answer: ManifestAnswer): boolean;
44
50
  /**
45
51
  * The apply requests: every page the plan leaves alone is in all of them;
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/plan/command.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAK9D,OAAO,EAA2B,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAExE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,iFAAiF;IACjF,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,SAAS,CAAC;IAClB,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzB,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,C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AC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,SAAS,CAAC;IAClB,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzB,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5D,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEpC,wBAAsB,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAkFzF;AAED,8FAA8F;AAC9F,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ9D;AA+CD,wBAAgB,UAAU,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAE1D;AAgFD;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,CAiB9E"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.runPlanCommand = runPlanCommand;
4
+ exports.secretsFileProblem = secretsFileProblem;
4
5
  exports.hasChanges = hasChanges;
5
6
  exports.batches = batches;
6
7
  const api_1 = require("../publish/api");
@@ -9,6 +10,7 @@ const manifest_1 = require("../publish/manifest");
9
10
  const rewrite_1 = require("../publish/rewrite");
10
11
  const exit_codes_1 = require("../exit-codes");
11
12
  const document_1 = require("./document");
13
+ const node_fs_1 = require("node:fs");
12
14
  const output_1 = require("./output");
13
15
  async function runPlanCommand(flags, deps) {
14
16
  const file = (0, manifest_1.findManifest)(deps.cwd ?? process.cwd(), flags.file);
@@ -31,8 +33,23 @@ async function runPlanCommand(flags, deps) {
31
33
  }
32
34
  if (flags.prune)
33
35
  doc.body.prune = true;
36
+ if (flags.command === 'apply' && flags.secretsFile) {
37
+ // Checked BEFORE the apply: a secret is shown once, so a file we would
38
+ // refuse must stop the run while nothing has been minted.
39
+ const bad = secretsFileProblem(flags.secretsFile);
40
+ if (bad) {
41
+ deps.err(`forumulate apply: ${bad}`);
42
+ return exit_codes_1.EXIT.USAGE;
43
+ }
44
+ }
34
45
  for (const s of doc.skipped)
35
46
  deps.err(`skipped ${s}`);
47
+ for (const w of doc.warnings)
48
+ deps.err(`warning: ${w}`);
49
+ if (flags.command === 'apply' && doc.unsetEnv.length && !flags.allowUnsetEnv) {
50
+ deps.err('forumulate apply: refusing to publish a page with an unset ${NAME} in it; set the variable(s) above, or pass --allow-unset-env to publish the literal text.');
51
+ return exit_codes_1.EXIT.USAGE;
52
+ }
36
53
  const api = new api_1.PublishApi({
37
54
  client: deps.client,
38
55
  authed: true,
@@ -85,11 +102,50 @@ async function runPlanCommand(flags, deps) {
85
102
  return (0, exit_codes_1.exitCodeForError)(e);
86
103
  }
87
104
  }
105
+ /** Why `--secrets-file` cannot be used, or null. An existing file must already be private. */
106
+ function secretsFileProblem(path) {
107
+ if (!(0, node_fs_1.existsSync)(path))
108
+ return null;
109
+ const st = (0, node_fs_1.statSync)(path);
110
+ if (!st.isFile())
111
+ return `--secrets-file ${path} is not a regular file`;
112
+ // Windows has no POSIX modes; the check would refuse every file there.
113
+ if (process.platform !== 'win32' && (st.mode & 0o777) !== 0o600)
114
+ return `--secrets-file ${path} exists with mode ${(st.mode & 0o777).toString(8)}; refusing to overwrite a file that is not 0600 (chmod 600 it, or pick a new path)`;
115
+ return null;
116
+ }
117
+ /** Written beside the target and renamed over it, so the file never exists with looser permissions or half-written. */
118
+ function writeSecretsFile(path, secrets) {
119
+ const tmp = `${path}.${process.pid}.tmp`;
120
+ (0, node_fs_1.writeFileSync)(tmp, `${JSON.stringify(secrets, null, 2)}\n`, { mode: 0o600, flag: 'wx' });
121
+ (0, node_fs_1.chmodSync)(tmp, 0o600); // the umask can only narrow `mode`, but say it
122
+ (0, node_fs_1.renameSync)(tmp, path);
123
+ }
88
124
  function report(answers, flags, deps) {
125
+ let shown = answers;
126
+ if (flags.command === 'apply') {
127
+ const secrets = (0, output_1.collectSecrets)(answers);
128
+ let where;
129
+ if (flags.secretsFile && Object.keys(secrets).length) {
130
+ try {
131
+ writeSecretsFile(flags.secretsFile, secrets);
132
+ where = flags.secretsFile;
133
+ }
134
+ catch (e) {
135
+ // The values exist nowhere else: losing them would cost a rotation, so
136
+ // this one failure prints them (to stderr, not the report).
137
+ deps.err(`forumulate apply: could not write ${flags.secretsFile} (${e.message}); the shown-once values follow, once:`);
138
+ deps.err(JSON.stringify(secrets, null, 2));
139
+ }
140
+ }
141
+ else if (flags.secretsFile)
142
+ where = flags.secretsFile;
143
+ shown = (0, output_1.redactSecrets)(answers, where);
144
+ }
89
145
  if (flags.json)
90
- deps.out(JSON.stringify({ ok: answers.every((a) => a.ok), batches: answers }, null, 2));
146
+ deps.out(JSON.stringify({ ok: shown.every((a) => a.ok), batches: shown }, null, 2));
91
147
  else
92
- (0, output_1.formatApply)(answers, { verbose: flags.verbose }).forEach((l) => deps.out(l));
148
+ (0, output_1.formatApply)(shown, { verbose: flags.verbose }).forEach((l) => deps.out(l));
93
149
  const bad = answers.some((a) => !a.ok || a.steps.some((s) => s.status === 'failed' || ('readBack' in s && s.readBack === 'mismatch')));
94
150
  return bad ? exit_codes_1.EXIT.FAILED : exit_codes_1.EXIT.OK;
95
151
  }
@@ -116,7 +172,8 @@ async function settleImpliedCollections(api, org, doc, spaces) {
116
172
  if (!id)
117
173
  continue;
118
174
  const have = await api.all(`/orgs/${encodeURIComponent(org)}/spaces/${id}/collections`, 'collections');
119
- (0, document_1.dropImplied)(doc.body, space, new Set(have.map((c) => c.slug)), slugs);
175
+ const byName = new Map(have.filter((c) => c.name).map((c) => [c.name.trim().toLowerCase(), c.slug]));
176
+ (0, document_1.dropImplied)(doc.body, space, new Set(have.map((c) => c.slug)), slugs, byName);
120
177
  }
121
178
  }
122
179
  function pendingAssets(doc, spaces) {
@@ -1 +1 @@
1
- {"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/plan/command.ts"],"names":[],"mappings":";;AAkDA,wCAoEC;AAsBD,gCAEC;AAoFD,0BAiBC;AAnPD,wCAAyD;AACzD,8CAA8D;AAC9D,kDAAmD;AACnD,gDAAiE;AACjE,8CAAuD;AACvD,yCAAiG;AACjG,qCAAwE;AA4CjE,KAAK,UAAU,cAAc,CAAC,KAAgB,EAAE,IAAiB;IACtE,MAAM,IAAI,GAAG,IAAA,uBAAY,EAAC,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACjE,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,IAAI,CAAC,GAAG,CAAC,cAAc,KAAK,CAAC,OAAO,wDAAwD,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;QACrI,OAAO,iBAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IACD,IAAI,GAAiB,CAAC;IACtB,IAAI,CAAC;QACH,GAAG,GAAG,IAAA,2BAAgB,EAAC,IAAI,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IACxD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,GAAG,CAAE,CAAW,CAAC,OAAO,CAAC,CAAC;QAC/B,OAAO,iBAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IACD,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;IAC3F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E,CAAC,GAAG,OAAO,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACpF,CAAC;IACD,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -30,7 +30,8 @@ import { type ScannedPage } from './markdown-dir';
30
30
  * resolved here is only what needs the disk: a `dir` becomes its pages, a
31
31
  * file name under `about` / `contactForm` becomes the map it holds, a
32
32
  * `homeDoc` file becomes the intro (with its `.<code>.md` twins), an
33
- * `openapi[].spec` file name becomes the document's text, and a blog's
33
+ * `openapi[].spec` file name becomes the document's text, a changelog's `releases: {file}` becomes
34
+ * its Markdown, and a blog's
34
35
  * `posts: {dir}` or a post `body: posts/x.md` becomes posts (posts-files.ts).
35
36
  */
36
37
  /** The `assets` key prefix of a blog post (a page key is its slug, which never holds a colon). */
@@ -47,6 +48,10 @@ export interface PlanDocument {
47
48
  assets: Map<string, Map<string, Map<string, string>>>;
48
49
  /** Files left out on purpose (drafts), for the plan to name. */
49
50
  skipped: string[];
51
+ /** Dead relative links and unset `${NAME}`s in page bodies: `plan` prints them, never fails on them. */
52
+ warnings: string[];
53
+ /** The `${NAME}` warnings alone: `apply` refuses on these unless `--allow-unset-env`. */
54
+ unsetEnv: string[];
50
55
  /**
51
56
  * Collections this loader added to a space's `collections` (space → slugs),
52
57
  * because a folder implies them. The command drops the ones the space
@@ -55,6 +60,13 @@ export interface PlanDocument {
55
60
  */
56
61
  implied: Map<string, string[]>;
57
62
  }
63
+ /**
64
+ * `{ cbid: ${NAME} }` is a YAML parse error: a plain scalar in a flow map or list cannot hold `{`.
65
+ * Quote each `${NAME}` that is a whole flow entry so `withEnv` finds it as a string afterwards.
66
+ * Only used as a RETRY after the plain parse failed, so a file that already parses (a code sample
67
+ * that prints `${HOME}` inside a block scalar) is never rewritten.
68
+ */
69
+ export declare function quoteFlowEnvRefs(text: string): string;
58
70
  /**
59
71
  * Put each `${NAME}` value in from the environment, so a secret (a consent
60
72
  * webhook secret, a connector key) lives in CI's secret store and the file can
@@ -65,8 +77,12 @@ export interface PlanDocument {
65
77
  */
66
78
  export declare function withEnv(v: unknown, env: NodeJS.ProcessEnv, where: string): unknown;
67
79
  export declare function loadPlanDocument(file: string, env?: NodeJS.ProcessEnv): PlanDocument;
68
- /** Take back implied collections the space turned out to have already. */
69
- export declare function dropImplied(body: Record<string, unknown>, space: string, existing: Set<string>, implied: string[]): void;
80
+ /**
81
+ * Take back implied collections the space turned out to have already: by slug, or — for a
82
+ * `category:` written as a name — by NAME, in which case the pages are pointed at the
83
+ * existing collection's slug instead of creating a twin beside it.
84
+ */
85
+ export declare function dropImplied(body: Record<string, unknown>, space: string, existing: Set<string>, implied: string[], byName?: Map<string, string>): void;
70
86
  /** The pages of a body, typed loosely: what the CLI rewrites and batches. */
71
87
  export declare function pagesOf(body: Record<string, unknown>): ScannedPage[];
72
88
  //# sourceMappingURL=document.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../src/plan/document.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,kGAAkG;AAClG,eAAO,MAAM,QAAQ,UAAU,CAAC;AAKhC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B;;;OAGG;IACH,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACtD,gEAAgE;IAChE,OAAO,EAAE,MAAM,E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E,MAAM,EAAE,CAAC;IAClB,wGAAwG;IACxG,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,yFAAyF;IACzF,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB;;;;;OAKG;IACH,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CAChC;AAOD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAYrD;AAsED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAalF;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,YAAY,CA6GjG;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,EACrB,OAAO,EAAE,MAAM,EAAE,EACjB,MAAM,GAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAa,GACtC,IAAI,CAmBN;AAsBD,6EAA6E;AAC7E,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,WAAW,EAAE,CAEpE"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.POST_KEY = void 0;
4
+ exports.quoteFlowEnvRefs = quoteFlowEnvRefs;
4
5
  exports.withEnv = withEnv;
5
6
  exports.loadPlanDocument = loadPlanDocument;
6
7
  exports.dropImplied = dropImplied;
@@ -9,6 +10,7 @@ const node_fs_1 = require("node:fs");
9
10
  const node_path_1 = require("node:path");
10
11
  const yaml_1 = require("yaml");
11
12
  const markdown_dir_1 = require("./markdown-dir");
13
+ const body_env_1 = require("./body-env");
12
14
  const posts_files_1 = require("./posts-files");
13
15
  /**
14
16
  * `forumulate.yaml` as `forumulate plan` / `apply` read it (DX-D): the API's
@@ -41,7 +43,8 @@ const posts_files_1 = require("./posts-files");
41
43
  * resolved here is only what needs the disk: a `dir` becomes its pages, a
42
44
  * file name under `about` / `contactForm` becomes the map it holds, a
43
45
  * `homeDoc` file becomes the intro (with its `.<code>.md` twins), an
44
- * `openapi[].spec` file name becomes the document's text, and a blog's
46
+ * `openapi[].spec` file name becomes the document's text, a changelog's `releases: {file}` becomes
47
+ * its Markdown, and a blog's
45
48
  * `posts: {dir}` or a post `body: posts/x.md` becomes posts (posts-files.ts).
46
49
  */
47
50
  /** The `assets` key prefix of a blog post (a page key is its slug, which never holds a colon). */
@@ -53,10 +56,42 @@ function asMap(v, where) {
53
56
  throw new Error(`${where} must be a map`);
54
57
  return v;
55
58
  }
59
+ /**
60
+ * `{ cbid: ${NAME} }` is a YAML parse error: a plain scalar in a flow map or list cannot hold `{`.
61
+ * Quote each `${NAME}` that is a whole flow entry so `withEnv` finds it as a string afterwards.
62
+ * Only used as a RETRY after the plain parse failed, so a file that already parses (a code sample
63
+ * that prints `${HOME}` inside a block scalar) is never rewritten.
64
+ */
65
+ function quoteFlowEnvRefs(text) {
66
+ return text
67
+ .split('\n')
68
+ .map((line) => line.replace(/\$\{[A-Za-z_][A-Za-z0-9_]*\}/g, (ref, at) => {
69
+ const before = line.slice(0, at);
70
+ const inFlow = (before.match(/[{[]/g)?.length ?? 0) > (before.match(/[}\]]/g)?.length ?? 0);
71
+ const whole = /[{[:,]\s*$/.test(before) && /^\s*(?:[,}\]]|$)/.test(line.slice(at + ref.length));
72
+ return inFlow && whole ? `"${ref}"` : ref;
73
+ }))
74
+ .join('\n');
75
+ }
56
76
  function readData(file) {
57
77
  const text = (0, node_fs_1.readFileSync)(file, 'utf8');
58
78
  try {
59
- return /\.json$/i.test(file) ? JSON.parse(text) : (0, yaml_1.parse)(text);
79
+ if (/\.json$/i.test(file))
80
+ return JSON.parse(text);
81
+ try {
82
+ return (0, yaml_1.parse)(text);
83
+ }
84
+ catch (first) {
85
+ const quoted = quoteFlowEnvRefs(text);
86
+ if (quoted === text)
87
+ throw first;
88
+ try {
89
+ return (0, yaml_1.parse)(quoted);
90
+ }
91
+ catch {
92
+ throw first;
93
+ }
94
+ }
60
95
  }
61
96
  catch (e) {
62
97
  throw new Error(`${file}: ${e.message}`);
@@ -95,6 +130,16 @@ function openApiOf(v, base) {
95
130
  };
96
131
  return Array.isArray(v) ? v.map(one) : one(v);
97
132
  }
133
+ /** `releases: {file: CHANGELOG.md}` → `{markdown: <the file's text>}`, which the API reads as Keep a Changelog. */
134
+ function releasesOf(v, base, where) {
135
+ if (!v || typeof v !== 'object' || Array.isArray(v) || typeof v.file !== 'string')
136
+ return v;
137
+ const { file, ...rest } = v;
138
+ const abs = (0, node_path_1.resolve)(base, file);
139
+ if (!(0, node_fs_1.existsSync)(abs))
140
+ throw new Error(`${where}: ${file} does not exist`);
141
+ return { ...rest, markdown: (0, node_fs_1.readFileSync)(abs, 'utf8') };
142
+ }
98
143
  /** `about: about.yaml` → the map in that file; a map stays a map. */
99
144
  function fileOrMap(v, base, where) {
100
145
  if (typeof v !== 'string')
@@ -154,6 +199,8 @@ function loadPlanDocument(file, env = process.env) {
154
199
  s.homeDoc = homeDocOf(s.homeDoc, base, codes, `spaces[${i}].homeDoc`);
155
200
  if (s.openapi !== undefined)
156
201
  s.openapi = openApiOf(s.openapi, base);
202
+ if (s.releases !== undefined)
203
+ s.releases = releasesOf(s.releases, base, `spaces[${i}].releases`);
157
204
  if (s.posts !== undefined) {
158
205
  const keys = new Set(s.authors && typeof s.authors === 'object' ? Object.keys(s.authors) : []);
159
206
  const r = (0, posts_files_1.resolvePosts)(s.posts, base, keys, `spaces[${i}].posts`);
@@ -172,29 +219,58 @@ function loadPlanDocument(file, env = process.env) {
172
219
  return Array.isArray(s?.locales) ? s.locales.map((l) => String(l.code ?? '')) : [];
173
220
  };
174
221
  const implied = new Map();
222
+ const warnings = [];
223
+ const unset = [];
175
224
  if (body.pages !== undefined) {
176
225
  if (!Array.isArray(body.pages))
177
226
  throw new Error(`${file}: pages must be a list`);
178
227
  const pages = [];
179
228
  for (const [i, entry] of body.pages.entries()) {
180
229
  const e = asMap(entry, `pages[${i}]`);
230
+ if (e.env !== undefined && typeof e.env !== 'boolean')
231
+ throw new Error(`pages[${i}]: \`env\` must be true or false`);
181
232
  if (e.dir === undefined) {
182
- pages.push(e);
233
+ // `env` is the CLI's, never the API's (it would be an unknown key there).
234
+ const { env: useEnv, ...page } = e;
235
+ if (useEnv === true) {
236
+ const where = `pages[${i}] (${String(page.space)}/${String(page.slug)})`;
237
+ const one = (s) => {
238
+ if (typeof s !== 'string')
239
+ return s;
240
+ const r = (0, body_env_1.substituteBody)(s, env);
241
+ const lines = r.unset.map((n) => `${where}: \${${n}} is not set in the environment; left as written in the page`);
242
+ unset.push(...lines);
243
+ warnings.push(...lines);
244
+ return r.text;
245
+ };
246
+ if (page.body !== undefined)
247
+ page.body = one(page.body);
248
+ if (page.sections && typeof page.sections === 'object')
249
+ page.sections = Object.fromEntries(Object.entries(page.sections).map(([k, v]) => [k, one(v)]));
250
+ }
251
+ pages.push(page);
183
252
  continue;
184
253
  }
185
- const extra = Object.keys(e).filter((k) => !['dir', 'space', 'collection', 'locales'].includes(k));
254
+ const extra = Object.keys(e).filter((k) => !['dir', 'space', 'collection', 'locales', 'ignore', 'env'].includes(k));
186
255
  if (extra.length)
187
- throw new Error(`pages[${i}]: a folder entry takes dir, space, collection and locales; not ${extra.join(', ')}`);
256
+ throw new Error(`pages[${i}]: a folder entry takes dir, space, collection, locales, ignore and env; not ${extra.join(', ')}`);
188
257
  if (typeof e.dir !== 'string' || typeof e.space !== 'string')
189
258
  throw new Error(`pages[${i}]: a folder entry needs \`dir\` and \`space\``);
259
+ if (e.ignore !== undefined && !(Array.isArray(e.ignore) && e.ignore.every((g) => typeof g === 'string')))
260
+ throw new Error(`pages[${i}]: \`ignore\` must be a list of globs`);
190
261
  const extraLocales = Array.isArray(e.locales) ? e.locales.map(String) : [];
191
262
  const scan = (0, markdown_dir_1.scanMarkdownDir)((0, node_path_1.resolve)(base, e.dir), {
192
263
  space: e.space,
193
264
  locales: [...localesOf(e.space), ...extraLocales],
194
265
  ...(typeof e.collection === 'string' ? { collection: e.collection } : {}),
266
+ ...(e.ignore ? { ignore: e.ignore } : {}),
267
+ env: e.env === true,
268
+ envVars: env,
195
269
  });
196
270
  pages.push(...scan.pages);
197
271
  skipped.push(...scan.skipped.map((s) => `${e.dir}/${s}`));
272
+ warnings.push(...scan.warnings.map((w) => `${e.dir}/${w}`));
273
+ unset.push(...scan.unsetEnv.map((w) => `${e.dir}/${w}`));
198
274
  const forSpace = assets.get(e.space) ?? new Map();
199
275
  for (const [k, v] of scan.assets)
200
276
  forSpace.set(k, v);
@@ -212,15 +288,39 @@ function loadPlanDocument(file, env = process.env) {
212
288
  body,
213
289
  assets,
214
290
  skipped,
291
+ warnings,
292
+ unsetEnv: unset,
215
293
  implied,
216
294
  };
217
295
  }
218
- /** Take back implied collections the space turned out to have already. */
219
- function dropImplied(body, space, existing, implied) {
296
+ /**
297
+ * Take back implied collections the space turned out to have already: by slug, or — for a
298
+ * `category:` written as a name — by NAME, in which case the pages are pointed at the
299
+ * existing collection's slug instead of creating a twin beside it.
300
+ */
301
+ function dropImplied(body, space, existing, implied, byName = new Map()) {
220
302
  const s = (Array.isArray(body.spaces) ? body.spaces : []).find((x) => x.slug === space);
221
303
  if (!s || !Array.isArray(s.collections))
222
304
  return;
223
- s.collections = s.collections.filter((c) => !(implied.includes(String(c.slug)) && existing.has(String(c.slug))));
305
+ const list = s.collections;
306
+ const taken = new Set();
307
+ for (const c of list) {
308
+ const slug = String(c.slug);
309
+ if (!implied.includes(slug))
310
+ continue;
311
+ if (existing.has(slug)) {
312
+ taken.add(slug);
313
+ continue;
314
+ }
315
+ const target = byName.get(String(c.name ?? '').trim().toLowerCase());
316
+ if (!target)
317
+ continue;
318
+ taken.add(slug);
319
+ for (const p of pagesOf(body))
320
+ if (p.space === space && p.collection === slug)
321
+ p.collection = target;
322
+ }
323
+ s.collections = list.filter((c) => !taken.has(String(c.slug)));
224
324
  if (s.collections.length === 0)
225
325
  delete s.collections;
226
326
  }