@workflow/astro 4.0.4 → 4.0.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,WAAW,EAChB,WAAW,EAGX,2BAA2B,EAC5B,MAAM,oBAAoB,CAAC;AAiB5B,qBAAa,YAAa,SAAQ,WAAW;;IAa5B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YA6DvB,eAAe;YAqCf,mBAAmB;YAqCnB,iBAAiB;CAmDhC;AAED,qBAAa,aAAc,SAAQ,2BAA2B;gBAChD,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC;IAa1B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAqCtC"}
1
+ {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,WAAW,EAChB,WAAW,EAIX,2BAA2B,EAC5B,MAAM,oBAAoB,CAAC;AAiB5B,qBAAa,YAAa,SAAQ,WAAW;;IAa5B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YA6DvB,eAAe;YA0Cf,mBAAmB;YA0CnB,iBAAiB;CAmDhC;AAED,qBAAa,aAAc,SAAQ,2BAA2B;gBAChD,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC;IAa1B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAqCtC"}
package/dist/builder.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { mkdir, readFile, writeFile } from 'node:fs/promises';
2
2
  import { join, resolve } from 'node:path';
3
- import { BaseBuilder, createBaseBuilderConfig, NORMALIZE_REQUEST_CODE, VercelBuildOutputAPIBuilder, } from '@workflow/builders';
3
+ import { BaseBuilder, createBaseBuilderConfig, NORMALIZE_REQUEST_CODE, replaceGeneratedRouteExport, VercelBuildOutputAPIBuilder, } from '@workflow/builders';
4
4
  const WORKFLOW_ROUTES = [
5
5
  {
6
6
  src: '^/\\.well-known/workflow/v1/flow/?$',
@@ -88,13 +88,16 @@ export const prerender = false;\n`);
88
88
  });
89
89
  let stepsRouteContent = await readFile(stepsRouteFile, 'utf-8');
90
90
  // Normalize request, needed for preserving request through astro
91
- stepsRouteContent = stepsRouteContent.replace(/export\s*\{\s*stepEntrypoint\s+as\s+POST\s*\}\s*;?$/m, `${NORMALIZE_REQUEST_CODE}
92
- export const POST = async ({request}) => {
91
+ stepsRouteContent = replaceGeneratedRouteExport(stepsRouteContent, /export\s*\{\s*stepEntrypoint\w*\s+as\s+HEAD\s*,\s*stepEntrypoint\w*\s+as\s+POST\s*\}\s*;?\s*$/m, `${NORMALIZE_REQUEST_CODE}
92
+ const handleStepRequest = async ({request}) => {
93
93
  const normalRequest = await normalizeRequest(request);
94
94
  return stepEntrypoint(normalRequest);
95
- }
95
+ };
96
96
 
97
- export const prerender = false;`);
97
+ export const HEAD = handleStepRequest;
98
+ export const POST = handleStepRequest;
99
+
100
+ export const prerender = false;`, 'Failed to wrap generated Astro step route');
98
101
  await writeFile(stepsRouteFile, stepsRouteContent);
99
102
  return manifest;
100
103
  }
@@ -110,13 +113,16 @@ export const prerender = false;`);
110
113
  });
111
114
  let workflowsRouteContent = await readFile(workflowsRouteFile, 'utf-8');
112
115
  // Normalize request, needed for preserving request through astro
113
- workflowsRouteContent = workflowsRouteContent.replace(/export const POST = workflowEntrypoint\(workflowCode\);?$/m, `${NORMALIZE_REQUEST_CODE}
114
- export const POST = async ({request}) => {
116
+ workflowsRouteContent = replaceGeneratedRouteExport(workflowsRouteContent, /const handler = workflowEntrypoint\(workflowCode\);\s*export const HEAD = handler;\s*export const POST = handler;?\s*$/m, `${NORMALIZE_REQUEST_CODE}
117
+ const handleWorkflowRequest = async ({request}) => {
115
118
  const normalRequest = await normalizeRequest(request);
116
119
  return workflowEntrypoint(workflowCode)(normalRequest);
117
- }
120
+ };
118
121
 
119
- export const prerender = false;`);
122
+ export const HEAD = handleWorkflowRequest;
123
+ export const POST = handleWorkflowRequest;
124
+
125
+ export const prerender = false;`, 'Failed to wrap generated Astro workflow route');
120
126
  await writeFile(workflowsRouteFile, workflowsRouteContent);
