@sandboxsonny/ace-kit 0.4.0 → 0.6.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 (73) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +1 -1
  3. package/dist/astro-integration.d.ts +3 -3
  4. package/dist/astro-integration.js +7 -4
  5. package/dist/chunk-7M26C36M.js +35 -0
  6. package/dist/{chunk-O3NAJNUN.js → chunk-G5FGBOFT.js} +7 -7
  7. package/dist/chunk-N5DIMG3X.js +16 -0
  8. package/dist/cli.js +14 -1169
  9. package/dist/environment-T5K5ZJ2M.js +222 -0
  10. package/dist/main-YRQQWLHX.js +1454 -0
  11. package/dist/react-router-server.js +3 -2
  12. package/dist/vite.js +2 -1
  13. package/docs/astro.md +12 -6
  14. package/docs/command-line.md +34 -5
  15. package/docs/dev-sites.md +2 -2
  16. package/docs/getting-started.md +8 -0
  17. package/docs/react-router.md +7 -5
  18. package/docs/sections.md +1 -1
  19. package/docs/typed-content.md +3 -3
  20. package/package.json +5 -2
  21. package/templates/astro/.dockerignore +7 -0
  22. package/templates/astro/.github/dependabot.yml +19 -0
  23. package/templates/astro/.github/workflows/ci.yml +23 -0
  24. package/templates/astro/.prettierignore +6 -0
  25. package/templates/astro/.prettierrc.json +20 -0
  26. package/templates/astro/.vscode/extensions.json +4 -0
  27. package/templates/astro/.vscode/launch.json +11 -0
  28. package/templates/astro/AGENTS.md +22 -0
  29. package/templates/astro/Dockerfile +17 -0
  30. package/templates/astro/_gitignore +26 -0
  31. package/templates/astro/astro.config.mjs +18 -0
  32. package/templates/astro/eslint.config.js +56 -0
  33. package/templates/astro/package.json +41 -0
  34. package/templates/astro/public/favicon.ico +0 -0
  35. package/templates/astro/public/favicon.svg +9 -0
  36. package/templates/astro/src/ace-kit.generated.d.ts +24 -0
  37. package/templates/astro/src/components/PageContent.astro +113 -0
  38. package/templates/astro/src/components/SiteFooter.astro +19 -0
  39. package/templates/astro/src/components/SiteHeader.astro +121 -0
  40. package/templates/astro/src/components/sections/Faq.astro +54 -0
  41. package/templates/astro/src/components/sections/Faq.schema.ts +17 -0
  42. package/templates/astro/src/components/sections/Gallery.astro +74 -0
  43. package/templates/astro/src/components/sections/Gallery.schema.ts +20 -0
  44. package/templates/astro/src/components/sections/Hero.astro +58 -0
  45. package/templates/astro/src/components/sections/Hero.schema.ts +14 -0
  46. package/templates/astro/src/layouts/BaseLayout.astro +36 -0
  47. package/templates/astro/src/pages/[...slug].astro +31 -0
  48. package/templates/astro/src/styles/global.css +56 -0
  49. package/templates/astro/src/types/page.d.ts +4 -0
  50. package/templates/astro/tsconfig.json +11 -0
  51. package/templates/astro/vitest.config.ts +4 -0
  52. package/templates/astro.section-types.json +109 -0
  53. package/templates/react-router/.prettierignore +5 -0
  54. package/templates/react-router/.prettierrc.json +11 -0
  55. package/templates/react-router/_gitignore +7 -0
  56. package/templates/react-router/app/ace-kit.generated.d.ts +18 -0
  57. package/templates/react-router/app/app.css +172 -0
  58. package/templates/react-router/app/components/page-content.tsx +32 -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 +64 -0
  64. package/templates/react-router/app/routes/page.tsx +22 -0
  65. package/templates/react-router/app/routes.ts +4 -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
@@ -1,5 +1,6 @@
1
1
  import { createAceClient, loadMenuLinks, loadPage } from './chunk-XYOW63V6.js';
2
2
  import './chunk-M5WR5TCR.js';
