Skip to content

Commit

Permalink
Update to babel 7 and refactor builds to be UMDs
Browse files Browse the repository at this point in the history
  • Loading branch information
Hopding committed Dec 18, 2018
1 parent 9e92140 commit 3db56ad
Show file tree
Hide file tree
Showing 8 changed files with 2,160 additions and 1,233 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["es2015"]
"presets": ["@babel/preset-env", { "modules": false, "loose": true }]
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
node_modules/
dist/
unicode-properties.*.js
unicode-properties.js
unicode-properties.min.js
34 changes: 34 additions & 0 deletions Makefile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// 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.rollupUMD();
target.rollupUMDMin();
};

target.generateTrieJson = () => {
exec('node generate.js');
};

target.rollupUMD = () => {
target.generateTrieJson();
env.UGLIFY = false;
exec('rollup -c rollup.config.js -o unicode-properties.js');
};

target.rollupUMDMin = () => {
target.generateTrieJson();
env.UGLIFY = true;
exec('rollup -c rollup.config.js -o unicode-properties.min.js');
};

target.clean = () => {
rm('-f', 'data.json', 'trie.json', 'unicode-properties.js', 'unicode-properties.min.js');
};
4 changes: 4 additions & 0 deletions generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ const codePoints = require('codepoints');
const fs = require('fs');
const UnicodeTrieBuilder = require('unicode-trie/builder');

// import codePoints from 'codepoints';
// import fs from 'fs';
// import UnicodeTrieBuilder from 'unicode-trie/builder';

const log2 = Math.log2 || (n => Math.log(n) / Math.LN2);

const bits = n => (log2(n) + 1) | 0;
Expand Down
Loading

0 comments on commit 3db56ad

Please sign in to comment.