Support a positional app name (npx servergen my-api)#39
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem & Solution Overview
Adds a positional app name so
npx servergen my-apiworks, while keeping-n, --namefor backward compatibility. If both are given with different values it errors clearly; if neither is given it errors clearly. Framework defaults toexpress, port to3000.--viewand--dbare now both rejected with thenodeframework.--helpgains usage examples (basic, Node, view, database, custom-port, skip-install).Testing Done
npm test: 223 passing, including new integration tests for positional naming, legacy--name, name sanitization, conflicting names, missing name, invalid combinations (node+view, node+db, invalid framework/view/port), and every supported flag (-f,-vejs/pug/hbs,--db,-p,--skip-install,--debug).npm run test:coveragepasses — coverage is now scoped to the importable library (the CLI entry point is exercised by the integration subprocess tests, which in-process istanbul can't measure).