121
127
  return manifest;
122
128
  }
@@ -1 +1 @@
1
- {"version":3,"file":"builder.js","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAEL,WAAW,EACX,uBAAuB,EACvB,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAE5B,MAAM,eAAe,GAAG;IACtB;QACE,GAAG,EAAE,qCAAqC;QAC1C,IAAI,EAAE,+BAA+B;KACtC;IACD;QACE,GAAG,EAAE,qCAAqC;QAC1C,IAAI,EAAE,+BAA+B;KACtC;IACD;QACE,GAAG,EAAE,iDAAiD;QACtD,IAAI,EAAE,0CAA0C;KACjD;CACF,CAAC;AAEF,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;QACE,KAAK,CAAC;YACJ,IAAI,EAAE,CAAC,WAAW,EAAE,eAAe,CAAC;YACpC,WAAW,EAAE,OAAgB;YAC7B,eAAe,EAAE,EAAE,EAAE,iBAAiB;YACtC,mBAAmB,EAAE,EAAE,EAAE,iBAAiB;YAC1C,iBAAiB,EAAE,EAAE,EAAE,iBAAiB;YACxC,UAAU,EAAE,OAAO,CAAC,GAAG,EAAE;YACzB,eAAe,EAAE,GAAG,EAAE,sDAAsD;SAC7E,CAAC,CAAC;IACL,CAAC;IAEQ,KAAK,CAAC,KAAK;QAClB,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;QAC9D,MAAM,oBAAo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AC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC/D,CAAC;CACF","sourcesContent":["import { mkdir, readFile, writeFile } from 'node:fs/promises';\nimport { join, resolve } from 'node:path';\nimport {\n type AstroConfig,\n BaseBuilder,\n createBaseBuilderConfig,\n NORMALIZE_REQUEST_CODE,\n VercelBuildOutputAPIBuilder,\n} from '@workflow/builders';\n\nconst WORKFLOW_ROUTES = [\n {\n src: '^/\\\\.well-known/workflow/v1/flow/?$',\n dest: '/.well-known/workflow/v1/flow',\n },\n {\n src: '^/\\\\.well-known/workflow/v1/step/?$',\n dest: '/.well-known/workflow/v1/step',\n },\n {\n src: '^/\\\\.well-known/workflow/v1/webhook/([^/]+?)/?$',\n dest: '/.well-known/workflow/v1/webhook/[token]',\n },\n];\n\nexport class LocalBuilder extends BaseBuilder {\n constructor() {\n super({\n dirs: ['src/pages', 'src/workflows'],\n buildTarget: 'astro' as const,\n stepsBundlePath: '', // unused in base\n workflowsBundlePath: '', // unused in base\n webhookBundlePath: '', // unused in base\n workingDir: process.cwd(),\n debugFilePrefix: '_', // Prefix with underscore so Astro ignores debug files\n });\n }\n\n override async build(): Promise<void> {\n const pagesDir = resolve(this.config.workingDir, 'src/pages');\n const workflowGeneratedDir = join(pagesDir, '.well-known/workflow/v1');\n\n // Ensure output directories exist\n await mkdir(workflowGeneratedDir, { recursive: true });\n\n // Add .gitignore to exclude generated files from version control\n if (process.env.VERCEL_DEPLOYMENT_ID === undefined) {\n await writeFile(join(workflowGeneratedDir, '.gitignore'), '*');\n }\n\n // Get workflow and step files to bundle\n const inputFiles = await this.getInputFiles();\n const tsconfigPath = await this.findTsConfigPath();\n\n const options = {\n inputFiles,\n workflowGeneratedDir,\n tsconfigPath,\n };\n\n // Generate the three Astro route handlers\n const stepsManifest = await this.buildStepsRoute(options);\n const workflowsManifest = await this.buildWorkflowsRoute(options);\n await this.buildWebhookRoute({ workflowGeneratedDir });\n\n // Merge manifests from both bundles\n const manifest = {\n steps: { ...stepsManifest.steps, ...workflowsManifest.steps },\n workflows: {\n ...stepsManifest.workflows,\n ...workflowsManifest.workflows,\n },\n classes: { ...stepsManifest.classes, ...workflowsManifest.classes },\n };\n\n // Generate unified manifest\n const workflowBundlePath = join(workflowGeneratedDir, 'flow.js');\n const manifestJson = await this.createManifest({\n workflowBundlePath,\n manifestDir: workflowGeneratedDir,\n manifest,\n });\n\n // Expose manifest as a public HTTP route when WORKFLOW_PUBLIC_MANIFEST=1\n // Astro maps `foo.json.js` to the URL `/foo.json`\n if (this.shouldExposePublicManifest && manifestJson) {\n await writeFile(\n join(workflowGeneratedDir, 'manifest.json.js'),\n `export function GET() {\n return new Response(${JSON.stringify(manifestJson)}, {\n headers: { \"content-type\": \"application/json\" },\n });\n}\n\nexport const prerender = false;\\n`\n );\n }\n }\n\n private async buildStepsRoute({\n inputFiles,\n workflowGeneratedDir,\n tsconfigPath,\n }: {\n inputFiles: string[];\n workflowGeneratedDir: string;\n tsconfigPath?: string;\n }) {\n // Create steps route: .well-known/workflow/v1/step.js\n const stepsRouteFile = join(workflowGeneratedDir, 'step.js');\n const { manifest } = await this.createStepsBundle({\n format: 'esm',\n inputFiles,\n outfile: stepsRouteFile,\n externalizeNonSteps: true,\n tsconfigPath,\n });\n\n let stepsRouteContent = await readFile(stepsRouteFile, 'utf-8');\n\n // Normalize request, needed for preserving request through astro\n stepsRouteContent = stepsRouteContent.replace(\n /export\\s*\\{\\s*stepEntrypoint\\s+as\\s+POST\\s*\\}\\s*;?$/m,\n `${NORMALIZE_REQUEST_CODE}\nexport const POST = async ({request}) => {\n const normalRequest = await normalizeRequest(request);\n return stepEntrypoint(normalRequest);\n}\n\nexport const prerender = false;`\n );\n await writeFile(stepsRouteFile, stepsRouteContent);\n\n return manifest;\n }\n\n private async buildWorkflowsRoute({\n inputFiles,\n workflowGeneratedDir,\n tsconfigPath,\n }: {\n inputFiles: string[];\n workflowGeneratedDir: string;\n tsconfigPath?: string;\n }) {\n // Create workflows route: .well-known/workflow/v1/flow.js\n const workflowsRouteFile = join(workflowGeneratedDir, 'flow.js');\n const { manifest } = await this.createWorkflowsBundle({\n format: 'esm',\n outfile: workflowsRouteFile,\n bundleFinalOutput: false,\n inputFiles,\n tsconfigPath,\n });\n\n let workflowsRouteContent = await readFile(workflowsRouteFile, 'utf-8');\n\n // Normalize request, needed for preserving request through astro\n workflowsRouteContent = workflowsRouteContent.replace(\n /export const POST = workflowEntrypoint\\(workflowCode\\);?$/m,\n `${NORMALIZE_REQUEST_CODE}\nexport const POST = async ({request}) => {\n const normalRequest = await normalizeRequest(request);\n return workflowEntrypoint(workflowCode)(normalRequest);\n}\n\nexport const prerender = false;`\n );\n await writeFile(workflowsRouteFile, workflowsRouteContent);\n\n return manifest;\n }\n\n private async buildWebhookRoute({\n workflowGeneratedDir,\n }: {\n workflowGeneratedDir: string;\n }) {\n // Create webhook route: .well-known/workflow/v1/webhook/[token].js\n const webhookRouteFile = join(workflowGeneratedDir, 'webhook/[token].js');\n\n await this.createWebhookBundle({\n outfile: webhookRouteFile,\n bundle: false,\n });\n\n // Post-process the generated file to wrap with Astro request converter\n let webhookRouteContent = await readFile(webhookRouteFile, 'utf-8');\n\n // Update handler signature to accept token as parameter\n webhookRouteContent = webhookRouteContent.replace(\n /async function handler\\(request\\) \\{[\\s\\S]*?const token = decodeURIComponent\\(pathParts\\[pathParts\\.length - 1\\]\\);/,\n `async function handler(request, token) {`\n );\n\n // Remove the URL parsing code since we get token from params\n webhookRouteContent = webhookRouteContent.replace(\n /const url = new URL\\(request\\.url\\);[\\s\\S]*?const pathParts = url\\.pathname\\.split\\('\\/'\\);[\\s\\S]*?\\n/,\n ''\n );\n\n // Normalize request, needed for preserving request through astro\n webhookRouteContent = webhookRouteContent.replace(\n /export const GET = handler;\\nexport const POST = handler;\\nexport const PUT = handler;\\nexport const PATCH = handler;\\nexport const DELETE = handler;\\nexport const HEAD = handler;\\nexport const OPTIONS = handler;/,\n `${NORMALIZE_REQUEST_CODE}\nconst createHandler = (method) => async ({ request, params, platform }) => {\n const normalRequest = await normalizeRequest(request);\n const response = await handler(normalRequest, params.token);\n return response;\n};\n\nexport const GET = createHandler('GET');\nexport const POST = createHandler('POST');\nexport const PUT = createHandler('PUT');\nexport const PATCH = createHandler('PATCH');\nexport const DELETE = createHandler('DELETE');\nexport const HEAD = createHandler('HEAD');\nexport const OPTIONS = createHandler('OPTIONS');\n\nexport const prerender = false;`\n );\n\n await writeFile(webhookRouteFile, webhookRouteContent);\n }\n}\n\nexport class VercelBuilder extends VercelBuildOutputAPIBuilder {\n constructor(config?: Partial<AstroConfig>) {\n const workingDir = config?.workingDir || process.cwd();\n super({\n ...createBaseBuilderConfig({\n workingDir,\n dirs: ['src/pages', 'src/workflows'],\n runtime: config?.runtime,\n }),\n buildTarget: 'vercel-build-output-api',\n debugFilePrefix: '_',\n });\n }\n\n override async build(): Promise<void> {\n const configPath = join(\n this.config.workingDir,\n '.vercel/output/config.json'\n );\n\n // The config output by astro\n const config = JSON.parse(await readFile(configPath, 'utf-8'));\n\n // Filter out existing workflow routes (wrong `dest` mapping)\n config.routes = config.routes.filter(\n (route: { src?: string; dest: string }) =>\n !route.src?.includes('.well-known/workflow')\n );\n\n // Find the index right after the \"filesystem\" handler and \"continue: true\" routes\n let insertIndex = config.routes.findIndex(\n (route: any) => route.handle === 'filesystem'\n );\n\n // Move past any routes with \"continue: true\" (like _astro cache headers)\n while (\n insertIndex < config.routes.length - 1 &&\n config.routes[insertIndex + 1]?.continue === true\n ) {\n insertIndex++;\n }\n\n // Insert workflow routes right after\n config.routes.splice(insertIndex + 1, 0, ...WORKFLOW_ROUTES);\n\n // Bundles workflows for vercel\n await super.build();\n\n // Use old astro config with updated routes\n await writeFile(configPath, JSON.stringify(config, null, 2));\n }\n}\n"]}
1
+ {"version":3,"file":"builder.js","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,Q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EQ,KAAK,CAAC,KAAK;QAClB,MAAM,UAAU,GAAG,IAAI,CACrB,IAAI,CAAC,MAAM,CAAC,UAAU,EACtB,4BAA4B,CAC7B,CAAC;QAEF,6BAA6B;QAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;QAE/D,6DAA6D;QAC7D,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAClC,CAAC,KAAqC,EAAE,EAAE,CACxC,CAAC,KAAK,CAAC,GAAG,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAC/C,CAAC;QAEF,kFAAkF;QAClF,IAAI,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CACvC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,YAAY,CAC9C,CAAC;QAEF,yEAAyE;QACzE,OACE,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;YACtC,MAAM,CAAC,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE,QAAQ,KAAK,IAAI,EACjD,CAAC;YACD,WAAW,EAAE,CAAC;QAChB,CAAC;QAED,qCAAqC;QACrC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,GAAG,CAAC,EAAE,CAAC,EAAE,GAAG,eAAe,CAAC,CAAC;QAE7D,+BAA+B;QAC/B,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;QAEpB,2CAA2C;QAC3C,MAAM,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC/D,CAAC;CACF","sourcesContent":["import { mkdir, readFile, writeFile } from 'node:fs/promises';\nimport { join, resolve } from 'node:path';\nimport {\n type AstroConfig,\n BaseBuilder,\n createBaseBuilderConfig,\n NORMALIZE_REQUEST_CODE,\n replaceGeneratedRouteExport,\n VercelBuildOutputAPIBuilder,\n} from '@workflow/builders';\n\nconst WORKFLOW_ROUTES = [\n {\n src: '^/\\\\.well-known/workflow/v1/flow/?$',\n dest: '/.well-known/workflow/v1/flow',\n },\n {\n src: '^/\\\\.well-known/workflow/v1/step/?$',\n dest: '/.well-known/workflow/v1/step',\n },\n {\n src: '^/\\\\.well-known/workflow/v1/webhook/([^/]+?)/?$',\n dest: '/.well-known/workflow/v1/webhook/[token]',\n },\n];\n\nexport class LocalBuilder extends BaseBuilder {\n constructor() {\n super({\n dirs: ['src/pages', 'src/workflows'],\n buildTarget: 'astro' as const,\n stepsBundlePath: '', // unused in base\n workflowsBundlePath: '', // unused in base\n webhookBundlePath: '', // unused in base\n workingDir: process.cwd(),\n debugFilePrefix: '_', // Prefix with underscore so Astro ignores debug files\n });\n }\n\n override async build(): Promise<void> {\n const pagesDir = resolve(this.config.workingDir, 'src/pages');\n const workflowGeneratedDir = join(pagesDir, '.well-known/workflow/v1');\n\n // Ensure output directories exist\n await mkdir(workflowGeneratedDir, { recursive: true });\n\n // Add .gitignore to exclude generated files from version control\n if (process.env.VERCEL_DEPLOYMENT_ID === undefined) {\n await writeFile(join(workflowGeneratedDir, '.gitignore'), '*');\n }\n\n // Get workflow and step files to bundle\n const inputFiles = await this.getInputFiles();\n const tsconfigPath = await this.findTsConfigPath();\n\n const options = {\n inputFiles,\n workflowGeneratedDir,\n tsconfigPath,\n };\n\n // Generate the three Astro route handlers\n const stepsManifest = await this.buildStepsRoute(options);\n const workflowsManifest = await this.buildWorkflowsRoute(options);\n await this.buildWebhookRoute({ workflowGeneratedDir });\n\n // Merge manifests from both bundles\n const manifest = {\n steps: { ...stepsManifest.steps, ...workflowsManifest.steps },\n workflows: {\n ...stepsManifest.workflows,\n ...workflowsManifest.workflows,\n },\n classes: { ...stepsManifest.classes, ...workflowsManifest.classes },\n };\n\n // Generate unified manifest\n const workflowBundlePath = join(workflowGeneratedDir, 'flow.js');\n const manifestJson = await this.createManifest({\n workflowBundlePath,\n manifestDir: workflowGeneratedDir,\n manifest,\n });\n\n // Expose manifest as a public HTTP route when WORKFLOW_PUBLIC_MANIFEST=1\n // Astro maps `foo.json.js` to the URL `/foo.json`\n if (this.shouldExposePublicManifest && manifestJson) {\n await writeFile(\n join(workflowGeneratedDir, 'manifest.json.js'),\n `export function GET() {\n return new Response(${JSON.stringify(manifestJson)}, {\n headers: { \"content-type\": \"application/json\" },\n });\n}\n\nexport const prerender = false;\\n`\n );\n }\n }\n\n private async buildStepsRoute({\n inputFiles,\n workflowGeneratedDir,\n tsconfigPath,\n }: {\n inputFiles: string[];\n workflowGeneratedDir: string;\n tsconfigPath?: string;\n }) {\n // Create steps route: .well-known/workflow/v1/step.js\n const stepsRouteFile = join(workflowGeneratedDir, 'step.js');\n const { manifest } = await this.createStepsBundle({\n format: 'esm',\n inputFiles,\n outfile: stepsRouteFile,\n externalizeNonSteps: true,\n tsconfigPath,\n });\n\n let stepsRouteContent = await readFile(stepsRouteFile, 'utf-8');\n\n // Normalize request, needed for preserving request through astro\n stepsRouteContent = replaceGeneratedRouteExport(\n stepsRouteContent,\n /export\\s*\\{\\s*stepEntrypoint\\w*\\s+as\\s+HEAD\\s*,\\s*stepEntrypoint\\w*\\s+as\\s+POST\\s*\\}\\s*;?\\s*$/m,\n `${NORMALIZE_REQUEST_CODE}\nconst handleStepRequest = async ({request}) => {\n const normalRequest = await normalizeRequest(request);\n return stepEntrypoint(normalRequest);\n};\n\nexport const HEAD = handleStepRequest;\nexport const POST = handleStepRequest;\n\nexport const prerender = false;`,\n 'Failed to wrap generated Astro step route'\n );\n await writeFile(stepsRouteFile, stepsRouteContent);\n\n return manifest;\n }\n\n private async buildWorkflowsRoute({\n inputFiles,\n workflowGeneratedDir,\n tsconfigPath,\n }: {\n inputFiles: string[];\n workflowGeneratedDir: string;\n tsconfigPath?: string;\n }) {\n // Create workflows route: .well-known/workflow/v1/flow.js\n const workflowsRouteFile = join(workflowGeneratedDir, 'flow.js');\n const { manifest } = await this.createWorkflowsBundle({\n format: 'esm',\n outfile: workflowsRouteFile,\n bundleFinalOutput: false,\n inputFiles,\n tsconfigPath,\n });\n\n let workflowsRouteContent = await readFile(workflowsRouteFile, 'utf-8');\n\n // Normalize request, needed for preserving request through astro\n workflowsRouteContent = replaceGeneratedRouteExport(\n workflowsRouteContent,\n /const handler = workflowEntrypoint\\(workflowCode\\);\\s*export const HEAD = handler;\\s*export const POST = handler;?\\s*$/m,\n `${NORMALIZE_REQUEST_CODE}\nconst handleWorkflowRequest = async ({request}) => {\n const normalRequest = await normalizeRequest(request);\n return workflowEntrypoint(workflowCode)(normalRequest);\n};\n\nexport const HEAD = handleWorkflowRequest;\nexport const POST = handleWorkflowRequest;\n\nexport const prerender = false;`,\n 'Failed to wrap generated Astro workflow route'\n );\n await writeFile(workflowsRouteFile, workflowsRouteContent);\n\n return manifest;\n }\n\n private async buildWebhookRoute({\n workflowGeneratedDir,\n }: {\n workflowGeneratedDir: string;\n }) {\n // Create webhook route: .well-known/workflow/v1/webhook/[token].js\n const webhookRouteFile = join(workflowGeneratedDir, 'webhook/[token].js');\n\n await this.createWebhookBundle({\n outfile: webhookRouteFile,\n bundle: false,\n });\n\n // Post-process the generated file to wrap with Astro request converter\n let webhookRouteContent = await readFile(webhookRouteFile, 'utf-8');\n\n // Update handler signature to accept token as parameter\n webhookRouteContent = webhookRouteContent.replace(\n /async function handler\\(request\\) \\{[\\s\\S]*?const token = decodeURIComponent\\(pathParts\\[pathParts\\.length - 1\\]\\);/,\n `async function handler(request, token) {`\n );\n\n // Remove the URL parsing code since we get token from params\n webhookRouteContent = webhookRouteContent.replace(\n /const url = new URL\\(request\\.url\\);[\\s\\S]*?const pathParts = url\\.pathname\\.split\\('\\/'\\);[\\s\\S]*?\\n/,\n ''\n );\n\n // Normalize request, needed for preserving request through astro\n webhookRouteContent = webhookRouteContent.replace(\n /export const GET = handler;\\nexport const POST = handler;\\nexport const PUT = handler;\\nexport const PATCH = handler;\\nexport const DELETE = handler;\\nexport const HEAD = handler;\\nexport const OPTIONS = handler;/,\n `${NORMALIZE_REQUEST_CODE}\nconst createHandler = (method) => async ({ request, params, platform }) => {\n const normalRequest = await normalizeRequest(request);\n const response = await handler(normalRequest, params.token);\n return response;\n};\n\nexport const GET = createHandler('GET');\nexport const POST = createHandler('POST');\nexport const PUT = createHandler('PUT');\nexport const PATCH = createHandler('PATCH');\nexport const DELETE = createHandler('DELETE');\nexport const HEAD = createHandler('HEAD');\nexport const OPTIONS = createHandler('OPTIONS');\n\nexport const prerender = false;`\n );\n\n await writeFile(webhookRouteFile, webhookRouteContent);\n }\n}\n\nexport class VercelBuilder extends VercelBuildOutputAPIBuilder {\n constructor(config?: Partial<AstroConfig>) {\n const workingDir = config?.workingDir || process.cwd();\n super({\n ...createBaseBuilderConfig({\n workingDir,\n dirs: ['src/pages', 'src/workflows'],\n runtime: config?.runtime,\n }),\n buildTarget: 'vercel-build-output-api',\n debugFilePrefix: '_',\n });\n }\n\n override async build(): Promise<void> {\n const configPath = join(\n this.config.workingDir,\n '.vercel/output/config.json'\n );\n\n // The config output by astro\n const config = JSON.parse(await readFile(configPath, 'utf-8'));\n\n // Filter out existing workflow routes (wrong `dest` mapping)\n config.routes = config.routes.filter(\n (route: { src?: string; dest: string }) =>\n !route.src?.includes('.well-known/workflow')\n );\n\n // Find the index right after the \"filesystem\" handler and \"continue: true\" routes\n let insertIndex = config.routes.findIndex(\n (route: any) => route.handle === 'filesystem'\n );\n\n // Move past any routes with \"continue: true\" (like _astro cache headers)\n while (\n insertIndex < config.routes.length - 1 &&\n config.routes[insertIndex + 1]?.continue === true\n ) {\n insertIndex++;\n }\n\n // Insert workflow routes right after\n config.routes.splice(insertIndex + 1, 0, ...WORKFLOW_ROUTES);\n\n // Bundles workflows for vercel\n await super.build();\n\n // Use old astro config with updated routes\n await writeFile(configPath, JSON.stringify(config, null, 2));\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workflow/astro",
3
- "version": "4.0.4",
3
+ "version": "4.0.5",
4
4
  "description": "Astro integration for Workflow SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,10 +23,10 @@
23
23
  "@swc/core": "1.15.3",
24
24
  "exsolve": "^1.0.8",
25
25
  "pathe": "^2.0.3",
26
- "@workflow/builders": "4.0.5",
27
- "@workflow/rollup": "4.0.4",
28
- "@workflow/swc-plugin": "4.1.0",
29
- "@workflow/vite": "4.0.4"
26
+ "@workflow/builders": "4.0.6",
27
+ "@workflow/rollup": "4.0.5",
28
+ "@workflow/swc-plugin": "4.1.1",
29
+ "@workflow/vite": "4.0.5"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/node": "22.19.0",