refine icon indicating copy to clipboard operation
refine copied to clipboard

feat: add lint-staged script to sort package json

Open BatuhanW opened this issue 1 year ago • 3 comments

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x] The commit message follows our guidelines: https://refine.dev/docs/guides-concepts/contributing/#commit-convention

What is the current behavior?

Currently our package.json files aren't sorted correctly, since some dependencies are added manually.

When the user uses create-refine-app to copy one of our examples and do npm install xxx or npm uninstall xxx, npm CLI is automatically sorting the package.json. It's distractive and causing unnecessary diff.

See the screenshot below for example redundant diff after running npm create refine-app@latest -- --example template-antd and npm install xxx

What is the new behavior?

  • Added sort-package-json as devDependency.
  • Added lint-staged script to automatically fix package.json sorting if it's changed.
  • Moved pidtree and wait-on packages to devDependencies in root package.json
  • Ran npx sort-package-json script for all package.json's.
  • Updated version field in package.json to 1.0.0 for all examples.

Notes for reviewers

Screenshot 2024-02-08 at 15 48 52

BatuhanW avatar Feb 08 '24 12:02 BatuhanW

⚠️ No Changeset found

Latest commit: d9d1f2ed2c7ee78f9fd991da57200a7711c0be80

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Feb 08 '24 12:02 changeset-bot[bot]

☁️ Nx Cloud Report

CI is running/has finished running commands for commit d9d1f2ed2c7ee78f9fd991da57200a7711c0be80. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 73 targets

Sent with 💌 from NxCloud.

nx-cloud[bot] avatar Feb 08 '24 12:02 nx-cloud[bot]

Passing run #10693 ↗︎

0 374 33 0 Flakiness 0

Details:

Merge d9d1f2ed2c7ee78f9fd991da57200a7711c0be80 into 642ad86b8dfcae049ab641f8a3ea...
Project: refine Commit: a3b52f07a9 ℹ️
Status: Passed Duration: 20:59 💡
Started: Feb 8, 2024 1:41 PM Ended: Feb 8, 2024 2:02 PM

Review all test suite changes for PR #5616 ↗︎

cypress[bot] avatar Feb 08 '24 13:02 cypress[bot]