Skip to content

feat: Add @dynamia-tools/cli — project scaffolding CLI#57

Merged
marioserrano09 merged 24 commits intovue-supportfrom
copilot/add-cli-tool-implementation
Apr 19, 2026
Merged

feat: Add @dynamia-tools/cli — project scaffolding CLI#57
marioserrano09 merged 24 commits intovue-supportfrom
copilot/add-cli-tool-implementation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 22, 2026

Adds a new Node.js CLI package at platform/packages/cli/ that scaffolds Dynamia Platform projects by cloning GitHub templates and performing token replacement. Published as @dynamia-tools/cli.

Package structure

platform/packages/cli/
├── cli.properties          ← single source of truth (versions, repos, tokens)
├── install.sh              ← curl-installable bootstrap (JDK 25 + Node.js + CLI)
├── package.json            ← ESM, bin: dynamia
└── src/
    ├── index.ts            ← entry point
    ├── commands/new.ts     ← 7-step interactive wizard
    ├── generators/
    │   ├── backend.ts      ← git clone + package rename
    │   └── frontend.ts     ← git clone + Vite fallback
    └── utils/
        ├── config.ts       ← cli.properties → CliConfig
        ├── env.ts          ← git/java/node checks
        ├── replace.ts      ← recursive token replacement + Java dir rename
        └── logger.ts       ← spinner, colors, banner

Key design decisions

  • cli.properties is the only config file — no versions, URLs, or token strings hardcoded in TypeScript. Adding a new template or bumping a version is a one-line properties edit.
  • git is mandatorycheckGit() runs before any prompts; missing git exits immediately with install instructions.
  • Backend package renaming — after clone, com.example.demo source trees are moved to the computed groupId.artifactId path, all token placeholders replaced in .java/.kt/.xml/.yml/…, and DemoApplication.* renamed to match the artifact ID.
  • Vite fallback is silent — if the frontend template clone fails and vite.fallback.enabled=true, a yellow warning is printed and Vite scaffolding proceeds without re-prompting.
  • ESM throughout"type": "module", all imports use .js extension (NodeNext resolution).

dynamia new wizard flow

Project name:            my-erp
What to scaffold?        Backend + Frontend
Backend language:        Java
Group ID:                com.mycompany
Artifact ID:             my-erp
Version:                 1.0.0-SNAPSHOT
Frontend framework:      Vue 3
Package manager:         pnpm
Generate project? (Y/n)

Produces:

my-erp/
├── backend/   (Java · Spring Boot · Dynamia Tools — com.mycompany.my.erp)
└── frontend/  (Vue 3 · Vite · @dynamia-tools/vue)

install.sh

Single-command bootstrap for Linux (apt/dnf/pacman) and macOS (brew):

curl -fsSL https://get.dynamia.tools | bash

Installs prerequisites, JDK 25 via SDKMAN, Node.js LTS via fnm, patches shell profile idempotently, then runs npm install -g @dynamia-tools/cli && dynamia new.


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

…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
Copilot AI changed the title [WIP] Add Node.js CLI tool for Dynamia Tools feat: Add @dynamia-tools/cli — project scaffolding CLI Mar 22, 2026
Copilot AI requested a review from marioserrano09 March 22, 2026 04:19
Feat: Improve Saas Accounts payments processors
@marioserrano09 marioserrano09 marked this pull request as ready for review April 19, 2026 23:04
Copilot AI review requested due to automatic review settings April 19, 2026 23:04
@marioserrano09 marioserrano09 merged commit 7ea7745 into vue-support Apr 19, 2026
1 check passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new @dynamia-tools/cli Node.js scaffolding CLI to generate Dynamia Platform backend/frontend projects from Git templates (with token replacement), while also bumping the monorepo release version and updating several platform/extension components.

