feat(nx-plugin): add git initialization to workspace generator with fallback for missing git#304
Conversation
…allback for missing git
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds automatic git initialization to scaffolding (CLI and NX generator), refines Docker Compose templates with selective rebuild notes and Redis persistence, updates scaffolded E2E test and file I/O usage, and documents TypeScript-typed SDK decorators with compile-time type-safety notes. Changes
Sequence Diagram(s)sequenceDiagram
participant CLI as Scaffold CLI
participant FS as File System (write templates)
participant Installer as installPackagesTask
participant Git as system git (execSync)
CLI->>FS: create project files (README, docker-compose, e2e test)
alt skipInstall == false
CLI->>Installer: install packages
Installer-->>CLI: install done
else skipInstall == true
Note over CLI,Installer: skip installations
end
CLI->>Git: run `git init` (if !skipGit)
CLI->>Git: run `git add -A`
CLI->>Git: run `git commit -m "Initial commit"`
Git-->>CLI: success or throws (caught, silently skipped)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
docs/frontmcp/sdk-reference/decorators/resource.mdx (1)
34-39: Consider using a section header for consistency.Similar to the
@Promptdocumentation, this uses inline paragraphs for type safety information instead of a## Type Safetysection header like@Tool,@Job, and@Agentuse. Consider aligning the format for consistency across decorator documentation.📝 Suggested formatting
function Resource(opts: ResourceMetadata): TypedClassDecorator-The
@Resourcedecorator validates at compile time that the decorated class extendsResourceContext. Using it on a plain class produces a descriptive compile error.-The same applies to
@ResourceTemplate.
+## Type Safety
+
+The@Resourcedecorator validates at compile time that the decorated class extendsResourceContext. Using it on a plain class produces a descriptive compile error.
+
+The same applies to@ResourceTemplate.Configuration Options
</details> <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In
@docs/frontmcp/sdk-reference/decorators/resource.mdxaround lines 34 - 39,
Add a "## Type Safety" section header above the paragraphs describing
type-checking for the decorators and move the two sentences about compile-time
validation under that header; specifically update the documentation around the
Resource declaration (function Resource(opts: ResourceMetadata):
TypedClassDecorator) so the lines about "@resource" and "@ResourceTemplate"
validation are grouped under a new "## Type Safety" header for consistency with
other decorator docs.</details> </blockquote></details> <details> <summary>docs/frontmcp/sdk-reference/decorators/prompt.mdx (1)</summary><blockquote> `43-47`: **Consider using a section header for consistency.** Other decorator docs (`@Job`, `@Tool`, `@Agent`) use a `## Type Safety` section header, but here the type safety information is an inline paragraph. For consistency across the SDK reference documentation, consider converting this to a proper section. <details> <summary>📝 Suggested formatting</summary> ```diff function Prompt(opts: PromptMetadata): TypedClassDecorator-The
@Promptdecorator validates at compile time that the decorated class extendsPromptContext. Using it on a plain class produces a descriptive compile error.
+## Type Safety
+
+The@Promptdecorator validates at compile time that the decorated class extendsPromptContext. Using it on a plain class produces a descriptive compile error.Configuration Options
</details> <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In
@docs/frontmcp/sdk-reference/decorators/prompt.mdxaround lines 43 - 47, Add
a "## Type Safety" section header above the existing sentence about compile-time
validation for the@Promptdecorator so it matches the other decorator docs
(@Job,@Tool,@Agent); update the block immediately after the function signature
function Prompt(opts: PromptMetadata): TypedClassDecoratorto replace the
inline paragraph aboutPromptContextwith a titled "## Type Safety" paragraph
that states "The@Promptdecorator validates at compile time that the
decorated class extendsPromptContext. Using it on a plain class produces a
descriptive compile error."</details> </blockquote></details> <details> <summary>libs/cli/src/commands/scaffold/create.ts (1)</summary><blockquote> `3-3`: **Consider using `@frontmcp/utils` for file operations.** The direct import from `fs` conflicts with the coding guideline requiring `@frontmcp/utils` for file system operations. Line 5 already imports utilities like `stat` from `@frontmcp/utils`. The `fsp.writeFile` on line 133 and `fsp.stat` on line 1523 could potentially use the utilities already imported. <details> <summary>Suggested refactor</summary> ```diff -import { promises as fsp } from 'fs';Then update usages:
- Line 133: Check if
@frontmcp/utilsprovides awriteFilethat accepts the same signature, or use the already-imported utilities- Line 1523: The
statfunction is already imported from@frontmcp/utilson line 5As per coding guidelines: "Use
@frontmcp/utilsfor all file system operations. Do NOT usefs/promisesornode:fsdirectly."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@libs/cli/src/commands/scaffold/create.ts` at line 3, Replace direct use of fs promises with the project's file utilities: remove the "import { promises as fsp } from 'fs'" and switch calls that use fsp.writeFile to the writeFile helper from `@frontmcp/utils` (or the equivalent already-exported utility), and ensure any fsp.stat calls are replaced by the already-imported stat function; update all references of fsp.writeFile and fsp.stat in this file (e.g., in create.ts) to call the `@frontmcp/utils` writeFile/stat helpers so the file I/O follows the coding guideline.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/frontmcp/sdk-reference/decorators/tool.mdx`:
- Around line 46-51: The code example for class BadTool uses the invalid
TypeScript token "..." inside the async execute method; replace the "..." with a
valid placeholder (e.g., a single-line comment or a minimal valid statement) and
ensure the method signature on BadTool.execute matches the inputSchema type
shown in the `@Tool` decorator; update the execute method body in the BadTool
class (method name: execute, decorator: `@Tool`) to a syntactically valid
placeholder implementation that also demonstrates the type mismatch (or corrects
it) so the snippet compiles.
---
Nitpick comments:
In `@docs/frontmcp/sdk-reference/decorators/prompt.mdx`:
- Around line 43-47: Add a "## Type Safety" section header above the existing
sentence about compile-time validation for the `@Prompt` decorator so it matches
the other decorator docs (`@Job`, `@Tool`, `@Agent`); update the block immediately
after the function signature `function Prompt(opts: PromptMetadata):
TypedClassDecorator` to replace the inline paragraph about `PromptContext` with
a titled "## Type Safety" paragraph that states "The `@Prompt` decorator
validates at compile time that the decorated class extends `PromptContext`.
Using it on a plain class produces a descriptive compile error."
In `@docs/frontmcp/sdk-reference/decorators/resource.mdx`:
- Around line 34-39: Add a "## Type Safety" section header above the paragraphs
describing type-checking for the decorators and move the two sentences about
compile-time validation under that header; specifically update the documentation
around the Resource declaration (function Resource(opts: ResourceMetadata):
TypedClassDecorator) so the lines about "@Resource" and "@ResourceTemplate"
validation are grouped under a new "## Type Safety" header for consistency with
other decorator docs.
In `@libs/cli/src/commands/scaffold/create.ts`:
- Line 3: Replace direct use of fs promises with the project's file utilities:
remove the "import { promises as fsp } from 'fs'" and switch calls that use
fsp.writeFile to the writeFile helper from `@frontmcp/utils` (or the equivalent
already-exported utility), and ensure any fsp.stat calls are replaced by the
already-imported stat function; update all references of fsp.writeFile and
fsp.stat in this file (e.g., in create.ts) to call the `@frontmcp/utils`
writeFile/stat helpers so the file I/O follows the coding guideline.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: b023836f-3636-4b89-b6c7-a8ba6f2928c5
⛔ Files ignored due to path filters (4)
libs/cli/src/commands/build/exec/__tests__/daemon-client.spec.tsis excluded by!**/build/**libs/cli/src/commands/build/exec/__tests__/generate-cli-entry.spec.tsis excluded by!**/build/**libs/cli/src/commands/build/exec/cli-runtime/daemon-client.tsis excluded by!**/build/**libs/cli/src/commands/build/exec/cli-runtime/generate-cli-entry.tsis excluded by!**/build/**
📒 Files selected for processing (14)
docs/frontmcp/deployment/local-dev-server.mdxdocs/frontmcp/getting-started/cli-reference.mdxdocs/frontmcp/getting-started/quickstart.mdxdocs/frontmcp/nx-plugin/generators/workspace.mdxdocs/frontmcp/sdk-reference/decorators/agent.mdxdocs/frontmcp/sdk-reference/decorators/job.mdxdocs/frontmcp/sdk-reference/decorators/prompt.mdxdocs/frontmcp/sdk-reference/decorators/resource.mdxdocs/frontmcp/sdk-reference/decorators/tool.mdxlibs/cli/src/commands/scaffold/__tests__/create.spec.tslibs/cli/src/commands/scaffold/create.tslibs/nx-plugin/src/generators/server/files/node/docker-compose.yml__tmpl__libs/nx-plugin/src/generators/workspace/workspace.spec.tslibs/nx-plugin/src/generators/workspace/workspace.ts
Performance Test ResultsStatus: ✅ All tests passed Summary
Total: 100 tests across 21 projects 📊 View full report in workflow run Generated at: 2026-03-23T19:23:45.573Z |
…allback for missing git
Cherry-pick CreatedA cherry-pick PR to Please review and merge if this change should also be in If the cherry-pick is not needed, close the PR. |
Summary by CodeRabbit
Documentation
New Features
Tests