Skip to content

Commit 9f15384

Browse files
committed
no longer babelify the code; instead rely on node v4+
1 parent e49e832 commit 9f15384

File tree

8 files changed

+286
-71
lines changed

8 files changed

+286
-71
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,3 @@ node_modules
77

88
# Jetbrains IDE project files
99
.idea
10-
11-
# Build files
12-
dist/group.js
13-
dist/trivialperms.js

.npmignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@ node_modules
99
.idea
1010

1111
# Build Files
12-
dist/trivialperms.min.js
12+
dist
1313

14-
# Ignore source files
14+
# Ignore dev files
1515
.babelrc
1616
.editorconfig
1717
.gitignore
1818
**.yml
1919
Gruntfile.js
20-
src
2120
examples
2221
test

Gruntfile.js

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,11 @@
55
module.exports = function(grunt)
66
{
77
grunt.initConfig({
8-
clean: ['dist'],
9-
babel: {
10-
options: {
11-
sourceMap: "inline",
12-
presets: ['es2015']
13-
},
14-
dev: {
15-
options: {
16-
compact: false,
17-
comments: true
18-
},
19-
files: [{
20-
expand: true,
21-
cwd:"src",
22-
src: ['**/*.js'],
23-
dest: 'dist'
24-
}]
25-
},
26-
prod: {
27-
options: {
28-
compact: true,
29-
comments: false
30-
},
31-
files: [{
32-
expand: true,
33-
cwd:"src",
34-
src: ['**/*.js'],
35-
dest: 'dist'
36-
}]
37-
}
8+
clean: {
9+
js: [
10+
'dist/**/*.*',
11+
'!dist/*.min.js'
12+
]
3813
},
3914
browserify: {
4015
options: {
@@ -51,12 +26,6 @@ module.exports = function(grunt)
5126
}
5227
}
5328
},
54-
watch: {
55-
index: {
56-
files: ["src/**/*.js"],
57-
tasks: ["babel:dev"]
58-
}
59-
},
6029
eslint: {
6130
src: {
6231
src: ['Gruntfile.js', 'src/**/*.js'],
@@ -71,18 +40,15 @@ module.exports = function(grunt)
7140

7241
//------------------------------------------------------------------------------------------------------------------
7342

74-
grunt.loadNpmTasks("grunt-babel");
7543
grunt.loadNpmTasks('grunt-contrib-clean');
7644
grunt.loadNpmTasks('grunt-contrib-watch');
7745
grunt.loadNpmTasks("grunt-browserify");
7846
grunt.loadNpmTasks("gruntify-eslint");
7947

8048
//------------------------------------------------------------------------------------------------------------------
8149

82-
grunt.registerTask("build-web", ["eslint", "clean", "browserify"]);
83-
grunt.registerTask("build-dev", ["eslint", "clean", "babel:dev"]);
84-
grunt.registerTask("build", ["eslint", "clean", "babel:prod"]);
85-
grunt.registerTask("default", ["build-dev", 'watch']);
50+
grunt.registerTask("build", ["eslint", "clean", "browserify"]);
51+
grunt.registerTask("default", ["build"]);
8652

8753
//------------------------------------------------------------------------------------------------------------------
8854
};

dist/trivialperms.min.js

Lines changed: 255 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
"name": "trivialperms",
33
"version": "1.0.0-rc.3",
44
"description": "A simple RBAC implementation that is datasource agnostic.",
5-
"main": "./dist/trivialperms.js",
5+
"main": "./src/trivialperms.js",
66
"scripts": {
7-
"test": "./node_modules/.bin/mocha --reporter spec --recursive --compilers js:babel-core/register",
8-
"compile": "./node_modules/.bin/grunt build",
9-
"prepublish": "npm run compile"
7+
"test": "mocha --reporter spec --recursive",
8+
"version": "grunt build"
109
},
1110
"keywords": [
1211
"json",
@@ -22,6 +21,7 @@
2221
"url": "https://github.com/trivialsoftware/TrivialPermissions.git"
2322
},
2423
"license": "MIT",
24+
"engines" : { "node" : ">=4.0.0" },
2525
"dependencies": {
2626
"bluebird": "^3.3.1",
2727
"lodash": "^4.5.1"
@@ -33,7 +33,6 @@
3333
"babel-preset-es2015": "^6.1.18",
3434
"chai": "^3.5.0",
3535
"grunt": "^0.4.5",
36-
"grunt-babel": "^6.0.0",
3736
"grunt-cli": "^0.1.13",
3837
"grunt-browserify": "^4.0.1",
3938
"grunt-contrib-clean": "^0.7.0",

src/group.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
//----------------------------------------------------------------------------------------------------------------------
2-
/// TPGroup
3-
///
4-
/// @module
2+
// TPGroup
3+
//
4+
// @module
55
//----------------------------------------------------------------------------------------------------------------------
66

7-
import find from 'lodash/find';
8-
import uniq from 'lodash/uniq';
9-
import remove from 'lodash/remove';
7+
const find = require('lodash/find');
8+
const uniq = require('lodash/uniq');
9+
const remove = require('lodash/remove');
1010

1111
const _ = {
1212
find,
@@ -73,6 +73,6 @@ class TPGroup {
7373

7474
//----------------------------------------------------------------------------------------------------------------------
7575

76-
export default TPGroup;
76+
module.exports = TPGroup;
7777

7878
//----------------------------------------------------------------------------------------------------------------------

src/trivialperms.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
//----------------------------------------------------------------------------------------------------------------------
2-
/// TrivialPerms
3-
///
4-
/// @module
2+
// TrivialPerms
3+
//
4+
// @module
55
//----------------------------------------------------------------------------------------------------------------------
66

7-
import map from 'lodash/map';
8-
import find from 'lodash/find';
9-
import some from 'lodash/some';
10-
import includes from 'lodash/includes';
11-
import isFunction from 'lodash/isFunction';
7+
const map = require('lodash/map');
8+
const find = require('lodash/find');
9+
const some = require('lodash/some');
10+
const includes = require('lodash/includes');
11+
const isFunction = require('lodash/isFunction');
1212

13-
import Promise from 'bluebird';
14-
import TPGroup from './group';
13+
const Promise = require('bluebird');
14+
const TPGroup = require('./group');
1515

1616
//----------------------------------------------------------------------------------------------------------------------
1717

test/group.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
const expect = require('chai').expect;
88

9-
const TPGroup = require('../src/group').default;
9+
const TPGroup = require('../src/group');
1010

1111
// ---------------------------------------------------------------------------------------------------------------------
1212

0 commit comments

Comments
 (0)