Repository navigation
Make rails new with core_setup run unattended and produce a working app - #215
Merged
Merged
Conversation
Dir['lib/**/*'] skips dotfiles, so the published gem had no .rubocop.yml, .rubocop/cops, .rspec, or .rspec_parallel. The generators that copy them raised partway, skipping later steps such as the parallel_tests database.yml edit, while still exiting successfully. The github generator's instructions symlink pointed outside the gem and did not survive installation; it now copies from the packaged .github/instructions. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Yarn 4's yarn init replaces an existing package.json with only name and packageManager. The webpack generator triggers Yarn setup after Rails has written package.json, so new apps lost the build script, type: module, and the Hotwire packages. yarn set version already pins packageManager. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
sentry-ruby 7 removed the option (structured logging is on by default), so the generated initializer raised NoMethodError at boot. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
core_setup and optics:all did not accept --material and friends, so the icons generator always prompted. Run without a terminal (e.g. from a rails new template) the prompt's limited_to loop spins forever on EOF. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The copy was dropped in #195, leaving the template unused. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Offer to create the GitHub repo when there is no origin. Drop two stale readiness checks: the webpack config no longer imports terser-webpack-plugin, and Rails merges DATABASE_URL into the primary config without a url: key. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Thor's ask with limited_to loops forever on EOF, so running optics:icons without a terminal (e.g. from a rails new template) hung. ask_or_default on GeneratorBase only prompts when stdin is a TTY. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ensure_yarn invoked yarn:setup with empty options, dropping --pretend, and Yarn#yes! shelled out through Open3 directly, so a pretend run still pinned Yarn and wrote .yarnrc.yml, package.json, and .gitignore. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
OutlawAndy
force-pushed
the
smooth-new-app
branch
from
October 14, 2026 18:06
e68f717 to
50f9dd9
Compare
Contributor
|
Heads up, the PR description is now out of date: it says the |
wesrich
approved these changes
Oct 14, 2026
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.
Why?
Generating a new app with
rails new --template(which runsrolemodel:core_setup --material) hung, and then produced an app that wouldn't build or boot. Every cause traced back to this gem. Several generators also failed partway while still exiting 0, so the damage was easy to miss.What Changed
Dir['lib/**/*']skips dotfiles, so the published gem had no.rubocop.yml,.rubocop/cops,.rspec, or.rspec_parallel. The generators that copy them raised partway. For example,testing:parallel_testsnever reached itsdatabase.ymlTEST_ENV_NUMBERedit, so every parallel process shared one test database.instructionssymlink pointed outside the gem and didn't survive installation, so the generator raised partway. The instructions were stale, so rather than package them, the generator no longer installs.github/instructions, and the instructions and symlink are deleted.package.jsonwhen setting up Yarn. Yarn 4'syarn initreplaces an existingpackage.jsonwith onlynameandpackageManager. The webpack generator triggers Yarn setup after Rails has writtenpackage.json, so new apps lost thebuildscript,type: module, and the Hotwire packages.yarn set version stablealready pinspackageManager, soyarn initnow runs only when there is nopackage.json.strip-sourcemap-loaderto the webpack generator's dev dependencies.webpack.config.jsuses it.config.enable_logsfrom the Sentry initializer. sentry-ruby 7 removed it, since structured logging is now on by default, so the generated app raisedNoMethodErrorat boot.rails newtemplate, Thor'slimited_toprompt treats end of input as a wrong answer and loops forever at 100% CPU.GeneratorBase#ask_or_defaultprompts only when stdin is a terminal and otherwise returns the default.optics:iconsuses it, so it installsmaterialwhen nobody can answer.core_setupandoptics:allnow accept the icons generator's flags (--material,--phosphor, …) and pass them tooptics:icons, so a template can still choose a non-default library.force: true).--pretendwhen setting up Yarn.ensure_yarninvokedyarn:setupwith empty options, which dropped--pretend.Yarn#yes!also ran commands throughOpen3directly. So a pretend run still pinned Yarn and wrote.yarnrc.yml,package.json, and.gitignore..rspecfrom the rspec generator. Change the testing:all prompt to a class option flag (off by default) #195 dropped the copy.origin, withgh authnow checked first.terser-webpack-plugin.DATABASE_URLinto the primary database config without aurl:key.Pre-merge checklist
core_setup,optics,github)Notes
How this was verified:
rails new … --templateagainst this branch, with stdin from/dev/null, finished unattended. The generated app:.rspec,.rspec_parallel,.rubocop.yml,.rubocop/cops, and the github generator's workflows and PR templatebuildscript,type: module, and the Hotwire packagesyarn build,zeitwerk:check, andrspecNot in this PR: a freshly generated app still fails its own
rubocop. Most offenses are in Rails-generated files (quotes, frozen string literals). The rest areBundler/DuplicatedGroup, becausegem_groupappends a new block on every call. Fixing that takes a finalrubocop -Aincore_setupplusgem_groupconsolidation, which would also make deploy-app's Gemfile-cleanup phase unnecessary. Proposing that separately.Please don't commit version changes within your PR. Versioning, releasing, and changelog entries are managed through the Release workflow.
Screenshots
N/A — no UI changes
🤖 Generated with Claude Code