-
Notifications
You must be signed in to change notification settings - Fork 8
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: pm-install
generator
#9
Conversation
Do you mind to also add a new section to readme? ππΌ |
@pi0 I added the changes for nypm. |
Would support for |
I would submit a new issue and talk to @pi0 about the feature! |
Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
|
||
#### Args supported for `pm-install` | ||
|
||
- `name`: The package name (by default tries to read from the `name` field in `package.json`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on packages
instead of name
? I've often seen READMEs that suggest installing multiple at once (e.g. typescript-eslint suggests installing typescript
as well).
For multiple, it could be a comma-separated (and space friendly) string:
<!-- AUTOMD_START generator="pm-install" packages="package-name, other-package-name" dev="true" -->
```sh
# npm
npm install -D package-name other-package-name
# yarn
yarn add -D package-name other-package-name
# pnpm
pnpm install -D package-name other-package-name
# bun
bun install -D package-name other-package-name
```
<!-- AUTOMD_END -->
And for a single one it would look the same but with a different key:
<!-- AUTOMD_START generator="pm-install" packages="package-name" dev="true" -->
```sh
# npm
npm install -D package-name
# yarn
yarn add -D package-name
# pnpm
pnpm install -D package-name
# bun
bun install -D package-name
```
<!-- AUTOMD_END -->
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm yes but it is also less common and I prefer to keep name shorter pm
already suggests it is about package. We can easily also use name="pkg1 pkg2"
btw even without array support wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well pm
stands for "package manager" right? So it doesn't really suggest one way or another. How about we make it space separated though, you are right that comma-separated is a little much.
<!-- AUTOMD_START generator="pm-install" packages="pkg1 pkg2" -->
<!-- AUTOMD_START generator="pm-install" packages="pkg" -->
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i read pm-install packages=
as package manager install packages="..."
while pm-install name=
as package manger install name=
.
More precisely what are setting in this param (according to npm) is "package specs"
Although we can really simply support packages
as an alias if you strongly like it more feel free to make a new PR to propose (thinking to move this one forward faster)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good yeah, I'll make a PR in the future!
Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
Thank you both @cpreston321 and @uncenter for your contribution it was nothing I expected and happy having your collaborations β€οΈ Mind you both automd and omark projects are really in trial stages and I usually used to keep projects like these private. So nothing in them is set in stone/ we don't need to worry about small details we can fix them later once main goals (like this generator) were met ππΌ |
π Linked issue
#5
β Type of change
π Description
Args:
- name? (falls back to package.json "name")
- dev? (if true adds -D or --save-dev)
- auto? (if false remove nypm)
π Checklist