Skip to content

fix offline use #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 56 commits into from
Aug 14, 2025
Merged

fix offline use #12

merged 56 commits into from
Aug 14, 2025

Conversation

Jason2866
Copy link

@Jason2866 Jason2866 commented Aug 14, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Windows terminal now defaults to UTF-8, resolving garbled characters.
    • More reliable startup and installation with improved error handling and safer teardown.
  • Refactor

    • Adopted lazy-loading for helper components to reduce startup time and memory usage.
  • Documentation

    • Updated example configuration to use the stable platform package.
  • Chores

    • Version bumped to 1.0.7.
    • Dependency updates for improved stability and compatibility.

Copy link

coderabbitai bot commented Aug 14, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Implements lazy loading of pioarduino-node-helpers and deferred installer stage initialization, adjusts installer check/install flow and teardown, ensures Windows terminals set UTF-8 on creation, updates a docs platform-zip URL, and bumps package version and two dependencies.

Changes

Cohort / File(s) Summary
Docs asset update
assets/welcome/pioarduino-ini-example.md
Replaced env.platform URL from a specific 51.03.04 release zip to the stable release zip.
Versioning & dependencies
package.json
Bumped version 1.0.6 → 1.0.7; updated dependencies.pioarduino-node-helpers ~11.3.4 → ~11.4.0; updated devDependencies.eslint-plugin-import ~2.31.0 → ^2.32.0.
Installer lazy init & lifecycle
src/installer/manager.js
Deferred stage construction (this.stages = null), added createStages() which dynamically requires pioarduino-node-helpers, ensured check() and install() call createStages(), made destroy() defensive and clears stages.
Extension runtime lazy-loading
src/main.js, src/utils.js
Replaced top-level static import of pioarduino-node-helpers with on-demand require calls in functions (patchOSEnviron, startInstaller/startPIOHome, handleUseDevelopmentPIOCoreConfiguration, notifyError, listCoreSerialPorts); startInstaller logs a warning and returns false on check error.
Terminal UTF-8 initialization
src/terminal.js
PIOTerminal now initializes terminal in a local var and explicitly sends chcp 65001 on Windows when creating or recreating the terminal before sending further text; public API unchanged.

Sequence Diagram(s)

sequenceDiagram
  participant Ext as Extension
  participant IM as InstallationManager
  participant Helpers as pioarduino-node-helpers

  Ext->>IM: check()
  IM->>IM: createStages() if null
  IM->>Helpers: require('pioarduino-node-helpers')
  IM->>IM: build stages
  IM->>IM: iterate stages -> check
  IM-->>Ext: check result / error
  note over Ext: on error, log warn and return false (skip install)
  Ext->>IM: install(progress) [if needed]
  IM->>IM: ensure stages, run install pipeline
Loading
sequenceDiagram
  participant User as User
  participant Ext as Extension
  participant Term as PIOTerminal

  User->>Ext: trigger terminal action
  Ext->>Term: sendText(text)
  alt terminal missing or ended
    Term->>Term: new() -> create terminal
    alt Windows
      Term->>Term: send "chcp 65001"
    end
  end
  Term->>Term: send text to shell
  Term-->>User: displays output
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A rabbit taps keys with a whiskered grin,
Lazy modules hop in when the work should begin.
Stages wake on call, terminals sing UTF-8,
Installer sighs safe, no surprise on update.
Version bumped, carrots stacked—hop to a cleaner state! 🥕🐇


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these settings in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 81df143 and 1749152.

📒 Files selected for processing (6)
  • assets/welcome/pioarduino-ini-example.md (1 hunks)
  • package.json (3 hunks)
  • src/installer/manager.js (5 hunks)
  • src/main.js (5 hunks)
  • src/terminal.js (1 hunks)
  • src/utils.js (3 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Jason2866 Jason2866 merged commit fbb1365 into pioarduino:pioarduino Aug 14, 2025
@Jason2866 Jason2866 deleted the merge branch August 14, 2025 16: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.

2 participants