@alteran/astro 0.1.10 → 0.1.12

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alteran/astro",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "Astro integration for running a Cloudflare-hosted Bluesky PDS with Alteran.",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",
package/src/lib/jwt.ts CHANGED
@@ -111,9 +111,9 @@ async function eddsaJwtSign(payload: any, env: Env): Promise<string> {
111
111
  // Decode base64 private key
112
112
  const keyBytes = b64urlDecode(keyData);
113
113
  const key = await crypto.subtle.importKey(
114
- 'raw',
114
+ 'pkcs8',
115
115
  keyBytes,
116
- { name: 'Ed25519', namedCurve: 'Ed25519' } as any,
116
+ { name: 'Ed25519' } as any,
117
117
  false,
118
118
  ['sign']
119
119
  );
@@ -33,6 +33,20 @@ export function createPdsFetchHandler(options?: CreatePdsFetchHandlerOptions): P
33
33
  // treat secrets uniformly regardless of source (Secret or Secret Store).
34
34
  const resolvedEnv = await resolveEnvSecrets(env);
35
35
 
36
+ // Cloudflare's Astro adapter expects an ASSETS binding for serving static
37
+ // fallback content. Our worker doesn't ship static assets in production,
38
+ // so provide a no-op stub to prevent adapter crashes (error code 1101).
39
+ if (!resolvedEnv.ASSETS || typeof (resolvedEnv as any).ASSETS.fetch !== 'function') {
40
+ (resolvedEnv as any).ASSETS = {
41
+ async fetch() {
42
+ return new Response('Not Found', {
43
+ status: 404,
44
+ headers: { 'Cache-Control': 'public, max-age=60' },
45
+ });
46
+ },
47
+ };
48
+ }
49
+
36
50
  try {
37
51
  validateConfigOrThrow(resolvedEnv);
38
52
  } catch (error) {