cli: make the existing app notice match what init checks

Open Beginner friendly
#191 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
92/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
angular, typescript
Domain
cli, testing

Research direction

Read printExistingAppNotice in apps/pidrang-cli/src/run-cli.ts, then compare its wording with isNewApp in apps/pidrang-cli/src/edit-app-routes.ts. Update the notice and the matching expectations in apps/pidrang-cli/src/run-cli.spec.ts; run pnpm exec nx test pidrang-cli. Done means the notice does not claim routes exist when only app.html changed, and the tests pass.

Written by the indexing model from the issue text.

Description

bug good first issue layer: library pkg: cli

What is wrong

When pidrang init runs on an app that is not a fresh ng new app, it prints:

The app already has its own pages and routes, so pidrang only added the resource routes to ...

That is not always true. The app counts as "not new" when app.html is no longer the ng new welcome page or app.routes.ts has routes. An app with an edited app.html and no routes gets this sentence too.

How to see it

  1. ng new an app, change one line of src/app/app.html, keep app.routes.ts empty.
  2. Run npx pidrang init: the sentence says the app has its own routes.

Where to look

  • The sentence: printExistingAppNotice in apps/pidrang-cli/src/run-cli.ts.
  • What is tested: isNewApp in apps/pidrang-cli/src/edit-app-routes.ts.
  • Tests: apps/pidrang-cli/src/run-cli.spec.ts (search for "already has its own pages").

Steps

  1. Change the sentence so it is true in every case, for example: "This is not a new ng new app (app.html or app.routes.ts was changed), so pidrang only added the resource routes to ...".
  2. Update the tests that check the old text.
  3. Run pnpm exec nx test pidrang-cli.

Done when

  • The sentence no longer claims the app has routes when it may not.
  • The tests pass.
Dominant language
TypeScript
Stars
2
Forks
2
Avg merge
9h 17m
Merged PRs (30d)
48

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pidrang/pidrang

All issues in pidrang/pidrang

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.