-
Notifications
You must be signed in to change notification settings - Fork 830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support wrangler types for Pipelines #8528
Conversation
🦋 Changeset detectedLatest commit: 32ba1cc The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This type was recently moved into |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13969709083/npm-package-wrangler-8528 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/8528/npm-package-wrangler-8528 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13969709083/npm-package-wrangler-8528 dev path/to/script.js Additional artifacts:cloudflare-workers-bindings-extension: wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13969709083/npm-package-cloudflare-workers-bindings-extension-8528 -O ./cloudflare-workers-bindings-extension.0.0.0-v7dcdd42d2.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v7dcdd42d2.vsix create-cloudflare: npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13969709083/npm-package-create-cloudflare-8528 --no-auto-update @cloudflare/kv-asset-handler: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13969709083/npm-package-cloudflare-kv-asset-handler-8528 miniflare: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13969709083/npm-package-miniflare-8528 @cloudflare/pages-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13969709083/npm-package-cloudflare-pages-shared-8528 @cloudflare/unenv-preset: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13969709083/npm-package-cloudflare-unenv-preset-8528 @cloudflare/vite-plugin: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13969709083/npm-package-cloudflare-vite-plugin-8528 @cloudflare/vitest-pool-workers: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13969709083/npm-package-cloudflare-vitest-pool-workers-8528 @cloudflare/workers-editor-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13969709083/npm-package-cloudflare-workers-editor-shared-8528 @cloudflare/workers-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13969709083/npm-package-cloudflare-workers-shared-8528 @cloudflare/workflows-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13969709083/npm-package-cloudflare-workflows-shared-8528 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
@@ -511,6 +512,12 @@ export async function generateEnvTypes( | |||
} | |||
} | |||
|
|||
if (configToDTS.pipelines) { | |||
for (const pipeline of configToDTS.pipelines) { | |||
envTypeStructure.push([constructTypeKey(pipeline.binding), "Pipeline"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work, sine the Pipeline
type isn't available globally anymore, as far as I know. This will need to be import("cloudflare:pipelines").Pipeline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
5762d7f
to
9f78711
Compare
for (const pipeline of configToDTS.pipelines) { | ||
envTypeStructure.push([ | ||
constructTypeKey(pipeline.binding), | ||
`import("cloudflare:pipelines").Pipeline`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having tested this, this actually needs to be:
import("cloudflare:pipelines").Pipeline<
import("cloudflare:pipelines").PipelineRecord
>
because the Pipeline
interface has no default for the generic. Is that intentional?
Pending internal discussion, this shouldn't be merged yet |
Adds support for `wrangler types` command to generate the necessary types for Workers Pipelines. Closes: https://jira.cfdata.org/browse/PIPE-181 Create swift-beers-battle.md
482179f
to
32ba1cc
Compare
Adds support for
wrangler types
command to generate the necessary types for Workers Pipelines.Fixes https://jira.cfdata.org/browse/PIPE-181
wrangler types -h