-
Notifications
You must be signed in to change notification settings - Fork 716
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
C3: Fix name argument and infer type argument from flags (#3525)
* Add back initialValue prop to interactive options * Try to infer type argument if missing * Adding changeset * Add initialValue back to confirmInput and fix tests * Refactor input prompts and argument validation * Improve wrangler-defaults test * Refactor --wrangler-defaults and add a -y flag * Proposed tweak to `parseArgs()` * Skip the hono e2e test --------- Co-authored-by: Pete Bacon Darwin <[email protected]>
- Loading branch information
1 parent
5a74cb5
commit 1ce3296
Showing
9 changed files
with
383 additions
and
317 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"create-cloudflare": patch | ||
--- | ||
|
||
C3: Infer missing --type argument from --framework or --existing-script |
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 |
---|---|---|
|
@@ -26,26 +26,32 @@ describe("E2E", () => { | |
} | ||
}); | ||
|
||
const runCli = async (framework: string) => { | ||
const runCli = async (framework: string, args: string[] = []) => { | ||
const projectPath = join(dummyPath, "test"); | ||
|
||
const argv = [ | ||
projectPath, | ||
"--type", | ||
"webFramework", | ||
"--framework", | ||
framework, | ||
"--no-deploy", | ||
"--no-git", | ||
"--wrangler-defaults", | ||
]; | ||
|
||
const result = await execa("node", ["./dist/cli.js", ...argv], { | ||
stderr: process.stderr, | ||
}); | ||
if (args.length > 0) { | ||
argv.push(...args); | ||
} else { | ||
argv.push("--no-git"); | ||
} | ||
|
||
// For debugging purposes, uncomment the following to see the exact | ||
// command the test uses. You can then run this via the command line. | ||
// console.log("COMMAND: ", `node ${["./dist/cli.js", ...argv].join(" ")}`); | ||
|
||
const result = await execa("node", ["./dist/cli.js", ...argv], { | ||
stderr: process.stderr, | ||
}); | ||
|
||
const { exitCode } = result; | ||
|
||
// Some baseline assertions for each framework | ||
|
@@ -116,4 +122,17 @@ describe("E2E", () => { | |
test("Vue", async () => { | ||
await runCli("vue"); | ||
}); | ||
|
||
// This test blows up in CI due to Github providing an unusual git user email address. | ||
// E.g. | ||
// ``` | ||
// fatal: empty ident name (for <[email protected]. | ||
// internal.cloudapp.net>) not allowed | ||
// ``` | ||
test.skip("Hono (wrangler defaults)", async () => { | ||
const { projectPath } = await runCli("hono", ["--wrangler-defaults"]); | ||
|
||
// verify that wrangler-defaults defaults to `true` for using git | ||
expect(join(projectPath, ".git")).toExist(); | ||
}); | ||
}); |
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.