improve and test vite-plugin-cloudflare .dev.vars files support#7864
improve and test vite-plugin-cloudflare .dev.vars files support#7864dario-piotrowicz merged 12 commits intomainfrom
.dev.vars files support#7864Conversation
🦋 Changeset detectedLatest commit: a39093d The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
|
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/13001188073/npm-package-wrangler-7864You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7864/npm-package-wrangler-7864Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13001188073/npm-package-wrangler-7864 dev path/to/script.jsAdditional artifacts:cloudflare-workers-bindings-extension: wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13001188073/npm-package-cloudflare-workers-bindings-extension-7864 -O ./cloudflare-workers-bindings-extension.0.0.0-vc2ba65d44.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-vc2ba65d44.vsixcreate-cloudflare: npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13001188073/npm-package-create-cloudflare-7864 --no-auto-update@cloudflare/kv-asset-handler: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13001188073/npm-package-cloudflare-kv-asset-handler-7864miniflare: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13001188073/npm-package-miniflare-7864@cloudflare/pages-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13001188073/npm-package-cloudflare-pages-shared-7864@cloudflare/unenv-preset: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13001188073/npm-package-cloudflare-unenv-preset-7864@cloudflare/vite-plugin: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13001188073/npm-package-cloudflare-vite-plugin-7864@cloudflare/vitest-pool-workers: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13001188073/npm-package-cloudflare-vitest-pool-workers-7864@cloudflare/workers-editor-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13001188073/npm-package-cloudflare-workers-editor-shared-7864@cloudflare/workers-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13001188073/npm-package-cloudflare-workers-shared-7864@cloudflare/workflows-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13001188073/npm-package-cloudflare-workflows-shared-7864Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
e3e9d3a to
69affde
Compare
b1407a5 to
6e539ad
Compare
dbe3e1b to
8689cad
Compare
8689cad to
eabe360
Compare
jamesopstad
left a comment
There was a problem hiding this comment.
Looks good! Just a few code comments and some changes to the readme.
3bb0dd1 to
5cc21f3
Compare
There was a problem hiding this comment.
| MY_DEV_VAR_A = "my .dev.vars staging variable A" | |
| MY_DEV_VAR_B = "my .dev.vars staging variable B" | |
| MY_DEV_VAR_A = "my .dev.vars.staging variable A" | |
| MY_DEV_VAR_B = "my .dev.vars.staging variable B" |
There was a problem hiding this comment.
I prefer not to have the . so that it is clearer that this this is a manually inputted string (otherwise without seeing the implementation someone could thing that this was generated by something like my ${devVarsFileName} variable A)
if you find it confusing I can change the strings to something like MY_DEV_VAR_A = "my .dev.vars variable A for the staging environment (or something like that)
There was a problem hiding this comment.
Note, mostly unrelated to this PR:
The vite-plugin catalog pins @types/node but that will not work as expected because of
"overrides": {
// ...
"@types/node": "$@types/node"
},So there would need to be a more specific override there for the plugin package
There was a problem hiding this comment.
is there any benefit in having a variable here (i.e. do we expect to add more files)
Otherwise it looks looks inlining would be less convoluted
There was a problem hiding this comment.
the benefit of the variable are:
- it is nicer to have if we can indeed add more files in the future
- if is a self documenting variable, the variable name helps (at least to me) understanding that it does
those are not huge benefits I don't mind inlining the array if that's what you strongly prefer
There was a problem hiding this comment.
I admit I am not convinced this needs a variable. But I don't care strongly.
There was a problem hiding this comment.
me neither 😅, as I said I prefer having the variable but it's not a huge deal either way 🙂
vicb
left a comment
There was a problem hiding this comment.
Looks good - with my limited understanding of the plugin.
But I always find things to comment ;)
23c0acd to
b146539
Compare
There was a problem hiding this comment.
I admit I am not convinced this needs a variable. But I don't care strongly.
the changes here add tests for making sure that the vite plugin correctly reads secrets from `.dev.vars` files with and without a specified environment as part of this wragler's `unstable_getMiniflareWorkerOptions` utility needed to also be updated to accept the environment name as its second parameter
Update md files Co-authored-by: James Opstad <13586373+jamesopstad@users.noreply.github.com>
Co-authored-by: James Opstad <13586373+jamesopstad@users.noreply.github.com>
Co-authored-by: Victor Berchet <victor@suumit.com>
Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
744f80b to
a39093d
Compare
fixes #7850
the changes here add tests for making sure that the vite plugin correctly reads secrets from
.dev.varsfiles with and without a specified environmentas part of this wragler's
unstable_getMiniflareWorkerOptionsutility needed to also be updated to accept the environment name as its second parameterunstable_getMiniflareWorkerOptionsutility is not currently tested, so I don't think it's necessary to include any here either)