-
Notifications
You must be signed in to change notification settings - Fork 778
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds an error when we use an entry point that doesn't exist, either for `wrangler dev` or `wrangler publish`, and either via cli arg or `build.upload.main` in `wrangler.toml`. By using a common abstraction for `dev` and `publish`, This also adds support for using `build.config.main`/`build.config.dir` for `wrangler dev`. Fixes #418 Fixes #390
- Loading branch information
1 parent
8f47712
commit c234ed2
Showing
9 changed files
with
175 additions
and
146 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
20 changes: 20 additions & 0 deletions
20
packages/wrangler/src/__tests__/helpers/write-wrangler-toml.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import * as fs from "fs"; | ||
import TOML from "@iarna/toml"; | ||
import type { Config } from "../../config"; | ||
|
||
/** Write a mock wrangler.toml file to disk. */ | ||
export default function writeWranglerToml(config: Omit<Config, "env"> = {}) { | ||
// We Omit `env` from config because TOML.stringify() appears to | ||
// have a weird type signature that appears to fail. We'll revisit this | ||
// when we write tests for publishing environments | ||
fs.writeFileSync( | ||
"./wrangler.toml", | ||
TOML.stringify({ | ||
compatibility_date: "2022-01-12", | ||
name: "test-name", | ||
...(config as TOML.JsonMap), | ||
}), | ||
|
||
"utf-8" | ||
); | ||
} |
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
Oops, something went wrong.