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!: adds type #313

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat!: adds type #313

wants to merge 1 commit into from

Conversation

reggi
Copy link
Contributor

@reggi reggi commented Nov 22, 2024

Adds type to package.json for use when running npm init.

  1. Defaults to commonjs
  2. Validates against commonjs | module
  3. Allows npm init --init-type module -y
  4. Allows for init.type=module in .npmrc
  5. Improved tests to make it easier to manage removing / adding new prompts

on the shoulders of #302
apart of the npm 11 roadmap npm/statusboard#898
statusboard issue here npm/statusboard#654
older rfc npm/rfcs#347

Note: Running npm init --init-type=module -y will not overwrite an existing package.json type field. This is deemed out of scope for init. To update an existing type edit it manually or field, use jq '.type = "module"' package.json > tmp.json && mv tmp.json package.json.

@reggi reggi requested a review from a team as a code owner November 22, 2024 20:21
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