Skip to content

Commit

Permalink
Rewrite Makefile using shelljs
Browse files Browse the repository at this point in the history
  • Loading branch information
Hopding committed Dec 18, 2018
1 parent ebda131 commit a246e7f
Show file tree
Hide file tree
Showing 4 changed files with 1,281 additions and 101 deletions.
33 changes: 0 additions & 33 deletions Makefile

This file was deleted.

36 changes: 36 additions & 0 deletions Makefile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// https://github.com/shelljs/shelljs#command-reference
// https://devhints.io/shelljs
// https://github.com/shelljs/shelljs/wiki/The-make-utility
require('shelljs/make');

config.fatal = true;
config.verbose = true;

target.all = () => {
// target.clean();
// target.generateTrieJson();
// target.moveTrieJsonToRoot();
target.rollupCjs();
};

target.generateTrieJson = () => {
exec('babel-node src/opentype/shapers/generate-data.js');
exec('babel-node src/opentype/shapers/gen-use.js');
exec('babel-node src/opentype/shapers/gen-indic.js');
};

target.moveTrieJsonToRoot = () => {
target.generateTrieJson();
mv('src/opentype/shapers/trie.json', 'trie.json');
mv('src/opentype/shapers/trieUse.json', 'trieUse.json');
mv('src/opentype/shapers/trieIndic.json', 'trieIndic.json');
};

target.rollupCjs = () => {
// target.moveTrieJsonToRoot();
exec('rollup -c rollup.config.js -o index.js');
};

target.clean = () => {
rm('-f', 'index.js', 'trie.json', 'trieUse.json', 'trieIndic.json', )
};
26 changes: 12 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,8 @@
"layout"
],
"scripts": {
"make": "node Makefile.js",
"test": "mocha",
"prepublish": "run-s clean trie:** rollup:**",
"trie:data": "babel-node src/opentype/shapers/generate-data.js",
"trie:use": "babel-node src/opentype/shapers/gen-use.js",
"trie:indic": "babel-node src/opentype/shapers/gen-indic.js",
"trie:copy": "shx cp src/opentype/shapers/*.trie ./",
"rollup:index": "rollup -c -m -i src/index.js -o index.js",
"rollup:base": "rollup -c -m -i src/base.js -o base.js",
"clean": "shx rm -f index.js base.js data.trie indic.trie use.trie src/opentype/shapers/data.trie src/opentype/shapers/use.trie src/opentype/shapers/use.json src/opentype/shapers/indic.trie src/opentype/shapers/indic.json",
"coverage": "cross-env BABEL_ENV=cover nyc mocha",
"build-bundle": "browserify --insert-globals --standalone fontkit ./index.js | uglifyjs --mangle -c > bundle.js"
},
Expand All @@ -38,26 +31,32 @@
"author": "Devon Govett <[email protected]>",
"license": "MIT",
"dependencies": {
"babel-runtime": "^6.11.6",
"babel-plugin-istanbul": "^4.1.3",
"babel-plugin-transform-class-properties": "^6.16.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-runtime": "^6.12.0",
"babel-preset-es2015": "^6.14.0",
"babel-register": "^6.14.0",
"babel-runtime": "^6.11.6",
"brfs": "^1.4.0",
"brotli": "^1.2.0",
"browserify-optional": "^1.0.0",
"clone": "^1.0.1",
"deep-equal": "^1.0.0",
"dfa": "^1.0.0",
"restructure": "^0.5.3",
"shelljs": "^0.8.3",
"tiny-inflate": "^1.0.2",
"unicode-properties": "git+https://github.com/Hopding/unicode-properties.git#9fd91fffd8a8a410d09b40fbec9c906607771bef",
"unicode-trie": "^0.3.0"
},
"devDependencies": {
"@babel/core": "^7.2.2",
"@babel/plugin-proposal-class-properties": "^7.2.1",
"@babel/plugin-proposal-decorators": "^7.2.2",
"@babel/preset-env": "^7.2.0",
"babel-cli": "^6.14.0",
"babel-preset-env": "^1.7.0",
"codepoints": "^1.2.0",
"concat-stream": "^1.4.6",
"cross-env": "^5.0.1",
Expand All @@ -67,11 +66,10 @@
"mocha": "^2.0.1",
"npm-run-all": "^4.0.2",
"nyc": "^10.3.2",
"rollup": "^0.34.10",
"rollup-plugin-babel": "^2.6.1",
"rollup-plugin-json": "^2.0.2",
"rollup-plugin-local-resolve": "^1.0.7",
"shx": "^0.2.2"
"rollup": "^0.68.0",
"rollup-plugin-babel": "^4.1.0",
"rollup-plugin-json": "^3.1.0",
"rollup-plugin-local-resolve": "^1.0.7"
},
"browserify": {
"transform": [
Expand Down
Loading

0 comments on commit a246e7f

Please sign in to comment.