{"_id":"@plugdash/autobuild","_rev":"5-6718448ffdb44d9e4e7f1608f01c068d","name":"@plugdash/autobuild","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.1":{"name":"@plugdash/autobuild","version":"0.1.1","keywords":["emdash","emdash-plugin","autobuild","deploy-hook","cloudflare-pages","netlify","vercel","ci-cd"],"license":"MIT","_id":"@plugdash/autobuild@0.1.1","maintainers":[{"name":"abhinav061","email":"abhinav061@gmail.com"}],"dist":{"shasum":"db00db6771824fd8ef325578c61786f2e53a5603","tarball":"https://registry.npmjs.org/@plugdash/autobuild/-/autobuild-0.1.1.tgz","fileCount":14,"integrity":"sha512-NrnoOLI9YqRpFs3tk7S29ydX+0IOgB11DVi85CUBhVt4f7o+6wtJoFNYPR3e1OjhuBMh2WEnpIC1hZnbW+1xoQ==","signatures":[{"sig":"MEQCIEWfLmf3wpO+i0b4wAvN4yroooJhQEuuQ0XpHfQTHCmPAiBiYMatHuhus4CpQLcyG8c7mMdFLZhhdX9DrMwnQ3pjCg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40140},"main":"./dist/index.mjs","type":"module","_from":"file:plugdash-autobuild-0.1.1.tgz","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"},"./sandbox":{"import":"./dist/sandbox-entry.mjs"}},"scripts":{"test":"vitest run","build":"tsdown src/index.ts src/sandbox-entry.ts --dts.eager","typecheck":"tsc --noEmit"},"_npmUser":{"name":"abhinav061","email":"abhinav061@gmail.com"},"_resolved":"/private/var/folders/6y/57bqcl410dl_xsbfbpkrgv500000gn/T/88c398957de132f8991b2b07252d896b/plugdash-autobuild-0.1.1.tgz","_integrity":"sha512-NrnoOLI9YqRpFs3tk7S29ydX+0IOgB11DVi85CUBhVt4f7o+6wtJoFNYPR3e1OjhuBMh2WEnpIC1hZnbW+1xoQ==","_npmVersion":"11.11.0","description":"Fires a Cloudflare Pages, Netlify, or Vercel build hook on every publish from EmDash","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.0.0","@plugdash/types":"0.0.0","@plugdash/testing":"0.0.0"},"peerDependencies":{"emdash":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/autobuild_0.1.1_1775397541365_0.14265549787462817","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@plugdash/autobuild","version":"0.2.0","keywords":["emdash","emdash-plugin","autobuild","deploy-hook","cloudflare-pages","netlify","vercel","ci-cd"],"license":"MIT","_id":"@plugdash/autobuild@0.2.0","maintainers":[{"name":"abhinav061","email":"abhinav061@gmail.com"}],"homepage":"https://github.com/plugdash/plugdash#readme","bugs":{"url":"https://github.com/plugdash/plugdash/issues"},"dist":{"shasum":"f595fc06529b9028ffda8aec9ca403214516b66a","tarball":"https://registry.npmjs.org/@plugdash/autobuild/-/autobuild-0.2.0.tgz","fileCount":12,"integrity":"sha512-v5kkLZvMdJ8QmOc5KHA+tMxOmPjTgsix8ZUbjd3fVgkYdHBr6kW9WfVsSzWcb+OVP/ahifDEJII+kOGZBJNz5A==","signatures":[{"sig":"MEUCIHjv79yWZTZfkMyw0iwJUHmqWbXOdRpH106BSCdcFq83AiEAlhf8vWi8noWOHeDnZ8xT7jK4RtW2e+qwQuVREpr2baY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@plugdash%2fautobuild@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":54485},"main":"./dist/index.mjs","type":"module","_from":"file:plugdash-autobuild-0.2.0.tgz","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"},"./sandbox":{"import":"./dist/sandbox-entry.mjs"}},"scripts":{"test":"vitest run","build":"tsdown src/index.ts src/sandbox-entry.ts --dts.eager","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f8bab23c-5971-4ca2-8d70-6d94c4acccac"}},"_resolved":"/tmp/ec6eb6ff9019c21ae992f60a3887fa7c/plugdash-autobuild-0.2.0.tgz","_integrity":"sha512-v5kkLZvMdJ8QmOc5KHA+tMxOmPjTgsix8ZUbjd3fVgkYdHBr6kW9WfVsSzWcb+OVP/ahifDEJII+kOGZBJNz5A==","repository":{"url":"git+https://github.com/plugdash/plugdash.git","type":"git","directory":"packages/autobuild"},"_npmVersion":"11.5.1","description":"Fires a Cloudflare Pages, Netlify, or Vercel build hook on every publish from EmDash","directories":{},"_nodeVersion":"22.22.2","_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.0.0","@plugdash/types":"0.0.0","@plugdash/testing":"0.0.0"},"peerDependencies":{"emdash":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/autobuild_0.2.0_1775416193287_0.5040337672123925","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@plugdash/autobuild","version":"0.2.1","keywords":["emdash","emdash-plugin","autobuild","deploy-hook","cloudflare-pages","netlify","vercel","ci-cd"],"license":"MIT","_id":"@plugdash/autobuild@0.2.1","maintainers":[{"name":"abhinav061","email":"abhinav061@gmail.com"}],"homepage":"https://github.com/plugdash/plugdash#readme","bugs":{"url":"https://github.com/plugdash/plugdash/issues"},"dist":{"shasum":"9d6ac095585bc9772679d8ea596a9f2081e09364","tarball":"https://registry.npmjs.org/@plugdash/autobuild/-/autobuild-0.2.1.tgz","fileCount":12,"integrity":"sha512-IlMv7Ow2ocMCTy3NqswMhm43x30gGgdwItj13gzkT784gbfacNynWWwNVuo+D6heDR+aU/gO3yt2LGNKZh2VpA==","signatures":[{"sig":"MEUCIH8F8J+fLDEDMXsVLUNjXo043OquszkCi42hQLgSiMjWAiEAzwlnp34gP03kkzq6Un+SXXDpmYsOjisgAor/phbl/Ss=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIBGrV/KBRzxa7gboBuqPN5f2MmAgp8XnCvW8Rt63+yORAiBIWZrVIhR4uJIwogsxeq+HJ68MxbdRSQo6wkMNNeUk1g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@plugdash%2fautobuild@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":57134},"main":"./dist/index.mjs","type":"module","_from":"file:plugdash-autobuild-0.2.1.tgz","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"},"./sandbox":{"import":"./dist/sandbox-entry.mjs"}},"scripts":{"test":"vitest run","build":"tsdown src/index.ts src/sandbox-entry.ts --dts.eager","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f8bab23c-5971-4ca2-8d70-6d94c4acccac"}},"_resolved":"/tmp/3d009602e31914785b551c3eb1dda74d/plugdash-autobuild-0.2.1.tgz","_integrity":"sha512-IlMv7Ow2ocMCTy3NqswMhm43x30gGgdwItj13gzkT784gbfacNynWWwNVuo+D6heDR+aU/gO3yt2LGNKZh2VpA==","repository":{"url":"git+https://github.com/plugdash/plugdash.git","type":"git","directory":"packages/autobuild"},"_npmVersion":"11.5.1","description":"Fires a Cloudflare Pages, Netlify, or Vercel build hook on every publish from EmDash","directories":{},"_nodeVersion":"22.23.2","_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.0.0","@plugdash/types":"0.0.0","@plugdash/testing":"0.0.0"},"peerDependencies":{"emdash":">=0.13.0"},"_npmOperationalInternal":{"tmp":"tmp/autobuild_0.2.1_1790352126966_0.17760925904565084","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@plugdash/autobuild","version":"0.2.2","keywords":["emdash","emdash-plugin","autobuild","deploy-hook","cloudflare-pages","netlify","vercel","ci-cd"],"license":"MIT","_id":"@plugdash/autobuild@0.2.2","maintainers":[{"name":"abhinav061","email":"abhinav061@gmail.com"}],"homepage":"https://github.com/plugdash/plugdash#readme","bugs":{"url":"https://github.com/plugdash/plugdash/issues"},"dist":{"shasum":"6a2d05eee0ece83b6b0c307b4d1645b9d7fb128c","tarball":"https://registry.npmjs.org/@plugdash/autobuild/-/autobuild-0.2.2.tgz","fileCount":12,"integrity":"sha512-AT0XTEsxjj9yAqHzK8WhEHPcBrn58Mg1M6gKQTsAyi+y4/5KGykJe4SZ+DHgEgDLS58V6Ua5kP3TI50faZVziw==","signatures":[{"sig":"MEQCIFsYsMFDNT7r2X6SlphxbhsBhZ7OzKve8z7L4b4dutpJAiAvpodBb5d8jxLtJrzVIkANpmytq/ZSThrBRhoRtqt5iw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIC3NeRmiOl4PcbDAr5Tb6TOn5SdJuLSVLZF0zJh8m1iyAiAfi8a7VVllXettpuLqeIdR7JdzlbYq//WfpSnrtfpZeg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@plugdash%2fautobuild@0.2.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":57281},"main":"./dist/index.mjs","type":"module","_from":"file:plugdash-autobuild-0.2.2.tgz","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"},"./sandbox":{"import":"./dist/sandbox-entry.mjs"}},"scripts":{"test":"vitest run","build":"tsdown src/index.ts src/sandbox-entry.ts --dts.eager","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f8bab23c-5971-4ca2-8d70-6d94c4acccac"}},"_resolved":"/tmp/b2bfa6189756716457c2d60085cfb964/plugdash-autobuild-0.2.2.tgz","_integrity":"sha512-AT0XTEsxjj9yAqHzK8WhEHPcBrn58Mg1M6gKQTsAyi+y4/5KGykJe4SZ+DHgEgDLS58V6Ua5kP3TI50faZVziw==","repository":{"url":"git+https://github.com/plugdash/plugdash.git","type":"git","directory":"packages/autobuild"},"_npmVersion":"11.5.1","description":"Fires a Cloudflare Pages, Netlify, or Vercel build hook on every publish from EmDash","directories":{},"_nodeVersion":"22.23.2","_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.0.0","@plugdash/types":"0.0.0","@plugdash/testing":"0.0.0"},"peerDependencies":{"emdash":">=0.13.0"},"_npmOperationalInternal":{"tmp":"tmp/autobuild_0.2.2_1790409451403_0.9289851645843705","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"_id":"@plugdash/autobuild@0.3.0","bugs":{"url":"https://github.com/plugdash/plugdash/issues"},"dist":{"shasum":"6730ed168ce120abcadf5c8baba1f358cad54af2","tarball":"https://registry.npmjs.org/@plugdash/autobuild/-/autobuild-0.3.0.tgz","fileCount":7,"integrity":"sha512-/07abNJdOi9wrtMT2hO4wkCGqiy8wOiORzpY1TsDhgxiJ1PYGRf4LzBd2Uuz2KgwDyiBUR/PFV/ETwdGMHTXVg==","signatures":[{"sig":"MEQCIGfo4VsDZ5FP/STBGTf6dtmn9eHZ/lstLEVrxLaMXyz7AiB54pvOgcZxRX54Smkd8c65hTAz4Mb/fAl85VbRShbIvQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIA/tE7wFODvRTuJ9My2f1XctPLIAKcllGoQY9yrlxshVAiBQ5kAk67SHznFz58XHt6VLoR79s/Ds7QrIaAHmDXbPLw=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@plugdash%2fautobuild@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":34018},"main":"./dist/index.mjs","name":"@plugdash/autobuild","type":"module","_from":"file:plugdash-autobuild-0.3.0.tgz","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"}},"license":"MIT","scripts":{"test":"vitest run","build":"tsdown src/index.ts --dts.eager","typecheck":"tsc --noEmit"},"version":"0.3.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"f8bab23c-5971-4ca2-8d70-6d94c4acccac"}},"homepage":"https://github.com/plugdash/plugdash#readme","keywords":["autobuild","ci-cd","cloudflare-pages","deploy-hook","emdash","emdash-plugin","netlify","vercel"],"_resolved":"/tmp/5b3fa5a8d6de95cc7bab09287409589d/plugdash-autobuild-0.3.0.tgz","_integrity":"sha512-/07abNJdOi9wrtMT2hO4wkCGqiy8wOiORzpY1TsDhgxiJ1PYGRf4LzBd2Uuz2KgwDyiBUR/PFV/ETwdGMHTXVg==","repository":{"url":"git+https://github.com/plugdash/plugdash.git","type":"git","directory":"packages/autobuild"},"_npmVersion":"11.5.1","description":"Fires a Cloudflare Pages, Netlify, or Vercel build hook when content is published or unpublished, for static sites that read EmDash at build time","directories":{},"maintainers":[{"name":"abhinav061","email":"abhinav061@gmail.com"}],"_nodeVersion":"22.23.3","_hasShrinkwrap":false,"devDependencies":{"emdash":"^1.0.1","vitest":"^2.0.0","@plugdash/types":"0.0.0","@plugdash/testing":"0.0.0"},"peerDependencies":{"emdash":">=1.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/autobuild_0.3.0_1790936787773_0.9408814570523774"}}},"time":{"created":"2026-04-05T13:59:01.282Z","modified":"2026-10-02T10:26:28.208Z","0.1.1":"2026-04-05T13:59:01.504Z","0.2.0":"2026-04-05T19:09:53.446Z","0.2.1":"2026-09-25T16:02:07.064Z","0.2.2":"2026-09-26T07:57:31.493Z","0.3.0":"2026-10-02T10:26:27.879Z"},"bugs":{"url":"https://github.com/plugdash/plugdash/issues"},"license":"MIT","homepage":"https://github.com/plugdash/plugdash#readme","keywords":["autobuild","ci-cd","cloudflare-pages","deploy-hook","emdash","emdash-plugin","netlify","vercel"],"repository":{"url":"git+https://github.com/plugdash/plugdash.git","type":"git","directory":"packages/autobuild"},"description":"Fires a Cloudflare Pages, Netlify, or Vercel build hook when content is published or unpublished, for static sites that read EmDash at build time","maintainers":[{"name":"abhinav061","email":"abhinav061@gmail.com"}],"readme":"# @plugdash/autobuild\n\nUse autobuild only when a **static** or prerendered site reads EmDash content at build time. A server-rendered EmDash site (`output: \"server\"`, the default in all templates) shows new content at once and does not need a rebuild.\n\nWhen one of those static sites needs a rebuild, autobuild calls a Cloudflare Pages, Netlify, or Vercel deploy hook after you publish or unpublish. Only on EmDash - the hook fires from the CMS lifecycle, not from a git push.\n\n## Install\n\n```bash\npnpm add @plugdash/autobuild\n```\n\n## Register\n\n```js\n// astro.config.mjs\nimport { defineConfig } from \"astro/config\";\nimport emdash from \"emdash/astro\";\nimport { autobuildPlugin } from \"@plugdash/autobuild\";\n\nexport default defineConfig({\n\tintegrations: [\n\t\temdash({\n\t\t\tplugins: [\n\t\t\t\tautobuildPlugin({\n\t\t\t\t\thookUrl: process.env.DEPLOY_HOOK_URL,\n\t\t\t\t\tcollections: [\"posts\"],\n\t\t\t\t\tdebounceMs: 5000,\n\t\t\t\t}),\n\t\t\t],\n\t\t}),\n\t],\n});\n```\n\nKeep the hook URL in an environment variable. Never commit it. Options are passed to the plugin by EmDash at runtime, so they work in `astro dev` and in a production build.\n\nOr set the URL in the admin: Plugins - Autobuild - settings, field \"Deploy hook URL\" (a secret). The admin value wins over the `hookUrl` option. Secret settings need `EMDASH_ENCRYPTION_KEY` in the server environment (`pnpm exec emdash secrets generate`; a Worker secret on Cloudflare). The admin page shows whether the URL is accepted.\n\n## Getting a deploy hook URL\n\n- **Cloudflare Pages:** Project -> Settings -> Builds & deployments -> Deploy hooks. Creates a URL like `https://api.cloudflare.com/client/v4/pages/webhooks/deploy_hooks/...`\n- **Netlify:** Site settings -> Build & deploy -> Build hooks. Creates a URL like `https://api.netlify.com/build_hooks/...`\n- **Vercel:** Project Settings -> Git -> Deploy Hooks. Creates a URL like `https://api.vercel.com/v1/integrations/deploy/...`\n\n## Options\n\n| Option         | Type                      | Default         | Description                                                 |\n| -------------- | ------------------------- | --------------- | ----------------------------------------------------------- |\n| `hookUrl`      | `string`                  | none            | Deploy webhook URL. https only, no localhost or private IPs |\n| `method`       | `\"POST\" \\| \"GET\"`         | `\"POST\"`        | HTTP method                                                 |\n| `collections`  | `string[]`                | all collections | Only these collections trigger a deploy                     |\n| `debounceMs`   | `number`                  | `5000`          | Triggers inside this window make one deploy                 |\n| `timeout`      | `number`                  | `5000`          | Request timeout in ms                                       |\n| `body`         | `Record<string, unknown>` | none            | Optional JSON body                                          |\n| `headers`      | `Record<string, string>`  | none            | Optional extra headers                                      |\n| `allowedHosts` | `string[]`                | see below       | Extra hosts the plugin may call, added to the defaults      |\n\n`allowedHosts` always includes `api.cloudflare.com`, `api.netlify.com`, `api.vercel.com` and the host of the `hookUrl` option. A hook URL entered in the admin on any other host is refused until you add that host here.\n\n## How it works\n\n1. `content:afterPublish` and `content:afterUnpublish` schedule a deploy. Autosaves do not: editing a draft or a live post changes nothing a reader can see.\n2. Deleting an entry schedules a deploy only if it was published. `content:beforeDelete` notes that in KV, because `afterDelete` only carries the id.\n3. Each trigger writes a token to plugin KV and waits `debounceMs`. Only the trigger whose token is still the latest calls the hook, so a burst makes one request, even across Workers isolates.\n4. The request goes out through `ctx.http.fetch()`. A failure is logged and never fails the publish.\n5. With no hook URL, the plugin logs one warning per process: `no hook URL configured, deploys are off`.\n\n## Security\n\nThe hook URL is checked before every request: `https://` only, no `localhost`, `127.x`, `10.x`, `172.16-31.x`, `192.168.x`, `169.254.x`, `::1`, `0.0.0.0`, and the host must be in `allowedHosts`. A bad URL fails closed with a logged error.\n\n## What it does not do\n\n- Does not retry failed deploys. The next publish retries.\n- Does not check that the deploy succeeded - use your host's dashboard.\n- Does not sign requests. Deploy hooks are already secret URLs.\n- Does not ship a UI component. This plugin is pure infrastructure.\n","readmeFilename":"README.md"}