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

wrangler publish #2

Closed
Tracked by #12
threepointone opened this issue Nov 15, 2021 · 3 comments
Closed
Tracked by #12

wrangler publish #2

threepointone opened this issue Nov 15, 2021 · 3 comments

Comments

@threepointone
Copy link
Contributor

threepointone commented Nov 15, 2021

This is the parent issue tracking the implementation of wrangler publish.

Usage

In it's simplest form, you can write a worker, say at index.js, and run: wrangler publish index.js --name myscriptname, and -

  • it'll 'bundle' your script into a single file, and publish it to myscriptname.<your subdomain>.workers.dev
  • Much like wrangler dev, we aim to provide a default experience that's immediately useful, so you shouldn't have to setup a bundler/compiler for most usecases. So, you can use modules from npm, create separate modules, use react (todo: --jsx <reference> for other libraries), use typescript, and it should all Just Work. (more details on the tracking issue for wrangler dev)
  • Much like wrangler dev, wrangler publish will also automatically infer whether your script is in the service-worker format or the newer ES modules format.
  • You can publish to your own domain/zone with wrangler publish <script> --name <name> --zone somedomain.com --route "somedomain.com/path/*"
    • You'll note that you can pass a domain directly to zone, instead of a zone_id. wrangler publish should work with both forms of configuration.
@threepointone threepointone mentioned this issue Nov 16, 2021
27 tasks
threepointone added a commit that referenced this issue Nov 16, 2021
* we are now a monorepo

* add a stub for the create package, fix builds
@huv1k
Copy link

huv1k commented Dec 2, 2021

Is there any plan to add a build step back to the public? Right now you need to compile your script before running publish what is kind of inconvenient.

@threepointone
Copy link
Contributor Author

To clarify:

  • Because we're using esbuild internally, most common usecases should just work without a compile step. So, if you're using npm modules, jsx, typescript etc, you shouldn't have to do a build step at all. Just point to your entry point and it should just work. (we're also reading the entrypoint from build.upload.main like wrangler1, but this hasn't been tested throughly).
  • If you do need need to run a build before dev/publish, we're thinking of doing what pages dev does, which is being able to pass the build step directly to dev/publish after --. So for example, if your build step is webpack, you should be able to do wrangler publish output/index.js -- webpack (assuming webpack outputs the worker to output/index.js) This isn't implemented yet, but should be done before the end of next week.
  • With this in place, we're probably going to deprecate having build.command in wrangler.toml, unless there's pushback.

Does this make sense, and is acceptable to you?

@threepointone
Copy link
Contributor Author

A remaning task here is to implement custom builds. Tracking that here #120 and closing this issue.

@petebacondarwin petebacondarwin added this to the Wrangler 2.0 milestone Feb 1, 2022
jspspike added a commit that referenced this issue Mar 13, 2023
# This is the 1st commit message:

Update rollback fetch call and remove deployments request from publish

# This is the commit message #2:

destructure the one value we want from the result
jspspike added a commit that referenced this issue Mar 15, 2023
# This is the 1st commit message:

Update rollback fetch call and remove deployments request from publish

# This is the commit message #2:

destructure the one value we want from the result
jspspike added a commit that referenced this issue Mar 16, 2023
# This is the 1st commit message:

Update rollback fetch call and remove deployments request from publish

# This is the commit message #2:

destructure the one value we want from the result
jspspike added a commit that referenced this issue Mar 16, 2023
* Deployment Details
Added a positional in the 'Deployments' command <deployment-id>.
<deployment-id> will get the details of the deployment, including versioned script, bindings, and usage model information.

changeset added

snapshot for commands updated

removed stray quotes

* Deployment Rollbacks
Created a subcommand on deployments that allows for rolling back a deployment to a previous ID provided.

Changed the command structure to have 2 subcommands view and rollback

Improved the Changeset messaging and combined rollback

Update help messages

Added comfirmation prompt to Rollback

Implemented --yes flag with tests

Updated tests

comfirmation handles non-TTY environments automatically fixed tests to reflect that and removed --yes option

tests breaking in CI

Turn off chalk in tests

Update messaging with new copy for confirm prompt matching dashboard & removing the PUT response in output

snapshots updated

rollback accounts URL

* # This is a combination of 2 commits.
# This is the 1st commit message:

Update rollback fetch call and remove deployments request from publish

# This is the commit message #2:

destructure the one value we want from the result

* Update rollback fetch call and remove deployments request from publish

destructure the one value we want from the result

Have script upload msw always return response body

Update deployment tests

Fixed misc tests

Delete index.js

Added check for request on rollback tests

Fix issue with wrangler version appearing after prompt

* Fix `next(param)` in Pages Plugins (#2789)

* Add duplex to r2 put (#2793)

* Add changeset (#2795)

* Version Packages (#2791)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Add hyphens to all deployment ids

* Merge

* Automatically rollback to previous deployment if deployment id is not specified (#2841)

Co-authored-by: jjohnson <jjohnson@cloudflare.com>

* Have deployment view output in table (#2844)

* Add suggested changes and update wrangler docs

* Separate content into option on view command

---------

Co-authored-by: jjohnson <jjohnson@cloudflare.com>

* Add message to rollback and restructre rollback commands (#2888)

* Add rollback reason

* fixup: Cleanup hanging prompt mocks in deployments tests

* Change structure for rollback commands

---------

Co-authored-by: jjohnson <jjohnson@cloudflare.com>
Co-authored-by: Samuel Macleod <smacleod@cloudflare.com>

* Remove showing script content in deployment view

---------

Co-authored-by: jjohnson <jjohnson@cloudflare.com>
Co-authored-by: Greg Brimble <gbrimble@cloudflare.com>
Co-authored-by: Somhairle MacLeòid <smacleod@cloudflare.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joshua Johnson <jspspike@gmail.com>
GregBrimble pushed a commit that referenced this issue Feb 8, 2024
set up default and optional path handler
GregBrimble pushed a commit that referenced this issue Feb 9, 2024
set up default and optional path handler
GregBrimble pushed a commit that referenced this issue Feb 9, 2024
set up default and optional path handler
CarmenPopoviciu added a commit that referenced this issue Mar 25, 2024
CarmenPopoviciu added a commit that referenced this issue Mar 25, 2024
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

No branches or pull requests

3 participants