Skip to content

feat(plugin-commands-init): add support for --init-type flag in pnpm init #9463

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

Merged
merged 4 commits into from
May 4, 2025

Conversation

cezary-klauza
Copy link
Contributor

add functionality to include "type": "module" in package.json when using --module or -m flag with pnpm init. Updated cliOptionsTypes and handler to handle the new flag and ensure proper sorting of fields in package.json

Closes #9416

add functionality to include "type": "module" in package.json when using
--module or -m flag with pnpm init. Updated cliOptionsTypes and handler
to handle the new flag and ensure proper sorting of fields in
package.json

Closes pnpm#9416
@cezary-klauza cezary-klauza requested a review from zkochan as a code owner April 27, 2025 12:09
Copy link

welcome bot commented Apr 27, 2025

💖 Thanks for opening this pull request! 💖
Please be patient and we will get back to you as soon as we can.

@zkochan
Copy link
Member

zkochan commented Apr 27, 2025

I'd use npm's convention: --init-type=module

Reference: npm/init-package-json#313

cezary-klauza and others added 2 commits April 28, 2025 16:49
allow users to specify the type field in package.json using the
--init-type option. The value can be set to "module" or "commonjs". The
option is also integrated with .npmrc, allowing users to define the
default value in their configuration file. Invalid values are validated
and result in an error.

BREAKING CHANGE: replaces the previous --module and -m option with
--init-type. Users must now use --init-type to specify the type field.
@zkochan zkochan changed the title feat(plugin-commands-init): add support for --module flag in pnpm init feat(plugin-commands-init): add support for --init-type flag in pnpm init May 3, 2025
@zkochan zkochan enabled auto-merge (squash) May 3, 2025 22:50
@zkochan zkochan merged commit b282bd1 into pnpm:main May 4, 2025
14 of 15 checks passed
Copy link

welcome bot commented May 4, 2025

Congrats on merging your first pull request! 🎉🎉🎉

@olehmisar
Copy link

huge for ESM adoption. Thanks for this.

@cezary-klauza cezary-klauza deleted the feat-type-module-init branch May 5, 2025 13:23
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.

pnpm init should add "type": "module" to package.json
3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy