Skip to content

chore: updated starter templates#785

Merged
petermasking merged 2 commits into
mainfrom
783-update-starter-templates
Jun 2, 2026
Merged

chore: updated starter templates#785
petermasking merged 2 commits into
mainfrom
783-update-starter-templates

Conversation

@basmasking

Copy link
Copy Markdown
Member

Fixes #783

Changes proposed in this pull request:

  • templates updated to work with latest version of jitar
  • renaming files not needed anymore and removed from the init manager.

@MaskingTechnology/jitar

@basmasking basmasking requested a review from petermasking as a code owner May 30, 2026 20:44
@basmasking basmasking linked an issue May 30, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 663191fc-5406-453e-aef7-45f5c02dd065

📥 Commits

Reviewing files that changed from the base of the PR and between 2cef038 and ccaf959.

📒 Files selected for processing (2)
  • packages/init/templates/react/package.json
  • packages/init/templates/vue/package.json

Summary by CodeRabbit

  • Refactor

    • Reorganized backend, React, and Vue starter templates and removed automatic renaming of underscore-prefixed files during project initialization.
    • Switched template build output from dist to build.
  • New Features

    • Added ready-to-use React and Vue starter templates (dev/build scripts, Vite configs, and standalone service settings).
    • Added simple greeting helper in Vue template.
  • Configuration Updates

    • Updated TypeScript and build configuration defaults across templates; added assetRoot for standalone services.

Walkthrough

InitManager no longer renames underscore-prefixed template files. Backend, React, and Vue starter templates are restructured: jitar/source paths move from ./dist to ./build, new app-scoped Vite/TypeScript configs and package templates are added, and several legacy root-level template files are removed.

Changes

Template Initialization and Configuration Refactor

Layer / File(s) Summary
InitManager underscore-file renaming removal
packages/init/src/InitManager.ts
Removes RENAME_FILES, deletes the private #renameFiles(projectName) method and its invocation in init(), and updates FS imports to only use promise-based APIs.
Backend template build configuration and dependencies
packages/init/templates/backend/_tsconfig.json, packages/init/templates/backend/jitar.json, packages/init/templates/backend/package.json, packages/init/templates/backend/src/tsconfig.json, packages/init/templates/backend/tsconfig.json
Deletes legacy backend _tsconfig.json, switches jitar.json.source to ./build, updates the backend package.json build script and dependency pins (including jitar -> ^0.11.0, rimraf -> ^6.1.3, typescript -> 5.9.3), and adds src/tsconfig.json for backend output to ../build.
React template app-specific configuration and restructuring
packages/init/templates/react/jitar.json, packages/init/templates/react/package.json, packages/init/templates/react/services/standalone.json, packages/init/templates/react/src/app/components/App.tsx, packages/init/templates/react/src/app/index.html, packages/init/templates/react/src/app/tsconfig.json, packages/init/templates/react/src/app/vite.config.ts, packages/init/templates/react/src/tsconfig.json, packages/init/templates/react/src/vite-env.d.ts, packages/init/templates/react/tsconfig.json
Adds a React starter package.json, creates app-scoped vite.config.ts and tsconfigs under src/app, updates imports and HTML entry paths, removes older root-level template files, sets jitar.json.source to ./build, and adds assetRoot: "./app" in standalone service.
Vue template app-specific configuration and restructuring
packages/init/templates/vue/jitar.json, packages/init/templates/vue/package.json, packages/init/templates/vue/services/standalone.json, packages/init/templates/vue/src/app/components/App.vue, packages/init/templates/vue/src/app/index.html, packages/init/templates/vue/src/app/tsconfig.json, packages/init/templates/vue/src/app/vite.config.ts, packages/init/templates/vue/src/domain/sayHello.js, packages/init/templates/vue/src/tsconfig.json, packages/init/templates/vue/src/vite-env.d.ts, packages/init/templates/vue/tsconfig.json
Adds a Vue starter package.json, creates app-scoped Vite and tsconfigs under src/app, introduces src/domain/sayHello.js, updates App.vue imports/asset paths and HTML entry, removes legacy root-level templates, sets jitar.json.source to ./build, and adds assetRoot: "./app" in standalone service.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • petermasking

Poem

🐰 I hopped through templates at dawn,

Changed paths where builds are drawn.
No more underscores to chase,
New configs find their place.
A tiny rabbit cheers the spawn.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: updated starter templates' is concise and clearly describes the main change of updating the starter templates, directly addressing the PR's core objective.
Description check ✅ Passed The description follows the template structure with a linked issue reference (#783), lists changes proposed, and mentions the team. All required sections are present.
Linked Issues check ✅ Passed The PR successfully updates all starter templates (backend, React, Vue) to work with the latest Jitar version without forcing the breaking change, and removes unnecessary file-renaming logic from InitManager as required by issue #783.
Out of Scope Changes check ✅ Passed All changes are in-scope: InitManager modifications remove file-renaming, backend/React/Vue templates updated for Jitar compatibility, and configuration files adjusted accordingly. No unrelated changes detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/init/src/InitManager.ts (1)

25-38: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Potential scaffold regression after removing post-copy filename normalization

After Line 37, init() only copies files. If any template still contains underscore-prefixed placeholder filenames, they will now be emitted unchanged (e.g., _tsconfig.json), which can break generated projects. Please either (1) guarantee templates contain no underscore placeholders, or (2) add a fail-fast validation in init when such files are detected.

#!/bin/bash
set -euo pipefail

echo "Checking for underscore-prefixed files in starter templates..."
fd -t f '^_' packages/init/templates || true

echo
echo "Expected result: no files listed."
echo "If files are listed, InitManager now copies them verbatim and scaffold output may be incorrect."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/init/src/InitManager.ts` around lines 25 - 38, The init method
currently only calls `#verifyTemplateName` and `#copyTemplate`, so templates
containing underscore-prefixed placeholder filenames (e.g., _tsconfig.json) will
be copied verbatim; add a fail-fast validation: create a private helper (e.g.,
`#ensureNoUnderscorePlaceholders`(templateName)) and call it in init after
`#verifyTemplateName` and before `#copyTemplate`; the helper should locate the
template directory using the same resolution logic as `#copyTemplate`, recursively
scan files, and if any file basename startsWith('_') throw a clear error (e.g.,
InvalidTemplatePlaceholder or a descriptive Error) that includes the offending
path and templateName so init fails fast instead of producing broken scaffolds.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/init/templates/backend/package.json`:
- Around line 6-17: The package.json currently pins "jitar": "^0.11.0" which is
not published and will break npm install; update the dependency declaration for
jitar in package.json (the "dependencies" block) to a resolvable range such as
"0.10.6" or a semver range that includes the latest published release (e.g.
">=0.10.6 <0.11.0") so npm install succeeds while keeping the existing npm
scripts ("build", "standalone", "gateway", "hi", "hello") intact.

In `@packages/init/templates/vue/src/app/vite.config.ts`:
- Line 9: The jitarUrl constant in vite.config.ts currently uses
'http://localhost:3000', which differs from the standalone service origin;
update the jitarUrl value to use 'http://127.0.0.1:3000' so it matches the
standalone service origin and avoids cross-origin/credential mismatches; locate
the jitarUrl entry in the export and replace the host portion accordingly.

---

Outside diff comments:
In `@packages/init/src/InitManager.ts`:
- Around line 25-38: The init method currently only calls `#verifyTemplateName`
and `#copyTemplate`, so templates containing underscore-prefixed placeholder
filenames (e.g., _tsconfig.json) will be copied verbatim; add a fail-fast
validation: create a private helper (e.g.,
`#ensureNoUnderscorePlaceholders`(templateName)) and call it in init after
`#verifyTemplateName` and before `#copyTemplate`; the helper should locate the
template directory using the same resolution logic as `#copyTemplate`, recursively
scan files, and if any file basename startsWith('_') throw a clear error (e.g.,
InvalidTemplatePlaceholder or a descriptive Error) that includes the offending
path and templateName so init fails fast instead of producing broken scaffolds.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: fc0ad633-b49a-4781-9ab5-6bc66d17559c

📥 Commits

Reviewing files that changed from the base of the PR and between 6f2043e and 2cef038.

⛔ Files ignored due to path filters (8)
  • packages/init/templates/react/public/vite.svg is excluded by !**/*.svg
  • packages/init/templates/react/src/app/assets/jitar.svg is excluded by !**/*.svg
  • packages/init/templates/react/src/app/assets/react.svg is excluded by !**/*.svg
  • packages/init/templates/react/src/app/public/vite.svg is excluded by !**/*.svg
  • packages/init/templates/vue/public/vite.svg is excluded by !**/*.svg
  • packages/init/templates/vue/src/app/assets/jitar.svg is excluded by !**/*.svg
  • packages/init/templates/vue/src/app/assets/vue.svg is excluded by !**/*.svg
  • packages/init/templates/vue/src/app/public/vite.svg is excluded by !**/*.svg
📒 Files selected for processing (43)
  • packages/init/src/InitManager.ts
  • packages/init/templates/backend/.gitignore
  • packages/init/templates/backend/_tsconfig.json
  • packages/init/templates/backend/jitar.json
  • packages/init/templates/backend/package.json
  • packages/init/templates/backend/src/tsconfig.json
  • packages/init/templates/backend/tsconfig.json
  • packages/init/templates/react/.gitignore
  • packages/init/templates/react/_package.json
  • packages/init/templates/react/_tsconfig.json
  • packages/init/templates/react/_vite.config.ts
  • packages/init/templates/react/jitar.json
  • packages/init/templates/react/package.json
  • packages/init/templates/react/services/standalone.json
  • packages/init/templates/react/src/app/components/App.css
  • packages/init/templates/react/src/app/components/App.tsx
  • packages/init/templates/react/src/app/components/index.css
  • packages/init/templates/react/src/app/components/main.tsx
  • packages/init/templates/react/src/app/index.html
  • packages/init/templates/react/src/app/tsconfig.json
  • packages/init/templates/react/src/app/vite.config.ts
  • packages/init/templates/react/src/tsconfig.json
  • packages/init/templates/react/src/vite-env.d.ts
  • packages/init/templates/react/tsconfig.build.json
  • packages/init/templates/react/tsconfig.json
  • packages/init/templates/vue/.gitignore
  • packages/init/templates/vue/_package.json
  • packages/init/templates/vue/_tsconfig.json
  • packages/init/templates/vue/_vite.config.ts
  • packages/init/templates/vue/jitar.json
  • packages/init/templates/vue/package.json
  • packages/init/templates/vue/services/standalone.json
  • packages/init/templates/vue/src/app/components/App.vue
  • packages/init/templates/vue/src/app/components/main.ts
  • packages/init/templates/vue/src/app/components/style.css
  • packages/init/templates/vue/src/app/index.html
  • packages/init/templates/vue/src/app/tsconfig.json
  • packages/init/templates/vue/src/app/vite.config.ts
  • packages/init/templates/vue/src/domain/sayHello.js
  • packages/init/templates/vue/src/tsconfig.json
  • packages/init/templates/vue/src/vite-env.d.ts
  • packages/init/templates/vue/tsconfig.build.json
  • packages/init/templates/vue/tsconfig.json
💤 Files with no reviewable changes (11)
  • packages/init/templates/react/src/vite-env.d.ts
  • packages/init/templates/react/_vite.config.ts
  • packages/init/templates/vue/src/vite-env.d.ts
  • packages/init/templates/react/tsconfig.build.json
  • packages/init/templates/vue/_tsconfig.json
  • packages/init/templates/react/_tsconfig.json
  • packages/init/templates/backend/_tsconfig.json
  • packages/init/templates/vue/_vite.config.ts
  • packages/init/templates/react/_package.json
  • packages/init/templates/vue/tsconfig.build.json
  • packages/init/templates/vue/_package.json

Comment on lines +6 to +17
"build": "rimraf build dist && tsc -p src/tsconfig.json && jitar build",
"standalone": "jitar start --service=services/standalone.json",
"gateway": "jitar start --service=services/gateway.json",
"hi": "jitar start --service=services/hi.json",
"hello": "jitar start --service=services/hello.json"
},
"dependencies": {
"jitar": "^0.10.2"
"jitar": "^0.11.0"
},
"devDependencies": {
"rimraf": "^6.1.0"
"rimraf": "^6.1.3",
"typescript": "5.9.3"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Confirm the pinned versions resolve on the npm registry
for pkg in "rimraf" "typescript" "jitar"; do
  echo "== $pkg available versions (tail) =="
  curl -s "https://registry.npmjs.org/$pkg" | jq -r '.versions | keys[]' | tail -20
done

Repository: MaskingTechnology/jitar

Length of output: 1997


🌐 Web query:

npm rimraf 6.1.3 version

💡 Result:

npm package rimraf version 6.1.3 was published on Feb 16, 2026 [1][2]. What changed in 6.1.3 (vs 6.1.2): the repo notes the 6.1.3 release on 2026-02-16 and shows a small package.json/package-lock.json update (dependency and TypeScript/@types updates), plus formatting/docs safety text changes [3]. The exact published version number in package.json and package-lock.json is updated from 6.1.2 to 6.1.3 [2]. Install it: npm install rimraf@6.1.3 [1] CLI supports --version to display its version [4].

Citations:


🌐 Web query:

npm typescript 5.9.3 version

💡 Result:

npm typescript 5.9.3 corresponds to the TypeScript compiler release 5.9.3. The official TypeScript repo release tag v5.9.3 is dated 2025-10-01, and the npm package version list shows 5.9.2–5.9.3 published in the Sep 2025 window; the 5.9.3 release notes announcement is linked from the tag page.

Citations:


🌐 Web query:

npm jitar 0.11.0 version

💡 Result:

The npm package “jitar” does not have version 0.11.0. The latest published version on npm for “jitar” is 0.10.6 (npm page shows latest 0.10.6), and npm’s registry version history lists versions up to 0.10.7 (no 0.11.0 entry). [1][2] If you meant a different package named similarly (e.g., “jiter” from pydantic, which has a v0.11.0 release—but that is not the npm package “jitar”). [3]

Citations:


Build script looks consistent, but jitar dependency range likely breaks npm install

  • rimraf@^6.1.3 and typescript@5.9.3 are present on npm.
  • dependencies.jitar: ^0.11.0 is not resolvable because npm’s jitar package has no 0.11.0 version (latest is 0.10.6), so the template install may fail until the npm package publishes 0.11.0 or the range is adjusted.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/init/templates/backend/package.json` around lines 6 - 17, The
package.json currently pins "jitar": "^0.11.0" which is not published and will
break npm install; update the dependency declaration for jitar in package.json
(the "dependencies" block) to a resolvable range such as "0.10.6" or a semver
range that includes the latest published release (e.g. ">=0.10.6 <0.11.0") so
npm install succeeds while keeping the existing npm scripts ("build",
"standalone", "gateway", "hi", "hello") intact.

const jitarConfig: JitarConfig = {
projectRoot: '../../',
sourceRoot: '../',
jitarUrl: 'http://localhost:3000',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use the same host as standalone service URL.

jitarUrl uses localhost while standalone uses 127.0.0.1. These are different origins in browsers and can cause credential/CORS inconsistencies in the starter setup.

Suggested change
-  jitarUrl: 'http://localhost:3000',
+  jitarUrl: 'http://127.0.0.1:3000',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
jitarUrl: 'http://localhost:3000',
jitarUrl: 'http://127.0.0.1:3000',
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/init/templates/vue/src/app/vite.config.ts` at line 9, The jitarUrl
constant in vite.config.ts currently uses 'http://localhost:3000', which differs
from the standalone service origin; update the jitarUrl value to use
'http://127.0.0.1:3000' so it matches the standalone service origin and avoids
cross-origin/credential mismatches; locate the jitarUrl entry in the export and
replace the host portion accordingly.

@sonarqubecloud

Copy link
Copy Markdown

@petermasking petermasking merged commit 614e059 into main Jun 2, 2026
25 checks passed
@petermasking petermasking deleted the 783-update-starter-templates branch June 2, 2026 08:50
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.

Update starter templates

2 participants