3
+ import { hostedAdminOrigin, hostedApiUrl } from './chunk-N5DIMG3X.js';
3
4
  import { previewTokenFrom, addFramingPolicy } from './chunk-YLO6IAXF.js';
4
5
  import { createReadableStreamFromReadable } from '@react-router/node';
5
6
  import { PassThrough } from 'stream';
@@ -10,9 +11,9 @@ import { jsx } from 'react/jsx-runtime';
10
11
  // src/react-router/settings.ts
11
12
  function getAceSettings() {
12
13
  return {
13
- apiUrl: process.env.ACE_API_URL ?? "http://localhost:8080",
14
+ apiUrl: process.env.ACE_API_URL ?? hostedApiUrl,
14
15
  siteDomain: process.env.ACE_SITE_DOMAIN ?? "localhost",
15
- previewAdminOrigin: process.env.ACE_PREVIEW_ADMIN_ORIGIN ?? "http://localhost:5173"
16
+ previewAdminOrigin: process.env.ACE_PREVIEW_ADMIN_ORIGIN ?? hostedAdminOrigin
16
17
  };
17
18
  }
18
19
  if (typeof window !== "undefined" && typeof process === "undefined") {
package/dist/vite.js CHANGED
@@ -1,4 +1,5 @@
1
- import { startDevSite, startSectionSync } from './chunk-O3NAJNUN.js';
1
+ import { startDevSite, startSectionSync } from './chunk-G5FGBOFT.js';
2
+ import './chunk-N5DIMG3X.js';
2
3
  import { resolve } from 'path';
3
4
  import { loadEnv } from 'vite';
4
5
 
package/docs/astro.md CHANGED
@@ -17,13 +17,19 @@ export default defineConfig({
17
17
 
18
18
  The integration declares three settings, adds the middleware that lets the CMS's admin app (and only it) frame the site for [live preview](./live-preview.md), and makes Vite process the kit. The settings are read when the server starts, not baked into the build, so one build runs anywhere:
19
19
 
20
- | Setting | Default | Meaning |
21
- | -------------------------- | ----------------------- | --------------------------------------------------------- |
22
- | `ACE_API_URL` | `http://localhost:8080` | where the CMS Ace API lives |
23
- | `ACE_SITE_DOMAIN` | `localhost` | the domain this site has in the CMS (the port is ignored) |
24
- | `ACE_PREVIEW_ADMIN_ORIGIN` | `http://localhost:5173` | where the CMS admin app runs |
20
+ | Setting | Default | Meaning |
21
+ | -------------------------- | ---------------------------------------------------- | --------------------------------------------------------- |
22
+ | `ACE_API_URL` | `https://api.ace-cms.co.uk` | where the CMS Ace API lives |
23
+ | `ACE_SITE_DOMAIN` | the host of Astro's `site` setting, else `localhost` | the domain this site has in the CMS (the port is ignored) |
24
+ | `ACE_PREVIEW_ADMIN_ORIGIN` | `https://app.ace-cms.co.uk` | where the CMS admin app runs |
25
25
 
26
- Put them in `.env` for development and in the environment for production.
26
+ CMS Ace is a hosted platform, so a site normally sets none of these except its domain, and it does that with Astro's own `site` setting, which Astro needs for canonical addresses anyway:
27
+
28
+ ```js
29
+ export default defineConfig({ site: "https://www.example.com", integrations: [ace()] });
30
+ ```
31
+
32
+ To try a site without editing the config, `npm run dev -- --site https://www.example.com` does the same. `ACE_SITE_DOMAIN`, when set, wins. Set `ACE_API_URL` and `ACE_PREVIEW_ADMIN_ORIGIN` (in `.env`) only to use a CMS running on your own machine, for example `http://localhost:8080` and `http://localhost:5173`.
27
33
 
28
34
  ## Pages
29
35
 
@@ -1,8 +1,9 @@
1
1
  # The command line
2
2
 
3
- `ace-kit` is also a command. It signs you in to CMS Ace from your terminal, and writes types for your content.
3
+ `ace-kit` is also a command. It makes new sites, signs you in to CMS Ace from your terminal, and writes types for your content.
4
4
 
5
5
  ```sh
6
+ npx @sandboxsonny/ace-kit create my-site --site my-site.com # make a new site (see Making a site)
6
7
  npx ace-kit login # sign in
7
8
  npx ace-kit whoami # who am I signed in as?
8
9
  npx ace-kit logout # sign out
@@ -10,18 +11,46 @@ npx ace-kit generate # write TypeScript types (see Typed content)
10
11
  npx ace-kit sync # send your section types to the CMS (see Sections)
11
12
  ```
12
13
 
13
- Every command takes `--api-url`, or reads `ACE_API_URL` from the environment or a `.env` file in the folder you run it in. Failing both, it uses the address you last signed in to (kept in a small file beside your logins), so after `ace-kit login --api-url …` you can simply run `ace-kit whoami` from anywhere.
14
+ Commands talk to the hosted CMS Ace unless told otherwise. Only for a CMS on your own machine, give `--api-url`, or set `ACE_API_URL` in the environment or a `.env` file in the folder you run it in. Failing both, a command uses the address you last signed in to (kept in a small file beside your logins), and failing that the hosted one, so `ace-kit login` and `ace-kit whoami` need no flags at all. Commands about a site (`sync`, `generate`) take `--site example.com`, or read `ACE_SITE_DOMAIN`.
15
+
16
+ ## Making a site
17
+
18
+ ```sh
19
+ npx @sandboxsonny/ace-kit create my-site my-site.com
20
+ ```
21
+
22
+ One command makes everything a new site needs:
23
+
24
+ 1. **Checks** the folder, the domain and the name, before anything is made.
25
+ 2. **Signs you in** if you aren't already (your browser opens; type the code from the terminal, as in [Signing in](#signing-in)).
26
+ 3. **Makes the site in CMS Ace** and gives it a starter: a `pages` content type, Home, About and Contact entries, a main menu and, for the Astro starter, the three example section types (hero, FAQ, gallery).
27
+ 4. **Copies a starter site** into `my-site/` with its name, domain and package name filled in.
28
+
29
+ If a site with that domain already exists in CMS Ace, it is **left alone** (nothing is added to it, in case it has real content), a warning says so, and only the folder is made. If the CMS refuses to make the site (for instance, you have made as many as your account allows) nothing is made at all.
30
+
31
+ Your account must be a **partner or super admin** (only they can make sites). The login `create` uses can set up the site it just made, for an hour, and no other site: it can't write content anywhere else.
32
+
33
+ | Option | Meaning |
34
+ | --------------------------------- | -------------------------------------------------------------------------------------- |
35
+ | `<domain>` (or `--site <domain>`) | The domain the site has in CMS Ace. Required. |
36
+ | `--framework astro\|react-router` | `astro` (the default) or `react-router`. The React Router starter has no sections yet. |
37
+ | `--name <name>` | The name shown to visitors. Default: made from the folder, so `my-site` is "My Site". |
38
+ | `--api-url <address>` | Only for a CMS on your own machine (or set `ACE_API_URL`). |
39
+
40
+ Against a CMS on your own machine (`--api-url` or `ACE_API_URL` set to `http://localhost:8080`), it also writes a `.env` in the new folder with `ACE_API_URL` and `ACE_PREVIEW_ADMIN_ORIGIN=http://localhost:5173`, and sets the site's Preview address to the local dev server (`http://localhost:4321`, or 4322 for React Router), so the site and live preview work with no more setup. Against the hosted CMS Ace none of that is needed.
41
+
42
+ The folder must not exist yet (or must be empty). The starter is a small server-rendered site with a header, footer, rich text, live preview and Prettier, ESLint, tests and a CI workflow. When it finishes: `cd my-site`, `npm install`, `npm run dev`.
14
43
 
15
44
  ## Signing in
16
45
 
17
46
  ```sh
18
- npx ace-kit login --api-url http://localhost:8080
47
+ npx ace-kit login
19
48
  ```
20
49
 
21
50
  ```
22
- Signing in to http://localhost:8080
51
+ Signing in to https://api.ace-cms.co.uk
23
52
 
24
- 1. Go to http://localhost:5173/device
53
+ 1. Go to https://app.ace-cms.co.uk/device
25
54
  2. Type BCDF-GHJK
26
55
 
27
56
  Check the code on that page matches. Waiting for you to approve it (Ctrl-C to cancel)...
package/docs/dev-sites.md CHANGED
@@ -6,7 +6,7 @@ When your site's dev server works against a hosted CMS, it doesn't touch the liv
6
6
 
7
7
  On start, the dev server (the Astro integration, or the `ace()` Vite plugin on React Router):
8
8
 
9
- 1. checks you are signed in (`npx ace-kit login`), and finds the site `ACE_SITE_DOMAIN` names;
9
+ 1. checks you are signed in (`npx ace-kit login`), and finds the site you are working on (Astro's `site` setting, or `ACE_SITE_DOMAIN`);
10
10
  2. asks the CMS for your dev site of it, which the CMS makes the first time as a copy of the live site: its content types, section types, menus and the **text** of its entries, with every link between entries pointing at the copy. Images are not copied yet, so image fields start empty;
11
11
  3. points the site at it: `ACE_SITE_DOMAIN` becomes the dev site's domain for as long as the dev server runs (your `.env` is not changed), so the site reads its content from the dev site, and section sync goes there;
12
12
  4. tells the CMS where the dev server is running, so the live preview in the admin app shows your dev server.
@@ -23,7 +23,7 @@ Partner accounts and super admins, for sites they own. Ask for a partner account
23
23
 
24
24
  ## Going to the live site
25
25
 
26
- A dev site is never merged into the live site. When your change is ready, deploy your site, then run `npx ace-kit sync` against the live site (`ACE_SITE_DOMAIN` set to the live domain, as in your `.env`). Deploy first: the live CMS then has the section types the deployed code expects.
26
+ A dev site is never merged into the live site. When your change is ready, deploy your site, then run `npx ace-kit sync` against the live site (`--site www.example.com`, or `ACE_SITE_DOMAIN`). Deploy first: the live CMS then has the section types the deployed code expects.
27
27
 
28
28
  ## Settings
29
29
 
@@ -2,6 +2,14 @@
2
2
 
3
3
  Ace Kit is everything a website needs to use CMS Ace (see the [README](../README.md)): a typed client for the public API, addressing (`/{content type}/{entry}`), responsive images, menus, rich text, live preview support, and thin Astro and React adapters. It has no runtime dependencies.
4
4
 
5
+ ## Starting from nothing
6
+
7
+ ```sh
8
+ npx @sandboxsonny/ace-kit create my-site my-site.com
9
+ ```
10
+
11
+ makes an Astro (or, with `--framework react-router`, a React Router) site with everything below already wired up. See [the command line](./command-line.md#making-a-site). To add the kit to a site you already have, read on.
12
+
5
13
  ## Install
6
14
 
7
15
  ```sh
@@ -26,11 +26,13 @@ export default defineConfig({ plugins: [ace(), reactRouter()] });
26
26
 
27
27
  The settings are environment variables, read when the server starts, so one build runs anywhere. Put them in `.env` for development and in the host's environment for production:
28
28
 
29
- | Variable | Default | Meaning |
30
- | -------------------------- | ----------------------- | --------------------------------------------------------- |
31
- | `ACE_API_URL` | `http://localhost:8080` | where the CMS Ace API lives |
32
- | `ACE_SITE_DOMAIN` | `localhost` | the domain this site has in the CMS (the port is ignored) |
33
- | `ACE_PREVIEW_ADMIN_ORIGIN` | `http://localhost:5173` | where the CMS admin app runs |
29
+ | Variable | Default | Meaning |
30
+ | -------------------------- | --------------------------- | --------------------------------------------------------- |
31
+ | `ACE_API_URL` | `https://api.ace-cms.co.uk` | where the CMS Ace API lives |
32
+ | `ACE_SITE_DOMAIN` | `localhost` | the domain this site has in the CMS (the port is ignored) |
33
+ | `ACE_PREVIEW_ADMIN_ORIGIN` | `https://app.ace-cms.co.uk` | where the CMS admin app runs |
34
+
35
+ CMS Ace is a hosted platform, so a site normally sets only `ACE_SITE_DOMAIN`. Set the other two only to use a CMS on your own machine (`http://localhost:8080` and `http://localhost:5173`).
34
36
 
35
37
  **2. The server entry**, which renders pages and lets the CMS's admin app (and only it) frame the site for [live preview](./live-preview.md):
36
38
 
package/docs/sections.md CHANGED
@@ -87,7 +87,7 @@ While the dev server runs, Ace Kit watches for `*.schema.ts` files (in `src`) an
87
87
  10:41:07 [ace-kit] Synced 3 section types (faq, gallery, hero) to localhost (http://localhost:8080).
88
88
  ```
89
89
 
90
- You don't run anything. You do need to be signed in once: `npx ace-kit login` (see [the command line](./command-line.md)). The sync goes to the site named by `ACE_SITE_DOMAIN` at `ACE_API_URL`, the same settings the site reads its content with, and only an owner of that site (or a super admin) can sync to it.
90
+ You don't run anything. You do need to be signed in once: `npx ace-kit login` (see [the command line](./command-line.md)). The sync goes to the site the dev server is working on, the same one it reads its content from, and only an owner of that site (or a super admin) can sync to it.
91
91
 
92
92
  **Your dev site, not the live one.** Against a _hosted_ CMS the dev server works on a [dev site](./dev-sites.md): your own private copy of the site, made for you the first time, so a half-written field never reaches editors or visitors of the live site. The sync goes there. Against a CMS on your own machine there is no need for one, and the sync goes to the site itself.
93
93
 
@@ -3,16 +3,16 @@
3
3
  The kit can write TypeScript types for your site's content types, so `getEntry` and `getEntries` return the right shape and a change in the CMS shows up as a type error in your site.
4
4
 
5
5
  ```sh
6
- npx ace-kit generate --api-url http://localhost:8080 --domain localhost
6
+ npx ace-kit generate --site www.example.com
7
7
  ```
8
8
 
9
9
  or with the settings in the environment:
10
10
 
11
11
  ```sh
12
- ACE_API_URL=http://localhost:8080 ACE_SITE_DOMAIN=localhost npx ace-kit generate
12
+ ACE_SITE_DOMAIN=www.example.com npx ace-kit generate
13
13
  ```
14
14
 
15
- It reads `GET /public/content-types` (no login: it describes field names and kinds, never entries) and writes `src/ace-kit.generated.d.ts` (change it with `--out`). Make sure the file is inside your `tsconfig` `include`. Commit it, and run the command again whenever content types change (a good moment is a CI step, or a `generate` script next to `dev`).
15
+ Add `--api-url http://localhost:8080` (or `ACE_API_URL`) only for a CMS on your own machine. It reads `GET /public/content-types` (no login: it describes field names and kinds, never entries) and writes `src/ace-kit.generated.d.ts` (change it with `--out`). Make sure the file is inside your `tsconfig` `include`. Commit it, and run the command again whenever content types change (a good moment is a CI step, or a `generate` script next to `dev`).
16
16
 
17
17
  ```ts
18
18
  // ace-kit.generated.d.ts (generated)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sandboxsonny/ace-kit",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Everything a website needs to use CMS Ace: a typed client, addressing, images, menus, rich text, live preview, and Astro and React adapters.",
5
5
  "keywords": [
6
6
  "cms",
@@ -29,6 +29,7 @@
29
29
  "files": [
30
30
  "dist",
31
31
  "astro",
32
+ "templates",
32
33
  "docs",
33
34
  "CHANGELOG.md",
34
35
  "LICENSE"
@@ -87,8 +88,10 @@
87
88
  "format": "prettier --write .",
88
89
  "format:check": "prettier --check .",
89
90
  "typecheck": "tsc --noEmit",
90
- "check": "npm run format:check && npm run lint && npm run typecheck && npm test && npm run build && npm run check:package",
91
+ "check": "npm run format:check && npm run lint && npm run typecheck && npm test && npm run build && npm run check:package && npm run check:templates",
91
92
  "check:package": "node scripts/check-package.mjs",
93
+ "check:templates": "node scripts/sync-templates.mjs --check",
94
+ "sync:templates": "node scripts/sync-templates.mjs",
92
95
  "pack:local": "npm run build && npm pack",
93
96
  "storybook": "storybook dev -p 6006",
94
97
  "build:storybook": "storybook build",
@@ -0,0 +1,7 @@
1
+ node_modules
2
+ dist
3
+ .astro
4
+ .env
5
+ .env.*
6
+ !.env.example
7
+ .vscode
@@ -0,0 +1,19 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: npm
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ groups:
8
+ # Small upgrades arrive together as one pull request. A major version of anything is its own pull request, so
9
+ # one that needs a deliberate look (a new Astro or Ace Kit major) doesn't hold back the rest.
10
+ minor-and-patch:
11
+ update-types: [minor, patch]
12
+ - package-ecosystem: docker
13
+ directory: /
14
+ schedule:
15
+ interval: monthly
16
+ - package-ecosystem: github-actions
17
+ directory: /
18
+ schedule:
19
+ interval: monthly
@@ -0,0 +1,23 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ check:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v7
16
+ - uses: actions/setup-node@v7
17
+ with:
18
+ # Matches the Dockerfile's node:24-alpine, so CI tests what production runs.
19
+ node-version: 24
20
+ cache: npm
21
+ - run: npm ci
22
+ # Format, lint, types, tests and a build.
23
+ - run: npm run check
@@ -0,0 +1,6 @@
1
+ node_modules
2
+ dist
3
+ .astro
4
+ public
5
+ package-lock.json
6
+ src/ace-kit.generated.d.ts
@@ -0,0 +1,20 @@
1
+ {
2
+ "printWidth": 120,
3
+ "tabWidth": 2,
4
+ "useTabs": false,
5
+ "semi": true,
6
+ "singleQuote": false,
7
+ "trailingComma": "all",
8
+ "bracketSpacing": true,
9
+ "arrowParens": "always",
10
+ "endOfLine": "lf",
11
+ "plugins": ["prettier-plugin-astro"],
12
+ "overrides": [
13
+ {
14
+ "files": "*.astro",
15
+ "options": {
16
+ "parser": "astro"
17
+ }
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "recommendations": ["astro-build.astro-vscode"],
3
+ "unwantedRecommendations": []
4
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "command": "./node_modules/.bin/astro dev",
6
+ "name": "Development server",
7
+ "request": "launch",
8
+ "type": "node-terminal"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,22 @@
1
+ ## Development
2
+
3
+ When starting the dev server, use background mode:
4
+
5
+ ```
6
+ astro dev --background
7
+ ```
8
+
9
+ Manage the background server with `astro dev stop`, `astro dev status`, and `astro dev logs`.
10
+
11
+ ## Documentation
12
+
13
+ Full documentation: https://docs.astro.build
14
+
15
+ Consult these guides before working on related tasks:
16
+
17
+ - [Adding pages, dynamic routes, or middleware](https://docs.astro.build/en/guides/routing/)
18
+ - [Working with Astro components](https://docs.astro.build/en/basics/astro-components/)
19
+ - [Using React, Vue, Svelte, or other framework components](https://docs.astro.build/en/guides/framework-components/)
20
+ - [Adding or managing content](https://docs.astro.build/en/guides/content-collections/)
21
+ - [Adding styles or using Tailwind](https://docs.astro.build/en/guides/styling/)
22
+ - [Supporting multiple languages](https://docs.astro.build/en/guides/internationalization/)
@@ -0,0 +1,17 @@
1
+ FROM node:24-alpine AS production-dependencies-env
2
+ COPY ./package.json package-lock.json /app/
3
+ WORKDIR /app
4
+ RUN npm ci --omit=dev
5
+
6
+ FROM node:24-alpine AS build-env
7
+ COPY . /app/
8
+ WORKDIR /app
9
+ RUN npm ci && npm run build
10
+
11
+ FROM node:24-alpine
12
+ ENV HOST=0.0.0.0
13
+ COPY ./package.json package-lock.json /app/
14
+ COPY --from=production-dependencies-env /app/node_modules /app/node_modules
15
+ COPY --from=build-env /app/dist /app/dist
16
+ WORKDIR /app
17
+ CMD ["node", "dist/server/entry.mjs"]
@@ -0,0 +1,26 @@
1
+ # build output
2
+ dist/
3
+ # generated types
4
+ .astro/
5
+
6
+ # dependencies
7
+ node_modules/
8
+
9
+ # logs
10
+ npm-debug.log*
11
+ yarn-debug.log*
12
+ yarn-error.log*
13
+ pnpm-debug.log*
14
+
15
+
16
+ # environment variables
17
+ .env
18
+ .env.production
19
+
20
+ # macOS-specific files
21
+ .DS_Store
22
+
23
+ # jetbrains setting folder
24
+ .idea/
25
+ .env.*
26
+ !.env.example
@@ -0,0 +1,18 @@
1
+ // @ts-check
2
+ import { defineConfig } from "astro/config";
3
+
4
+ import node from "@astrojs/node";
5
+ import ace from "@sandboxsonny/ace-kit/astro/integration";
6
+
7
+ // https://astro.build/config
8
+ export default defineConfig({
9
+ // The site's domain in CMS Ace. Ace Kit reads it from here (ACE_SITE_DOMAIN, if set, wins), so the dev server can find
10
+ // or make your own private copy of this site to work on.
11
+ site: "https://example.adamsdevelopment.co.uk",
12
+ // Pages are rendered on each request so they always show the CMS's live content.
13
+ output: "server",
14
+ adapter: node({ mode: "standalone" }),
15
+ // Ace Kit connects the site to CMS Ace: it declares ACE_API_URL, ACE_SITE_DOMAIN and ACE_PREVIEW_ADMIN_ORIGIN, and
16
+ // lets the CMS's admin app frame the site for live preview.
17
+ integrations: [ace()],
18
+ });
@@ -0,0 +1,56 @@
1
+ import eslint from "@eslint/js";
2
+ import astro from "eslint-plugin-astro";
3
+ import prettierConfig from "eslint-config-prettier";
4
+ import globals from "globals";
5
+ import typescriptEslint from "typescript-eslint";
6
+
7
+ export default typescriptEslint.config(
8
+ { ignores: ["node_modules", "dist", ".astro", "public"] },
9
+
10
+ eslint.configs.recommended,
11
+ ...typescriptEslint.configs.recommended,
12
+ ...astro.configs.recommended,
13
+
14
+ {
15
+ files: ["**/*.{ts,astro,mjs}"],
16
+ languageOptions: { globals: { ...globals.browser, ...globals.node } },
17
+ rules: {
18
+ // Types are imported with `import type` from src/types.
19
+ "@typescript-eslint/consistent-type-imports": ["error", { fixStyle: "separate-type-imports" }],
20
+ "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
21
+
22
+ // No abbreviated names in code. Spell it out: `request`, `response`, `message`...
23
+ "id-denylist": [
24
+ "error",
25
+ "req",
26
+ "res",
27
+ "resp",
28
+ "cfg",
29
+ "msg",
30
+ "btn",
31
+ "tmp",
32
+ "idx",
33
+ "evt",
34
+ "cb",
35
+ "fn",
36
+ "opts",
37
+ "args",
38
+ "val",
39
+ "num",
40
+ "str",
41
+ "obj",
42
+ "arr",
43
+ ],
44
+
45
+ eqeqeq: ["error", "always"],
46
+ "no-console": ["warn", { allow: ["error", "warn"] }],
47
+ "prefer-const": "error",
48
+ },
49
+ },
50
+
51
+ // Command-line scripts report what they did on the console.
52
+ { files: ["scripts/**"], rules: { "no-console": "off" } },
53
+
54
+ // Must stay last: turns off any rule that would fight with Prettier.
55
+ prettierConfig,
56
+ );
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "example-astro-site",
3
+ "type": "module",
4
+ "version": "0.0.1",
5
+ "engines": {
6
+ "node": ">=22.12.0"
7
+ },
8
+ "scripts": {
9
+ "dev": "astro dev",
10
+ "build": "astro build",
11
+ "preview": "astro preview",
12
+ "astro": "astro",
13
+ "lint": "eslint .",
14
+ "lint:fix": "eslint . --fix",
15
+ "format": "prettier --write .",
16
+ "format:check": "prettier --check .",
17
+ "typecheck": "astro check",
18
+ "check": "npm run format:check && npm run lint && npm run typecheck && npm test && npm run build",
19
+ "test": "vitest run --passWithNoTests",
20
+ "generate": "ace-kit generate"
21
+ },
22
+ "dependencies": {
23
+ "@astrojs/node": "^11.1.7",
24
+ "@sandboxsonny/ace-kit": "^0.5.0",
25
+ "astro": "^7.3.8"
26
+ },
27
+ "devDependencies": {
28
+ "@astrojs/check": "^0.9.10",
29
+ "@eslint/js": "^10.0.1",
30
+ "eslint": "^10.12.0",
31
+ "eslint-config-prettier": "^10.1.8",
32
+ "eslint-plugin-astro": "^1.7.0",
33
+ "globals": "^17.13.0",
34
+ "jsdom": "^29.1.1",
35
+ "prettier": "^3.9.10",
36
+ "prettier-plugin-astro": "^1.1.1",
37
+ "typescript": "^6.0.3",
38
+ "typescript-eslint": "^8.71.1",
39
+ "vitest": "^5.0.4"
40
+ }
41
+ }
@@ -0,0 +1,9 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 128 128">
2
+ <path d="M50.4 78.5a75.1 75.1 0 0 0-28.5 6.9l24.2-65.7c.7-2 1.9-3.2 3.4-3.2h29c1.5 0 2.7 1.2 3.4 3.2l24.2 65.7s-11.6-7-28.5-7L67 45.5c-.4-1.7-1.6-2.8-2.9-2.8-1.3 0-2.5 1.1-2.9 2.7L50.4 78.5Zm-1.1 28.2Zm-4.2-20.2c-2 6.6-.6 15.8 4.2 20.2a17.5 17.5 0 0 1 .2-.7 5.5 5.5 0 0 1 5.7-4.5c2.8.1 4.3 1.5 4.7 4.7.2 1.1.2 2.3.2 3.5v.4c0 2.7.7 5.2 2.2 7.4a13 13 0 0 0 5.7 4.9v-.3l-.2-.3c-1.8-5.6-.5-9.5 4.4-12.8l1.5-1a73 73 0 0 0 3.2-2.2 16 16 0 0 0 6.8-11.4c.3-2 .1-4-.6-6l-.8.6-1.6 1a37 37 0 0 1-22.4 2.7c-5-.7-9.7-2-13.2-6.2Z" />
3
+ <style>
4
+ path { fill: #000; }
5
+ @media (prefers-color-scheme: dark) {
6
+ path { fill: #FFF; }
7
+ }
8
+ </style>
9
+ </svg>
@@ -0,0 +1,24 @@
1
+ // Generated by ace-kit from localhost. Do not edit: run `ace-kit generate` to update it.
2
+ import type { AceImageData, AceLinkData, AceRichTextDocument, AceSection } from "@sandboxsonny/ace-kit";
3
+
4
+ declare module "@sandboxsonny/ace-kit" {
5
+ interface AceContentTypes {
6
+ /** Pages */
7
+ "pages": {
8
+ /** Headline */
9
+ "headline": string;
10
+ /** Body */
11
+ "body"?: AceRichTextDocument;
12
+ /** Hero image */
13
+ "hero"?: AceImageData;
14
+ /** Published */
15
+ "published"?: string;
16
+ /** Button */
17
+ "button"?: AceLinkData;
18
+ /** Content */
19
+ "content"?: AceSection[];
20
+ };
21
+ }
22
+ }
23
+
24
+ export {};