Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/analytics-emdash-1-0-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@eisbachcode/emdash-plugin-analytics": patch
---

Tested on EmDash 0.42.0 and the 1.0 release candidate (1.0.1-rc.0); neither needed a change. From EmDash 0.42.0 the four MCP tools also work when the plugin is registered in `plugins: []`; on 0.39 to 0.41 only sandboxed and registry installs have them. The README now shows how to install and register the plugin.
13 changes: 9 additions & 4 deletions .github/workflows/compat-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm typecheck
- run: ./scripts/compat-matrix.sh 0.39.0 0.39.1 0.40.0 0.40.1 0.41.0
- run: ./scripts/compat-matrix.sh 0.39.0 0.39.1 0.40.0 0.40.1 0.41.0 0.42.0 1.0.1-rc.0:0.2.6-rc.0

latest:
name: current EmDash (informational)
Expand All @@ -59,7 +59,12 @@ jobs:
# dist-tags.latest, not the highest semver: emdash@1.0.0 exists on npm
# but was published 2026-04-27 and deprecated, and it outranks every
# real 0.x release in semver order.
run: echo "version=$(npm view emdash dist-tags.latest)" >> "$GITHUB_OUTPUT"
#
# The harness is the current plugin-test too: one from before 0.2.6
# cannot start an EmDash 1.x host.
run: |
echo "version=$(npm view emdash dist-tags.latest)" >> "$GITHUB_OUTPUT"
echo "harness=$(npm view @emdash-cms/plugin-test dist-tags.latest)" >> "$GITHUB_OUTPUT"
- run: |
echo "current EmDash on npm: ${{ steps.resolve.outputs.version }}"
./scripts/compat-matrix.sh "${{ steps.resolve.outputs.version }}"
echo "current EmDash on npm: ${{ steps.resolve.outputs.version }} (plugin-test ${{ steps.resolve.outputs.harness }})"
./scripts/compat-matrix.sh "${{ steps.resolve.outputs.version }}:${{ steps.resolve.outputs.harness }}"
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pnpm install
pnpm typecheck
pnpm test # emdash-plugin validate, then vitest, per package
pnpm build
./scripts/compat-matrix.sh 0.39.0 0.39.1 0.40.0 0.40.1 0.41.0 # suites against other EmDash releases
./scripts/compat-matrix.sh 0.39.0 0.39.1 0.40.0 0.40.1 0.41.0 0.42.0 1.0.1-rc.0:0.2.6-rc.0 # suites against other EmDash releases
```

## Releases
Expand Down
7 changes: 4 additions & 3 deletions packages/analytics/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ at the workspace root is enough.
does not match, so a loader's result and its declared output have to
agree key for key. `tests/tools.test.ts` checks each answer against the
schema the build wrote.
- **MCP tools reach sandboxed installs only.** EmDash's in-process loader
reads tools from the runtime module, where the build removed them, so a
`plugins: []` install lists none. Test tools sandboxed.
- **In `plugins: []`, MCP tools need EmDash 0.42.0 or later.** Older
in-process loaders read tools from the runtime module, where the build
removes them, so a `plugins: []` install on 0.39 to 0.41 lists none.
Sandboxed installs have them on every supported version.
- **Block Kit keeps no state.** Anything a page needs to remember between
interactions travels in an `action_id`, a button `value` or a table
cursor (see `src/ui/content.ts`).
37 changes: 31 additions & 6 deletions packages/analytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ entry that earned them rather than to a URL string.
> **Status: early releases.** Cloudflare Web Analytics plus demo data: a
> dashboard widget, an Analytics page with a setup check, a per-entry page,
> an Analytics panel in the entry editor and four read-only MCP tools.
> Tested on EmDash 0.39 to 0.41. See "Not in this version".
> Tested on EmDash 0.39 to 0.42 and on the 1.0 release candidate
> (1.0.1-rc.0). See "Not in this version".

The screenshots show demo data on a site made from EmDash's blog template.

Expand Down Expand Up @@ -136,11 +137,11 @@ To use them:
After an update that changes a tool, EmDash stops serving the tools until
they are approved again, but the switch stays on. Turn it off and on.

**Sandboxed installs only, for now.** A plugin registered in `plugins: []`
gets none of its MCP tools on EmDash 0.39 to 0.41: the plugin build keeps
the tool declarations out of the runtime module, and EmDash's in-process
loader looks for them only there. Under `sandboxed: []` or installed from
the registry, the tools work. This is an EmDash limitation, not a setting.
**Registered in `plugins: []`, the tools need EmDash 0.42 or later.** On
0.39 to 0.41, EmDash's in-process loader looks for tool declarations only in
the plugin's runtime module, where the plugin build leaves them out, so such
a site gets none. Under `sandboxed: []` or installed from the registry, the
tools work on every EmDash version this plugin supports.

## What you need

Expand Down Expand Up @@ -174,6 +175,30 @@ your sites through the analytics data instead.
Prefer an **account-owned** token over a user-owned one. A user token dies
with that user's membership; an account-owned token does not.

## Install

```sh
pnpm add @eisbachcode/emdash-plugin-analytics
```

```js
// astro.config.mjs
import analytics from "@eisbachcode/emdash-plugin-analytics";

