Skip to content

Commit

Permalink
Remove Makefile and migrate to NPM scripts (#1135)
Browse files Browse the repository at this point in the history
* Remove Makefile and migrate to NPM scripts

* Update documentation/.arclint

* Check node version in prestart

* Group test npm scripts into `test:`
  • Loading branch information
ylemkimon authored and kevinbarabash committed Feb 6, 2018
1 parent 73d80f5 commit 383a68b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 112 deletions.
2 changes: 1 addition & 1 deletion .arclint
Expand Up @@ -2,7 +2,7 @@
"linters": {
"katex-linter": {
"type": "script-and-regex",
"script-and-regex.script": "make lint || true",
"script-and-regex.script": "npm run test:lint || true",
"script-and-regex.regex": "/^(?P<file>\\S+): line (?P<line>\\d+), col \\d+, (?P<message>.*)$/m"
}
}
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -74,7 +74,7 @@ by running `npm install webpack-dev-server@2.7.1`.

The JavaScript parser and some of the HTML and MathML tree
builders are tested with Jest. These tests can be run using node with
`npm run jest`. If you need to debug the tests see
`npm run test:jest`. If you need to debug the tests see
[https://facebook.github.io/jest/docs/troubleshooting.html](https://facebook.github.io/jest/docs/troubleshooting.html)

The interactive editor can also be used for debugging tests in the browser by
Expand Down
95 changes: 0 additions & 95 deletions Makefile

This file was deleted.

26 changes: 16 additions & 10 deletions package.json
Expand Up @@ -39,6 +39,7 @@
"jspngopt": "^0.2.0",
"less": "~2.7.1",
"less-loader": "^4.0.5",
"mkdirp": "^0.5.1",
"nomnom": "^1.8.1",
"object-assign": "^4.1.0",
"pako": "1.0.4",
Expand All @@ -55,23 +56,28 @@
},
"bin": "cli.js",
"scripts": {
"lint": "eslint katex.js katex.webpack.js cli.js webpack.common.js webpack.config.js webpack.dev.js src static test contrib dockers && stylelint src/katex.less",
"flow": "flow",
"jest": "jest",
"test": "npm run prestart && npm run test:lint && npm run test:flow && npm run test:jest",
"test:lint": "eslint katex.js katex.webpack.js cli.js webpack.common.js webpack.config.js webpack.dev.js src static test contrib dockers && stylelint src/katex.less",
"test:flow": "flow",
"test:jest": "jest",
"jest-update": "jest --updateSnapshot",
"coverage": "jest --coverage",
"clean": "rm -rf build/* node_modules/",
"clean-install": "npm run clean && npm i",
"test": "check-dependencies && npm run lint && npm run flow && npm run jest",
"verify-screenshots": "check-dependencies && dockers/Screenshotter/screenshotter.sh --verify",
"start": "check-dependencies && webpack-dev-server --hot --config webpack.dev.js",
"build": "check-dependencies && rimraf build/* && webpack",
"screenshots": "npm run prestart && dockers/Screenshotter/screenshotter.sh",
"verify-screenshots": "npm run screenshots -- --verify",
"prestart": "node check-node-version.js && check-dependencies && cd src && node unicodeMake.js >unicodeSymbols.js",
"start": "webpack-dev-server --hot --config webpack.dev.js",
"build": "npm run prestart && rimraf build/* && webpack",
"dist": "npm test && npm run build && npm run dist:copy && npm run dist:zip && npm run dist:dist",
"dist:copy": "cd build && mkdirp katex && cp -r katex.js katex.min.js katex.css katex.min.css contrib fonts ../README.md katex",
"dist:zip": "cd build && tar czf katex.tar.gz katex/ && zip -rq katex.zip katex/",
"dist:dist": "rimraf dist/ && cp -r build/katex/ dist/",
"watch": "npm run build -- --watch",
"perf-test": "check-dependencies && NODE_ENV=test node test/perf-test.js",
"prepublishOnly": "make NIS= dist"
"perf-test": "npm run prestart && NODE_ENV=test node test/perf-test.js"
},
"pre-commit": [
"lint"
"test:lint"
],
"dependencies": {
"match-at": "^0.1.1"
Expand Down
2 changes: 1 addition & 1 deletion release.sh
Expand Up @@ -104,7 +104,7 @@ git checkout --detach

# Build generated files and add them to the repository (for bower)
git clean -fdx build dist
make setup dist
npm run dist
sed -i.bak -E '/^\/dist\/$/d' .gitignore
rm -f .gitignore.bak
git add .gitignore dist/
Expand Down
4 changes: 0 additions & 4 deletions src/unicodeMake.js
Expand Up @@ -4,10 +4,6 @@
// whose purpose is to generate unicodeSymbols.js in this directory.
// In this way, only this tool, and not the distribution/browser,
// needs String's normalize function.
//
// This tool should be run (via `node unicodeMake.js` or `make unicode`)
// whenever KaTeX adds support for new accents, and whenever
// the Unicode spec adds new symbols that should be supported.

const accents = require('./unicodeAccents');

Expand Down

0 comments on commit 383a68b

Please sign in to comment.