Skip to content

feat: Add a PowerShell installer script and getting started documenta…#240

Merged
lc-cn merged 2 commits intozhinjs:mainfrom
abandon-jw3:main
Feb 12, 2026
Merged

feat: Add a PowerShell installer script and getting started documenta…#240
lc-cn merged 2 commits intozhinjs:mainfrom
abandon-jw3:main

Conversation

@abandon-jw3
Copy link

@abandon-jw3 abandon-jw3 commented Feb 12, 2026

feat:add Powershell installer script


Summary by cubic

Add a Windows PowerShell installer and update Getting Started with a one‑line Windows setup. Also add @zhin.js/types to the CLI template for better TypeScript support.

  • New Features
    • Added install.ps1 for Windows: checks Node.js (>=20.19.0 or >=22.12.0), installs pnpm via corepack/npm, then runs pnpm create zhin-app with passed args.
    • Updated Getting Started: added PowerShell one‑liner (irm https://zhin.js.org/install.ps1 | iex) and minor formatting fixes for examples and the CLI table.
    • CLI template: added @zhin.js/types to generated projects.

Written for commit 4d62222. Summary will update on new commits.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="docs/public/install.ps1">

<violation number="1" location="docs/public/install.ps1:94">
P1: Node.js version gate incorrectly accepts 22.0.0–22.11.x. The else-if branch checks major -eq 20 OR major -ge 22, which causes Node 22.0.0-22.11.x to incorrectly pass when it should be rejected (requires >= 22.12.0). The condition should only allow major version 20 in this branch.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

elseif (Test-VersionGte $nodeVersionRaw "20.19.0") {
# 检查不是 21.x(因为 21 < 22.12)
$major = [int]($nodeVersionRaw.Split('.')[0])
if ($major -eq 20 -or $major -ge 22) {
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Feb 12, 2026

Choose a reason for hiding this comment

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

P1: Node.js version gate incorrectly accepts 22.0.0–22.11.x. The else-if branch checks major -eq 20 OR major -ge 22, which causes Node 22.0.0-22.11.x to incorrectly pass when it should be rejected (requires >= 22.12.0). The condition should only allow major version 20 in this branch.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/public/install.ps1, line 94:

<comment>Node.js version gate incorrectly accepts 22.0.0–22.11.x. The else-if branch checks major -eq 20 OR major -ge 22, which causes Node 22.0.0-22.11.x to incorrectly pass when it should be rejected (requires >= 22.12.0). The condition should only allow major version 20 in this branch.</comment>

<file context>
@@ -0,0 +1,170 @@
+    elseif (Test-VersionGte $nodeVersionRaw "20.19.0") {
+        # 检查不是 21.x(因为 21 < 22.12)
+        $major = [int]($nodeVersionRaw.Split('.')[0])
+        if ($major -eq 20 -or $major -ge 22) {
+            Log-Success "Node.js v${nodeVersionRaw} ✓"
+            return
</file context>
Fix with Cubic

@lc-cn lc-cn merged commit 98702e4 into zhinjs:main Feb 12, 2026
1 of 2 checks passed
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