Changes:

  • Introduces platform/packages/cli (interactive dynamia new, template validation, token replacement, bootstrap installer).
  • Bumps framework/modules/packages to 26.4.1 and updates root dependency versions (Spring Boot, ZK, AWS, Swagger).
  • Extends SaaS payment-provider domain/UI descriptors and refactors a few platform components (e.g., ProviderPickerBox, default ModuleProvider bean placement).

Reviewed changes

Copilot reviewed 82 out of 84 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
themes/theme-dynamical/sources/pom.xml Bump parent/dependency versions to 26.4.1
themes/pom.xml Bump parent version to 26.4.1
pom.xml Bump root version + dependency version properties
platform/ui/zk/src/main/java/tools/dynamia/zk/ui/ProviderPickerBox.java Refactor renderer/selection logic; add Javadoc; minor API tweaks
platform/ui/zk/pom.xml Bump module + internal deps to 26.4.1
platform/ui/ui-shared/pom.xml Bump module + internal deps to 26.4.1
platform/starters/zk-starter/pom.xml Bump starter + internal deps to 26.4.1
platform/packages/vue/package.json Bump version + formatting cleanup
platform/packages/ui-core/package.json Bump version + formatting cleanup
platform/packages/sdk/package.json Bump version to 26.4.1
platform/packages/sdk/package-lock.json Align lock version to 26.4.1
platform/packages/package.json Workspace package version update
platform/packages/cli/tsconfig.json New CLI TS config (NodeNext, strict, emit types)
platform/packages/cli/src/utils/template-repo.ts New helper: validate repo + branch via git
platform/packages/cli/src/utils/replace.ts New helper: token replacement + Java package/class renames
platform/packages/cli/src/utils/logger.ts New helper: banner, spinner, error codes, friendly git errors
platform/packages/cli/src/utils/env.ts New helper: git/java/node environment checks
platform/packages/cli/src/utils/config.ts New helper: parse/load cli.properties into typed config
platform/packages/cli/src/index.ts CLI entrypoint + command dispatch (new)
platform/packages/cli/src/generators/frontend.ts Frontend generation (clone template; Vite fallback)
platform/packages/cli/src/generators/backend.ts Backend generation (clone template; token/package rename)
platform/packages/cli/src/commands/new.ts dynamia new interactive wizard flow
platform/packages/cli/package.json New published package metadata, bin, deps, engines
platform/packages/cli/package-lock.json New lockfile for CLI dependencies
platform/packages/cli/install.sh New curl-installable bootstrap installer script
platform/packages/cli/cli.properties New single-source CLI config (versions/repos/tokens)
platform/packages/cli/README.md New CLI documentation and conventions
platform/core/web/pom.xml Bump module + internal deps to 26.4.1
platform/core/viewers/pom.xml Bump module + internal deps to 26.4.1
platform/core/templates/pom.xml Bump module + internal deps to 26.4.1
platform/core/reports/pom.xml Bump module to 26.4.1
platform/core/navigation/pom.xml Bump module + internal deps to 26.4.1
platform/core/io/pom.xml Bump module to 26.4.1
platform/core/integration/pom.xml Bump module + internal deps to 26.4.1
platform/core/domain/pom.xml Bump module to 26.4.1
platform/core/domain-jpa/pom.xml Bump module + internal deps to 26.4.1
platform/core/crud/pom.xml Bump module + internal deps to 26.4.1
platform/core/commons/pom.xml Bump module to 26.4.1
platform/core/actions/pom.xml Bump module + internal deps to 26.4.1
platform/app/src/main/java/tools/dynamia/app/DynamiaToolsWebApplication.java Remove default ModuleProvider bean from app class
platform/app/src/main/java/tools/dynamia/app/DynamiaBaseConfiguration.java Add default ModuleProvider bean in base configuration
platform/app/pom.xml Bump module + internal deps to 26.4.1
extensions/security/sources/ui/pom.xml Bump module + internal deps to 26.4.1
extensions/security/sources/pom.xml Bump parent version to 26.4.1
extensions/security/sources/core/pom.xml Bump module + internal deps to 26.4.1
extensions/saas/sources/ui/src/main/resources/META-INF/descriptors/AccountRegionTable.yml Add paymentProvider column
extensions/saas/sources/ui/src/main/resources/META-INF/descriptors/AccountRegionForm.yml Adjust layout columns
extensions/saas/sources/ui/src/main/resources/META-INF/descriptors/AccountPaymentProviderTable.yml Remove serviceURL from table
extensions/saas/sources/ui/src/main/resources/META-INF/descriptors/AccountPaymentProviderForm.yml Add new secrets/extra fields; regroup layout
extensions/saas/sources/ui/src/main/resources/META-INF/descriptors/AccountForm.yml Add customPaymentProvider field to group
extensions/saas/sources/ui/pom.xml Bump module + internal deps to 26.4.1
extensions/saas/sources/remote/pom.xml Bump module + internal deps to 26.4.1
extensions/saas/sources/pom.xml Bump parent version to 26.4.1
extensions/saas/sources/jpa/pom.xml Bump module + internal deps to 26.4.1
extensions/saas/sources/core/src/main/java/tools/dynamia/modules/saas/domain/AccountPaymentProvider.java Add integrity/webCheckout secrets + extra fields
extensions/saas/sources/core/src/main/java/tools/dynamia/modules/saas/domain/Account.java Add customPaymentProvider relationship + accessors
extensions/saas/sources/core/src/main/java/tools/dynamia/modules/saas/AccountPaymentProcessor.java Adjust interface (extra label defaults)
extensions/saas/sources/core/pom.xml Bump module + internal deps to 26.4.1
extensions/saas/sources/api/pom.xml Bump module + internal deps to 26.4.1
extensions/saas/packages/saas-sdk/package.json Bump version to 26.4.1
extensions/reports/sources/ui/pom.xml Bump versions; use swagger.version property
extensions/reports/sources/pom.xml Bump parent version to 26.4.1
extensions/reports/sources/core/pom.xml Bump module + internal deps to 26.4.1
extensions/reports/sources/api/pom.xml Bump module to 26.4.1
extensions/reports/packages/reports-sdk/package.json Bump version to 26.4.1
extensions/pom.xml Bump parent version to 26.4.1
extensions/finances/sources/pom.xml Bump parent version to 26.4.1
extensions/finances/sources/api/pom.xml Bump module to 26.4.1
extensions/file-importer/sources/ui/pom.xml Bump module + internal deps to 26.4.1
extensions/file-importer/sources/pom.xml Bump parent version to 26.4.1
extensions/file-importer/sources/core/pom.xml Bump module + internal deps to 26.4.1
extensions/entity-files/sources/ui/pom.xml Bump module + internal deps to 26.4.1
extensions/entity-files/sources/s3/pom.xml Bump module + internal deps to 26.4.1
extensions/entity-files/sources/pom.xml Bump parent version to 26.4.1
extensions/entity-files/sources/core/pom.xml Bump module + internal deps to 26.4.1
extensions/entity-files/packages/files-sdk/package.json Bump version to 26.4.1
extensions/email-sms/sources/ui/pom.xml Bump module + internal deps to 26.4.1
extensions/email-sms/sources/pom.xml Bump parent version to 26.4.1
extensions/email-sms/sources/core/pom.xml Bump module + internal deps to 26.4.1
extensions/dashboard/sources/pom.xml Bump module + internal deps to 26.4.1
examples/demo-zk-books/pom.xml Update example tools.version property
bump-version.sh Add helper script to bump pnpm + Maven versions
README.md Update docs to reflect new versioning/release version
.github/workflows/publish-npm.yml Adjust pnpm setup step configuration
Files not reviewed (2)
  • platform/packages/cli/package-lock.json: Language not supported
  • platform/packages/sdk/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)

