chore: convert shell scripts to Node.js for cross-platform compatibility#43
Open
littlesmilelove wants to merge 1 commit intoHaleclipse:masterfrom
Open
chore: convert shell scripts to Node.js for cross-platform compatibility#43littlesmilelove wants to merge 1 commit intoHaleclipse:masterfrom
littlesmilelove wants to merge 1 commit intoHaleclipse:masterfrom
Conversation
Reviewer's GuideReplaces shell-based pre/post packaging logic with equivalent Node.js scripts to make the packaging workflow cross-platform while preserving README backup and badge URL rewriting behavior. Sequence diagram for Node-based prepackage and postpackage workflowsequenceDiagram
actor Developer
participant PNPM as pnpm
participant PreScript as prepackage_mjs
participant Vsce as vsce
participant PostScript as postpackage_mjs
participant FS as filesystem
Developer->>PNPM: run package
PNPM->>PreScript: run prepackage script
PreScript->>FS: check README_md_bak exists
FS-->>PreScript: exists or not
PreScript->>FS: delete README_md_bak if exists
PreScript->>FS: copy README_md to README_md_bak
PreScript->>FS: read README_md
PreScript->>FS: write README_md with SVG_URL replaced by PNG_PATH
PreScript-->>PNPM: exit success
PNPM->>Vsce: run vsce package
Vsce-->>PNPM: create vsix package
PNPM->>PostScript: run postpackage script
PostScript->>FS: check README_md_bak exists
FS-->>PostScript: exists or not
PostScript->>FS: copy README_md_bak to README_md
PostScript->>FS: delete README_md_bak
PostScript-->>PNPM: exit success
PNPM-->>Developer: packaging complete
Flow diagram for updated packaging npm scripts using Node jsflowchart TD
A[Developer runs pnpm run package] --> B[prepackage script runs node prepackage_mjs]
B --> C[Delete existing README_md_bak if present]
C --> D[Copy README_md to README_md_bak]
D --> E[Replace SVG badge URL with PNG path in README_md]
E --> F[Run vsce package]
F --> G[postpackage script runs node postpackage_mjs]
G --> H[If README_md_bak exists copy to README_md]
H --> I[Delete README_md_bak]
I --> J[Packaging complete]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
prepackage.mjs, consider handling the case whereREADME.mddoes not exist before callingcopyFileSync/readFileSyncso the script fails with a clearer message or exits gracefully. - To avoid relying on relatively new Node APIs, you might want to replace
content.replaceAll(...)with a more broadly compatiblecontent.split(...).join(...)or a global regex replace.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `prepackage.mjs`, consider handling the case where `README.md` does not exist before calling `copyFileSync`/`readFileSync` so the script fails with a clearer message or exits gracefully.
- To avoid relying on relatively new Node APIs, you might want to replace `content.replaceAll(...)` with a more broadly compatible `content.split(...).join(...)` or a global regex replace.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
convert shell scripts to Node.js for cross-platform compatibility (windows)
Summary by Sourcery
Replace shell-based packaging scripts with Node.js equivalents to improve cross-platform compatibility for the packaging workflow.
New Features:
Enhancements: