Skip to content
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

feat: sort export/import paths #350

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

GeorgeTaveras1231
Copy link
Contributor

Subset of #336

Sorts path objects in imports and exports alphabetically, pushing wildcards to bottom.

GeorgeTaveras1231 and others added 17 commits February 27, 2025 14:46
Force relative position of certain conditions, sort paths in
alphabetically with exception of paths with wildcards.
Co-authored-by: Keith Cirkel <[email protected]>
1. types before target environments
2. environments first
3. support module-sync
Additionally fix order of `module-sync` which goes after `require` and `import`
Adds known edge conditions and addition compilation targets from the
WinterCG standard (Called out in the Node.js community conditions documentation.

- https://nodejs.org/api/packages.html#community-conditions-definitions
Apply some alphabetical order
- move types to top
- move browser under deno and bun since those can be used to bundle app for browsers
@GeorgeTaveras1231
Copy link
Contributor Author

@fisker this only handles the path keys - I'll let you handle the conditions.

fisker added a commit to fisker/sort-package-json that referenced this pull request Mar 4, 2025
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.

1 participant