Skip to content

Drop the Heroku generator's dead code and refresh its USAGE - #671

Merged
tricknotes merged 1 commit into
mainfrom
generator-housekeeping
Sep 7, 2026
Merged

Drop the Heroku generator's dead code and refresh its USAGE#671
tricknotes merged 1 commit into
mainfrom
generator-housekeeping

Conversation

@tricknotes

@tricknotes tricknotes commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Housekeeping across both generators: dead code, a stale USAGE, and a missing spec.

Why

Dead code. HerokuGenerator#app_paths had no callers — neither the generator nor package.json.erb referenced it — so it described a shape of the configuration that nothing depended on.

USAGE drift. It omitted the yarn.lock that identify_as_yarn_project writes for a Yarn project, and named SKIP_EMBER without saying what unsetting it accomplishes, leaving a reader to guess why the command is in the list at all.

No spec. ember:init had no coverage at all, so nothing caught a broken initializer template.

What changed

  • Removed EmberCli::HerokuGenerator#app_paths.
  • Rewrote lib/generators/ember/heroku/USAGE: lists yarn.lock, explains SKIP_EMBER, and notes that the generator should be re-run when an application is added.
  • Added spec/generators/ember/init/init_generator_spec.rb.

No public API changes, so no CHANGELOG entry.

Out of scope

  • The generator classes stay in the EmberCli namespace with their explicit namespace "ember:heroku" / namespace "ember:init" calls. Rails' own convention would infer them from lib/generators/ember/... as Ember::*, but that means introducing a new top-level namespace, which is a deliberate call for the maintainer rather than housekeeping.
  • ember:init still does not add mount_ember_app to config/routes.rb — the README documents that as a manual step. Changing it alters what the generator does to a project, so it is left for a separate discussion.

Verification

$ bin/rspec spec/generators
6 examples, 0 failures

Rails::Generators.find_by_namespace still resolves ember:herokuEmberCli::HerokuGenerator and ember:initEmberCli::InitGenerator.

Full spec/lib also passes here except EmberCli::App#test exits with exit status of 0, which fails on main in this container too — ember test reports Launcher Chrome not found, unrelated to this change.

🤖 Generated with Claude Code

https://claude.ai/code/session_014rAfkAVGVifbaEoTVeT66u

`HerokuGenerator#app_paths` had no callers —
neither the generator nor `package.json.erb` referenced it —
so it described a shape of the configuration that nothing depended on.

The Heroku generator's `USAGE` had drifted from what the generator does:
it omitted the `yarn.lock` written for a Yarn project,
and named `SKIP_EMBER` without saying what unsetting it accomplishes,
leaving a reader to guess why the command is in the list at all.

`ember:init` had no spec, so nothing caught a broken initializer template.
Cover the file it writes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014rAfkAVGVifbaEoTVeT66u
@tricknotes
tricknotes force-pushed the generator-housekeeping branch from 8a6662a to 64ab515 Compare September 7, 2026 12:08
@tricknotes tricknotes changed the title Let the generators say who they are through their location Drop the Heroku generator's dead code and refresh its USAGE Sep 7, 2026
@tricknotes
tricknotes marked this pull request as ready for review September 7, 2026 12:13
@tricknotes
tricknotes merged commit b5eb8b3 into main Sep 7, 2026
12 checks passed
@tricknotes
tricknotes deleted the generator-housekeeping branch September 7, 2026 12:14
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.

2 participants