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

Add better entry point description #1177

Merged
merged 1 commit into from
Nov 15, 2022
Merged

Add better entry point description #1177

merged 1 commit into from
Nov 15, 2022

Conversation

jircdev
Copy link
Contributor

@jircdev jircdev commented Nov 14, 2022

This change fixes the missing flag in the first example. If you just run yarn version it will only plot the version, not change it.
Update the note from the end of the first example to the --new-version flag where it is related to.

The current docs say the next about NodeJS:

is used to define the entry point of your code used by programs like Node.js. If unspecified it will default to index.js.

This PR proposes to change the NodeJS definition, seeking to avoid confusion about how javascript and javascript packages really work.

Also, today NodeJS purpose the "exports" entry point usage instead of "main" entry, and this entry point (exports) has better support for universal packages.

Also is proposed to add a mention of "exports" entry point which is taken over "main" entry point if it is defined. The paragraph is added after the explanation about the entry points contained.

The current docs say
>   is used to define the entry point of your code used by programs like Node.js. If unspecified it will default to index.js.

Since Node is not a program, is an execution environment, the description given proposes to change, to avoid misconceptions about how javascript and javascript packages really work.
I think is convenient to try to unify definitions and criteria. Also,  today NodeJS purpose the "exports" entry point usage instead of "main" entry, and this entry point (exports) has better support for universal packages.
@Haroenv Haroenv merged commit 22906bf into yarnpkg:master Nov 15, 2022
@Haroenv
Copy link
Member

Haroenv commented Nov 15, 2022

Good little addition, thanks!

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