Skip to content

fix(*): drop shx and replace it with Node.js native script #402

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 10 commits into from
Jul 14, 2025

Conversation

lumirlumir
Copy link
Owner

@lumirlumir lumirlumir commented Jul 13, 2025

This pull request refactors the handling of file permissions across three packages (clang-format-git-python, clang-format-git, and clang-format-node) by replacing the use of the shx dependency with custom chmod.js scripts. These scripts ensure that the necessary files and binaries have the correct execution permissions. Additionally, the postinstall and postbuild scripts are updated to use these new chmod.js files, and the shx dependency is removed.

File Permission Handling Updates:

Package Configuration Updates:

Copy link

vercel bot commented Jul 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
npm-clang-format-node-website ⬜️ Skipped (Inspect) Jul 14, 2025 10:32am

@github-actions github-actions bot added 🏷️ scope: * Auto-generated label based on Conventional Commits specification for GitHub release notes 🏷️ type: fix Auto-generated label based on Conventional Commits specification for GitHub release notes labels Jul 13, 2025
Copy link

Labels have been automatically applied based on the Conventional Commits specification.🏷️

Copy link

codecov bot commented Jul 13, 2025

Bundle Report

Changes will decrease total bundle size by 9 bytes (-0.0%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
website-esm 603.06kB -9 bytes (-0.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: website-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.*.js -9 bytes 8.85kB -0.1%

Files in index.*.js:

  • ./index.md → Total Size: 8.98kB

Copy link

codecov bot commented Jul 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (168f217) to head (01c6fdd).
Report is 1 commits behind head on main.

@@            Coverage Diff            @@
##              main      #402   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           11        11           
  Lines          424       424           
=========================================
  Hits           424       424           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 168f217...01c6fdd. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lumirlumir lumirlumir marked this pull request as ready for review July 13, 2025 14:01
@Copilot Copilot AI review requested due to automatic review settings July 13, 2025 14:01
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes the shx dependency and shell-based chmod commands, replacing them with Node.js native scripts to set executable permissions in each package.

  • Updated package.json in three packages to include chmod.js, remove shx, and change postinstall to node chmod.js
  • Added chmod.js in each package to programmatically set file permissions
  • Removed redundant chmod and postbuild scripts and shx dependencies

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/clang-format-node/package.json Added chmod.js to files, removed shx, updated scripts
packages/clang-format-node/chmod.js New script to set bin file permissions via Node
packages/clang-format-git/package.json Added chmod.js, removed shx, updated scripts
packages/clang-format-git/chmod.js New script to set bin file permissions via Node
packages/clang-format-git-python/package.json Added chmod.js, removed shx, updated scripts
packages/clang-format-git-python/chmod.js New script to set script file permissions via Node
Comments suppressed due to low confidence (2)

packages/clang-format-node/chmod.js:1

  • There are no tests verifying that this script sets the intended permissions; consider adding a small integration or unit test to ensure future changes don't break file permissions.
/**

packages/clang-format-node/chmod.js:19

  • The recursive option for fs.readdirSync is only supported in Node.js v16.7+; consider adding a small helper or using fs.promises.opendir to walk directories for broader compatibility.
const clangFormatNodePaths = readdirSync(binPath, {

@lumirlumir lumirlumir merged commit df49101 into main Jul 14, 2025
52 checks passed
@lumirlumir lumirlumir deleted the fix-drop-shx-and-replace-it-with-nodejs-native-script branch July 14, 2025 10:41
lumirlumir added a commit that referenced this pull request Jul 14, 2025
…ch`) (#404)

## Release Information: `v1.3.5`

New release of `lumirlumir/npm-clang-format-node` has arrived! 🎉

This PR bumps the package versions from `v1.3.4` to `v1.3.5` (`patch`).

See
[Actions](https://github.com/lumirlumir/npm-clang-format-node/actions/runs/16264909140)
for more details.

| Info        | Value                      |
| ----------- | -------------------------- |
| Repository  | `lumirlumir/npm-clang-format-node` |
| SEMVER      | `patch`     |
| Pre ID      | `canary`      |
| Short SHA   | df49101       |
| Old Version | `v1.3.4`  |
| New Version | `v1.3.5`  |

<!-- Release notes generated using configuration in .github/release.yml
at main -->

## What's Changed
### 🐛 Bug Fixes
* fix(*): drop `shx` and replace it with Node.js native script by
@lumirlumir in
#402
### 🛠️ Builds
* build(*): add `cp.mjs` script for file copying and update build
scripts by @lumirlumir in
#400
### ♻️ Code Refactoring
* refactor(*): simplify paths to the binary files by @lumirlumir in
#401
### ⬆️ Dependency Updates
* chore(deps-dev): bump eslint from 9.30.1 to 9.31.0 by @dependabot[bot]
in #403


**Full Changelog**:
v1.3.4...v1.3.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ scope: * Auto-generated label based on Conventional Commits specification for GitHub release notes 🏷️ type: fix Auto-generated label based on Conventional Commits specification for GitHub release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy