Skip to content
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.

Commit

Permalink
fix jspm add node-process dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ozsay committed Nov 5, 2015
1 parent e5f06b8 commit b40bfe5
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ menu, menu-item, power-save-blocker, protocol, web-contents, tray`
path, punycode, querystring, readline, stream, string_decoder, tls, dgram, url,
util, v8, vm, zlib`

> All of the modules are required upon instantiation.
> All of the modules are lazy required (required only on use).
### remoteProvider

Expand Down
11 changes: 5 additions & 6 deletions angular-electron.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(function(angular, require, undefined) {'use strict';
(function(angular, electronRequire, electronProcess, undefined) {'use strict';

angular.module('angular-electron', []);

Expand All @@ -15,7 +15,7 @@ angular.module('angular-electron').directive('externalLink', ['shell', function
};
}]);

angular.module('angular-electron').constant('process', process);
angular.module('angular-electron').constant('process', electronProcess);

var remoteModules = ['app', 'auto-updater', 'browser-window', 'content-tracing', 'dialog',
'global-shortcut', 'menu', 'menu-item', 'power-save-blocker',
Expand All @@ -25,8 +25,7 @@ var nodeModules = ['buffer', 'child_process', 'cluster', 'crypto', 'dns', 'event
'string_decoder', 'tls', 'dgram', 'url', 'util', 'v8', 'vm', 'zlib'];

angular.module('angular-electron').provider('remote', ['$provide', function($provide) {
var _remote = 'remote';
var remote = require(_remote);
var remote = electronRequire('remote');

function register(name, _require) {
_require = _require || name;
Expand Down Expand Up @@ -60,7 +59,7 @@ var wrapModules = ['ipc', 'web-frame', 'clipboard', 'crash-reporter', 'native-im

angular.forEach(wrapModules, function (_module) {
angular.module('angular-electron').service(_module.name || _module, [function() {
var __module = require(_module.require || _module);
var __module = electronRequire(_module.require || _module);

return __module;
}]);
Expand Down Expand Up @@ -104,4 +103,4 @@ angular.module('angular-electron').service('safeShutdown', ['$q', 'currentWindow
};
}]);

})(window.angular, window.require);
})(window.angular, window.require, window.process);
2 changes: 1 addition & 1 deletion angular-electron.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ var gulp = require('gulp'),
insert = require('gulp-insert'),
uglify = require('gulp-uglify');

var HEADER = "(function(angular, require, undefined) {'use strict';\n\n" +
var HEADER = "(function(angular, electronRequire, electronProcess, undefined) {'use strict';\n\n" +
"angular.module('angular-electron', []);\n\n";
var FOOTER = "\n})(window.angular, window.require);\n";
var FOOTER = "\n})(window.angular, window.require, window.process);\n";

gulp.task('build:dev', function () {
return gulp.src('./src/*')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-electron",
"version": "0.1.10",
"version": "0.1.11",
"description": "angularjs helpers for electron apps",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/process.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
angular.module('angular-electron').constant('process', process);
angular.module('angular-electron').constant('process', electronProcess);
3 changes: 1 addition & 2 deletions src/remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ var nodeModules = ['buffer', 'child_process', 'cluster', 'crypto', 'dns', 'event
'string_decoder', 'tls', 'dgram', 'url', 'util', 'v8', 'vm', 'zlib'];

angular.module('angular-electron').provider('remote', ['$provide', function($provide) {
var _remote = 'remote';
var remote = require(_remote);
var remote = electronRequire('remote');

function register(name, _require) {
_require = _require || name;
Expand Down
2 changes: 1 addition & 1 deletion src/rendererModules.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var wrapModules = ['ipc', 'web-frame', 'clipboard', 'crash-reporter', 'native-im

angular.forEach(wrapModules, function (_module) {
angular.module('angular-electron').service(_module.name || _module, [function() {
var __module = require(_module.require || _module);
var __module = electronRequire(_module.require || _module);

return __module;
}]);
Expand Down

0 comments on commit b40bfe5

Please sign in to comment.