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: standalone version for each package #23

Merged
merged 9 commits into from
Sep 7, 2023

Conversation

antfu
Copy link
Collaborator

@antfu antfu commented Sep 5, 2023

This PR introduces a "Virtual Package" system, that will compare the package files and automatically bump versions whenever the file changes.

The output would look like this:

image

@antfu antfu mentioned this pull request Sep 5, 2023
2 tasks
create.cjs Outdated Show resolved Hide resolved
@antfu antfu marked this pull request as ready for review September 6, 2023 13:09
create.cjs Outdated Show resolved Hide resolved
create.cjs Outdated Show resolved Hide resolved
create.cjs Outdated Show resolved Hide resolved
@SukkaW
Copy link
Owner

SukkaW commented Sep 7, 2023

@antfu

I have pushed some changes to the branch:

I'd like to hear your thoughts about those changes.

create.cjs Outdated
: {};

// exclude version from comparison
if (JSON.stringify({ ...existingPackageJson, version: undefined }) !== JSON.stringify({ ...pkg.packageJson, version: undefined })) {
Copy link
Owner

Choose a reason for hiding this comment

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

Don't know which is faster, dequal or JSON.stringify. I will create a naive benchmark to test it.

Copy link
Owner

Choose a reason for hiding this comment

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

dequal is 2x faster: https://replit.com/@isukkaw/dequal-vs-json-stringify

So in 290a697 (#23) I have replaced JSON.stringify with dequal.

@antfu
Copy link
Collaborator Author

antfu commented Sep 7, 2023

Feel free to push any changes. Tbh I don't really feel performance is really a concern here, but also sure why not if you prefer.

Do you think you have the plan to convert this file to .ts (asking because I saw you write them back to JSDocs), and break it into multiple files (separate the logic and the data, so they can be better organized, as well as expose some raw data to the JS API etc)? I believe https://github.com/esbuild-kit/tsx is quite performant to run directly the ts scripts.

@SukkaW
Copy link
Owner

SukkaW commented Sep 7, 2023

Feel free to push any changes. Tbh I don't really feel performance is really a concern here, but also sure why not if you prefer.

Do you think you have the plan to convert this file to .ts (asking because I saw you write them back to JSDocs), and break it into multiple files (separate the logic and the data, so they can be better organized, as well as expose some raw data to the JS API etc)? I believe https://github.com/esbuild-kit/tsx is quite performant to run directly the ts scripts.

I'd like to, but TBH this is kind of too much for this PR. Let's do this in a separate PR.

@SukkaW SukkaW merged commit c822758 into SukkaW:master Sep 7, 2023
1 check passed
@antfu antfu deleted the feat/standalone-version branch September 7, 2023 12:45
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.

None yet

2 participants