bearminion 1.7.0 → 1.9.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 (92) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/astro.d.ts +2 -2
  3. package/dist/astro.js +17 -5
  4. package/dist/cli.d.ts +1 -0
  5. package/dist/cli.js +819 -0
  6. package/dist/content.d.ts +1 -1
  7. package/dist/content.js +2 -2
  8. package/dist/hash-BeBymBO1.js +59 -0
  9. package/dist/index.d.ts +2 -2
  10. package/dist/index.js +4 -4
  11. package/dist/marks-DPBilumg.js +174 -0
  12. package/dist/marks.js +1 -174
  13. package/dist/{options-BeJQnsZM.d.ts → options-4HWVEj9O.d.ts} +7 -1
  14. package/dist/{page-BfI9cD8g.d.ts → page-CA4iyFDS.d.ts} +7 -7
  15. package/dist/{page-NOFVEqn1.js → page-X-WnOu7-.js} +1 -1
  16. package/dist/{preview--S1QUrMM.js → preview-B_88I5Jm.js} +1 -1
  17. package/dist/{reload-BPkPoQ-P.js → reload-Dkp3xC0l.js} +1 -1
  18. package/dist/rich-text-70hddxMC.js +403 -0
  19. package/dist/rich-text.js +1 -403
  20. package/dist/sections-manifest-CO9QfJPG.js +97 -0
  21. package/dist/{theme-DFjHjgFO.js → theme-Dv7_7B56.js} +2 -2
  22. package/dist/ui/mount.js +20 -7
  23. package/package.json +7 -1
  24. package/registry/default/files/src/components/atoms/Button.astro +64 -0
  25. package/registry/default/files/src/components/atoms/Emphasis.astro +24 -0
  26. package/registry/default/files/src/components/atoms/Image.astro +78 -0
  27. package/registry/default/files/src/components/atoms/Typography.astro +53 -0
  28. package/registry/default/files/src/components/atoms/button.ts +31 -0
  29. package/registry/default/files/src/components/atoms/image.ts +34 -0
  30. package/registry/default/files/src/components/atoms/options.ts +39 -0
  31. package/registry/default/files/src/components/atoms/typography.ts +64 -0
  32. package/registry/default/files/src/components/molecules/CommandLine.astro +109 -0
  33. package/registry/default/files/src/components/molecules/MediaFrame.astro +71 -0
  34. package/registry/default/files/src/components/molecules/Pill.astro +24 -0
  35. package/registry/default/files/src/components/molecules/SectionHeader.astro +63 -0
  36. package/registry/default/files/src/components/molecules/SectionShell.astro +33 -0
  37. package/registry/default/files/src/components/sections/contact/Contact.astro +231 -0
  38. package/registry/default/files/src/components/sections/contact/definition.ts +52 -0
  39. package/registry/default/files/src/components/sections/contact/form.ts +313 -0
  40. package/registry/default/files/src/components/sections/contact/wireframe.ts +15 -0
  41. package/registry/default/files/src/components/sections/cta/Cta.astro +206 -0
  42. package/registry/default/files/src/components/sections/cta/definition.ts +49 -0
  43. package/registry/default/files/src/components/sections/cta/wireframe.ts +9 -0
  44. package/registry/default/files/src/components/sections/faq/Faq.astro +136 -0
  45. package/registry/default/files/src/components/sections/faq/definition.ts +54 -0
  46. package/registry/default/files/src/components/sections/faq/wireframe.ts +19 -0
  47. package/registry/default/files/src/components/sections/features/Features.astro +146 -0
  48. package/registry/default/files/src/components/sections/features/definition.ts +54 -0
  49. package/registry/default/files/src/components/sections/features/wireframe.ts +19 -0
  50. package/registry/default/files/src/components/sections/gallery/Gallery.astro +128 -0
  51. package/registry/default/files/src/components/sections/gallery/definition.ts +59 -0
  52. package/registry/default/files/src/components/sections/gallery/lightbox.ts +159 -0
  53. package/registry/default/files/src/components/sections/gallery/wireframe.ts +12 -0
  54. package/registry/default/files/src/components/sections/hero/Hero.astro +185 -0
  55. package/registry/default/files/src/components/sections/hero/HeroBadge.astro +26 -0
  56. package/registry/default/files/src/components/sections/hero/definition.ts +74 -0
  57. package/registry/default/files/src/components/sections/hero/wireframe.ts +12 -0
  58. package/registry/default/files/src/components/sections/logo-strip/LogoStrip.astro +107 -0
  59. package/registry/default/files/src/components/sections/logo-strip/definition.ts +30 -0
  60. package/registry/default/files/src/components/sections/logo-strip/wireframe.ts +11 -0
  61. package/registry/default/files/src/components/sections/media/Media.astro +118 -0
  62. package/registry/default/files/src/components/sections/media/MediaPlayer.astro +176 -0
  63. package/registry/default/files/src/components/sections/media/definition.ts +77 -0
  64. package/registry/default/files/src/components/sections/media/source.ts +3 -0
  65. package/registry/default/files/src/components/sections/media/wireframe.ts +9 -0
  66. package/registry/default/files/src/components/sections/pricing/Pricing.astro +210 -0
  67. package/registry/default/files/src/components/sections/pricing/definition.ts +62 -0
  68. package/registry/default/files/src/components/sections/pricing/wireframe.ts +18 -0
  69. package/registry/default/files/src/components/sections/shared.ts +13 -0
  70. package/registry/default/files/src/components/sections/stats/Stats.astro +110 -0
  71. package/registry/default/files/src/components/sections/stats/definition.ts +41 -0
  72. package/registry/default/files/src/components/sections/stats/wireframe.ts +15 -0
  73. package/registry/default/files/src/components/sections/steps/Steps.astro +139 -0
  74. package/registry/default/files/src/components/sections/steps/definition.ts +62 -0
  75. package/registry/default/files/src/components/sections/steps/icons.ts +27 -0
  76. package/registry/default/files/src/components/sections/steps/wireframe.ts +16 -0
  77. package/registry/default/files/src/components/sections/testimonials/Testimonials.astro +172 -0
  78. package/registry/default/files/src/components/sections/testimonials/definition.ts +42 -0
  79. package/registry/default/files/src/components/sections/testimonials/wireframe.ts +21 -0
  80. package/registry/default/files/src/components/sections/text/Text.astro +43 -0
  81. package/registry/default/files/src/components/sections/text/definition.ts +36 -0
  82. package/registry/default/files/src/components/sections/text/wireframe.ts +12 -0
  83. package/registry/default/files/src/components/sections/text-image/TextImage.astro +107 -0
  84. package/registry/default/files/src/components/sections/text-image/definition.ts +39 -0
  85. package/registry/default/files/src/components/sections/text-image/wireframe.ts +12 -0
  86. package/registry/default/files/src/lib/assets.ts +13 -0
  87. package/registry/default/files/src/lib/cn.ts +6 -0
  88. package/registry/default/files/src/lib/contact-form.ts +97 -0
  89. package/registry/default/files/src/lib/hidden-text.ts +32 -0
  90. package/registry/default/files/src/lib/image-url.ts +38 -0
  91. package/registry/default/files/src/lib/link-attrs.ts +74 -0
  92. package/registry/default/registry.json +670 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # bearminion
2
2
 
3
+ ## 1.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d1c211b: `npx bearminion add <section...>` copies a section into an existing site, with the atoms, molecules and helpers it imports, and lists it in the generated section files. It writes a file only when the site has none, or has an earlier release's copy that nobody changed; a file you changed stops it, and nothing is written unless you pass `--overwrite`. `--list`, `--dry-run`, `--yes`, `--diff`, `--install` and `--json` are there for people and for scripts. New sites start with a `bearminion.lock.json`, and `add` keeps it up to date. The files come from a registry that ships inside the package, so nothing is downloaded. See [The command line](https://github.com/langehelp-software/bearminion/blob/main/docs/cli.md).
8
+ - 7819b98: `npx bearminion add form resend --host vercel` writes the Contact form's handler to `src/forms/contact.ts` and the Vercel function that runs it. It is the first form recipe sent through a real service; Formspree, Web3Forms, Postmark, Slack and the Netlify, Cloudflare and Astro glue stay in the Forms guide as files to copy until each has been tried. The handler is written with example `FROM` and `TO` addresses and refuses to send until you change them. The command never replaces a handler you wrote unless you pass `--overwrite`, and it notes the files in `bearminion.lock.json`. `BEARMINION_FORMS=required` in the host's build environment makes `astro build` fail while a Contact form has no handler. See [The command line](https://github.com/langehelp-software/bearminion/blob/main/docs/cli.md#add-a-form-handler).
9
+ - 7819b98: A detail in the Contact section has a **Hide from crawlers** switch. Switched on, the built page carries the email address or phone number scrambled and a few lines of script show it when the page loads, so crawlers that only read the HTML find nothing to collect. It is off by default and changes nothing for existing sites. The editor can now show an optional on/off switch on a list item that does not have it yet. The form recipe for Resend reads the sender and receiver from `CONTACT_FROM` and `CONTACT_TO`, so no address is written into the repository.
10
+
11
+ ### Patch Changes
12
+
13
+ - 75bf724: A text field you edit in the sidebar now shows on the page before you save. It used to update only when the same text was typed on the page itself, so a change to, say, a Contact detail or an eyebrow stayed invisible until you saved and reloaded.
14
+
15
+ ## 1.8.0
16
+
17
+ ### Minor Changes
18
+
19
+ - 305d094: A section type is now a directory, and nothing else has to be edited. `npx bearminion sync` (new command) writes `definitions.gen.ts` and `components.gen.ts` from the directories under `sections/`; the starter's hand-written `registry.ts` and the `case` per section in `SectionList.astro` are gone. The new `sectionsDir` option makes `astro build`, `astro check` and `astro sync` stop when the generated files are stale, and `astro dev` warn. `npx bearminion sync --check` is the same test for CI.
20
+
21
+ Sites created before this release keep working as they are. To move one over, copy `definitions.ts`, `SectionList.astro` and `astro.config.ts` from a new site, delete `registry.ts`, run `npx bearminion sync`, and read [Add a section type](https://github.com/langehelp-software/bearminion/blob/main/templates/default/README.md#add-a-section-type).
22
+
3
23
  ## 1.7.0
4
24
 
5
25
  ### Minor Changes
package/dist/astro.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as SectionRegistry, J as SiteDefinition, Y as SiteOf, Yt as ContentMigrator, k as ContentModel, t as Page, u as SectionOf } from "./page-BfI9cD8g.js";
2
- import { a as StoreKeyError, c as createFileStore, i as FileStoreOptions, n as EditorContext, o as StoreOperation, r as ContentStore, s as UploadStore, t as BearminionOptions } from "./options-BeJQnsZM.js";
1
+ import { A as SectionRegistry, J as SiteDefinition, Y as SiteOf, Yt as ContentMigrator, k as ContentModel, t as Page, u as SectionOf } from "./page-CA4iyFDS.js";
2
+ import { a as StoreKeyError, c as createFileStore, i as FileStoreOptions, n as EditorContext, o as StoreOperation, r as ContentStore, s as UploadStore, t as BearminionOptions } from "./options-4HWVEj9O.js";
3
3
  import { AstroIntegration } from "astro";
4
4
  //#region src/integration.d.ts
5
5
  interface BearminionIntegration extends AstroIntegration {
package/dist/astro.js CHANGED
@@ -1,9 +1,10 @@
1
- import { a as imageFields, c as ContentReadError, l as ContentValidationError, r as loadThemePreview, t as PreviewUnavailableError } from "./preview--S1QUrMM.js";
2
- import { t as defaultTheme } from "./theme-DFjHjgFO.js";
3
- import { i as isSystemPage, n as createPageSchema$1, r as createTolerantPageSchema, s as withoutOrphanSections, u as isOrphanSection } from "./page-NOFVEqn1.js";
1
+ import { a as imageFields, c as ContentReadError, l as ContentValidationError, r as loadThemePreview, t as PreviewUnavailableError } from "./preview-B_88I5Jm.js";
2
+ import { t as defaultTheme } from "./theme-Dv7_7B56.js";
3
+ import { i as isSystemPage, n as createPageSchema$1, r as createTolerantPageSchema, s as withoutOrphanSections, u as isOrphanSection } from "./page-X-WnOu7-.js";
4
4
  import { a as DEFAULT_UPLOADS_DIR, i as DEFAULT_CONTENT_DIR, n as createMigrator, o as DEFAULT_VIDEOS_DIR, r as API_PREFIX, t as SCHEMA_VERSION_KEY } from "./migrate-b408EaLp.js";
5
- import { a as JSON_BODY_LIMIT, c as isInside, d as resolveDir, f as resolveInside, i as IMAGE_BYTE_LIMIT, l as isLocalRequest, n as contentReloadPlugin, o as MULTIPART_BODY_LIMIT, r as dropEarlyReloadAfterSave, s as asDirectory, u as readSlug } from "./reload-BPkPoQ-P.js";
5
+ import { a as JSON_BODY_LIMIT, c as isInside, d as resolveDir, f as resolveInside, i as IMAGE_BYTE_LIMIT, l as isLocalRequest, n as contentReloadPlugin, o as MULTIPART_BODY_LIMIT, r as dropEarlyReloadAfterSave, s as asDirectory, u as readSlug } from "./reload-Dkp3xC0l.js";
6
6
  import { S as isAssetPath, b as describeSiteRef, c as projectId, v as assetRefs, y as describePageRef } from "./draft-store-1Y4-sn45.js";
7
+ import { i as syncSections, r as staleSectionsMessage } from "./sections-manifest-CO9QfJPG.js";
7
8
  import { z } from "zod";
8
9
  import fs from "node:fs";
9
10
  import path from "node:path";
@@ -1997,7 +1998,14 @@ function bearminion(options) {
1997
1998
  return {
1998
1999
  name: "bearminion",
1999
2000
  hooks: {
2000
- "astro:config:setup"({ command, config, updateConfig, injectScript }) {
2001
+ "astro:config:setup"({ command, config, updateConfig, injectScript, logger }) {
2002
+ if (options.sectionsDir !== void 0) {
2003
+ const { changed } = syncSections(path.resolve(rootPath(config.root), options.sectionsDir), { check: true });
2004
+ if (changed.length > 0) {
2005
+ if (command !== "dev") throw new Error(staleSectionsMessage(changed));
2006
+ logger.warn(staleSectionsMessage(changed));
2007
+ }
2008
+ }
2001
2009
  if (command !== "dev") return;
2002
2010
  const context = resolveEditorContext(options, rootInput(config.root));
2003
2011
  updateConfig({ vite: {
@@ -2087,6 +2095,10 @@ async function renderSitePreview(environment, previewModule, site, pathname) {
2087
2095
  pathname
2088
2096
  });
2089
2097
  }
2098
+ function rootPath(root) {
2099
+ const input = rootInput(root);
2100
+ return input instanceof URL ? fileURLToPath(input) : input;
2101
+ }
2090
2102
  function rootInput(root) {
2091
2103
  if (typeof root === "string" || root instanceof URL) return root;
2092
2104
  return process.cwd();
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {}