Skip to content

Commit

Permalink
support umd
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Grainger committed Jul 5, 2017
1 parent a08cb60 commit cfdb610
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 297 deletions.
6 changes: 0 additions & 6 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,10 @@ module.exports = function(grunt) {
flow: {
files: {
'dist/ng-flow.js': [
'src/provider.js',
'src/directives/init.js',
'src/directives/*.js',
'src/*.js'
],
'dist/ng-flow-standalone.js': [
'bower_components/flow.js/dist/flow.js',
'src/provider.js',
'src/directives/init.js',
'src/directives/*.js',
'src/*.js'
]
}
Expand Down
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* for module loading using webpack or similar package bundlers */
window.Flow = require('./dist/ng-flow-standalone');
module.exports = 'flow';
/* backwards compatable with deprecated index.js*/
try {
console.warn(new Error("use const ngFlow = require('@flowjs/ng-flow');"));
} catch (e) {
// do nothing
}
module.exports = require('./src/ng-flow');
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"test": "grunt test"
},
"main": "dist/ng-flow.js",
"main": "src/ng-flow.js",
"repository": {
"type": "git",
"url": "git://github.com/flowjs/ng-flow.git"
Expand Down
2 changes: 0 additions & 2 deletions src/angular-flow.js

This file was deleted.

14 changes: 0 additions & 14 deletions src/directives/btn.js

This file was deleted.

57 changes: 0 additions & 57 deletions src/directives/drag-events.js

This file was deleted.

26 changes: 0 additions & 26 deletions src/directives/drop.js

This file was deleted.

50 changes: 0 additions & 50 deletions src/directives/events.js

This file was deleted.

22 changes: 0 additions & 22 deletions src/directives/img.js

This file was deleted.

43 changes: 0 additions & 43 deletions src/directives/init.js

This file was deleted.

10 changes: 0 additions & 10 deletions src/directives/transfers.js

This file was deleted.

16 changes: 15 additions & 1 deletion dist/ng-flow.js → src/ng-flow.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['angular', '@flowjs/flow.js'], factory);
} else if (typeof exports === 'object') {
// Node, CommonJS-like
module.exports = factory(require('angular'), require('@flowjs/flow.js'));
} else {
// Browser globals (root is window)
root.ngFlow = factory(root.angular, root.Flow);
}
}(this, function (angular, Flow) {
/**
* @description
* var app = angular.module('App', ['flow.provider'], function(flowFactoryProvider){
Expand Down Expand Up @@ -286,4 +297,7 @@ angular.module('flow.transfers', ['flow.init'])
};
}]);
angular.module('flow', ['flow.provider', 'flow.init', 'flow.events', 'flow.btn',
'flow.drop', 'flow.transfers', 'flow.img', 'flow.dragEvents']);
'flow.drop', 'flow.transfers', 'flow.img', 'flow.dragEvents']);

return 'flow';
}));
62 changes: 0 additions & 62 deletions src/provider.js

This file was deleted.

0 comments on commit cfdb610

Please sign in to comment.