bearminion 1.16.2 → 1.18.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.
- package/CHANGELOG.md +21 -0
- package/dist/astro.js +28 -3
- package/dist/cli.js +366 -0
- package/dist/hosted-astro.js +1 -1
- package/dist/{hosted-middleware-BQPW2YiB.js → hosted-middleware-CedN9WNM.js} +5 -0
- package/dist/hosted.d.ts +6 -0
- package/dist/hosted.js +1 -1
- package/package.json +1 -1
- package/registry/default/files/src/components/seo/Seo.astro +73 -0
- package/registry/default/files/src/env.d.ts +13 -0
- package/registry/default/files/src/pages/404.astro +18 -0
- package/registry/default/files/src/pages/[...slug].astro +40 -0
- package/registry/default/registry.json +111 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# bearminion
|
|
2
2
|
|
|
3
|
+
## 1.18.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- aa89b17: `npx bearminion add hosted` sets a site up for the hosted editor.
|
|
8
|
+
|
|
9
|
+
- Writes the starter files the editor depends on (`src/lib/editing.ts`, `image-url.ts`, `env.d.ts`, the image components, `Seo.astro`, the page routes, and the Media and Logo strip sections when the site has them), `src/editor.ts`, and `astro.editor.config.ts`, the build of the editor deployment. It adds a `build:editor` script to `package.json` without reformatting it, notes everything in `bearminion.lock.json`, and prints the GitHub App and Vercel checklist. `--dry-run`, `--yes`, `--overwrite`, `--install`, `--diff` and `--json` work as for sections.
|
|
10
|
+
- Never edits `astro.config.ts`. The editor build merges the site's config with the adapter and `bearminionHostedEditor`, so the public build cannot load editor code. Vercel only for now.
|
|
11
|
+
- `status` and `add` now recognise the files of every release back to 1.0, not only 1.9 and later. A site made before 1.9 and without a lock file used to see its untouched files reported as `differs`; they are now `outdated` and `add` replaces them. `Seo.astro`, `env.d.ts` and the page routes are tracked as well, so `add hosted` can tell an old copy from one you changed.
|
|
12
|
+
- Sites that already run the hosted editor with an environment-variable gate in `astro.config.ts` keep working and are left as they are.
|
|
13
|
+
|
|
14
|
+
## 1.17.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- 6ed3bc2: The hosted editor can now be limited to named people, and it warns when a site's own files are older than it needs.
|
|
19
|
+
|
|
20
|
+
- `auth: { allowedLogins: ['ann', 'bob'] }` narrows sign-in to those GitHub logins, on top of push access. It is checked at sign-in and on every request, so a login removed from the list is signed out at its next request. An empty list is refused.
|
|
21
|
+
- The editor build warns when a starter site has no `src/lib/editing.ts`, or when `src/pages/[...slug].astro` or `src/pages/404.astro` never reads `Astro.locals.bearminion`. A missing `editing.ts` makes a page answer 500 after an image is uploaded in the editor.
|
|
22
|
+
- Sites created before 1.16 do not get 1.16's fixes to `MediaFrame`, `Image`, `Seo`, `LogoStrip`, `env.d.ts` and the page routes from `npm update`. See "Keeping the site's files current" in the integration guide for the steps, then `npx bearminion@latest status`.
|
|
23
|
+
|
|
3
24
|
## 1.16.2
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/dist/astro.js
CHANGED
|
@@ -10,7 +10,7 @@ import { a as isHistoryId, c as imageBodyLimit, d as stableStringify, i as histo
|
|
|
10
10
|
import { S as isAssetPath } from "./draft-store-DBEfw_Gq.js";
|
|
11
11
|
import { n as contentReloadPlugin, r as dropEarlyReloadAfterSave } from "./reload-BzVw721A.js";
|
|
12
12
|
import { i as syncSections, r as staleSectionsMessage } from "./sections-manifest-CO9QfJPG.js";
|
|
13
|
-
import fs from "node:fs";
|
|
13
|
+
import fs, { existsSync, readFileSync } from "node:fs";
|
|
14
14
|
import path from "node:path";
|
|
15
15
|
import { fileURLToPath } from "node:url";
|
|
16
16
|
import { promisify } from "node:util";
|
|
@@ -944,6 +944,28 @@ function isErrno(error) {
|
|
|
944
944
|
return error instanceof Error && "code" in error;
|
|
945
945
|
}
|
|
946
946
|
//#endregion
|
|
947
|
+
//#region src/hosted-template-check.ts
|
|
948
|
+
const TEMPLATE_DOCS = "https://docs.bearminion.com/integration/#keeping-the-sites-files-current";
|
|
949
|
+
/** Reads a file, or `undefined` when it is not there. */
|
|
950
|
+
function read(file) {
|
|
951
|
+
try {
|
|
952
|
+
return existsSync(file) ? readFileSync(file, "utf8") : void 0;
|
|
953
|
+
} catch {
|
|
954
|
+
return;
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
/** What is out of step in the project at `root`, one sentence each. Empty when the site is current, or is not the starter. */
|
|
958
|
+
function staleTemplateProblems(root) {
|
|
959
|
+
const problems = [];
|
|
960
|
+
const starterMarker = path.join(root, "src/components/molecules/MediaFrame.astro");
|
|
961
|
+
if (existsSync(starterMarker) && !existsSync(path.join(root, "src/lib/editing.ts"))) problems.push("src/lib/editing.ts is missing, so the image components throw for an image uploaded in the editor and the page answers 500 until the next build.");
|
|
962
|
+
const route = read(path.join(root, "src/pages/[...slug].astro"));
|
|
963
|
+
if (route !== void 0 && !route.includes("locals.bearminion")) problems.push("src/pages/[...slug].astro does not read Astro.locals.bearminion, so the editor would show the pages as they were at build time.");
|
|
964
|
+
const notFound = read(path.join(root, "src/pages/404.astro"));
|
|
965
|
+
if (notFound !== void 0 && !notFound.includes("locals.bearminion")) problems.push("src/pages/404.astro does not read Astro.locals.bearminion, so the editor would show the 404 page as it was at build time.");
|
|
966
|
+
return problems;
|
|
967
|
+
}
|
|
968
|
+
//#endregion
|
|
947
969
|
//#region src/hosted-integration.ts
|
|
948
970
|
const VIRTUAL_ID = "virtual:bearminion/editor";
|
|
949
971
|
const RESOLVED_ID = `\0${VIRTUAL_ID}`;
|
|
@@ -958,9 +980,12 @@ function bearminionHostedEditor(options) {
|
|
|
958
980
|
if (!options.module) throw new Error("bearminionHostedEditor needs `module`: the file that exports your hosted editor.");
|
|
959
981
|
return {
|
|
960
982
|
name: "bearminion:hosted-editor",
|
|
961
|
-
hooks: { "astro:config:setup"({ config, updateConfig, addMiddleware }) {
|
|
983
|
+
hooks: { "astro:config:setup"({ config, updateConfig, addMiddleware, logger }) {
|
|
962
984
|
if (!config.adapter) throw new Error("bearminionHostedEditor renders on a server, so the project needs an adapter (for example @astrojs/cloudflare or @astrojs/vercel). Add it to the editor build only.");
|
|
963
|
-
const
|
|
985
|
+
const root = fileURLToPath(config.root);
|
|
986
|
+
const editorModule = path.resolve(root, options.module);
|
|
987
|
+
const stale = staleTemplateProblems(root);
|
|
988
|
+
if (stale.length > 0) logger.warn(`This site's files are older than the editor needs:\n${stale.map((problem) => ` - ${problem}`).join("\n")}\nHow to bring them up to date: ${TEMPLATE_DOCS}`);
|
|
964
989
|
updateConfig({
|
|
965
990
|
...config.output === "static" ? { output: "server" } : {},
|
|
966
991
|
vite: {
|
package/dist/cli.js
CHANGED
|
@@ -565,6 +565,231 @@ function checkForm(root, requestedHost) {
|
|
|
565
565
|
};
|
|
566
566
|
}
|
|
567
567
|
//#endregion
|
|
568
|
+
//#region src/add/hosted.ts
|
|
569
|
+
const EDITOR_PATH = "src/editor.ts";
|
|
570
|
+
const BUILD_SCRIPT = "build:editor";
|
|
571
|
+
const SECTIONS_PREFIX = "src/components/sections/";
|
|
572
|
+
const BASE_CONFIGS = [
|
|
573
|
+
"astro.config.ts",
|
|
574
|
+
"astro.config.mts",
|
|
575
|
+
"astro.config.mjs",
|
|
576
|
+
"astro.config.js"
|
|
577
|
+
];
|
|
578
|
+
const HOSTS = [{
|
|
579
|
+
name: "vercel",
|
|
580
|
+
description: "Vercel: a second project on the same repository",
|
|
581
|
+
adapterPackage: "@astrojs/vercel",
|
|
582
|
+
adapterImport: "vercel",
|
|
583
|
+
adapterCall: "vercel()"
|
|
584
|
+
}];
|
|
585
|
+
const EDITOR_SOURCE = `import { createHostedEditor } from 'bearminion/hosted'
|
|
586
|
+
import { overlaySource } from 'bearminion/hosted-overlay'
|
|
587
|
+
import { contentModel } from './lib/content-model'
|
|
588
|
+
|
|
589
|
+
const secret = (name: string): string => {
|
|
590
|
+
const value = process.env[name]
|
|
591
|
+
if (!value) throw new Error(\`Missing \${name}.\`)
|
|
592
|
+
return value
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
// A function, so a host that hands over its secrets per request works the same way.
|
|
596
|
+
export default () =>
|
|
597
|
+
createHostedEditor({
|
|
598
|
+
...contentModel,
|
|
599
|
+
repo: secret('BEARMINION_REPO'), // 'owner/name'
|
|
600
|
+
auth: {
|
|
601
|
+
clientId: secret('GITHUB_CLIENT_ID'),
|
|
602
|
+
clientSecret: secret('GITHUB_CLIENT_SECRET'),
|
|
603
|
+
secret: secret('SESSION_SECRET'), // 32+ characters: openssl rand -base64 32
|
|
604
|
+
// Only these GitHub logins may sign in, and they still need push access. Leave it out to allow everyone with push access.
|
|
605
|
+
// allowedLogins: ['your-github-login'],
|
|
606
|
+
},
|
|
607
|
+
overlay: overlaySource,
|
|
608
|
+
})
|
|
609
|
+
`;
|
|
610
|
+
/** The site's Astro config and the name the editor build's config gets beside it. Undefined when the site has none. */
|
|
611
|
+
function findBaseConfig(root) {
|
|
612
|
+
for (const file of BASE_CONFIGS) {
|
|
613
|
+
const target = path.join(root, file);
|
|
614
|
+
if (!fs.existsSync(target)) continue;
|
|
615
|
+
const typed = file.endsWith("ts");
|
|
616
|
+
const extension = file.endsWith(".mts") ? "mts" : typed ? "ts" : "mjs";
|
|
617
|
+
return {
|
|
618
|
+
file,
|
|
619
|
+
importPath: typed ? `./${file.replace(/\.m?ts$/, "")}` : `./${file}`,
|
|
620
|
+
editorConfig: `astro.editor.config.${extension}`,
|
|
621
|
+
addsEditor: fs.readFileSync(target, "utf8").includes("bearminionHostedEditor")
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
function configSource(host, base) {
|
|
626
|
+
return `import ${host.adapterImport} from '${host.adapterPackage}'
|
|
627
|
+
import { mergeConfig } from 'astro/config'
|
|
628
|
+
import { bearminionHostedEditor } from 'bearminion/astro'
|
|
629
|
+
import site from '${base.importPath}'
|
|
630
|
+
|
|
631
|
+
// The build of the editor deployment: the site's own config plus a server adapter and the hosted editor.
|
|
632
|
+
// \`${BUILD_SCRIPT}\` in package.json runs it. The public site keeps building from ${base.file} and never loads any of this.
|
|
633
|
+
export default mergeConfig(site, {
|
|
634
|
+
adapter: ${host.adapterCall},
|
|
635
|
+
integrations: [bearminionHostedEditor({ module: './${EDITOR_PATH}' })],
|
|
636
|
+
})
|
|
637
|
+
`;
|
|
638
|
+
}
|
|
639
|
+
const buildCommand = (base) => `astro build --config ${base.editorConfig}`;
|
|
640
|
+
/** Adds one script to the text of a `package.json` without reformatting the rest. Undefined when it cannot be done safely. */
|
|
641
|
+
function addScript(text, name, command) {
|
|
642
|
+
const match = /"scripts"\s*:\s*\{/.exec(text);
|
|
643
|
+
if (!match) return void 0;
|
|
644
|
+
const after = match.index + match[0].length;
|
|
645
|
+
const rest = text.slice(after);
|
|
646
|
+
const first = /^(\s*)(\S)/.exec(rest);
|
|
647
|
+
if (!first) return void 0;
|
|
648
|
+
const entry = `${JSON.stringify(name)}: ${JSON.stringify(command)}`;
|
|
649
|
+
let result;
|
|
650
|
+
if (first[2] === "}") {
|
|
651
|
+
const lineStart = text.lastIndexOf("\n", match.index) + 1;
|
|
652
|
+
const indent = /^\s*/.exec(text.slice(lineStart))?.[0] ?? "";
|
|
653
|
+
result = `${text.slice(0, after)}\n${indent} ${entry}\n${indent}${rest.slice(rest.indexOf("}"))}`;
|
|
654
|
+
} else result = `${text.slice(0, after)}${first[1]}${entry},${rest}`;
|
|
655
|
+
try {
|
|
656
|
+
return JSON.parse(result).scripts?.[name] === command ? result : void 0;
|
|
657
|
+
} catch {
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
/** The section a file of the site belongs to, when it is a section's own file. */
|
|
662
|
+
const sectionOf = (file) => file.startsWith(SECTIONS_PREFIX) ? file.slice(24).split("/")[0] : void 0;
|
|
663
|
+
function planHosted(root, registry, host, lock, overwrite) {
|
|
664
|
+
const group = registry.groups?.hosted;
|
|
665
|
+
if (group === void 0) throw new Error("This copy of bearminion has no hosted files. Reinstall the package.");
|
|
666
|
+
const base = findBaseConfig(root);
|
|
667
|
+
if (base === void 0) throw new Error("No Astro config found (astro.config.ts, .mts, .mjs or .js). Run this in the site's folder, or pass --cwd.");
|
|
668
|
+
const notes = [];
|
|
669
|
+
const files = [];
|
|
670
|
+
for (const file of group.files) {
|
|
671
|
+
const section = sectionOf(file);
|
|
672
|
+
if (section !== void 0 && !fs.existsSync(path.join(root, SECTIONS_PREFIX, section, "definition.ts"))) continue;
|
|
673
|
+
const entry = registry.files[file];
|
|
674
|
+
if (entry === void 0) throw new Error(`The registry lists ${file} for the hosted editor but holds no copy of it.`);
|
|
675
|
+
const target = path.join(root, file);
|
|
676
|
+
let action;
|
|
677
|
+
if (!fs.existsSync(target)) action = "create";
|
|
678
|
+
else {
|
|
679
|
+
const hash = hashContent(file, fs.readFileSync(target));
|
|
680
|
+
if (hash === entry.hash) action = "same";
|
|
681
|
+
else if (entry.history.includes(hash) || lock.files[file]?.hash === hash) action = "update";
|
|
682
|
+
else action = overwrite ? "overwrite" : "conflict";
|
|
683
|
+
}
|
|
684
|
+
files.push({
|
|
685
|
+
path: file,
|
|
686
|
+
action
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
const recipe = (file, source) => {
|
|
690
|
+
const target = path.join(root, file);
|
|
691
|
+
let action = "create";
|
|
692
|
+
if (fs.existsSync(target)) action = hashContent(file, fs.readFileSync(target)) === hashContent(file, source) ? "same" : overwrite ? "overwrite" : "keep";
|
|
693
|
+
files.push({
|
|
694
|
+
path: file,
|
|
695
|
+
action,
|
|
696
|
+
source
|
|
697
|
+
});
|
|
698
|
+
if (action === "keep") notes.push(`${file} already exists and differs from the recipe, so it was left alone.`);
|
|
699
|
+
};
|
|
700
|
+
recipe(EDITOR_PATH, EDITOR_SOURCE);
|
|
701
|
+
let script = "skipped";
|
|
702
|
+
const scriptCommand = buildCommand(base);
|
|
703
|
+
if (base.addsEditor) notes.push(`${base.file} already adds the hosted editor itself, so no ${base.editorConfig} was written and no ${BUILD_SCRIPT} script was added. Use one way or the other: with an environment-variable gate in ${base.file}, build the editor deployment with that variable set.`);
|
|
704
|
+
else {
|
|
705
|
+
recipe(base.editorConfig, configSource(host, base));
|
|
706
|
+
const manifest = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8"));
|
|
707
|
+
const current = manifest.scripts?.[BUILD_SCRIPT];
|
|
708
|
+
if (current === scriptCommand) script = "same";
|
|
709
|
+
else if (current !== void 0) {
|
|
710
|
+
script = "different";
|
|
711
|
+
notes.push(`package.json already has a "${BUILD_SCRIPT}" script that differs from \`${scriptCommand}\`, so it was left alone.`);
|
|
712
|
+
} else if (manifest.scripts === void 0) {
|
|
713
|
+
script = "unavailable";
|
|
714
|
+
notes.push(`package.json has no "scripts" object. Build the editor deployment with: ${scriptCommand}`);
|
|
715
|
+
} else script = "add";
|
|
716
|
+
}
|
|
717
|
+
return {
|
|
718
|
+
files,
|
|
719
|
+
script,
|
|
720
|
+
scriptCommand,
|
|
721
|
+
npm: missingPackages(root, { [host.adapterPackage]: "latest" }),
|
|
722
|
+
dirty: [],
|
|
723
|
+
notes,
|
|
724
|
+
base,
|
|
725
|
+
packageManager: detectPackageManager(root)
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
const writesHosted = (action) => action === "create" || action === "update" || action === "overwrite";
|
|
729
|
+
/** Writes what the plan says and notes the files in the lock. Returns the paths written. A plan with conflicts is never applied. */
|
|
730
|
+
function applyHosted(root, registryDir, registry, plan, lock) {
|
|
731
|
+
if (plan.files.some((file) => file.action === "conflict")) throw new Error("The plan has conflicts. Nothing was written.");
|
|
732
|
+
const written = [];
|
|
733
|
+
const recipes = {};
|
|
734
|
+
for (const file of plan.files) {
|
|
735
|
+
if (writesHosted(file.action)) {
|
|
736
|
+
const target = path.join(root, file.path);
|
|
737
|
+
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
738
|
+
if (file.source === void 0) fs.copyFileSync(path.join(registryDir, "files", file.path), target);
|
|
739
|
+
else fs.writeFileSync(target, file.source);
|
|
740
|
+
written.push(file.path);
|
|
741
|
+
}
|
|
742
|
+
if (file.source !== void 0 && (writesHosted(file.action) || file.action === "same")) recipes[file.path] = {
|
|
743
|
+
version: registry.version,
|
|
744
|
+
hash: hashContent(file.path, file.source)
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
if (plan.script === "add") {
|
|
748
|
+
const manifest = path.join(root, "package.json");
|
|
749
|
+
const patched = addScript(fs.readFileSync(manifest, "utf8"), BUILD_SCRIPT, plan.scriptCommand);
|
|
750
|
+
if (patched === void 0) {
|
|
751
|
+
plan.script = "unavailable";
|
|
752
|
+
plan.notes.push(`Could not add the script to package.json safely. Add it by hand: "${BUILD_SCRIPT}": "${plan.scriptCommand}"`);
|
|
753
|
+
} else {
|
|
754
|
+
fs.writeFileSync(manifest, patched);
|
|
755
|
+
written.push("package.json");
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
const registryFiles = plan.files.filter((file) => file.source === void 0).map((file) => file.path);
|
|
759
|
+
const recorded = recordFiles(lock, registry, registryFiles);
|
|
760
|
+
const files = Object.fromEntries(Object.entries({
|
|
761
|
+
...recorded.files,
|
|
762
|
+
...recipes
|
|
763
|
+
}).sort(([a], [b]) => a < b ? -1 : 1));
|
|
764
|
+
return {
|
|
765
|
+
written,
|
|
766
|
+
lock: {
|
|
767
|
+
...recorded,
|
|
768
|
+
files
|
|
769
|
+
}
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
/** What is left to do outside the repository. */
|
|
773
|
+
function checklist(manager, base) {
|
|
774
|
+
return [
|
|
775
|
+
"Next, outside this repository:",
|
|
776
|
+
"",
|
|
777
|
+
"1. A GitHub App (Settings > Developer settings > GitHub Apps > New GitHub App)",
|
|
778
|
+
" - Redirect URI: https://<address of the editor deployment>/__bearminion/auth/callback (add it once you have the address)",
|
|
779
|
+
" - Repository permissions: Contents and Pull requests read and write, Metadata read",
|
|
780
|
+
" - Expire user authorization tokens: on",
|
|
781
|
+
" - Install it on this repository only",
|
|
782
|
+
" - Visibility: a private App lets only its owner sign in. If anyone else edits, make it public and set allowedLogins in src/editor.ts.",
|
|
783
|
+
"",
|
|
784
|
+
"2. A second Vercel project from this same repository (the first stays the public site)",
|
|
785
|
+
` - Build Command: ${manager} run ${BUILD_SCRIPT}`,
|
|
786
|
+
" - Deployment Protection: off for this project (the editor has its own sign-in)",
|
|
787
|
+
" - Environment variables: BEARMINION_REPO (owner/name), GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, SESSION_SECRET (openssl rand -base64 32)",
|
|
788
|
+
"",
|
|
789
|
+
`3. Open the new project's address and sign in. The public site's build, from ${base.file}, is unchanged.`
|
|
790
|
+
];
|
|
791
|
+
}
|
|
792
|
+
//#endregion
|
|
568
793
|
//#region src/add/status.ts
|
|
569
794
|
/** Decides the state of one file from its hash in the site, in the release, and in the lock. */
|
|
570
795
|
function classify(siteHash, release, lockHash) {
|
|
@@ -628,12 +853,14 @@ Usage
|
|
|
628
853
|
npx bearminion add <section...> [options]
|
|
629
854
|
npx bearminion add --list
|
|
630
855
|
npx bearminion add form [<service>] [--host <host>]
|
|
856
|
+
npx bearminion add hosted [--host vercel]
|
|
631
857
|
npx bearminion status [--json]
|
|
632
858
|
npx bearminion check form [--host <host>] [--json]
|
|
633
859
|
npx bearminion sync [options]
|
|
634
860
|
|
|
635
861
|
Commands
|
|
636
862
|
add Copy sections into this site, with the files they need
|
|
863
|
+
add hosted Set the site up for the hosted editor: the starter files it needs, the editor module, and a build for the editor deployment
|
|
637
864
|
status Show which sections are in this site and whether their files match this release
|
|
638
865
|
check form Look for what keeps the Contact form from working: missing files, wrong names, unset variables
|
|
639
866
|
sync Rewrite sections/definitions.gen.ts and components.gen.ts from the section directories
|
|
@@ -651,6 +878,10 @@ Options for add form
|
|
|
651
878
|
--host <host> Where the site runs (found from the project when omitted). See --list
|
|
652
879
|
--list List the services and hosts
|
|
653
880
|
|
|
881
|
+
Options for add hosted
|
|
882
|
+
--host <host> Where the editor deployment runs. Only vercel so far (the default)
|
|
883
|
+
--dry-run, -y, --overwrite, --install, --json, --diff work as for sections
|
|
884
|
+
|
|
654
885
|
Options for check form
|
|
655
886
|
--host <host> Where the site runs (found from the project when omitted)
|
|
656
887
|
--json Print one JSON document instead of text
|
|
@@ -802,6 +1033,7 @@ function diffAgainstRelease(root, registryDir, file) {
|
|
|
802
1033
|
}
|
|
803
1034
|
async function runAdd(root, names, values, io) {
|
|
804
1035
|
if (names[0] === "form") return runAddForm(root, names.slice(1), values, io);
|
|
1036
|
+
if (names[0] === "hosted") return runAddHosted(root, names.slice(1), values, io);
|
|
805
1037
|
const { log } = io;
|
|
806
1038
|
const json = values.json === true;
|
|
807
1039
|
const fail = (message, code = 1, extra = {}) => {
|
|
@@ -939,6 +1171,140 @@ async function runAdd(root, names, values, io) {
|
|
|
939
1171
|
}
|
|
940
1172
|
return installed === "failed" ? 1 : 0;
|
|
941
1173
|
}
|
|
1174
|
+
async function runAddHosted(root, names, values, io) {
|
|
1175
|
+
const { log } = io;
|
|
1176
|
+
const json = values.json === true;
|
|
1177
|
+
const fail = (message, code = 1, extra = {}) => {
|
|
1178
|
+
log(json ? JSON.stringify({
|
|
1179
|
+
ok: false,
|
|
1180
|
+
error: message,
|
|
1181
|
+
...extra
|
|
1182
|
+
}, null, 2) : message);
|
|
1183
|
+
return code;
|
|
1184
|
+
};
|
|
1185
|
+
if (names.length > 0) return fail("`add hosted` takes no names. For example: npx bearminion add hosted --host vercel", 2);
|
|
1186
|
+
const hostName = values.host ?? "vercel";
|
|
1187
|
+
if (hostName === "cloudflare") return fail("This command does not set up Cloudflare yet. The recipe for it is in the integration guide: https://docs.bearminion.com/integration/#the-editor-deployment-on-astro");
|
|
1188
|
+
const host = HOSTS.find((candidate) => candidate.name === hostName);
|
|
1189
|
+
if (host === void 0) return fail(`There is no host called "${hostName}". The hosts are: ${HOSTS.map((candidate) => candidate.name).join(", ")}.`);
|
|
1190
|
+
let loaded;
|
|
1191
|
+
try {
|
|
1192
|
+
loaded = loadRegistry(io.registryDir);
|
|
1193
|
+
} catch (error) {
|
|
1194
|
+
return fail(error instanceof Error ? error.message : String(error));
|
|
1195
|
+
}
|
|
1196
|
+
const { registry, dir: registryDir } = loaded;
|
|
1197
|
+
let plan;
|
|
1198
|
+
let lock;
|
|
1199
|
+
try {
|
|
1200
|
+
lock = readLock(root, registry.template);
|
|
1201
|
+
plan = planHosted(root, registry, host, lock, values.overwrite === true);
|
|
1202
|
+
} catch (error) {
|
|
1203
|
+
return fail(error instanceof Error ? error.message : String(error));
|
|
1204
|
+
}
|
|
1205
|
+
plan.dirty = dirtyFiles(root, plan.files.filter((file) => file.action === "update" || file.action === "overwrite").map((file) => file.path));
|
|
1206
|
+
const conflicts = plan.files.filter((file) => file.action === "conflict");
|
|
1207
|
+
const changes = plan.files.filter((file) => file.action !== "same");
|
|
1208
|
+
const installPlan = Object.keys(plan.npm).length > 0 ? installCommand(plan.packageManager, plan.npm) : void 0;
|
|
1209
|
+
const writes = plan.files.filter((file) => writesHosted(file.action)).length + (plan.script === "add" ? 1 : 0);
|
|
1210
|
+
const report = (extra) => JSON.stringify({
|
|
1211
|
+
ok: conflicts.length === 0,
|
|
1212
|
+
version: registry.version,
|
|
1213
|
+
host: host.name,
|
|
1214
|
+
files: plan.files.map(({ path: file, action }) => ({
|
|
1215
|
+
path: file,
|
|
1216
|
+
action
|
|
1217
|
+
})),
|
|
1218
|
+
script: plan.script,
|
|
1219
|
+
npm: plan.npm,
|
|
1220
|
+
notes: plan.notes,
|
|
1221
|
+
dirty: plan.dirty,
|
|
1222
|
+
...extra
|
|
1223
|
+
}, null, 2);
|
|
1224
|
+
const label = (action) => LABELS[action] ?? action;
|
|
1225
|
+
if (!json) {
|
|
1226
|
+
log(`${values["dry-run"] ? "Would set up" : "Setting up"} the hosted editor for ${host.name} (bearminion ${registry.version})`);
|
|
1227
|
+
log("");
|
|
1228
|
+
for (const file of changes) {
|
|
1229
|
+
const note = file.action === "keep" ? "yours, left alone" : NOTES[file.action];
|
|
1230
|
+
log(` ${label(file.action).padEnd(9)} ${file.path}${note ? ` (${note})` : ""}`);
|
|
1231
|
+
}
|
|
1232
|
+
if (plan.script === "add") log(` ${"add".padEnd(9)} package.json (script "${BUILD_SCRIPT}": ${plan.scriptCommand})`);
|
|
1233
|
+
const same = plan.files.length - changes.length;
|
|
1234
|
+
if (same > 0) log(` ${same} file${same === 1 ? "" : "s"} already match.`);
|
|
1235
|
+
log("");
|
|
1236
|
+
}
|
|
1237
|
+
if (conflicts.length > 0) {
|
|
1238
|
+
if (values.diff && !json) for (const file of conflicts) {
|
|
1239
|
+
log(diffAgainstRelease(root, registryDir, file.path));
|
|
1240
|
+
log("");
|
|
1241
|
+
}
|
|
1242
|
+
if (json) log(report({
|
|
1243
|
+
error: "Some files differ from this release and were changed by you.",
|
|
1244
|
+
written: []
|
|
1245
|
+
}));
|
|
1246
|
+
else {
|
|
1247
|
+
log(`${conflicts.length} file${conflicts.length === 1 ? "" : "s"} differ${conflicts.length === 1 ? "s" : ""} from this release because you changed ${conflicts.length === 1 ? "it" : "them"}. Nothing was written.`);
|
|
1248
|
+
log("Use --diff to see how, then merge the lines the editor needs by hand, or use --overwrite to replace them. Commit first: git keeps your version.");
|
|
1249
|
+
}
|
|
1250
|
+
return 1;
|
|
1251
|
+
}
|
|
1252
|
+
if (writes === 0) {
|
|
1253
|
+
if (json) log(report({ written: [] }));
|
|
1254
|
+
else {
|
|
1255
|
+
for (const note of plan.notes) log(note);
|
|
1256
|
+
log("Nothing to write: every file is already in place.");
|
|
1257
|
+
}
|
|
1258
|
+
return 0;
|
|
1259
|
+
}
|
|
1260
|
+
if (!json && plan.files.some((file) => file.action === "update")) log("Files that you did not change are replaced by this release. Other parts of the site use them: read the diff and run your build.");
|
|
1261
|
+
if (!json && plan.dirty.length > 0) log(`Uncommitted changes in ${plan.dirty.join(", ")} will be overwritten.`);
|
|
1262
|
+
if (values["dry-run"]) {
|
|
1263
|
+
if (json) log(report({
|
|
1264
|
+
dryRun: true,
|
|
1265
|
+
written: []
|
|
1266
|
+
}));
|
|
1267
|
+
else {
|
|
1268
|
+
for (const note of plan.notes) log(note);
|
|
1269
|
+
log("Dry run: nothing was written.");
|
|
1270
|
+
}
|
|
1271
|
+
return 0;
|
|
1272
|
+
}
|
|
1273
|
+
if (!values.yes) {
|
|
1274
|
+
if (json || io.confirm === void 0) return fail("Not asking in here: pass --yes to write, or --dry-run to look first.", 1, { files: plan.files.map(({ path: file, action }) => ({
|
|
1275
|
+
path: file,
|
|
1276
|
+
action
|
|
1277
|
+
})) });
|
|
1278
|
+
if (!await io.confirm(`Write ${writes} file${writes === 1 ? "" : "s"}?`)) {
|
|
1279
|
+
log("Nothing was written.");
|
|
1280
|
+
return 1;
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
let written;
|
|
1284
|
+
try {
|
|
1285
|
+
const applied = applyHosted(root, registryDir, registry, plan, lock);
|
|
1286
|
+
writeLock(root, applied.lock);
|
|
1287
|
+
written = applied.written;
|
|
1288
|
+
} catch (error) {
|
|
1289
|
+
return fail(error instanceof Error ? error.message : String(error));
|
|
1290
|
+
}
|
|
1291
|
+
let installed;
|
|
1292
|
+
if (installPlan && values.install) installed = io.exec(installPlan.command, installPlan.args, root) === 0 ? "done" : "failed";
|
|
1293
|
+
if (json) {
|
|
1294
|
+
log(report({
|
|
1295
|
+
written,
|
|
1296
|
+
installed: installed ?? null
|
|
1297
|
+
}));
|
|
1298
|
+
return installed === "failed" ? 1 : 0;
|
|
1299
|
+
}
|
|
1300
|
+
log(`Wrote ${written.length} file${written.length === 1 ? "" : "s"} and noted them in bearminion.lock.json.`);
|
|
1301
|
+
for (const note of plan.notes) log(note);
|
|
1302
|
+
if (installPlan && installed === void 0) log(`The editor build needs ${host.adapterPackage}. Install it: ${formatCommand(installPlan)}`);
|
|
1303
|
+
if (installed === "failed") log(`Installing failed. Run it yourself: ${formatCommand(installPlan)}`);
|
|
1304
|
+
log("");
|
|
1305
|
+
for (const line of checklist(plan.packageManager, plan.base)) log(line);
|
|
1306
|
+
return installed === "failed" ? 1 : 0;
|
|
1307
|
+
}
|
|
942
1308
|
const LEVEL_TEXT = {
|
|
943
1309
|
ok: "ok",
|
|
944
1310
|
problem: "problem",
|
package/dist/hosted-astro.js
CHANGED
|
@@ -101,6 +101,9 @@ function createHostedAuth(options) {
|
|
|
101
101
|
const now = options.now ?? Date.now;
|
|
102
102
|
const sessionMs = (options.sessionDays ?? 7) * 864e5;
|
|
103
103
|
const keyPromise = deriveKey(options.secret);
|
|
104
|
+
if (options.allowedLogins !== void 0 && options.allowedLogins.length === 0) throw new Error("createHostedAuth(): allowedLogins is empty, so nobody could sign in. Leave it out to allow everyone with push access.");
|
|
105
|
+
const allowedLogins = options.allowedLogins ? new Set(options.allowedLogins.map((login) => login.trim().toLowerCase())) : void 0;
|
|
106
|
+
const isAllowed = (login) => !allowedLogins || allowedLogins.has(login.toLowerCase());
|
|
104
107
|
const originOf = (request) => (options.origin ?? new URL(request.url).origin).replace(/\/+$/, "");
|
|
105
108
|
const secure = (request) => originOf(request).startsWith("https://");
|
|
106
109
|
const names = (request) => secure(request) ? {
|
|
@@ -185,6 +188,7 @@ function createHostedAuth(options) {
|
|
|
185
188
|
async function authenticate(request) {
|
|
186
189
|
const stored = await open(await keyPromise, "session", readCookies(request.headers.get("cookie")).get(names(request).session));
|
|
187
190
|
if (!stored || typeof stored.token !== "string" || typeof stored.login !== "string") return null;
|
|
191
|
+
if (!isAllowed(stored.login)) return null;
|
|
188
192
|
const at = now();
|
|
189
193
|
if (at >= stored.issuedAt + sessionMs) return null;
|
|
190
194
|
if (at < stored.expiresAt - REFRESH_MARGIN_MS) return { session: stored };
|
|
@@ -244,6 +248,7 @@ function createHostedAuth(options) {
|
|
|
244
248
|
if (!userReply?.ok) return page(502, "Sign-in failed", "GitHub did not say who you are. Start again.", { "set-cookie": clearState });
|
|
245
249
|
const who = await userReply.json();
|
|
246
250
|
if (typeof who.login !== "string" || typeof who.id !== "number") return page(502, "Sign-in failed", "GitHub sent an unexpected answer. Start again.", { "set-cookie": clearState });
|
|
251
|
+
if (!isAllowed(who.login)) return page(403, "No access", `${who.login} is not on the list of people who may edit this site. Ask the owner to add you.`, { "set-cookie": clearState });
|
|
247
252
|
if (!await hasPushAccess(reply.access_token)) return page(403, "No access", `${who.login} cannot write to ${options.repo}. Ask the owner for write access, and check that the GitHub App is installed on the repository.`, { "set-cookie": clearState });
|
|
248
253
|
const headers = new Headers({
|
|
249
254
|
location: saved.returnTo,
|
package/dist/hosted.d.ts
CHANGED
|
@@ -69,6 +69,12 @@ interface HostedAuthOptions {
|
|
|
69
69
|
secret: string;
|
|
70
70
|
/** `owner/name`. Only people with push access to this repository may sign in. */
|
|
71
71
|
repo: string;
|
|
72
|
+
/**
|
|
73
|
+
* GitHub logins that may sign in, on top of having push access. Default: everyone with push access. Case does not
|
|
74
|
+
* matter. A login taken off the list is signed out on its next request, without waiting for its token to expire.
|
|
75
|
+
* An empty list is refused, because it would lock everyone out.
|
|
76
|
+
*/
|
|
77
|
+
allowedLogins?: readonly string[];
|
|
72
78
|
/**
|
|
73
79
|
* The public origin of the editor, `https://admin.example.com`. Default: the origin of the request, which is wrong
|
|
74
80
|
* behind a proxy that rewrites the scheme or host, so set it there. The GitHub App's callback URL must be
|
package/dist/hosted.js
CHANGED
|
@@ -5,7 +5,7 @@ import { n as createMigrator } from "./migrate-b408EaLp.js";
|
|
|
5
5
|
import { i as resolveMaxImageBytes, r as resolveConvert } from "./upload-rules-Cao9uY5K.js";
|
|
6
6
|
import { f as DEFAULT_VIDEO_BYTE_LIMIT, n as missingImageSvg, r as handleEditorRequest, t as githubStore } from "./github-store-D3LEUhcM.js";
|
|
7
7
|
import { S as isAssetPath } from "./draft-store-DBEfw_Gq.js";
|
|
8
|
-
import { n as AUTH_PREFIX, r as createHostedAuth, t as createHostedMiddleware } from "./hosted-middleware-
|
|
8
|
+
import { n as AUTH_PREFIX, r as createHostedAuth, t as createHostedMiddleware } from "./hosted-middleware-CedN9WNM.js";
|
|
9
9
|
//#region src/hosted-context.ts
|
|
10
10
|
/** The context for `handleEditorRequest`. */
|
|
11
11
|
function createHostedContext(options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bearminion",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.0",
|
|
4
4
|
"description": "A git-based CMS for Astro with no database and no server: JSON content in your repo, edited by clicking on the page during astro dev.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Jakub Lange",
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { hasJsonLdId, mergeJsonLd, siteJsonLdIds, type Page } from 'bearminion'
|
|
3
|
+
import type { Site } from '../organisms/site-definition'
|
|
4
|
+
import { isRemote, resolveLocalAsset } from '../../lib/assets'
|
|
5
|
+
import { editing } from '../../lib/editing'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
site: Site
|
|
9
|
+
page: Page
|
|
10
|
+
pathname: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const { site, page, pathname } = Astro.props
|
|
14
|
+
|
|
15
|
+
function resolveAgainstSite(value: string): string {
|
|
16
|
+
if (/^https?:\/\//i.test(value)) return value
|
|
17
|
+
return new URL(value, site.url).href
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function absoluteImage(src: string): string | undefined {
|
|
21
|
+
if (isRemote(src)) return src
|
|
22
|
+
const asset = resolveLocalAsset(src)
|
|
23
|
+
// An image just uploaded in the hosted editor is not in this build yet. A preview has no use for a share image.
|
|
24
|
+
if (!asset && editing) return undefined
|
|
25
|
+
if (!asset) throw new Error(`No file in src/assets for image path "${src}". Restore the file, or choose another image in the editor and save.`)
|
|
26
|
+
return new URL(asset.src, site.url).href
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const title = site.seo.titleTemplate ? site.seo.titleTemplate.replaceAll('%s', page.seo.title) : page.seo.title
|
|
30
|
+
const description = page.seo.description || site.seo.description || ''
|
|
31
|
+
const path = pathname.startsWith('/') ? pathname : `/${pathname}`
|
|
32
|
+
const canonical = page.seo.canonical ? resolveAgainstSite(page.seo.canonical) : new URL(path, site.url).href
|
|
33
|
+
const robots = [page.seo.noindex ? 'noindex' : 'index', page.seo.nofollow ? 'nofollow' : 'follow'].join(', ')
|
|
34
|
+
const ogImageSrc = page.seo.ogImage ?? site.seo.ogImage
|
|
35
|
+
const ogImage = ogImageSrc ? absoluteImage(ogImageSrc) : undefined
|
|
36
|
+
|
|
37
|
+
// Blocks from site.seo.jsonLd go on every page. When the site describes itself, the generated WebPage points at those blocks.
|
|
38
|
+
const siteBlocks = site.seo.jsonLd ?? []
|
|
39
|
+
const ids = siteJsonLdIds(site.url)
|
|
40
|
+
const webPage = {
|
|
41
|
+
'@context': 'https://schema.org',
|
|
42
|
+
'@type': 'WebPage',
|
|
43
|
+
name: title,
|
|
44
|
+
description,
|
|
45
|
+
url: canonical,
|
|
46
|
+
...(ogImage ? { image: ogImage } : {}),
|
|
47
|
+
isPartOf: hasJsonLdId(siteBlocks, ids.website) ? { '@id': ids.website } : { '@type': 'WebSite', name: site.name, url: site.url },
|
|
48
|
+
...(hasJsonLdId(siteBlocks, ids.organization) ? { publisher: { '@id': ids.organization } } : {}),
|
|
49
|
+
}
|
|
50
|
+
// A page's own JSON-LD replaces only the generated WebPage. Blocks with the same @id are emitted once, the page's first.
|
|
51
|
+
const blocks = mergeJsonLd(siteBlocks, page.seo.jsonLd ?? [webPage])
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
<title>{title}</title>
|
|
55
|
+
<meta name="description" content={description} />
|
|
56
|
+
<link rel="canonical" href={canonical} />
|
|
57
|
+
<meta name="robots" content={robots} />
|
|
58
|
+
<meta property="og:site_name" content={site.name} />
|
|
59
|
+
<meta property="og:title" content={title} />
|
|
60
|
+
<meta property="og:description" content={description} />
|
|
61
|
+
<meta property="og:type" content="website" />
|
|
62
|
+
<meta property="og:url" content={canonical} />
|
|
63
|
+
{ogImage && <meta property="og:image" content={ogImage} />}
|
|
64
|
+
<meta name="twitter:card" content={ogImage ? 'summary_large_image' : 'summary'} />
|
|
65
|
+
<meta name="twitter:title" content={title} />
|
|
66
|
+
<meta name="twitter:description" content={description} />
|
|
67
|
+
{ogImage && <meta name="twitter:image" content={ogImage} />}
|
|
68
|
+
{/* `<` is escaped so a value cannot close the script tag. */}
|
|
69
|
+
{
|
|
70
|
+
blocks.map((block) => (
|
|
71
|
+
<script type="application/ld+json" set:html={JSON.stringify(block).replace(/</g, '\\u003c')} />
|
|
72
|
+
))
|
|
73
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="astro/client" />
|
|
2
|
+
|
|
3
|
+
interface ImportMetaEnv {
|
|
4
|
+
/** Set by the hosted editor's build (`bearminionHostedEditor`). Not set in a public site's build. */
|
|
5
|
+
readonly BEARMINION_HOSTED?: boolean
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare namespace App {
|
|
9
|
+
interface Locals {
|
|
10
|
+
/** Set by the hosted editor (`bearminionHostedEditor`) for a signed-in person: the repository's current content. */
|
|
11
|
+
bearminion?: import('bearminion/hosted').HostedLocals
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { Site } from '../components/organisms/site-definition'
|
|
3
|
+
import type { Page } from '../components/sections/definitions'
|
|
4
|
+
import SectionList from '../components/sections/SectionList.astro'
|
|
5
|
+
import Base from '../layouts/Base.astro'
|
|
6
|
+
import { getPage, getSite } from '../lib/content'
|
|
7
|
+
|
|
8
|
+
// Astro emits this route as /404.html, which static hosts serve for unknown URLs.
|
|
9
|
+
// The content is content/pages/404.json, so the editor changes it like any other page.
|
|
10
|
+
const live = Astro.locals.bearminion
|
|
11
|
+
const site = live ? ((await live.content.getSite()) as Site) : await getSite()
|
|
12
|
+
const page = live ? ((await live.content.getPage('404')) as Page | undefined) : await getPage('404')
|
|
13
|
+
if (!page) throw new Error('content/pages/404.json is missing')
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<Base site={site} page={page}>
|
|
17
|
+
<SectionList sections={page.sections} motion={site.theme.motion} />
|
|
18
|
+
</Base>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { Site } from '../components/organisms/site-definition'
|
|
3
|
+
import type { Page } from '../components/sections/definitions'
|
|
4
|
+
import SectionList from '../components/sections/SectionList.astro'
|
|
5
|
+
import Base from '../layouts/Base.astro'
|
|
6
|
+
import { getPages, getSite } from '../lib/content'
|
|
7
|
+
|
|
8
|
+
export async function getStaticPaths() {
|
|
9
|
+
const site = await getSite()
|
|
10
|
+
// 404.json is rendered by src/pages/404.astro, so Astro emits /404.html instead of /404/index.html.
|
|
11
|
+
const pages = await getPages(['404'])
|
|
12
|
+
|
|
13
|
+
return pages.map((page) => ({
|
|
14
|
+
params: {
|
|
15
|
+
// The home page is stored as slug "index" and published at `/`.
|
|
16
|
+
slug: page.slug === 'index' ? undefined : page.slug,
|
|
17
|
+
},
|
|
18
|
+
props: { site, page },
|
|
19
|
+
}))
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface Props {
|
|
23
|
+
site: Site
|
|
24
|
+
page: Page
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// The hosted editor draws the repository's current content (`Astro.locals.bearminion`); a static build uses the props.
|
|
28
|
+
const live = Astro.locals.bearminion
|
|
29
|
+
let { site, page } = Astro.props as Partial<Props>
|
|
30
|
+
if (live) {
|
|
31
|
+
site = (await live.content.getSite()) as Site
|
|
32
|
+
page = (await live.content.getPage(Astro.params.slug ?? 'index')) as Page | undefined
|
|
33
|
+
if (!page) return Astro.rewrite('/404')
|
|
34
|
+
}
|
|
35
|
+
if (!site || !page) throw new Error(`No content for ${Astro.url.pathname}.`)
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
<Base site={site} page={page}>
|
|
39
|
+
<SectionList sections={page.sections} motion={site.theme.motion} />
|
|
40
|
+
</Base>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"template": "default",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.18.0",
|
|
5
5
|
"files": {
|
|
6
6
|
"src/components/atoms/Button.astro": {
|
|
7
7
|
"hash": "7be42b3dc3a3b59bec169de32a9d801904689e2705473d1945724658dc799043",
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
},
|
|
20
20
|
"src/components/atoms/Typography.astro": {
|
|
21
21
|
"hash": "56e7ea3cf08ef4159d6b72c97761d13334b5468476e0226d62b42effd1368fd2",
|
|
22
|
-
"history": [
|
|
22
|
+
"history": [
|
|
23
|
+
"dd790bc3b1c51ceea838ee804f676af03e1803060eb88787b60c4ba407b47388"
|
|
24
|
+
]
|
|
23
25
|
},
|
|
24
26
|
"src/components/atoms/button.ts": {
|
|
25
27
|
"hash": "dfa3955ebb4416ecb1aea899f41b2d2abc26d163790615fbc8113a998a6cd6e6",
|
|
@@ -35,7 +37,9 @@
|
|
|
35
37
|
},
|
|
36
38
|
"src/components/atoms/typography.ts": {
|
|
37
39
|
"hash": "a4310d2e1ffae64d245c3d8b3fce2d220f19c598bb38f70ed1bd17c0262840c6",
|
|
38
|
-
"history": [
|
|
40
|
+
"history": [
|
|
41
|
+
"0953a9a14109bebcec9e60cf037f57a7b3e1f25bd27035661a02a6f0750614c2"
|
|
42
|
+
]
|
|
39
43
|
},
|
|
40
44
|
"src/components/molecules/CommandLine.astro": {
|
|
41
45
|
"hash": "af11f7f28617129636ee1d0097c21427bdb7bfaa7d8ee2750faaa8bedcb67b06",
|
|
@@ -53,7 +57,9 @@
|
|
|
53
57
|
},
|
|
54
58
|
"src/components/molecules/SectionHeader.astro": {
|
|
55
59
|
"hash": "b2692e02875362cc9dac3dc7a6c80bd056bf8d2af2973da1eb62d9d268d6b9ba",
|
|
56
|
-
"history": [
|
|
60
|
+
"history": [
|
|
61
|
+
"5399e810b39faec8f4c930086bdb585258af683867f538d5ae54e318df190054"
|
|
62
|
+
]
|
|
57
63
|
},
|
|
58
64
|
"src/components/molecules/SectionShell.astro": {
|
|
59
65
|
"hash": "dc57fc01c666f1fef4b1b9799c2c0728571ac123af1567df3cb6f1e6456d2843",
|
|
@@ -61,15 +67,23 @@
|
|
|
61
67
|
},
|
|
62
68
|
"src/components/sections/contact/Contact.astro": {
|
|
63
69
|
"hash": "4247463ccd5cdde93ab263f12908ca2a87e5e6c2b51b6e6025f712c919b7ece1",
|
|
64
|
-
"history": [
|
|
70
|
+
"history": [
|
|
71
|
+
"be2ea214015db14fbc6198f51d0f2de44bb24b021acf1a00bae9c9a215b133cc",
|
|
72
|
+
"43143b2042f5b59a7acbf8c14b28102b4f7fe74c5da694a42137817bf4924bcd"
|
|
73
|
+
]
|
|
65
74
|
},
|
|
66
75
|
"src/components/sections/contact/definition.ts": {
|
|
67
76
|
"hash": "9ce73d48688466dcbbb6a0943dcc88190d2be05c2aad8b60c8c2a189e78dad28",
|
|
68
|
-
"history": [
|
|
77
|
+
"history": [
|
|
78
|
+
"188b157cdf81598a37a9b3da1ab444f4ed15c7216b37fd23181d24722b73ff7b",
|
|
79
|
+
"c3582aea02ce0bf008f92e68baf28ab071a80c7fee31fbfcea0d10d1362a49db"
|
|
80
|
+
]
|
|
69
81
|
},
|
|
70
82
|
"src/components/sections/contact/form.ts": {
|
|
71
83
|
"hash": "18b1f2e2527525a74313ec5e9903e2033b9e5ccae955e5778efd6af10e5b58dd",
|
|
72
|
-
"history": [
|
|
84
|
+
"history": [
|
|
85
|
+
"b2f4c63406477e308b03d92e91285e3d96ac3d6d69fa12e4873f62059b3c358a"
|
|
86
|
+
]
|
|
73
87
|
},
|
|
74
88
|
"src/components/sections/contact/wireframe.ts": {
|
|
75
89
|
"hash": "91bbbf164a0c0eea2f526bf84fef2ba2ab02b298354049df6fbc73f171a1ce8f",
|
|
@@ -77,11 +91,15 @@
|
|
|
77
91
|
},
|
|
78
92
|
"src/components/sections/cta/Cta.astro": {
|
|
79
93
|
"hash": "0ae98e77b6d645b71f58dbf790908333be59dd16c3c558e924021ce2bcb0d2dc",
|
|
80
|
-
"history": [
|
|
94
|
+
"history": [
|
|
95
|
+
"245b778ca9e5345affe3e781914c610270c2fabb387eb803888a267e43ad4cbd"
|
|
96
|
+
]
|
|
81
97
|
},
|
|
82
98
|
"src/components/sections/cta/definition.ts": {
|
|
83
99
|
"hash": "d6576c8a53ac59dae964644765d690f2938e589fc13b24c0a0993ead5ba62285",
|
|
84
|
-
"history": [
|
|
100
|
+
"history": [
|
|
101
|
+
"29855468c9539fc89690fe5075245e2ae52d36e821892b48709df01d5e1668f2"
|
|
102
|
+
]
|
|
85
103
|
},
|
|
86
104
|
"src/components/sections/cta/wireframe.ts": {
|
|
87
105
|
"hash": "5c4e998a2a30a4185776d5112c0dcf09130002f3a04d4f31752bb1346ae7fc3f",
|
|
@@ -89,11 +107,15 @@
|
|
|
89
107
|
},
|
|
90
108
|
"src/components/sections/faq/Faq.astro": {
|
|
91
109
|
"hash": "59843ad44db35cbe21acfc17c92b7455dcd0b293d5c4a91c5ce23daa70904039",
|
|
92
|
-
"history": [
|
|
110
|
+
"history": [
|
|
111
|
+
"7796e553cc5c12529fc2b2a5bec9eb6785c30bb50ba16ef0407f1d5c476af984"
|
|
112
|
+
]
|
|
93
113
|
},
|
|
94
114
|
"src/components/sections/faq/definition.ts": {
|
|
95
115
|
"hash": "b24bdd9077c471379130d611ecdcda487d88b1108ab22dba0a6307839243eac8",
|
|
96
|
-
"history": [
|
|
116
|
+
"history": [
|
|
117
|
+
"38c4ec6cc15b1164aeb8281cb4a99330ec50925999c34a770be6e2c17b60f915"
|
|
118
|
+
]
|
|
97
119
|
},
|
|
98
120
|
"src/components/sections/faq/wireframe.ts": {
|
|
99
121
|
"hash": "d3865d0b0d6fecf92eef5c9959cf495253527f7e73592726c42fa87fc2e21d38",
|
|
@@ -101,11 +123,15 @@
|
|
|
101
123
|
},
|
|
102
124
|
"src/components/sections/features/Features.astro": {
|
|
103
125
|
"hash": "fa2d4de7ada18b6fc9159c99db54aa9c09d8209b421db574251cec695e7abf9d",
|
|
104
|
-
"history": [
|
|
126
|
+
"history": [
|
|
127
|
+
"6d5f76591fee55759bd31fd66a9359990e1136c6fa7f765c1bfaf319c43300db"
|
|
128
|
+
]
|
|
105
129
|
},
|
|
106
130
|
"src/components/sections/features/definition.ts": {
|
|
107
131
|
"hash": "127837186fa07885e95a61f7a00dc6a965b3a74ffc589de3e3c9e31b360c13ca",
|
|
108
|
-
"history": [
|
|
132
|
+
"history": [
|
|
133
|
+
"8c62f71d97b69b9c156a96db4eca59103050c4126d111270e66838af85b21b85"
|
|
134
|
+
]
|
|
109
135
|
},
|
|
110
136
|
"src/components/sections/features/wireframe.ts": {
|
|
111
137
|
"hash": "20194a8cba45ed2da0625a6ff9d22d98cfd44188d73a477a2dda81a74a998c94",
|
|
@@ -129,7 +155,9 @@
|
|
|
129
155
|
},
|
|
130
156
|
"src/components/sections/hero/Hero.astro": {
|
|
131
157
|
"hash": "65e50177ddc8b73ded1bf1fc71f2ae950ff1102457b73719e40ceec6467d56d9",
|
|
132
|
-
"history": [
|
|
158
|
+
"history": [
|
|
159
|
+
"fcde40f87608bd323d90e2412be72260baa1a516e245bebec06f76130d764f7b"
|
|
160
|
+
]
|
|
133
161
|
},
|
|
134
162
|
"src/components/sections/hero/HeroBadge.astro": {
|
|
135
163
|
"hash": "6467a7bb27d4dc718c568f069187385b507fedfb9f79ded3929ee0893126ce6f",
|
|
@@ -137,7 +165,9 @@
|
|
|
137
165
|
},
|
|
138
166
|
"src/components/sections/hero/definition.ts": {
|
|
139
167
|
"hash": "db17e42d4e7cc7ebf61e978c405cd9b5ef5c399c6a44c80beddec4e9784882a6",
|
|
140
|
-
"history": [
|
|
168
|
+
"history": [
|
|
169
|
+
"6007fa0427eac40fe74e884704cb66def85b472d5a1a0dec6984adb7522c5a6e"
|
|
170
|
+
]
|
|
141
171
|
},
|
|
142
172
|
"src/components/sections/hero/wireframe.ts": {
|
|
143
173
|
"hash": "4bbe971afb2d4f3af5166c3b525bffe6564627d4a6a3da218073fd5d6eaa68c0",
|
|
@@ -160,22 +190,30 @@
|
|
|
160
190
|
"src/components/sections/media/Media.astro": {
|
|
161
191
|
"hash": "8277c9c2ef089b437c5ccaa93b80d9f9c0020bfb9c4a29526264c29c25d6fcf0",
|
|
162
192
|
"history": [
|
|
163
|
-
"1df9f736daf07b6a4a2768463896b477197d1baa68a445e4ee1de92080b227c2"
|
|
193
|
+
"1df9f736daf07b6a4a2768463896b477197d1baa68a445e4ee1de92080b227c2",
|
|
194
|
+
"c37566c895c8ad6ae1fd15986056cb8315511cfe1b9d7ae2737200e7abe5524e",
|
|
195
|
+
"f5e22ebc9fa07935f7cf5e1d2cffacf6f574355d7521eb691c05255f0cb6a60b"
|
|
164
196
|
]
|
|
165
197
|
},
|
|
166
198
|
"src/components/sections/media/MediaPlayer.astro": {
|
|
167
199
|
"hash": "e5b8e9800c43e0a276ef763fddfb62e99cbb120f22a31928b81277d85a4626a8",
|
|
168
200
|
"history": [
|
|
169
|
-
"e2444c6ff067276b4aeb5a7f6da368a0ce7e6db4feaac7303d508f3df28eadad"
|
|
201
|
+
"e2444c6ff067276b4aeb5a7f6da368a0ce7e6db4feaac7303d508f3df28eadad",
|
|
202
|
+
"9ec13f1da22554d24f573bd5971663a125641174b220ea7a3f62cb994bc2d80a",
|
|
203
|
+
"0c2f819051bf9988f257d0176977dd9fe99b6c84edb44bf2d9f54b80711bb729"
|
|
170
204
|
]
|
|
171
205
|
},
|
|
172
206
|
"src/components/sections/media/definition.ts": {
|
|
173
207
|
"hash": "520d1d78d234c8a005abeffe99fdfe12201cc78e56023bf627869b562974aa3c",
|
|
174
|
-
"history": [
|
|
208
|
+
"history": [
|
|
209
|
+
"06aeb13847a6da7f3a455dca183850b27270e3c437451c9ceb83cc9ce53fd246"
|
|
210
|
+
]
|
|
175
211
|
},
|
|
176
212
|
"src/components/sections/media/source.ts": {
|
|
177
213
|
"hash": "737f87a8352e226469968cdaae3d3240c3e1c9395ba0a4279fb6505ec039fb49",
|
|
178
|
-
"history": [
|
|
214
|
+
"history": [
|
|
215
|
+
"de6410a03882f27414b2be6fbbaddb8a2065fdb8bbd17631143f7a674e51f6b3"
|
|
216
|
+
]
|
|
179
217
|
},
|
|
180
218
|
"src/components/sections/media/wireframe.ts": {
|
|
181
219
|
"hash": "9afe102c0d66136de50dbe75b4d668b53897283950f71ba26c8e1e70e7abfc9f",
|
|
@@ -239,11 +277,15 @@
|
|
|
239
277
|
},
|
|
240
278
|
"src/components/sections/text-image/TextImage.astro": {
|
|
241
279
|
"hash": "8fdadd5ca3ee5412b726162f7f3681ec7d662c00f06c4959b0f27e6699142120",
|
|
242
|
-
"history": [
|
|
280
|
+
"history": [
|
|
281
|
+
"cbc220de5cacefc1f1ac353f9ef658ecebaf21510b861c38ef4158ec3dd387d5"
|
|
282
|
+
]
|
|
243
283
|
},
|
|
244
284
|
"src/components/sections/text-image/definition.ts": {
|
|
245
285
|
"hash": "630028579eae5df29879e3b9e2230d4aa45c09d99de8e992de1f1b67da7154f9",
|
|
246
|
-
"history": [
|
|
286
|
+
"history": [
|
|
287
|
+
"f8a8b5626576731eecf1e0766b13a58df377f8105ba82464693e553382fd00ac"
|
|
288
|
+
]
|
|
247
289
|
},
|
|
248
290
|
"src/components/sections/text-image/wireframe.ts": {
|
|
249
291
|
"hash": "af9a266f1120eee687823afe114ea3cdb656e1e0911eda30fb5574501544f96d",
|
|
@@ -261,6 +303,21 @@
|
|
|
261
303
|
"hash": "fb55bafc2fa8dd9fee1cfa24ca54de644114d557e4610f7e083b9b01ed258522",
|
|
262
304
|
"history": []
|
|
263
305
|
},
|
|
306
|
+
"src/components/seo/Seo.astro": {
|
|
307
|
+
"hash": "1bcd3ee145234663a8b3a0b101d76bb31e69dc8d6d028ad9a83d328cf3536bf4",
|
|
308
|
+
"history": [
|
|
309
|
+
"cdb5e21b469dd225d8e9e1d5d5d6fdf1c4e697ce79d1dfac7069c2dc35cd67e4",
|
|
310
|
+
"0d75bdcace1e1594fdb49e71a913f4355dc7024a9a52681e9b09922fbcd7ec2b",
|
|
311
|
+
"c8831250a574e852afdf0fbbe05aa5ec4aa90dd2a3bff04b39ad64a05bc1e14c"
|
|
312
|
+
]
|
|
313
|
+
},
|
|
314
|
+
"src/env.d.ts": {
|
|
315
|
+
"hash": "17b0db27bd3d73f4accf3c7f7f0e7740a85809432d8875ffe830ddd350ce2963",
|
|
316
|
+
"history": [
|
|
317
|
+
"9c9283a414423d9223e5ea86941b142443b8af7a007f77612dc2c098de2d2500",
|
|
318
|
+
"25ac662fa50581fc23a93cdead11e3abbbbb60bc5641c6deaf3ef743dcc8f2f3"
|
|
319
|
+
]
|
|
320
|
+
},
|
|
264
321
|
"src/lib/assets.ts": {
|
|
265
322
|
"hash": "8efa10327696d29ad9f4d2fc85a3962d969ba80db1cb63184b148000b7147450",
|
|
266
323
|
"history": []
|
|
@@ -284,12 +341,25 @@
|
|
|
284
341
|
"src/lib/image-url.ts": {
|
|
285
342
|
"hash": "deb9afab379804204634f3eeb0496dce6b923496c6f2bf33227d64e40fa5809f",
|
|
286
343
|
"history": [
|
|
287
|
-
"47e51f06b5bfc3c0fc595bd18d13d71f9f68d063c3d12e5514ecb8098a114131"
|
|
344
|
+
"47e51f06b5bfc3c0fc595bd18d13d71f9f68d063c3d12e5514ecb8098a114131",
|
|
345
|
+
"3dae51d5ec398be8d772b4e3cab2788935ee27becb0b47665e9176c2f249d87f"
|
|
288
346
|
]
|
|
289
347
|
},
|
|
290
348
|
"src/lib/link-attrs.ts": {
|
|
291
349
|
"hash": "648802476e4dfaaeab6c4172313c683420c1fb66898de8f8c74ca4adf876cd37",
|
|
292
350
|
"history": []
|
|
351
|
+
},
|
|
352
|
+
"src/pages/404.astro": {
|
|
353
|
+
"hash": "3c322ae407871b6fb7fae74d1421eaa7f0e0497605ab44ddff0cf7297b7cbfe5",
|
|
354
|
+
"history": [
|
|
355
|
+
"6e5db32a6eb34c459176022e439dc3bfd6871c550978e74c0abd78a05de83b91"
|
|
356
|
+
]
|
|
357
|
+
},
|
|
358
|
+
"src/pages/[...slug].astro": {
|
|
359
|
+
"hash": "08bf1ac4b4a8a9961045f91e74a22aa2ec3b622998ebfa1f167ab39039bbf467",
|
|
360
|
+
"history": [
|
|
361
|
+
"c1f491e544eead7313f31a8e1c630776b5ec7ab886f61cf04fbd66eeed69fa28"
|
|
362
|
+
]
|
|
293
363
|
}
|
|
294
364
|
},
|
|
295
365
|
"items": {
|
|
@@ -689,5 +759,24 @@
|
|
|
689
759
|
"zod": "^4.6.7"
|
|
690
760
|
}
|
|
691
761
|
}
|
|
762
|
+
},
|
|
763
|
+
"groups": {
|
|
764
|
+
"hosted": {
|
|
765
|
+
"label": "Hosted editor",
|
|
766
|
+
"description": "The starter's files that the hosted editor depends on: the editing flag, the image components, SEO, the types and the page routes.",
|
|
767
|
+
"files": [
|
|
768
|
+
"src/components/atoms/Image.astro",
|
|
769
|
+
"src/components/molecules/MediaFrame.astro",
|
|
770
|
+
"src/components/sections/logo-strip/LogoStrip.astro",
|
|
771
|
+
"src/components/sections/media/Media.astro",
|
|
772
|
+
"src/components/sections/media/MediaPlayer.astro",
|
|
773
|
+
"src/components/seo/Seo.astro",
|
|
774
|
+
"src/env.d.ts",
|
|
775
|
+
"src/lib/editing.ts",
|
|
776
|
+
"src/lib/image-url.ts",
|
|
777
|
+
"src/pages/404.astro",
|
|
778
|
+
"src/pages/[...slug].astro"
|
|
779
|
+
]
|
|
780
|
+
}
|
|
692
781
|
}
|
|
693
782
|
}
|