Skip to content

validate the package name #5

Open
@gr2m

Description

@gr2m

we validate the repository name today:

{
type: "input",
name: "repository",
message:
"Full name of the repository. Name must start with 'octoherd-script-' (Example: octocat/octoherd-script-hello-world)",
default: (answers) => {
if (answers.packageName.startsWith("@octoherd")) {
return answers.packageName.substr(1);
}
return answers.packageName.startsWith("@")
? answers.packageName.substr(1)
: [login, answers.packageName].join("/");
},
validate: (input) =>
/^[^/]+\/octoherd-script-/.test(input) ||
/^octoherd\/script-/.test(input),
},

but not the npm package

{
type: "input",
name: "packageName",
message:
"What npm package name should the project have? (Example: octoherd-script-hello-world)",
},

I think that package names should be one of three

  • octoherd-script-<my name>
  • @my-scope/octoherd-script-<my name>
  • @octoherd/script-<my name>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions