Conversation
Without the comma the json code will fail
|
✅ Deploy Preview for docsdocker ready! 🔨 Explore the source changes: 4cce9fe 🔍 Inspect the deploy log: https://app.netlify.com/sites/docsdocker/deploys/623940c1862b900008c58a72 😎 Browse the preview: https://deploy-preview-14423--docsdocker.netlify.app |
|
@crazy-max Is there a better way to add a custom script without manually modifying the json file? |
|
@usha-mandya |
|
We could also use jq with something like: jq '.scripts + {"debug": "nodemon --inspect=0.0.0.0:9229 server.js"}' < package.jsonBut don't think it's worth it. |
|
@crazy-max yeah, so we were discussing "how can we make this less error-prone"? We can't show the whole Editing JSON can be error-prone, so I was thinking "perhaps I guess the best alternative then would be to call out "make sure the JSON is valid after you edit it" (or something along those lines) |
Perhaps it's still an option to show just the |
|
Yeah with #14423 (comment) it would look like this in output: {
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
"lint": "eslint src/**/*.ts __tests__/**/*.ts",
"format": "eslint --fix src/**/*.ts __tests__/**/*.ts",
"test": "jest --coverage",
"all": "yarn run build && yarn run format && yarn test",
"debug": "nodemon --inspect=0.0.0.0:9229 server.js"
}with https://github.com/docker/login-action/blob/master/package.json |
|
Also if someone has $ npx npm-add-script \
-k "debug" \
-v "nodemon --inspect=0.0.0.0:9229 server.js" \
--force |
|
@thaJeztah @crazy-max Thanks for weighing in on this. @YgorPerez Thanks for the PR. Discussed this PR internally and decided not to go ahead with adding |
Without the comma the json code will fail