@sandboxsonny/ace-kit 0.5.0 → 0.7.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 (74) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/astro-integration.js +1 -1
  3. package/dist/chunk-7M26C36M.js +35 -0
  4. package/dist/{chunk-WM5NOQE3.js → chunk-T7DKI2U3.js} +4 -3
  5. package/dist/cli.js +14 -1179
  6. package/dist/environment-J4VYOHDK.js +223 -0
  7. package/dist/main-AGLPUGNN.js +1733 -0
  8. package/dist/react-router-server.d.ts +1 -1
  9. package/dist/vite.js +1 -1
  10. package/docs/command-line.md +55 -1
  11. package/docs/getting-started.md +8 -0
  12. package/docs/react-router.md +32 -3
  13. package/docs/react.md +5 -2
  14. package/package.json +5 -2
  15. package/templates/astro/.dockerignore +7 -0
  16. package/templates/astro/.github/dependabot.yml +19 -0
  17. package/templates/astro/.github/workflows/ci.yml +23 -0
  18. package/templates/astro/.prettierignore +6 -0
  19. package/templates/astro/.prettierrc.json +20 -0
  20. package/templates/astro/.vscode/extensions.json +4 -0
  21. package/templates/astro/.vscode/launch.json +11 -0
  22. package/templates/astro/AGENTS.md +22 -0
  23. package/templates/astro/Dockerfile +17 -0
  24. package/templates/astro/_gitignore +26 -0
  25. package/templates/astro/astro.config.mjs +18 -0
  26. package/templates/astro/eslint.config.js +56 -0
  27. package/templates/astro/package.json +41 -0
  28. package/templates/astro/public/favicon.ico +0 -0
  29. package/templates/astro/public/favicon.svg +9 -0
  30. package/templates/astro/src/ace-kit.generated.d.ts +24 -0
  31. package/templates/astro/src/components/PageContent.astro +113 -0
  32. package/templates/astro/src/components/SiteFooter.astro +19 -0
  33. package/templates/astro/src/components/SiteHeader.astro +121 -0
  34. package/templates/astro/src/components/sections/Faq.astro +54 -0
  35. package/templates/astro/src/components/sections/Faq.schema.ts +17 -0
  36. package/templates/astro/src/components/sections/Gallery.astro +74 -0
  37. package/templates/astro/src/components/sections/Gallery.schema.ts +20 -0
  38. package/templates/astro/src/components/sections/Hero.astro +58 -0
  39. package/templates/astro/src/components/sections/Hero.schema.ts +14 -0
  40. package/templates/astro/src/layouts/BaseLayout.astro +36 -0
  41. package/templates/astro/src/pages/[...slug].astro +31 -0
  42. package/templates/astro/src/styles/global.css +56 -0
  43. package/templates/astro/src/types/page.d.ts +4 -0
  44. package/templates/astro/tsconfig.json +11 -0
  45. package/templates/astro/vitest.config.ts +4 -0
  46. package/templates/astro.section-types.json +109 -0
  47. package/templates/react-router/.prettierignore +5 -0
  48. package/templates/react-router/.prettierrc.json +11 -0
  49. package/templates/react-router/_gitignore +7 -0
  50. package/templates/react-router/app/ace-kit.generated.d.ts +24 -0
  51. package/templates/react-router/app/app.css +257 -0
  52. package/templates/react-router/app/components/page-content.tsx +55 -0
  53. package/templates/react-router/app/components/sections/faq.schema.ts +17 -0
  54. package/templates/react-router/app/components/sections/faq.tsx +26 -0
  55. package/templates/react-router/app/components/sections/gallery.schema.ts +20 -0
  56. package/templates/react-router/app/components/sections/gallery.tsx +39 -0
  57. package/templates/react-router/app/components/sections/hero.schema.ts +14 -0
  58. package/templates/react-router/app/components/sections/hero.tsx +25 -0
  59. package/templates/react-router/app/components/site-footer.tsx +9 -0
  60. package/templates/react-router/app/components/site-header.tsx +49 -0
  61. package/templates/react-router/app/entry.server.tsx +1 -0
  62. package/templates/react-router/app/root.tsx +75 -0
  63. package/templates/react-router/app/routes/page.test.tsx +118 -0
  64. package/templates/react-router/app/routes/page.tsx +22 -0
  65. package/templates/react-router/app/routes.ts +8 -0
  66. package/templates/react-router/app/types/page.d.ts +4 -0
  67. package/templates/react-router/eslint.config.js +76 -0
  68. package/templates/react-router/package.json +51 -0
  69. package/templates/react-router/public/favicon.svg +9 -0
  70. package/templates/react-router/react-router.config.ts +6 -0
  71. package/templates/react-router/tsconfig.json +22 -0
  72. package/templates/react-router/vite.config.ts +10 -0
  73. package/templates/react-router/vitest.config.ts +15 -0
  74. package/templates/react-router.section-types.json +109 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @sandboxsonny/ace-kit
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 909b1a1: Add `ace-kit doctor`: checks Node, that Ace Kit is installed, the CMS and site the settings point at, the login, the Pages content and the section types, and says what to do about each problem.
8
+ - 584dcb1: The React Router starter made by `ace-kit create` now has the hero, FAQ and gallery sections, like the Astro one, and its published date and button. `ace-kit sync`, `ace-kit doctor` and the dev server look for `*.schema.ts` files in `app/` as well as `src/`. The docs now say a React Router site needs an `index` route as well as the `*` route, because `*` doesn't match `/`.
9
+
10
+ ## 0.6.0
11
+
12
+ ### Minor Changes
13
+
14
+ - 6235a3b: Add `ace-kit create <folder> <domain>`: signs you in, makes the site in CMS Ace with starter content (a Pages type, Home, About and Contact, a main menu and example sections), and copies an Astro or React Router starter into the folder (`--framework`, `--name`). Needs a CMS Ace that lets a command-line login set up the site it just made.
15
+
3
16
  ## 0.5.0
