Jitsu changes my package.json and breaks local environment #402

Closed
willish opened this Issue Mar 6, 2013 · 6 comments

Projects

None yet

4 participants

@willish
willish commented Mar 6, 2013

Just a minor frustration, but every time I deploy to nodejitsu, my package.json gets changed.

I have to manually undo the changes each time I want to run the application locally.

Specifically it updates the "start" value in "scripts", to "server.js"

This means "npm start" becomes broken locally under windows.

@mmalecki
Contributor
mmalecki commented Mar 6, 2013

What do you have it set to originally? Please post your package.json.

@willish
willish commented Mar 6, 2013

Original

"scripts": {
"prestart": "coffee -o app -c src",
"debug": "coffee -o app -c src && node debug server.js",
"commit": "coffee -o app -c src && git add . && git commit -m
"deploy"",
"deploy": "coffee -o app -c src && rm -r -f lib/nzk-api && cp -R
../../DrawingTorch-unstable/nzk-api lib/nzk-api && jitsu deploy",
"devstart": "coffee -o app -c src && coffee -o
../../DrawingTorch-unstable/nzk-api/lib -c
../../DrawingTorch-unstable/nzk-api/src && npm start"
}

After

"scripts": {
"prestart": "coffee -o app -c src",
"debug": "coffee -o app -c src && node debug server.js",
"commit": "coffee -o app -c src && git add . && git commit -m
"deploy"",
"deploy": "coffee -o app -c src && rm -r -f lib/nzk-api && cp -R
../../DrawingTorch-unstable/nzk-api lib/nzk-api && jitsu deploy",
"devstart": "coffee -o app -c src && coffee -o
../../DrawingTorch-unstable/nzk-api/lib -c
../../DrawingTorch-unstable/nzk-api/src && npm start",
"start": "server.js"
}

But that is not the only annoyance (minor!) , it also does things like
change my version number, and put a deploy specific "subdomain" entry in.

Since I wish to use one package.json for many different deployments, this
is annoying.

Can jitsu not just generate a temporary package.json for its own needs and
leave mine alone :)

On Wed, Mar 6, 2013 at 6:53 PM, Maciej Małecki notifications@github.comwrote:

What do you have it set to originally? Please post your package.json.


Reply to this email directly or view it on GitHubhttps://github.com/nodejitsu/jitsu/issues/402#issuecomment-14515374
.

@mmalecki
Contributor
mmalecki commented Mar 7, 2013

@barbourwill these fields are required by out infrastracture in order for your app to work correctly.
scripts:start has to be defined to let our application server know what file to start when running your application. This also allows you to just start your app with npm start locally. It's hard to argue that it's a bad change.

Version number change simply represents next release of your application (deployment should be considered a release).

subdomain entry on the other hand, tells our infrastracture where to look for your app (short story). We also need it to properly serve your application. Hardly a bad change either.

The fact that we should work on better support for multiple apps with one package.json is true, though. Since this is basically what this issue is about, I'm going to close this as a duplicate and refer you to one of many of those issues.

@mmalecki mmalecki closed this Mar 7, 2013
@mmalecki mmalecki added a commit that referenced this issue Mar 7, 2013
@mmalecki mmalecki [minor] Use proper `scripts:start` syntax
Apparently defaulting to just `script.js` causes Windows to fail hard
(see #402).
b1a818c
@mmalecki
Contributor
mmalecki commented Mar 7, 2013

b1a818c should help with the Windows issue, too.

@aral
aral commented Mar 19, 2013

I just noticed that it sets the name back also. I’m not sure how to change the name (as I have to since someone just grabbed the name I was using in npm). That’ll teach me not to publish early.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment