bearminion 0.0.0-stage → 1.0.1
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 +19 -0
- package/LICENSE +21 -0
- package/README.md +56 -2
- package/dist/astro.d.ts +43 -0
- package/dist/astro.js +1754 -0
- package/dist/content.d.ts +39 -0
- package/dist/content.js +63 -0
- package/dist/draft-store-1Y4-sn45.js +236 -0
- package/dist/index.d.ts +227 -0
- package/dist/index.js +361 -0
- package/dist/marks-BzLa48Y9.d.ts +50 -0
- package/dist/marks.d.ts +2 -0
- package/dist/marks.js +174 -0
- package/dist/migrate-B56wxCiC.js +59 -0
- package/dist/options-CxRzVfhi.d.ts +115 -0
- package/dist/page-C0l3CIuz.js +424 -0
- package/dist/page-DgQlGree.d.ts +1227 -0
- package/dist/preview-C9MHO88K.js +55 -0
- package/dist/reload-COk8Nncw.js +201 -0
- package/dist/rich-text.d.ts +41 -0
- package/dist/rich-text.js +365 -0
- package/dist/theme-DZkec408.js +33 -0
- package/dist/theme-colors-BneXpLYG.js +425 -0
- package/dist/ui/mount.d.ts +4 -0
- package/dist/ui/mount.js +21934 -0
- package/package.json +92 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# bearminion
|
|
2
|
+
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0fb0cc9: Published through npm trusted publishing, with a provenance attestation that links the package to its source commit and build. No code changes.
|
|
8
|
+
|
|
9
|
+
## 1.0.0
|
|
10
|
+
|
|
11
|
+
First public release.
|
|
12
|
+
|
|
13
|
+
- Content model: pages and site settings as JSON in the repository, validated with Zod against the site's own `defineSection`, `defineSite` and `defineTheme` definitions, with content migrations (`schemaVersion`).
|
|
14
|
+
- Entry points: `bearminion` (runtime-neutral schemas and helpers), `bearminion/astro` (integration, file store, loaders), `bearminion/content`, `bearminion/rich-text` and `bearminion/marks`. `astro` 7 and `zod` 4 are peer dependencies.
|
|
15
|
+
- Dev-only inline editor: click-to-edit text, rich text (bold, italic, links, lists) on ProseMirror, section toolbar (move, add, duplicate, settings, delete), sidebar tabs for pages, section, navigation, footer, design and site settings, and a palette derived from three seed colors with WCAG contrast checks.
|
|
16
|
+
- Images: an upload library that includes the theme's own images, fit and position controls, and guards against deleting an image that saved content or the unsaved draft still uses.
|
|
17
|
+
- Saving: one transactional `POST /save` for the page and the site, with validation issues reported per file; undo and redo, version history in `.editor/history/`, drafts kept in `localStorage`, and optional local git commits (`bearminion({ git: true })`, never pushes).
|
|
18
|
+
- Security: the dev API answers only local, same-origin requests; uploads are checked by signature; pasted HTML is parsed and reduced to the supported subset.
|
|
19
|
+
- Production: `astro build` ships a static site with nothing from the editor in it.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jakub Lange
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,57 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/langehelp-software/bearminion/main/.github/assets/banner.png" alt="BearMinion: a git-based CMS for Astro. Click to edit. Commit to publish." width="100%" />
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
A website you edit by clicking on it. No database, no admin panel, no server.<br />
|
|
7
|
+
Built on <a href="https://astro.build">Astro</a>.
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<a href="https://www.npmjs.com/package/bearminion"><img src="https://img.shields.io/npm/v/bearminion?color=169717" alt="npm version" /></a>
|
|
12
|
+
<a href="https://github.com/langehelp-software/bearminion/actions/workflows/ci.yml"><img src="https://github.com/langehelp-software/bearminion/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
|
|
13
|
+
<a href="https://github.com/langehelp-software/bearminion/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-169717" alt="MIT license" /></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
This package is the engine behind BearMinion. You don't install it on its own: create a site from the template and it comes included.
|
|
17
|
+
|
|
18
|
+
## Quick start
|
|
19
|
+
|
|
20
|
+
You need [Node.js](https://nodejs.org) 22.12 or newer.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm create astro@latest -- --template langehelp-software/bearminion/templates/default my-site
|
|
24
|
+
cd my-site
|
|
25
|
+
npm run dev
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Open the address it prints, press **Ctrl+E** (**Cmd+E** on a Mac), click any text to change it, and press **Ctrl/Cmd+S** to save. Push the folder to GitHub and import it in Vercel, Netlify or Cloudflare Pages to put it online.
|
|
29
|
+
|
|
30
|
+
<p align="center">
|
|
31
|
+
<img src="https://raw.githubusercontent.com/langehelp-software/bearminion/main/.github/assets/editor.png" alt="The BearMinion editor: a section toolbar on the hero, a heading being edited, and the Pages tab in the sidebar" width="100%" />
|
|
32
|
+
</p>
|
|
33
|
+
|
|
34
|
+
## What you can change
|
|
35
|
+
|
|
36
|
+
- **Text** right on the page, with bold, italic, links and lists
|
|
37
|
+
- **Sections**: ten ready-made types, each with three layouts, added from a visual picker
|
|
38
|
+
- **Pages, menus and footer**, with titles and descriptions for search and sharing
|
|
39
|
+
- **Images**: upload, choose how they fill their frame and which part stays in view
|
|
40
|
+
- **Colors**: pick three, and the editor builds a full light and dark palette that stays readable
|
|
41
|
+
|
|
42
|
+
Content is plain JSON in your project, validated on every save and kept in your git history. The editor only runs during `astro dev`; the published site is static HTML with nothing from the editor in it.
|
|
43
|
+
|
|
44
|
+
<p align="center">
|
|
45
|
+
<img src="https://raw.githubusercontent.com/langehelp-software/bearminion/main/.github/assets/design.png" alt="The Design tab: color mode, brand, neutral and link colors, and a preview of every section tone in light and dark mode" width="100%" />
|
|
46
|
+
</p>
|
|
47
|
+
|
|
48
|
+
## Learn more
|
|
49
|
+
|
|
50
|
+
- [Documentation](https://github.com/langehelp-software/bearminion/blob/main/docs/README.md), including [building your own theme](https://github.com/langehelp-software/bearminion/blob/main/docs/themes.md) on this package
|
|
51
|
+
- [Source and issues](https://github.com/langehelp-software/bearminion)
|
|
52
|
+
|
|
53
|
+
Requires Astro 7 and Zod 4 (peer dependencies, already in the template).
|
|
54
|
+
|
|
55
|
+
## License
|
|
56
|
+
|
|
57
|
+
[MIT](https://github.com/langehelp-software/bearminion/blob/main/LICENSE) © Jakub Lange
|
package/dist/astro.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Dt as ContentMigrator, M as SiteDefinition, N as SiteOf, g as SectionRegistry, h as ContentModel, t as Page, u as SectionOf } from "./page-DgQlGree.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-CxRzVfhi.js";
|
|
3
|
+
import { AstroIntegration } from "astro";
|
|
4
|
+
//#region src/integration.d.ts
|
|
5
|
+
interface BearminionIntegration extends AstroIntegration {
|
|
6
|
+
name: 'bearminion';
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Dev-only Astro integration. `astro build`, `astro preview`, and `astro sync`
|
|
10
|
+
* return before any plugin, route, or script is registered. `astro:server:setup`
|
|
11
|
+
* runs only while `astro dev` is serving.
|
|
12
|
+
*/
|
|
13
|
+
export declare function bearminion(options: BearminionOptions): BearminionIntegration;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/load.d.ts
|
|
16
|
+
interface LoadOptions {
|
|
17
|
+
/** Upgrades files written under an older `schemaVersion`. `loadContent` builds it from the model. */
|
|
18
|
+
migrator?: ContentMigrator;
|
|
19
|
+
/**
|
|
20
|
+
* Keep a page's sections whose `type` the site no longer defines, instead of failing. For config-time
|
|
21
|
+
* code that does not render sections (the sitemap filter, the `site` URL), so `astro dev` still starts and
|
|
22
|
+
* the editor can open the page and remove the section. The collections and the build stay strict.
|
|
23
|
+
*/
|
|
24
|
+
tolerateOrphans?: boolean;
|
|
25
|
+
}
|
|
26
|
+
interface LoadedContent<TModel extends ContentModel = ContentModel> {
|
|
27
|
+
site: SiteOf<TModel['site']>;
|
|
28
|
+
pages: Page<SectionOf<TModel['sections']>>[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Load `site.json` and `pages/*.json` from a content directory.
|
|
32
|
+
* Throws {@link ContentReadError} or {@link ContentValidationError} with the file path.
|
|
33
|
+
*/
|
|
34
|
+
export declare function loadContent<TModel extends ContentModel>(contentDir: string, model: TModel, options?: Pick<LoadOptions, 'tolerateOrphans'>): LoadedContent<TModel>;
|
|
35
|
+
/** Validate and return `contentDir/site.json`. */
|
|
36
|
+
export declare function loadSite<TDefinition extends SiteDefinition>(contentDir: string, site: TDefinition, { migrator }?: Pick<LoadOptions, 'migrator'>): SiteOf<TDefinition>;
|
|
37
|
+
/**
|
|
38
|
+
* Validate every `contentDir/pages/*.json` file.
|
|
39
|
+
* Pages are returned in filename order. Slugs must be unique.
|
|
40
|
+
*/
|
|
41
|
+
export declare function loadPages<TRegistry extends SectionRegistry>(contentDir: string, registry: TRegistry, { migrator, tolerateOrphans }?: LoadOptions): Page<SectionOf<TRegistry>>[];
|
|
42
|
+
//#endregion
|
|
43
|
+
export { type BearminionIntegration, type BearminionOptions, type ContentStore, type EditorContext, type FileStoreOptions, type LoadOptions, type LoadedContent, StoreKeyError, type StoreOperation, type UploadStore, bearminion as default, createFileStore };
|