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

C3-name-validation-fix #3496

Merged
merged 2 commits into from
Jun 20, 2023
Merged

C3-name-validation-fix #3496

merged 2 commits into from
Jun 20, 2023

Conversation

petebacondarwin
Copy link
Contributor

@petebacondarwin petebacondarwin commented Jun 20, 2023

If you hit enter when asked for the name of the project, you expect it
to use the default value. But the project name validation was then failing
as it was receiving undefined for the value of the input rather than the
default value.

Now the validator will be passed the default if no value was provided.

Author has included the following, where applicable:

  • [N/A] Tests - it is not really possible to automate a test for this as it requires interaction.
  • Changeset (Changeset guidelines)

To test manually:

  1. Run npm run build in the root to ensure the binaries are up to date.
  2. Then run node ./packages/create-cloudflare/dist/cli.js
  3. And hit enter.

Reviewer is to perform the following, as applicable:

  • Checked for inclusion of relevant tests
  • Checked for inclusion of a relevant changeset
  • Checked for creation of associated docs updates
  • Manually pulled down the changes and spot-tested

If you hit enter when asked for the name of the project, you expect it
to use the default value. But the project name validation was then failing
as it was receiving undefined for the value of the input rather than the
default value.

Now the validator will be passed the default if no value was provided.
@changeset-bot
Copy link

changeset-bot bot commented Jun 20, 2023

🦋 Changeset detected

Latest commit: ff7e7d5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-cloudflare Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@petebacondarwin petebacondarwin added the c3 Relating to C3 (create-cloudflare) package label Jun 20, 2023
@github-actions
Copy link
Contributor

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5320150716/npm-package-wrangler-3496

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/3496/npm-package-wrangler-3496

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5320150716/npm-package-wrangler-3496 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5320150716/npm-package-cloudflare-pages-shared-3496

Note that these links will no longer work once the GitHub Actions artifact expires.

@codecov
Copy link

codecov bot commented Jun 20, 2023

Codecov Report

Merging #3496 (ff7e7d5) into main (9fd12df) will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3496      +/-   ##
==========================================
+ Coverage   75.18%   75.21%   +0.02%     
==========================================
  Files         183      183              
  Lines       11055    11055              
  Branches     2904     2904              
==========================================
+ Hits         8312     8315       +3     
+ Misses       2743     2740       -3     

see 2 files with indirect coverage changes

@petebacondarwin petebacondarwin merged commit 91135e0 into main Jun 20, 2023
@petebacondarwin petebacondarwin deleted the c3-name-validation-fix branch June 20, 2023 12:41
@github-actions github-actions bot mentioned this pull request Jun 20, 2023
@RamIdeas RamIdeas mentioned this pull request Jun 20, 2023
2 tasks
@petebacondarwin
Copy link
Contributor Author

petebacondarwin commented Jun 20, 2023

I just tried this again locally and actually my fix is wrong. The fix assumes that the value will be undefined but actually it is being passed "".

I think for C3 PRs we have to be careful to actually pull down the code and run it, since there is very little test coverage, especially for interactive behaviour.

@jculvey
Copy link
Contributor

jculvey commented Jun 20, 2023

I just tried this again locally and actually my fix is wrong. The fix assumes that the value will be undefined but actually it is being passed "".

Added a fix for this in my PR.

lrapoport-cf pushed a commit that referenced this pull request Aug 11, 2023
* Remove package-lock.json, which should be handled at the root

* [C3] fix: ensure that default project name can be used

If you hit enter when asked for the name of the project, you expect it
to use the default value. But the project name validation was then failing
as it was receiving undefined for the value of the input rather than the
default value.

Now the validator will be passed the default if no value was provided.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c3 Relating to C3 (create-cloudflare) package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants