Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/itchy-days-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-cloudflare": minor
---

Change the default project type to the hello world worker script.
4 changes: 2 additions & 2 deletions packages/create-cloudflare/e2e-tests/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe.skipIf(frameworkToTest || isQuarantineMode())(
promptHandlers: [
{
matcher: /What type of application do you want to create/,
input: [keys.down, keys.enter],
input: [keys.enter],
},
{
matcher: /Do you want to use TypeScript/,
Expand Down Expand Up @@ -130,7 +130,7 @@ describe.skipIf(frameworkToTest || isQuarantineMode())(
promptHandlers: [
{
matcher: /What type of application do you want to create/,
input: [keys.down, keys.enter],
input: [keys.enter],
},
{
matcher: /Do you want to use git for version control/,
Expand Down
2 changes: 1 addition & 1 deletion packages/create-cloudflare/src/helpers/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function openInBrowser(url: string): Promise<void> {

export const C3_DEFAULTS = {
projectName: new Haikunator().haikunate({ tokenHex: true }),
type: "webFramework",
type: "hello-world",
framework: "angular",
autoUpdate: true,
deploy: true,
Expand Down
10 changes: 9 additions & 1 deletion packages/create-cloudflare/src/helpers/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,15 @@ const needsPackageManagerReset = (ctx: PagesGeneratorContext) => {
export const npmInstall = async () => {
const { npm } = detectPackageManager();

await runCommand(`${npm} install`, {
const installCmd = [npm, "install"];

if (npm === "yarn" && process.env.VITEST) {
// Yarn can corrupt the cache if more than one instance is running at once,
// which is what we do in our tests.
installCmd.push("--mutex", "network");
}

await runCommand(installCmd, {
silent: true,
startText: "Installing dependencies",
doneText: `${brandColor("installed")} ${dim(`via \`${npm} install\``)}`,
Expand Down
8 changes: 4 additions & 4 deletions packages/create-cloudflare/src/templateMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ type TemplateConfig = {
};

export const templateMap: Record<string, TemplateConfig> = {
webFramework: {
label: "Website or web app",
handler: runPagesGenerator,
},
"hello-world": {
label: `"Hello World" Worker`,
handler: runWorkersGenerator,
},
webFramework: {
label: "Website or web app",
handler: runPagesGenerator,
},
common: {
label: "Example router & proxy Worker",
handler: runWorkersGenerator,
Expand Down