andesine 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 (29) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +66 -0
  3. package/dist/cli.js +2492 -49
  4. package/dist/cli.js.map +1 -1
  5. package/dist/templates/extension/.env.example +5 -0
  6. package/dist/templates/extension/LICENSE +21 -0
  7. package/dist/templates/extension/README.md +39 -0
  8. package/dist/templates/extension/andesine.config.ts +83 -0
  9. package/dist/templates/extension/andesine.keys.json +4 -0
  10. package/dist/templates/extension/gitignore +4 -0
  11. package/dist/templates/extension/package.template.json +27 -0
  12. package/dist/templates/extension/src/backend/server.ts +80 -0
  13. package/dist/templates/extension/src/frontend/count-words-action.tsx +46 -0
  14. package/dist/templates/extension/src/frontend/hello-panel.tsx +93 -0
  15. package/dist/templates/extension/src/frontend/index.tsx +6 -0
  16. package/dist/templates/extension/src/frontend/note-view.tsx +51 -0
  17. package/dist/templates/extension/src/frontend/shout-action.tsx +33 -0
  18. package/dist/templates/extension/src/frontend/wrap-in-note-action.tsx +52 -0
  19. package/dist/templates/extension/tsconfig.json +16 -0
  20. package/dist/templates/pages/package.template.json +3 -3
  21. package/dist/templates/pages/src/components/content/copy-button.tsx +1 -1
  22. package/dist/templates/pages/src/components/layout/call-to-action.tsx +2 -6
  23. package/dist/templates/pages/src/components/layout/footer.astro +1 -2
  24. package/dist/templates/pages/src/components/layout/header.astro +0 -3
  25. package/dist/templates/pages/src/components/layout/mobile-navigation.tsx +1 -1
  26. package/dist/templates/pages/src/components/layout/page-actions.tsx +1 -7
  27. package/dist/templates/pages/src/components/primitives/button.tsx +21 -37
  28. package/dist/templates/pages/src/components/search/search-palette.tsx +1 -3
  29. package/package.json +18 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.0
4
+
5
+ - Validate extension manifests with the 0.6.0 rules: `settingsSections` is no longer
6
+ accepted, and element views accept a `description` and an `icon`, whose CSS
7
+ `extensions build` generates with the other manifest icons.
8
+ - Update the `extensions init` template: block action samples without UI (“Shout”), with a
9
+ `Menu` (“Count words”), and with a `Dialog` (“Wrap in Note”); a “More” menu and an “About”
10
+ dialog in the panel sample; a description and an icon for the Note view; and a local setup
11
+ guide in its README. The bookmarks panel and the About settings section samples, and the
12
+ declared request URL, are removed.
13
+ - Simplify the buttons of the `pages init` template: one `variant` (`primary`, `secondary`, or
14
+ `ghost`) replaces `variant` and `color`, and buttons default to the small size.
15
+
16
+ ## 0.5.0
17
+
18
+ - Accept the `extensions` role permission (manage workspace extensions) in role commands.
19
+ - Add `andesine extensions init [directory]`, which creates an extension with a backend
20
+ from the template of the same release and generates its first backend key.
21
+ - Add `andesine extensions build`: manifest validation with the registry rules, the
22
+ frontend bundle with the generated `startExtension` call, view and icon CSS, and
23
+ `dist/extension.json` with the artifact digests and sizes.
24
+ - Add `andesine extensions keys generate`, `check`, and `revoke`. Private keys stay in
25
+ `.andesine/keys` and are never uploaded.
26
+ - Leave extension-only API operations (which need extension JWTs) out of the generated
27
+ command bindings.
28
+ - Add `andesine extensions dev`, which runs an extension on a local instance for the
29
+ signed-in member: it uploads each build with a development key, reloads it on changes,
30
+ writes the key and the instance URL to the backend's `.env`, and stops it on exit
31
+ (`--remove` uninstalls it; `--backend <url>` points it at a local backend). It refuses hosts
32
+ that are not local.
33
+ - Add `andesine extensions test-event <webhook> <type>` for sample events to the
34
+ development extension's webhooks.
35
+ - Add `andesine extensions registry check` and `registry build` for extension registry CI:
36
+ validation with the instance rules, new versions without overwriting published ones, and
37
+ the registry index.
38
+
3
39
  ## 0.4.0
4
40
 
5
41
  - Add `andesine pages init [directory]`, which creates an Andesine Pages site from
package/README.md CHANGED
@@ -32,6 +32,72 @@ template of this CLI release, with `@andesine/pages` and `@andesine/ui` pinned t
32
32
  same version. Then run `npm install` and `npm run dev` in the directory. The command
33
33
  needs no credentials.
34
34
 
35
+ ## Extensions
36
+
37
+ ```sh
38
+ npx andesine extensions init hello --name acme/hello
39
+ npx andesine extensions build
40
+ npx andesine extensions keys generate
41
+ npx andesine extensions keys check --registry https://registry.example.com/index.json
42
+ npx andesine extensions keys revoke key-2026-10-07
43
+ ```
44
+
45
+ `extensions init` creates an extension with a Solid frontend and a Node backend in a new or
46
+ empty directory (default `extension`), and generates its first backend key.
47
+
48
+ `extensions build` loads `andesine.config.ts`, validates the manifest with the same rules
49
+ as the extension registry, bundles the frontend into one script with a generated
50
+ `startExtension` call for the manifest's view entries, and generates the CSS of the views
51
+ and of the manifest icons. It writes `dist/frontend.js`, `dist/styles.css`,
52
+ `dist/icons.css`, and `dist/extension.json` (the manifest and the SHA-256 digest and size
53
+ of each file). Builds are deterministic.
54
+
55
+ `extensions keys generate` creates an Ed25519 key pair. The public key goes to
56
+ `andesine.keys.json`, which the manifest imports; the private key goes to
57
+ `.andesine/keys/<kid>.json` (mode 0600) and is never uploaded. `keys check` compares the
58
+ private key in `ANDESINE_EXTENSION_KEY` or `--key` with the manifest keys and, with
59
+ `--registry`, with the keys of the registry entry. `keys revoke` moves a key ID to
60
+ `revokedKeys`. Extension commands use `--root <directory>` (default: current directory);
61
+ only `dev` and `test-event` need credentials.
62
+
63
+ ### Local development
64
+
65
+ ```sh
66
+ npx andesine --base-url http://localhost:3333 --workspace ws_... extensions dev
67
+ npx andesine extensions test-event content entry.created
68
+ npx andesine extensions dev --remove
69
+ ```
70
+
71
+ `extensions dev` runs the extension on a local instance for the signed-in member only. It
72
+ needs `andesine auth login` against that instance (API keys cannot develop extensions), a
73
+ selected workspace, and `EXTENSIONS_DEVELOPMENT_ENABLED=true` on the local backend; it refuses
74
+ other hosts than `localhost`, `127.0.0.1`, `[::1]`, `*.localhost`, `*.local`, and `*.test`.
75
+ It creates a development key pair in `.andesine/keys/development.json`, uploads only its
76
+ public key with each build, and writes the private key and the instance URL to the backend's
77
+ environment file (`--env-file`, default `.env`). `--backend <url>` uses a local backend URL
78
+ in place of the manifest's, so the manifest can keep its HTTPS deployment URL. Each change rebuilds and reloads the
79
+ extension; a failed build waits for the next change. A build that asks for more permissions
80
+ waits for approval in Settings → Extensions. Ctrl+C stops the extension and keeps its
81
+ configuration and storage. `extensions test-event <webhook> <type>` sends a sample event to a
82
+ webhook and reports the first attempt; `extensions dev --remove` uninstalls the development
83
+ extension and deletes its state.
84
+
85
+ ### Registry
86
+
87
+ ```sh
88
+ npx andesine extensions registry check --published <site checkout>
89
+ npx andesine extensions registry build --published <site checkout> --site-url https://extensions.andesine.app
90
+ ```
91
+
92
+ For the CI of an extension registry repository (projects under `extensions/<scope>/<name>`,
93
+ each with `andesine.registry.json` for the publisher, and `registry/revocations.json`).
94
+ `registry check` validates every project with the instance rules: manifests, keys (published
95
+ keys never change, revoked keys stay revoked), version order, published versions that cannot
96
+ change and must rebuild to the same styles, revocations, and no removed extensions.
97
+ `registry build` runs the check, writes each new version's files and `version.json` next to the
98
+ published ones without overwriting them, and writes `index.json` last. Dependencies of each
99
+ project must be installed.
100
+
35
101
  ## Project configuration
36
102
 
37
103
  Run `andesine init` for guided setup. It uses Clack prompts and progress indicators