Skip to content
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

create-waku non-interactive #1208

Open
rmarscher opened this issue Feb 3, 2025 · 1 comment
Open

create-waku non-interactive #1208

rmarscher opened this issue Feb 3, 2025 · 1 comment

Comments

@rmarscher
Copy link
Contributor

I'm working on a PR to add create-waku to Cloudflare's C3 CLI tool.

I'm trying to figure out if there is a way to run create-waku so that it doesn't require any interactive prompts.

I'm not sure if there is a way to pre-fill the project name. I think it would be expected to use the first positional argument for that. Or a --project-name option would be fine too. It was looking at the code and at the prompts npm package and I'm not seeing it.

In the create-cloudflare implementation for Remix - https://github.com/cloudflare/workers-sdk/blob/main/packages/create-cloudflare/templates-experimental/remix/c3.ts#L13 - the project name is passed as the first positional argument to the npm create remix command.

The create-remix cli has a block of code that attempts to detect if it should run in a non-interactive mode. They also look for a custom environment variable (CREATE_REMIX_FORCE_INTERACTIVE).

  // Adapted from https://github.com/sindresorhus/is-interactive
  return Boolean(
    process.stdout.isTTY &&
      process.env.TERM !== "dumb" &&
      !("CI" in process.env)
  );

I could potentially help and create a PR for create-waku. Thanks!

@dai-shi
Copy link
Owner

dai-shi commented Feb 4, 2025

Hm, I think adding --project-name option sounds good. It might be useful for the normal usage. The question is if we could fallback to interactive mode if the provided --project-name value is invalid.

Yeah, please open a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants