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

replace GNU make with something else #2352

Closed
boneskull opened this issue Jul 3, 2016 · 10 comments · Fixed by Urigo/tortilla#64
Closed

replace GNU make with something else #2352

boneskull opened this issue Jul 3, 2016 · 10 comments · Fixed by Urigo/tortilla#64
Labels
area: repository tooling concerning ease of contribution type: chore generally involving deps, tooling, configuration, etc.

Comments

@boneskull
Copy link
Contributor

boneskull commented Jul 3, 2016

scripty is a thing and so is p-s.

I don't want the overhead of a full-blown task runner like Grunt or Gulp, as I don't want to rely on plugins.

Thoughts?

@kentcdodds Have you seen scripty? p-s looks similar. Maybe you guys should pool efforts?

cc @searls
cc @mochajs/core

@boneskull boneskull added the type: chore generally involving deps, tooling, configuration, etc. label Jul 3, 2016
@kentcdodds
Copy link

Yeah, I've seen scripty. Pretty different approaches to the problem. I'm bias, but I feel like p-s is better. scripty requires you add a ton of folders and files to your project which is to much work for a simple script IMO. p-s is basically: package.json scripts in a JavaScript file (meaning you get dynamic logic and comments).

@boneskull
Copy link
Contributor Author

@kentcdodds scripty also has/had that weird win32/linux dichotomy wherein you need to provide two versions of the same script. even if you are using node scripts, you can't use a shebang in windows (afaik!)

@kentcdodds
Copy link

Yeah. Give p-s a try. You'll like it.

@searls
Copy link

searls commented Jul 3, 2016

A couple scripty notes:

  • if your motivation is simply making your package.json smaller, then p-s should be fine, but you're still writing shell scripts as strings in a JavaScript file, which can be awkward when you have many scripts of decent complexity
  • scripty's intention is primarily to let Shell scripts be Shell scripts, rather than trying to cram them inside of JavaScript strings; npm is limited to sh, as well, whereas scripty is glad to spawn any shebangable scripting language
  • the Windows script dichotomy is something I'm not sure how scripty can solve. Most teams I'm on are unix-only, and perhaps it's the only situation under which I'd use scripty I'm definitely open to suggestions if there's anything that can be done reliably short of "wait for Windows to run bash".

tl;dr scripty is a tool for writing a project's scripts in first class files (with syntax highlighting, multiple lines, the whole works) with some added understanding of hierarchical grouping of tasks.

@kentcdodds
Copy link

Notes in response to @searls notes 😃

but you're still writing shell scripts as strings in a JavaScript file, which can be awkward when you have many scripts of decent complexity

True. And if things get complicated, you can always invoke a stout file yourself (can even be a JavaScript file). Just like with normal npm scripts

Most teams I'm on are unix-only

That may be true for some teams. But many teams are multiplatform and even more so is open source. p-s has a solid cross-platform story.

scripty is a tool for writing a project's scripts in first class files

That's great and I think it solves that problem really well. My issue is when I'm just calling out to another binary like ESLint or Webpack or AVA, I don't want to have an entire file for a single line to invoke the CLI. I like that p-s gives me the flexibility to both call out to CLIs like this and also really simply break out to a file when necessary.

@TimothyGu
Copy link
Contributor

Is there a reason why we need to replace GNU Make right now?

Also have you considered ShellJS?

@boneskull
Copy link
Contributor Author

Is there a reason why we need to replace GNU Make right now?

Who said it has to happen right now? 😝

In general, I would prefer to only use Node.js-based tools to maximize portability.

ShellJS is cool--shx is even more applicable to our use case--but it doesn't really solve the same problem make does.

@kentcdodds
Copy link

If you wanted to use shx, you'd still want a way to organize/document your scripts. p-s can do that for you and it works great with the ShellJS binary 👍 (Though honestly, I've never felt the need to use it).

@boneskull
Copy link
Contributor Author

boneskull commented Jul 8, 2016

I have a branch which starts to leverage p-s (see this commit). I wanted to ensure the mocha.js bundle was built upon npm version, and that the bundle had a banner w/ its version number.

It's kind of weird to have both make and p-s at the same time. It'd be more developer-friendly if we migrated all at once.

At any rate, if @mochajs/core has any opinion on p-s or another tool, I'm all ears.

@ScottFreeCode
Copy link
Contributor

ScottFreeCode commented Aug 1, 2017

This should come up when I search GitHub issues for "Makefile". [And now it does!]

I've mentioned this on Gitter, but I have code prepared that just converts the Makefile targets to NPM scripts and it turned out not that bad. I plan on opening a PR (at which point the whole team can weigh in and evaluate it) after the following are merged as they touch some of the same code:

Now that CI is working again, I am going to try rebasing these as applicable to confirm that the tests pass so we can start merging them. With any luck it'll be fairly clear-cut to finish reviewing any that still need review.

@ScottFreeCode ScottFreeCode added the area: repository tooling concerning ease of contribution label Aug 25, 2017
TedYav pushed a commit to TedYav/mocha that referenced this issue Jan 7, 2018
TedYav added a commit to TedYav/mocha that referenced this issue Jan 8, 2018
TedYav added a commit to TedYav/mocha that referenced this issue Jan 8, 2018
TedYav added a commit to TedYav/mocha that referenced this issue Jan 8, 2018
TedYav added a commit to TedYav/mocha that referenced this issue Jan 8, 2018
TedYav added a commit to TedYav/mocha that referenced this issue Jan 8, 2018
TedYav added a commit to TedYav/mocha that referenced this issue Jan 9, 2018
TedYav added a commit to TedYav/mocha that referenced this issue Jan 9, 2018
TedYav added a commit to TedYav/mocha that referenced this issue Jan 10, 2018
sgilroy pushed a commit to TwineHealth/mocha that referenced this issue Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: repository tooling concerning ease of contribution type: chore generally involving deps, tooling, configuration, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants