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

πŸ‘Œ IMPROVE: prevent CLI from being created without a name #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

selkasse
Copy link

@selkasse selkasse commented Jun 10, 2022

Copilot

πŸ€– Generated by Copilot at f03e3fa

Summary

πŸš«πŸš¨πŸ› οΈ

Add validation for project name input in utils/ask.js. Prevent creating a project with an empty name.

project name blank?
Validation says: "Please fill" -
Spring needs new blossoms

Walkthrough

  • Add a validation check for the project name input (link)

​

Human

As a result, the generated CLI is created in the same directory, and the package.json file has empty "name" and "bin" keys. This pull request adds the validation to prevent this issue.

{
	"name": "",
	"description": "break",
	"version": "0.0.1",
	"license": "UNLICENSED",
	"bin": {
		"": "index.js"
	},
	"author": {
		"name": "break",
		"email": "break",
		"url": "break"
	},
	"keywords": [
		"",
		"break"
	],
	"files": [
		"index.js",
		"utils"
	],
	"scripts": {
		"format": "prettier --write \"./**/*.{js,json}\""
	},
	"dependencies": {
		"chalk": "^4.1.2",
		"cli-alerts": "^1.2.2",
		"cli-handle-error": "^4.4.0",
		"cli-handle-unhandled": "^1.1.1",
		"cli-meow-help": "^3.1.0",
		"cli-welcome": "^2.2.2",
		"meow": "^9.0.0"
	},
	"devDependencies": {
		"prettier": "^2.6.2"
	}
}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please remove this file from your 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

Successfully merging this pull request may close these issues.

None yet

2 participants