Skip to content

Commit

Permalink
Use node modules
Browse files Browse the repository at this point in the history
Use modules instead for plain export.
Added index file which loads all individaul lists.
Bump version.
  • Loading branch information
jlblcc committed Dec 14, 2015
1 parent e9710d6 commit a138a54
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mdcodes",
"version": "1.2.2",
"version": "1.2.3",
"homepage": "https://github.com/adiwg/mdCodes",
"authors": [
"Josh Bradley <[email protected]>"
Expand Down
15 changes: 15 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

const glob = require('glob');
const path = require('path');
const all = {};

glob.sync('./resources/js/*.js').forEach(function(file) {
const obj = require(path.resolve(file));
const name = path.basename(file, '.js');
if (0 === name.indexOf('iso_')) {
all[name] = obj;
}
});

module.exports = exports = all;
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mdcodes",
"version": "1.2.2",
"version": "1.2.3",
"description": "CodeLists for ADIwg mdJSON",
"repository": {
"type": "git",
Expand Down Expand Up @@ -28,6 +28,7 @@
},
"dependencies": {
"buildify": "^0.4.0",
"glob": "^6.0.1",
"rimraf": "^2.4.4"
}
}
2 changes: 1 addition & 1 deletion scripts/prepublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ for (let file of files) {
buildify()
.load('resources/json/' + file)
.perform(function(content) {
return 'export default ' + content + ';';
return 'module.exports = ' + content + ';';
})
.save(name);
//console.log('Created ' + name);
Expand Down

0 comments on commit a138a54

Please sign in to comment.