feat(cli): harden env checks, add tests, non-interactive flags for new - #101
Merged
Merged
Conversation
- checkJava(): parse the major version out of the "version \"NN" pattern
instead of an includes('25') substring match (false-positive risk on
e.g. a JDK reporting 17.0.25).
- checkNode(): read the minimum version from cli.properties/CliConfig
instead of a hardcoded 22, matching engines.node (>=24).
- fetchSpringBootVersion: add a 4s AbortSignal timeout so a slow/dead
start.spring.io doesn't stall the wizard before the first prompt.
- Add vitest (matching sdk/ui-core/vue/microfrontend-bridge convention)
with unit tests for config.ts parsing, replace.ts (token replacement
+ Java package renaming), env.ts checks, and the new flag parser.
- dynamia new: add non-interactive flags (--name, --scaffold,
--backend-lang, --group-id, --artifact-id, --version, --description,
--frontend, --pm, --yes, --git/--no-git) so the wizard can run
unattended for scripting/CI. Any flag left unset still prompts.
- Remove stray package-lock.json (npm) -- this is a pnpm workspace and
the package was already tracked in the root pnpm-lock.yaml.
Fixes #95, #96, #97, #98, #99, #100
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UcARdenC1Sk5EVpkzboH9W
This was referenced Sep 22, 2026
Closed
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.
Closes #95, #96, #97, #98, #99, #100.
Changes
env.ts): parses the major version out of theversion "NNpattern instead of anincludes('25')substring match — avoids false positives on e.g. a JDK reporting17.0.25.env.ts): now reads the minimum version fromcli.propertiesviaCliConfiginstead of a hardcoded22, matchingpackage.json'sengines.node >=24.new.ts): added a 4sAbortSignaltimeout so a slow/deadstart.spring.iodegrades to the fallback instead of stalling the wizard.vitest(same setup assdk/ui-core/vue/microfrontend-bridge) with 31 unit tests coveringconfig.ts(properties parsing, token camelCasing, template loading),replace.ts(token replacement, Java package renaming/Application class rename, pom.xml rewriting),env.ts(mockedexeca), and the new flag parser.package.jsonnow has a realtestscript, sopnpm -r testinpublish-npm.ymlactually gates on this package instead of silently skipping it.dynamia new:--name,--scaffold,--backend-lang,--group-id,--artifact-id,--version,--description,--frontend,--pm,--yes,--git/--no-git. Any flag left unset still falls back to its interactive prompt. Verified end-to-end with a real clone oftemplate-backend-java.package-lock.json— this is a pnpm workspace and the package was already tracked in the rootpnpm-lock.yaml.Verification
pnpm run typecheck— cleanpnpm run build— cleanpnpm run test— 31/31 passingdynamia new --name smoke-test --scaffold backend --backend-lang java --group-id com.acme --artifact-id smoke-test --version 1.0.0-SNAPSHOT --yes --no-gitgenerated a correctly renamed project (SmokeTestApplication.javaundercom/acme/smoke/test).Note: base branch also depends on #93 (disables the 4 template ids without an existing repo) — that PR is separate and unmerged, this one doesn't touch
cli.properties.🤖 Generated with Claude Code
https://claude.ai/code/session_01UcARdenC1Sk5EVpkzboH9W