Open ari-becker opened 1 year ago
Once we have more of the Wrangler API built out we could use it as a dependency + bundle it into the action. Right now, however, we cannot.
We could theoretically use cache here, I'm not too sure it'll make a big improvement. 19 seconds is still a pretty short time. I'll leave this open to consider though.
Unless I'm missing something:
Given the Wrangler CLI is already an NPM package, is there any reason it doesn't export its main program to be invoked programmatically? It wouldn't increase the API surface of that package at all, but it would allow this package to import main
and call it directly, at which point it would also allow this package to esbuild that package into the shipped JavaScript file. It would also resolve #74 and #75.
This action invokes
npx wrangler
via the shell: https://github.com/cloudflare/pages-action/blob/0fc25c3c282fb26e9a53abfadf6d2898adcac3de/src/index.ts#L37This causes NPM to re-download and re-install
wranger
on each invocation of this action.Notice how there is an NPM warning that it will need to install wrangler.
We're considering migrating from Netlify to Cloudflare Pages - to deploy the same site,
nwtgck/actions-netlify
takes 2 seconds while this action takes 19 seconds.If
wrangler
was in-lined / cached by this action, the deployment would take much less time to finish.