hoodiehq / camp

:circus_tent: Welcome to Hoodie Camp!
https://hoodie.camp
Apache License 2.0
99 stars 55 forks source link

Donโ€™t set "hoodie-start" script if "start" script is set to "hoodie" #103

Closed gr2m closed 7 years ago

gr2m commented 7 years ago

๐Ÿค” What you will need to know

Basic knowledge of Node.js and npm.

โ“ The Motivation

We improved the setup experience for new Hoodie apps by directly setting the "start" script in your appโ€™s package.json file when you installed hoodie with npm install --save hoodie via https://github.com/hoodiehq/hoodie/pull/592

We also made sure that we donโ€™t override an existing "start" script via https://github.com/hoodiehq/hoodie/pull/642, by setting "hoodie-start".

But if the "start" script is set to "hoodie", then we donโ€™t need to do anything.

๐Ÿž The Bug

If the "start" script is set to "hoodie", npm install --save hoodie current sets the "hoodie-start" script. But it should not do anything if the start script is set to "hoodie" or something like "hoodie --inMemory".

:clipboard: Step by Step

๐Ÿค”โ“ Questions

Ping us in the Hoodie Chat or on Twitter

gautamkrishnar commented 7 years ago

I would like to work on this Invite me to slack. Your invite form is not working on http://hood.ie/chat/

LowProfileDog commented 7 years ago

Welcome @gautamkrishnar!

Does that slack form work for you: https://hoodie-slackin-xuhlegfruy.now.sh ?

The issue is all yours :) Iโ€™ve invited you to our Camp repository, you can accept my invitation at https://github.com/hoodiehq/camp/invitations

Once accepted, you can assign yourself to this issue and check off the checkboxes above. Enjoy ๐Ÿ•

gautamkrishnar commented 7 years ago

Thanks. https://hoodie-slackin-xuhlegfruy.now.sh worked for me. I am now going through hoodie docs.

gr2m commented 7 years ago

Hey @gautamkrishnar how are things going? Anything we can help with?

gautamkrishnar commented 7 years ago

Sorry for being late. I was a little busy these days. @gr2m can you please explain me what i need to change. This statement looks a bit confusing to me: If the "start" script is set to "hoodie", npm install --save hoodie current sets the "hoodie-start" script. But it should not do anything if the start script is set to "hoodie" or something like "hoodie --inMemory".

gr2m commented 7 years ago

no worries, happy to explain. Try this:

mkdir test
cd test
npm init -y
npm install --save hoodie

when itโ€™s done, you will see that the package.json file in the test folder you created has a line "start": "hoodie".

now, remove the "dependencies" key from your package.json and rm -rf node_modules. Leave the "start": "hoodie" line and run npm install --save hoodie again. Open package.json and now you will see two lines

    "start": "hoodie",
    "start-hoodie": "hoodie"

This is what this issue is about. If the "start" script already exists and it is set to "hoodie" or a value that starts with "hoodie", then do not create the "start-hoodie" script to avoid duplication. The code where all this is happening is in bin/setup.js

Does that help?

gautamkrishnar commented 7 years ago

Thinks a lot for your explanation. I will try to fix that soon....

On Mon 30 Jan, 2017, 2:33 AM Gregor Martynus, notifications@github.com wrote:

no worries, happy to explain. Try this:

mkdir test cd test npm init -y npm install --save hoodie

when itโ€™s done, you will see that the package.json file in the test folder you created has a line "start": "hoodie".

now, remove the "dependencies" key from your package.json and rm -rf node_modules. Leave the "start": "hoodie" line and run npm install --save hoodie again. Open package.json and now you will see two lines

"start": "hoodie",
"start-hoodie": "hoodie"

This is what this issue is about. If the "start" script already exists and it is set to "hoodie" or a value that starts with "hoodie", then do not create the "start-hoodie" script to avoid duplication. The code where all this is happening is in bin/setup.js https://github.com/hoodiehq/hoodie/blob/master/bin/setup.js

Does that help?

โ€” You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub https://github.com/hoodiehq/camp/issues/103#issuecomment-275945825, or mute the thread https://github.com/notifications/unsubscribe-auth/AIAh2n7uDugERHdIlE6Kxj3L5mvS4qJLks5rXP6pgaJpZM4LWjuq .