extensions/saas/sources/core/src/main/java/tools/dynamia/modules/saas/AccountPaymentProcessor.java:7

  • Javadoc says this interface is for “processing account payments”, but the processing method was removed and only metadata/label getters remain. Update the Javadoc to reflect the current contract (or restore the processing API if it’s still required).
/**
 * Basic API to implement processing account payments. You should implement
 * your own payment processor and register it using spring annotations
 * registry.
 */


configuration:
fields: [ locale, timeZone,skin, maxUsers,statusDescription,uuid,instanceUuid,creationDate,remote,autoInit,requiredInstanceUuid,redirect,templateAccount ]
fields: [ locale, timeZone,skin, maxUsers,statusDescription,uuid,instanceUuid,creationDate,customPaymentProvider,remote,autoInit,requiredInstanceUuid,redirect,templateAccount, ]
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline YAML sequence has a trailing comma before the closing bracket, which is invalid YAML in many parsers and can break descriptor loading. Remove the trailing comma (and consider adding spaces after commas for readability).

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node.js version check is inconsistent with the CLI’s declared requirement (package.json engines >=24, cli.properties node.minimum.version=24, README says 24). checkNode currently accepts >=22; align it with the configured minimum (ideally read from cli.properties/config) so users get accurate guidance.

Copilot uses AI. Check for mistakes.
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',
})
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vite fallback installs packages using yarn install <pkg> / yarn install <pkg1> <pkg2>, which Yarn does not support (it should be yarn add). This will make the fallback path fail for Yarn users; branch on packageManager and use the correct add/install command per tool.

