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

Adds support for both yarn and npm. #22

Merged
merged 3 commits into from
Nov 8, 2019

Conversation

asyed94
Copy link
Contributor

@asyed94 asyed94 commented Oct 4, 2019

The first commit makes poetic check for a yarn.lock file to decide whether to use npm install or yarn install and adds yarpm to the included npm scripts for cross compatibility.

The second one just adds a package-lock.json to the repo for the npm crowd.

@arianacosta arianacosta self-requested a review October 10, 2019 09:33
Copy link
Owner

@arianacosta arianacosta left a comment

Choose a reason for hiding this comment

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

Hi @asyed94,

Thank you for submitting a PR! In general, it's good. I left a few comments.

@@ -1,9 +1,10 @@
{
"devDependencies": {
"poetic": "^1.0.5"
"poetic": "^1.0.5",
"yarpm": "^0.2.1"
Copy link
Owner

Choose a reason for hiding this comment

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

Let's try to keep poetic as a single dependency. Also yarpm doesn't seem to be well maintained.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, it would definitely be nicer to have poetic as a single dependency. 👍

bin/package.boilerplate.json Outdated Show resolved Hide resolved
@@ -66,7 +66,11 @@ const updatePackageJson = () => {
const installPackages = () => {
try {
console.log('🍉 Installing packages ...');
cp.execSync('yarn install');
if (fse.existsSync('yarn.lock')) {
Copy link
Owner

Choose a reason for hiding this comment

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

I like this idea! 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! However, after looking at it again with a fresh mind, I don't think this covers all cases.
If the user runs poetic immediately after git init and yarn/npm init their project dir will not contain a yarn.lock file 🙁. A better solution would probably be to try yarn install first, then if that throws an error run npm install.

Copy link

@ktiedt ktiedt Nov 7, 2019

Choose a reason for hiding this comment

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

Or provide an input similar to how CLI tools like vue-cli do and ask the user what their preference is...

Or provide a CLI argument to specify it... ;)

Honestly it seems odd to default to a dependency that isn't installed by default with node (or installed as a dep with the package in question.

Copy link
Owner

Choose a reason for hiding this comment

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

That's a good point, I agree. It should be customizable. Ideally, it should support a CLI argument, and if that is not provided it should ask what to use.

Copy link

@ktiedt ktiedt Nov 8, 2019

Choose a reason for hiding this comment

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

@arianacosta when will this be available via npm/npx, it was the one thing preventing me from using this and I am hoping to simplify a bit of boilerplate on some 100% npm driven projects.

Copy link
Owner

Choose a reason for hiding this comment

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

@ktiedt I was planning on releasing it this weekend, unfortunately, this doesn't work. This installs and all, but the functionality is broken. I've created another ticket for it: #28

I hope we can find a solution soon, but having NPM is going to be more challenging than what we originally thought. I'll keep you posted 👍

@arianacosta arianacosta added the enhancement New feature or request label Oct 10, 2019
@asyed94 asyed94 requested a review from arianacosta November 6, 2019 01:22
Copy link
Owner

@arianacosta arianacosta left a comment

Choose a reason for hiding this comment

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

Thank you very much for your contribution! We will continue to expand and improve this area, but for now, I'll approve and merge.

@arianacosta arianacosta merged commit 8caa239 into arianacosta:master Nov 8, 2019
arianacosta pushed a commit that referenced this pull request Dec 2, 2019
# [1.2.0](v1.1.0...v1.2.0) (2019-12-02)

### Bug Fixes

* removes installation with npm and upgrades dependencies ([b410ffa](b410ffa))

### Chores

* add semantic release workflow ([40e6e47](40e6e47)), closes [#33](#33)

### Continuous Integration

* **release:** fix issue with protected branch ([#37](#37)) ([67c8980](67c8980))

### Documentation

* **contributing:** improve instructions for contributing ([35a4696](35a4696))

### Features

* simplify installation script ([#36](#36)) ([ab52404](ab52404))

### Miscellaneous

* Adds support for both yarn and npm. (#22) ([8caa239](8caa239)), closes [#22](#22)
* updated readme ([01f2c32](01f2c32))
@arianacosta
Copy link
Owner

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants