Merged
Conversation
…ontend generators, and install.sh Co-authored-by: marioserrano09 <5221275+marioserrano09@users.noreply.github.com> Agent-Logs-Url: https://github.com/dynamiatools/framework/sessions/07bbccf6-9bbf-4a03-832d-6df9a79eba92
…project configuration
…ntation feat: Add @dynamia-tools/cli — project scaffolding CLI
There was a problem hiding this comment.
Pull request overview
Adds a new TypeScript-based Node.js CLI package (@dynamia-tools/cli) to scaffold Dynamia Platform projects and refactors a fallback ModuleProvider bean into the base Spring configuration.
Changes:
- Introduces a new CLI with config-driven templates (
cli.properties), interactivenewwizard, and environment checks. - Adds backend/frontend generators with git template validation, token replacement, and backend package/class renaming.
- Moves the fallback
emptyModuleProviderbean fromDynamiaToolsWebApplicationtoDynamiaBaseConfiguration.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| platform/packages/cli/tsconfig.json | TypeScript build config for Node ESM (NodeNext). |
| platform/packages/cli/src/utils/template-repo.ts | Adds git repo/branch validation before cloning templates. |
| platform/packages/cli/src/utils/replace.ts | Implements recursive token replacement and Java package/class renaming. |
| platform/packages/cli/src/utils/logger.ts | Adds CLI-friendly logging, error codes, and git error normalization. |
| platform/packages/cli/src/utils/env.ts | Adds git/java/node environment checks for the CLI. |
| platform/packages/cli/src/utils/config.ts | Loads/parses cli.properties into a CliConfig object. |
| platform/packages/cli/src/index.ts | CLI entry point and command dispatch (currently new). |
| platform/packages/cli/src/generators/frontend.ts | Frontend template clone with Vite fallback + token replacement. |
| platform/packages/cli/src/generators/backend.ts | Backend template clone + token/package renaming. |
| platform/packages/cli/src/commands/new.ts | Interactive wizard to scaffold backend/frontend projects. |
| platform/packages/cli/package.json | Defines CLI package metadata, deps, bin entry, and Node engine requirement. |
| platform/packages/cli/package-lock.json | Locks dependency tree for npm installs. |
| platform/packages/cli/install.sh | Adds one-line bootstrap installer for toolchain + CLI. |
| platform/packages/cli/cli.properties | Centralizes template repos, versions, tokens, and feature flags. |
| platform/packages/cli/README.md | Documents CLI install/usage and template conventions. |
| platform/app/src/main/java/tools/dynamia/app/DynamiaToolsWebApplication.java | Removes fallback ModuleProvider bean from web app config. |
| platform/app/src/main/java/tools/dynamia/app/DynamiaBaseConfiguration.java | Adds fallback ModuleProvider bean when none is registered. |
Files not reviewed (1)
- platform/packages/cli/package-lock.json: Language not supported
| const TEXT_EXTENSIONS = new Set([ | ||
| '.java', '.kt', '.groovy', | ||
| '.xml', '.yml', '.yaml', '.properties', | ||
| '.md', '.txt', '.json', '.gradle', '.kts', |
| // Install Dynamia SDK packages | ||
| const sdkPkg = config.npm['sdk']?.package ?? DEFAULT_SDK_PACKAGE | ||
| const uiPkg = config.npm['ui-core']?.package ?? DEFAULT_UI_CORE_PACKAGE | ||
| await execa(pm, ['install', sdkPkg, uiPkg], { |
Comment on lines
+78
to
+84
| // Install Dynamia SDK packages | ||
| const sdkPkg = config.npm['sdk']?.package ?? DEFAULT_SDK_PACKAGE | ||
| const uiPkg = config.npm['ui-core']?.package ?? DEFAULT_UI_CORE_PACKAGE | ||
| await execa(pm, ['install', sdkPkg, uiPkg], { | ||
| cwd: targetDir, | ||
| stdio: 'inherit', | ||
| }) |
| } catch { | ||
| // ignore — use fallback | ||
| } | ||
| // Fallback from config (spring.boot.version kept as reference) |
Comment on lines
+10
to
+17
| const result = await execa('java', ['-version'], { stderr: 'pipe', stdout: 'pipe' }) | ||
| // java -version writes to stderr | ||
| const output = result.stderr + result.stdout | ||
| if (output.includes('25')) { | ||
| return true | ||
| } | ||
| warn('JDK 25 not detected. A different Java version is installed. Some features may not work as expected.') | ||
| return true // not a hard stop — just warn |
Comment on lines
+24
to
+38
| /** | ||
| * Check that Node.js >= 22 is available. | ||
| * Returns true if the requirement is satisfied. | ||
| */ | ||
| export async function checkNode(): Promise<boolean> { | ||
| try { | ||
| const result = await execa('node', ['--version'], { stdout: 'pipe' }) | ||
| const version = result.stdout.trim().replace(/^v/, '') | ||
| const majorStr = version.split('.')[0] | ||
| const major = majorStr && majorStr.length > 0 ? parseInt(majorStr, 10) : 0 | ||
| if (!isNaN(major) && major >= 22) { | ||
| return true | ||
| } | ||
| warn(`Node.js ${version} found but version >=22 is required. Please upgrade Node.js.`) | ||
| return false |
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.
No description provided.