-
Notifications
You must be signed in to change notification settings - Fork 687
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support a
WRANGLER_C3_COMMAND
env var to support C3 integration tes…
…ting (#3461) * [wrangler] test: ensure that mocks are cleared between tests * chore: add additional known words to spelling dictionary * [wrangler] test: mock console logs in traverse-module-graph tests This avoids unwanted excess logging output during tests. * [wrangler] test: allow the C3 command to be modified via an environment variable. `WRANGLER_C3_COMMAND` can override the command used by `wrangler init` when delegating to C3. By default this will use `create cloudflare@2`. If you want to test the integration between wrangler and C3 locally, you can do the following: ```sh # Ensure both Wrangler and C3 are built npm run build # Run the command from the Wrangler package directory cd packages/wrangler # Tell Wrangler to use the local version of create-cloudflare WRANGLER_C3_COMMAND="run create-cloudflare" npx wrangler init temp ``` This makes use of the fact we have a monorepo and npm will delegate to the local version of a package if possible. Since the way `wrangler init` is written, it will always use `npm` (or equivalent) to run C3, rather than `npx` (or equivalent). Therefore we have added a `create-cloudflare` script to the Wrangler `package.json` that will work with `npm run create-cloudflare`. But that means that you must run the `npx wrangler init` command from the `wrangler` package directory.
- Loading branch information
1 parent
03133ee
commit b0bbf69
Showing
8 changed files
with
124 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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
26 changes: 26 additions & 0 deletions
26
packages/wrangler/src/environment-variables/misc-variables.ts
This file contains 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 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