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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌 feat: download of Worker script --from-dash #1645

Merged
merged 1 commit into from
Aug 12, 2022
Merged

Conversation

JacobMGEvans
Copy link
Contributor

@JacobMGEvans JacobMGEvans commented Aug 10, 2022

Workaround for handling multipart/form-data slicing off top and bottom boundaries.

  • Need to prevent download in existing projects
  • Duplicate the logic for JS files
  • Tests
  • Changeset

multipart/formdata not supported currently in Undici nodejs/undici#974

@changeset-bot
Copy link

changeset-bot bot commented Aug 10, 2022

馃 Changeset detected

Latest commit: f514540

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

This PR includes changesets to release 1 package
Name Type
wrangler 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

@github-actions
Copy link
Contributor

github-actions bot commented Aug 10, 2022

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2848647603/npm-package-wrangler-1645

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

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/1645/npm-package-wrangler-1645

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/2848647603/npm-package-wrangler-1645 dev path/to/script.js

@codecov
Copy link

codecov bot commented Aug 10, 2022

Codecov Report

Merging #1645 (f514540) into main (249361c) will decrease coverage by 0.41%.
The diff coverage is 71.21%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1645      +/-   ##
==========================================
- Coverage   81.37%   80.96%   -0.42%     
==========================================
  Files          90       91       +1     
  Lines        5955     6062     +107     
  Branches     1527     1555      +28     
==========================================
+ Hits         4846     4908      +62     
- Misses       1109     1154      +45     
Impacted Files Coverage 螖
packages/wrangler/src/cfetch/internal.ts 7.69% <0.00%> (-1.77%) 猬囷笍
...ages/wrangler/src/__tests__/helpers/mock-cfetch.ts 95.00% <90.00%> (-0.72%) 猬囷笍
packages/wrangler/src/init.ts 97.15% <97.43%> (+0.34%) 猬嗭笍
packages/wrangler/src/pages/dev.tsx 21.54% <0.00%> (-1.35%) 猬囷笍
packages/wrangler/src/pages/publish.tsx 45.27% <0.00%> (-1.21%) 猬囷笍
packages/wrangler/src/pages/constants.ts 100.00% <0.00%> (酶)
...angler/src/pages/functions/routes-consolidation.ts 100.00% <0.00%> (酶)
packages/wrangler/src/pages/errors.ts 25.00% <0.00%> (酶)
packages/wrangler/src/pages/build.tsx 61.81% <0.00%> (+0.94%) 猬嗭笍
...ackages/wrangler/src/__tests__/helpers/mock-bin.ts 100.00% <0.00%> (+5.26%) 猬嗭笍

@JacobMGEvans
Copy link
Contributor Author

JacobMGEvans commented Aug 10, 2022

Video of functional testing, showing source code downloaded from dashboard of test-worker

Screen.Recording.2022-08-10.at.2.01.59.PM.mov

@JacobMGEvans JacobMGEvans linked an issue Aug 11, 2022 that may be closed by this pull request
@JacobMGEvans JacobMGEvans force-pushed the from-dash branch 2 times, most recently from ad7c13a to 19be735 Compare August 11, 2022 15:17
@JacobMGEvans JacobMGEvans changed the title wip: download of Worker script 馃殌 feat: download of Worker script Aug 11, 2022
@JacobMGEvans JacobMGEvans marked this pull request as ready for review August 11, 2022 15:27
@JacobMGEvans JacobMGEvans changed the title 馃殌 feat: download of Worker script 馃殌 feat: download of Worker script --from-dash Aug 11, 2022
Copy link
Contributor

@caass caass left a comment

Choose a reason for hiding this comment

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

Awesome! Left a couple comments, but once those are addressed it looks good to me 馃憤馃徎

packages/wrangler/src/__tests__/init.test.ts Outdated Show resolved Hide resolved
packages/wrangler/src/__tests__/init.test.ts Show resolved Hide resolved
packages/wrangler/src/init.ts Show resolved Hide resolved
.changeset/six-needles-begin.md Outdated Show resolved Hide resolved
Added `wrangler init --from-dash <worker-name>`, which allows initializing a wrangler project from a pre-existing worker in the dashboard.

Resolves #1624
Discussion: #1623

Notes: `multiplart/form-data` parsing is [not currently supported in Undici](nodejs/undici#974), so a temporary workaround to slice off top and bottom boundaries is in place.
@JacobMGEvans JacobMGEvans merged commit ac39748 into main Aug 12, 2022
@JacobMGEvans JacobMGEvans deleted the from-dash branch August 12, 2022 18:53
This was referenced Aug 12, 2022
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.

馃殌 Feature: Source code wrangler init --from-dash
2 participants