export default defineConfig({
integrations: [
emdash({
// database, storage, ...
plugins: [analytics],
}),
],
});
```

To run it sandboxed, list it under `sandboxed: [analytics]` instead. That
needs a sandbox runner, which on Cloudflare means the Workers Paid plan; see
EmDash's [plugin sandbox guide](https://docs.emdashcms.com/deployment/plugin-sandbox/).

## Settings

Fill these in under Plugins → Analytics → Settings.
Expand Down
24 changes: 12 additions & 12 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ allowBuilds:
strictDepBuilds: true
dangerouslyAllowAllBuilds: false
minimumReleaseAgeExclude:
- '@emdash-cms/admin@0.39.0 || 0.40.1'
- '@emdash-cms/auth@0.39.0 || 0.40.1'
- '@emdash-cms/blocks@0.39.0 || 0.40.1'
- '@emdash-cms/cloudflare@0.39.0 || 0.40.1'
- '@emdash-cms/gutenberg-to-portable-text@0.39.0 || 0.40.1'
- '@emdash-cms/plugin-cli@0.12.0'
- '@emdash-cms/plugin-test@0.2.0 || 0.2.3'
- '@emdash-cms/plugin-types@0.4.0'
- '@emdash-cms/registry-client@0.6.1'
- '@emdash-cms/registry-lexicons@0.6.0'
- '@emdash-cms/registry-verification@0.3.2'
- emdash@0.39.0 || 0.40.1
- '@emdash-cms/admin@0.39.0 || 0.40.1 || 0.42.0 || 1.0.1-rc.0'
- '@emdash-cms/auth@0.39.0 || 0.40.1 || 0.42.0 || 1.0.1-rc.0'
- '@emdash-cms/blocks@0.39.0 || 0.40.1 || 0.42.0 || 1.0.1-rc.0'
- '@emdash-cms/cloudflare@0.39.0 || 0.40.1 || 0.42.0 || 1.0.1-rc.0'
- '@emdash-cms/gutenberg-to-portable-text@0.39.0 || 0.40.1 || 0.42.0 || 1.0.1-rc.0'
- '@emdash-cms/plugin-cli@0.12.0 || 0.13.0'
- '@emdash-cms/plugin-test@0.2.0 || 0.2.3 || 0.2.5 || 0.2.6-rc.0'
- '@emdash-cms/plugin-types@0.4.0 || 0.5.0'
- '@emdash-cms/registry-client@0.6.1 || 0.7.0'
- '@emdash-cms/registry-lexicons@0.6.0 || 0.7.0'
- '@emdash-cms/registry-verification@0.3.2 || 0.3.3'
- emdash@0.39.0 || 0.40.1 || 0.42.0 || 1.0.1-rc.0
22 changes: 17 additions & 5 deletions scripts/compat-matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@
# the workerd harness. `shared` uses plain vitest with no host, and a `link:`ed
# package has no npm versions to override against.
#
# Usage: scripts/compat-matrix.sh [version...] (default: 0.39.1 0.40.0)
# The reverse happened with EmDash 1.0: it moved the module the harness loads
# (`emdash/plugin-test-runtime` became `emdash/internal/plugin-test-runtime`),
# so no harness before plugin-test 0.2.6 can start a 1.0 host. A version
# written as `version:harness` also overrides plugin-test, for example
# `1.0.1-rc.0:0.2.6-rc.0`.
#
# Usage: scripts/compat-matrix.sh [version[:harness]...] (default: 0.39.1 0.40.0)

set -euo pipefail

Expand Down Expand Up @@ -97,8 +103,11 @@ run_suites() {
echo "baseline (harness's own pinned host, no overrides)"
run_suites "baseline"

for v in "${VERSIONS[@]}"; do
echo "emdash $v"
for spec in "${VERSIONS[@]}"; do
v="${spec%%:*}"
harness=""
[ "$spec" != "$v" ] && harness="${spec#*:}"
echo "emdash $v${harness:+ (plugin-test $harness)}"
git checkout -- pnpm-workspace.yaml pnpm-lock.yaml
cat >> pnpm-workspace.yaml <<-EOF

Expand All @@ -107,16 +116,19 @@ for v in "${VERSIONS[@]}"; do
"@emdash-cms/cloudflare": $v
"@emdash-cms/blocks": $v
EOF
if [ -n "$harness" ]; then
printf ' "@emdash-cms/plugin-test": %s\n' "$harness" >> pnpm-workspace.yaml
fi
run_suites "$v"
done

echo
printf '%-26s %-12s' "package" "baseline"
for v in "${VERSIONS[@]}"; do printf '%-12s' "$v"; done
for spec in "${VERSIONS[@]}"; do printf '%-12s' "${spec%%:*}"; done
echo
for p in "${PKGS[@]}"; do
printf '%-26s %-12s' "$p" "$(lookup baseline "$p")"
for v in "${VERSIONS[@]}"; do printf '%-12s' "$(lookup "$v" "$p")"; done
for spec in "${VERSIONS[@]}"; do printf '%-12s' "$(lookup "${spec%%:*}" "$p")"; done
echo
done
echo
Expand Down
Loading