Copilot uses AI. Check for mistakes.
Comment on lines +144 to +146
replacements['<dynamia.version>26.4.1</dynamia.version>'] = `<dynamia.version>${dynamiaVersion}</dynamia.version>`
replacements['<version>4.0.5</version>'] = `<version>${springBootVersion}</version>`
replacements['<version>4.0.5.RELEASE</version>'] = `<version>${springBootVersion}</version>`
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file hardcodes specific framework versions (e.g. 26.4.1 and 4.0.5) in the replacement fallbacks, which contradicts the PR’s stated design goal that versions/URLs/tokens live only in cli.properties. Consider deriving these fallback match strings from config (or avoiding version-specific match strings) so bumps remain a properties-only change.

Copilot uses AI. Check for mistakes.
{
"name": "@dynamia-tools/platform-packages",
"version": "26.3.2",
"version": "26.4.0",
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workspace package version is set to 26.4.0 while the rest of the PR bumps packages to 26.4.1. This inconsistency can confuse tooling and release automation; align this version with the release version used elsewhere.

Copilot uses AI. Check for mistakes.
<maven.build.timestamp.format>yyyyMMdd</maven.build.timestamp.format>

<tools.version>26.3.2</tools.version>
<tools.version>26.4.0</tools.version>
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example project still references tools.version 26.4.0, but the repository version is being bumped to 26.4.1. Update this property so the demo stays aligned with the released BOM/artifacts.

Suggested change
<tools.version>26.4.0</tools.version>
<tools.version>26.4.1</tools.version>

Copilot uses AI. Check for mistakes.
Comment thread README.md
Comment on lines +19 to 22
Starting with version **26.4.1**, Dynamia Platform adopts **Calendar Versioning (CalVer)** with the format `YY.MM.MINOR`. This means:
- **All modules share the same version**: Core, extensions, starters, themes—everything is released together
- **26.4.0** = First release of February 2026 (Year 26, Month 02, Release 0)
- **26.4.1** = First release of February 2026 (Year 26, Month 02, Release 0)
- **26.2.1** = Second release of February 2026
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CalVer explanation is internally inconsistent: it states 26.4.1 is the first February 2026 release and calls it “Release 0”. With YY.MM.MINOR, the first release for a month should typically be .0; either adjust the examples/text or update the version referenced here.

Copilot uses AI. Check for mistakes.
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.

3 participants