Skip to content
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

feat(cloudflare-workers-bindings-extensions): list bindings on the sidebar #7582

Merged
merged 5 commits into from
Dec 19, 2024

Conversation

edmundhung
Copy link
Member

@edmundhung edmundhung commented Dec 18, 2024

Fixes DEVX-1472

This PR introduce the bindings view on the vscode extension that lists all the supported bindings in the sidebar. This implementation assumes the wrangler config is present on the root of the workspace folder and does not support monorepo at the moment.


  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because:
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because: No e2e tests for VSCode extension
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Documentation not necessary because: unreleased

Copy link

changeset-bot bot commented Dec 18, 2024

🦋 Changeset detected

Latest commit: 9e31010

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
cloudflare-workers-bindings-extension Patch

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

Copy link
Contributor

github-actions bot commented Dec 18, 2024

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/12401351877/npm-package-wrangler-7582

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7582/npm-package-wrangler-7582

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12401351877/npm-package-wrangler-7582 dev path/to/script.js
Additional artifacts:
wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12401351877/npm-package-cloudflare-workers-bindings-extension-7582 -O ./cloudflare-workers-bindings-extension.0.0.0-vb5632048e.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-vb5632048e.vsix
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12401351877/npm-package-create-cloudflare-7582 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12401351877/npm-package-cloudflare-kv-asset-handler-7582
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12401351877/npm-package-miniflare-7582
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12401351877/npm-package-cloudflare-pages-shared-7582
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12401351877/npm-package-cloudflare-unenv-preset-7582
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12401351877/npm-package-cloudflare-vitest-pool-workers-7582
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12401351877/npm-package-cloudflare-workers-editor-shared-7582
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12401351877/npm-package-cloudflare-workers-shared-7582
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12401351877/npm-package-cloudflare-workflows-shared-7582

Note that these links will no longer work once the GitHub Actions artifact expires.


wrangler@3.97.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20241205.0
workerd 1.20241205.0 1.20241205.0
workerd --version 1.20241205.0 2024-12-05

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@emily-shen emily-shen force-pushed the edmundhung/vscode-extension-list-bindings branch 2 times, most recently from d2e3f15 to 2f42303 Compare December 18, 2024 16:38
@edmundhung edmundhung force-pushed the edmundhung/vscode-extension-list-bindings branch from 06fe2d8 to 9e31010 Compare December 18, 2024 16:54
@edmundhung edmundhung marked this pull request as ready for review December 18, 2024 17:00
@edmundhung edmundhung requested a review from a team as a code owner December 18, 2024 17:00
@@ -19,6 +19,7 @@
"package": "pnpm run check:type && pnpm run check:lint && node esbuild.js --production",
"compile-tests": "tsc -p . --outDir out",
"watch-tests": "tsc -p . -w --outDir out",
"test": "node ./out/test/runTest.js",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use tsx in various other places for stuff like this. Would that work? I'd alos love to see if it's possible to run this in CI—does it fail if you add a test:ci script?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried that but it fails with this message:

Error: Cannot find module '/Users/edmund/Workspace/workers-sdk/packages/cloudflare-workers-bindings-extension/src/test/suite/index'

I have also pushed a commit with the test:ci script. The tests seems to be running fine on windows and macos but fails on ubuntu (https://github.com/cloudflare/workers-sdk/actions/runs/12401086099/job/34619688337). I can look at this next as a follow-up.

Copy link
Member Author

@edmundhung edmundhung Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we need to have Xvfb enabled specifically for ubuntu:
https://code.visualstudio.com/api/working-with-extensions/continuous-integration#github-actions

Copy link
Contributor

@penalosa penalosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment about tests, but otherwise looking good! We should also make sure to render all bindings, not just the ones we can edit

@edmundhung
Copy link
Member Author

Minor comment about tests, but otherwise looking good! We should also make sure to render all bindings, not just the ones we can edit

I can do a follow-up and extend it to all bindings tomorrow 👍🏼 (or on this branch if the main is still locked)

@edmundhung edmundhung force-pushed the edmundhung/vscode-extension-list-bindings branch from c1f26ae to 9e31010 Compare December 18, 2024 21:08
@edmundhung edmundhung merged commit ab0ac94 into main Dec 19, 2024
55 of 57 checks passed
@edmundhung edmundhung deleted the edmundhung/vscode-extension-list-bindings branch December 19, 2024 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants