-
Notifications
You must be signed in to change notification settings - Fork 41
docs(cloudflare): add a section for CLI commands #184
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
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
157988a
docs(cloudflare): add a section for CLI commands
vicb 07c1144
Update pages/cloudflare/cli.mdx
vicb 3377a06
Update pages/cloudflare/cli.mdx
vicb b1a86f7
Update pages/cloudflare/_meta.json
vicb 685a8f6
Update pages/cloudflare/cli.mdx
vicb b0c0764
Update pages/cloudflare/cli.mdx
vicb d26e6b3
Update pages/cloudflare/cli.mdx
vicb a2567b5
Update pages/cloudflare/cli.mdx
vicb c9398f3
Update pages/cloudflare/cli.mdx
vicb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Callout } from "nextra/components"; | ||
|
||
## `opennextjs-cloudflare` CLI | ||
|
||
The cloudflare adapter provides a `opennextjs-cloudflare` CLI to develop, build, and deploy your application. You should not use `wrangler` commands directly unless documented otherwise or if you know what you are doing. | ||
vicb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
## commands | ||
|
||
`opennextjs-cloudflare` support multiple commands, invoked via `opennextjs-cloudflare <command>`. | ||
|
||
The currently supported commands are `build`, `populateCache`, `preview`, `deploy`, and `upload`. | ||
|
||
You can list the command by invoking `pnpm opennextjs-cloudflare` and get help with a given command by invoking `pnpm opennextjs-cloudflare <command> --help`. | ||
vicb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
Most commands take command specific options (i.e. `pnpm opennextjs-cloudflare build --skipNextBuild --noMinify`) and also accept wrangler options (i.e. `pnpm opennextjs-cloudflare build --config=/path/to/wrangler.jsonc --env=prod`). | ||
|
||
### `build` command | ||
|
||
It first builds the Next.js application by invoking the `build` script of the `package.json` - which typically execute `next build`. It then runs the cloudflare specific build step to update the built files to run on the Cloudflare runtime. | ||
vicb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
### `populateCache` command | ||
|
||
It populates the configured [Open Next cache components](/cloudflare/caching) so that caching works at runtime. It can populate the local bindings (`populateCache local`) used during development on your local machine or the remote bindings (`populateCache remote`) used by the deployed application. Note that this command is implicitely called by the `preview`, `deploy`, and `upload` commands so there is no need to explicitely call `populate` when one of those is used. | ||
vicb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
### `preview` command | ||
|
||
It starts by populating the local cache and then launch a local developement server (via `wrangler dev`) so that you can preview the application locally. | ||
vicb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
### `deploy` command | ||
|
||
It starts by populating the remote cache and then deploy your application to Cloudflare (via `wrangler deploy`). The application will start serving as soon as it is deployed. | ||
vicb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
### `upload` command | ||
|
||
It starts by populating the remote cache and then upload a version of your application to Cloudflare (via `wrangler upload`). Note that the application will not automatically be served on uploads. See [Gradual deployments](https://developers.cloudflare.com/workers/configuration/versions-and-deployments/gradual-deployments/) to learn more about how to serve an uploaded version. | ||
vicb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.