4
17
 
5
18
  ### Minor Changes
@@ -1,4 +1,4 @@
1
- import { startDevSite, sectionSync } from './chunk-WM5NOQE3.js';
1
+ import { startDevSite, sectionSync } from './chunk-T7DKI2U3.js';
2
2
  import { domainFromSite, hostedAdminOrigin, hostedApiUrl } from './chunk-N5DIMG3X.js';
3
3
  import { envField } from 'astro/config';
4
4
  import { fileURLToPath } from 'url';
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/auth/login-store.ts
4
+ function normaliseApiUrl(address) {
5
+ let parsed;
6
+ try {
7
+ parsed = new URL(address.trim());
8
+ } catch {
9
+ throw new Error(`"${address}" is not a web address. Write the API address like http://localhost:8080.`);
10
+ }
11
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
12
+ throw new Error(`The API address must start with http:// or https:// (it was "${address}").`);
13
+ }
14
+ if (parsed.username || parsed.password) {
15
+ throw new Error("The API address must not contain a username or password.");
16
+ }
17
+ return `${parsed.origin}${parsed.pathname.replace(/\/+$/, "")}`;
18
+ }
19
+ function hasExpired(login, now) {
20
+ const endsAt = Date.parse(login.expiresAt);
21
+ return Number.isNaN(endsAt) || endsAt <= now;
22
+ }
23
+ function parseStoredLogin(value) {
24
+ if (typeof value !== "object" || value === null) return null;
25
+ const { token, expiresAt, email } = value;
26
+ if (typeof token !== "string" || token === "" || typeof expiresAt !== "string" || typeof email !== "string")
27
+ return null;
28
+ return { token, expiresAt, email };
29
+ }
30
+
31
+ export {
32
+ normaliseApiUrl,
33
+ hasExpired,
34
+ parseStoredLogin
35
+ };
@@ -351,8 +351,9 @@ var skippedFolders = /* @__PURE__ */ new Set([
351
351
  ".output",
352
352
  "coverage"
353
353
  ]);
354
- async function findSchemaFiles(root, folder = "src") {
355
- const start = join(root, folder);
354
+ var defaultSchemaFolders = ["src", "app"];
355
+ async function findSchemaFiles(root, folder) {
356
+ const folders = defaultSchemaFolders ;
356
357
  const found = [];
357
358
  async function walk(directory) {
358
359
  let entries;
@@ -370,7 +371,7 @@ async function findSchemaFiles(root, folder = "src") {
370
371
  }
371
372
  }
372
373
  }
373
- await walk(start);
374
+ for (const name of folders) await walk(join(root, name));
374
375
  return found.sort((first, second) => {
375
376
  const [firstName, secondName] = [relative(root, first), relative(root, second)];
376
377
  return firstName < secondName ? -1 : firstName > secondName ? 1 : 0;