-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
Mid-script Args #177
Comments
Sorry, this project is pretty much in maintenance mode until someone else steps up to be a maintainer. I don't use this much and so I don't have time for writing on it. |
No worries, thanks for the heads up! |
@kentcdodds just out of curiosity, what would you guess is the effort level for maintaining this project? I've never maintained an open source project, but potentially interested or might know someone that would be. |
It's all in how much you want to put into it. I haven't done much with this project in about a year and it's still getting 11k downloads per month 🤷♂️ |
Cool, I'm going to get some input from my team at work, think about it and get back to you. |
Can't you just do
with the script: |
lol, I think you may be right; I'm going to feel dumb if that works 😂 |
Maintainership could be managed like styled-components - anybody that has a PR merged gets write access if they want, via a bot, and then the top-level maintainers cut releases every once in a while. That said, the solution offered by @Mehuge is indeed the way to do it ;) Here's how I manage process.env._dbg =
'*,-babel*,-express*,-send,-body-parser*,-morgan,-compression,-puppeteer*'
const DEBUG = `DEBUG=\${DEBUG:-$_dbg}`
const webpack = (cfg, {prod, watch, browser, minify} = {}) =>
[
`NODE_ENV=${prod ? 'production' : 'development'}`,
browser && 'BROWSER=y',
minify && 'MINIFY=y',
`webpack --config ./lib/webpack/webpack.config.${cfg}.babel.js`,
(watch && '--watch') || '--bail',
]
.filter(Boolean)
.join(' ')
const scripts = {
default: 'nps dev',
dev: {
default: `nps dev.debug`,
plain: `nps build.dll dev.runPlain`,
debug: `nps build.dll dev.runDebug`,
runPlain: webpack('server', {watch: true}),
runDebug: `${DEBUG} ${webpack('server', {watch: true})}`,
},
...etc
}
module.exports = {scripts} |
This is how it works, except without the bot. The fact is, nobody I've given commit rights to has taken up the responsibilities of a maintainer. |
:-/ I can do PR reviews and merges for nps and nps-utils. What are your expectations for maintaining? What kind of changes are ok to do/reject? |
Because I'm not using the project anymore, I'm not the one to say. I'd just ask that maintainers follow server and get feedback from users before making large changes. Once someone takes the role of maintainer and proves they can handle it, I'll personally bow out and grant release rights. |
Ok, works for me. Sign me up.
Out of interest, how come you're no longer using the project, is it no
longer your domain or do you do things differently now?
…On Mon, Aug 13, 2018 at 4:38 PM Kent C. Dodds ***@***.***> wrote:
Because I'm not using the project anymore, I'm not the one to say. I'd
just ask that maintainers follow server and get feedback from users before
making large changes.
Once someone takes the role of maintainer and proves they can handle it,
I'll personally bow out and grant release rights.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#177 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AADWlkFzl0R2e9U0c2W8ntEBkox8knxRks5uQY9bgaJpZM4Ub1aK>
.
|
Now I write a CLI that encapsulates most of the scripts that my projects need: https://blog.kentcdodds.com/automation-without-config-412ab5e47229 Go ahead and start making PRs/helping in issues and I'll give you commit access :) |
Ah yes in nps I don't have a PR yet but in nps-utils I do. |
Here is a scenario I would love this "mid-script args" to solve. I am using Nrwl NX monorepo with tons of angular apps inside. I want to create an NPS shortcut for each app to get into the NG Angular cli for that app. I want to type This could work if I could only tell nps WHERE to place the "quoted paramaters". By default nps just places them at the END of your command. But that does not work because NPS shouldn't assume I want my "quoted params" at the end. It should let me pick where they get injected. Something like this
Now the params of |
@mreschke the problem is encoding the given parameters. Since nps always expects to generate shell code, I propose that the literal Now, currently the only way to pass arguments is to call |
nps
version: latestnode
version: latestnpm
version: latestProblem description:
Since we're improving on npm scripts, it would be awesome to be able to pass script args somewhere in the middle of the script.
e.g. passing an environment to a script like
ENV={env} webpack --config webpack.config.{env}.js
Suggested solution:
Would love to begin a discussion about potential approaches and challenges. My first thought is to use template literals for interpolating script args into scripts in order to form the string that finally gets executed.
The text was updated successfully, but these errors were encountered: