Skip to content

C3-name-validation-fix#3496

Merged
petebacondarwin merged 2 commits intomainfrom
c3-name-validation-fix
Jun 20, 2023
Merged

C3-name-validation-fix#3496
petebacondarwin merged 2 commits intomainfrom
c3-name-validation-fix

Conversation

@petebacondarwin
Copy link
Copy Markdown
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.
@petebacondarwin petebacondarwin requested review from a team, RamIdeas and jculvey as code owners June 20, 2023 08:13
@changeset-bot
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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.

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