Skip to content

Conversation

@othelarian
Copy link

Origin of the PR

The main issues I found with the makefile:

  • not cross platform: even if make can work on Windows the makefile use linux commands and follow the linux guidelines (currently the makefile isn't working on Windows as it is). It's possible to get it more crossplatform but he needs knowledge, which leads to my second point.
  • a different language: makefile have a specific way to handle things, and while easy to learn it's still a different approach than full JavaScript.

So this PR has one goal: get rid of the makefile by using only npm and a LiveScript file.

What it does

This PR adds entries in the package.json that work with a index.ls file at the root of the repository. Using the npm run [command] syntax directly in the console it's now possible to launch this specific actions:

  • browser: compile the lib into 2 files, livescript.js and livescript.min.js. Replace the browser, build-browser, browser/livescript.js and browser/livescript-min.js makefile targets.
  • clean: remove the following directories: browser, lib and coverage. Not exactly the same as the makefile clean targets, but the needs are a little bit different.
  • coverage: run istanbul to get the package coverage. Replace the makefile coverage target.
  • lib: compile the lib itself, creating the lib directory and filling it up with all the js files composing the livescript lib. Replace the lib, lib/parser.js and lib/%.js targets.
  • package: (re)generating the package.json from the package.json.ls. Replace the package.json target.
  • test: launch the test script. Replace the test target

The README.md is also updated with the same explanation.

Some makefile targets weren't transfered like all, loc, force, full, install and dev-install. Most of their actions are already standards now. I left the makefile unchanged for people who still wanted to use it.

Side effects

I bumped the uglify-js version as it doesn't change anything meaningful, but I kept the istanbul as it is. I think, as written in the code itself, that a rewrite with mocha is a better idea.

Note

It's an opiniated PR, so I will understand that it may be refused, I'm ok with this.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant