Skip to content

Commit

Permalink
Fix module resolution issues
Browse files Browse the repository at this point in the history
  • Loading branch information
saharj committed May 14, 2016
1 parent b9cf007 commit 78fd501
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 69 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"node": ">=5.8.0"
},
"scripts": {
"build": "webpack --production --hide-modules",
"build": "webpack --production --hide-modules --stats=errors-only",
"unit-test": "karma start test/unit/karma.conf.js --single-run=true",
"unit-test-watch": "karma start test/unit/karma.conf.js",
"pree2e-test": "webdriver-manager update",
Expand Down
6 changes: 3 additions & 3 deletions scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ window.SwaggerEditor = angular.module('SwaggerEditor', [
'ngStorage'
]);

require('./config.js');
require('scripts/config.js');

// Require all of components
require('./components');
require('scripts/components');

// Bootstrap the app
require('./bootstrap');
require('scripts/bootstrap');
100 changes: 50 additions & 50 deletions scripts/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,72 +6,72 @@
*/

// Configurations
require('./config/app.config.js');
require('scripts/config/app.config.js');

// Router
require('./router');
require('scripts/router');

// Services
require('./services/analytics.js');
require('./services/ast-manager.js');
require('./services/auth-manager.js');
require('./services/autocomplete.js');
require('./services/backend.js');
require('./services/builder.js');
require('./services/codegen.js');
require('./services/editor.js');
require('./services/external-hooks.js');
require('./services/fileloader.js');
require('./services/focused-path.js');
require('./services/fold-state-manager.js');
require('./services/keyword-map.js');
require('./services/local-storage.js');
require('./services/preferences.js');
require('./services/storage.js');
require('./services/sway-worker.js');
require('./services/tag-manager.js');
require('./services/yaml.js');
require('scripts/services/analytics.js');
require('scripts/services/ast-manager.js');
require('scripts/services/auth-manager.js');
require('scripts/services/autocomplete.js');
require('scripts/services/backend.js');
require('scripts/services/builder.js');
require('scripts/services/codegen.js');
require('scripts/services/editor.js');
require('scripts/services/external-hooks.js');
require('scripts/services/fileloader.js');
require('scripts/services/focused-path.js');
require('scripts/services/fold-state-manager.js');
require('scripts/services/keyword-map.js');
require('scripts/services/local-storage.js');
require('scripts/services/preferences.js');
require('scripts/services/storage.js');
require('scripts/services/sway-worker.js');
require('scripts/services/tag-manager.js');
require('scripts/services/yaml.js');

// Controllers
require('./controllers/editor.js');
require('./controllers/errorpresenter.js');
require('./controllers/general-modal.js');
require('./controllers/header.js');
require('./controllers/import-file.js');
require('./controllers/importurl.js');
require('./controllers/main.js');
require('./controllers/modal.js');
require('./controllers/openexamples.js');
require('./controllers/paste-json.js');
require('./controllers/preferences.js');
require('./controllers/preview.js');
require('./controllers/security.js');
require('./controllers/confirm-reset.js');
require('scripts/controllers/editor.js');
require('scripts/controllers/errorpresenter.js');
require('scripts/controllers/general-modal.js');
require('scripts/controllers/header.js');
require('scripts/controllers/import-file.js');
require('scripts/controllers/importurl.js');
require('scripts/controllers/main.js');
require('scripts/controllers/modal.js');
require('scripts/controllers/openexamples.js');
require('scripts/controllers/paste-json.js');
require('scripts/controllers/preferences.js');
require('scripts/controllers/preview.js');
require('scripts/controllers/security.js');
require('scripts/controllers/confirm-reset.js');

// Directives
require('./directives/auto-focus.js');
require('./directives/collapsewhen.js');
require('./directives/on-file-change.js');
require('./directives/operation.js');
require('./directives/schemamodel.js');
require('./directives/scroll-into-view-when.js');
require('./directives/stop-event.js');
require('./directives/track-event.js');
require('./directives/tryoperation.js');
require('scripts/directives/auto-focus.js');
require('scripts/directives/collapsewhen.js');
require('scripts/directives/on-file-change.js');
require('scripts/directives/operation.js');
require('scripts/directives/schemamodel.js');
require('scripts/directives/scroll-into-view-when.js');
require('scripts/directives/stop-event.js');
require('scripts/directives/track-event.js');
require('scripts/directives/tryoperation.js');

// Enums
require('./enums/defaults.js');
require('./enums/strings.js');
require('scripts/enums/defaults.js');
require('scripts/enums/strings.js');

// Filter
require('./filters/formdata.js');
require('scripts/filters/formdata.js');

// Plugins
require('./plugins/jquery.scroll-into-view.js');
require('scripts/plugins/jquery.scroll-into-view.js');

// Misc
require('./ace/snippets/swagger.snippet.js');
require('./analytics/google.js');
require('scripts/ace/snippets/swagger.snippet.js');
require('scripts/analytics/google.js');

// Ace Editor
window.ace = require('brace');
Expand Down
16 changes: 8 additions & 8 deletions scripts/controllers/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ SwaggerEditor.controller('HeaderCtrl', function HeaderCtrl($scope, $uibModal,
*/
function showCodegenError(resp) {
$uibModal.open({
template: require('../templates/code-gen-error-modal.html'),
template: require('templates/code-gen-error-modal.html'),
controller: 'GeneralModal',
size: 'large',
resolve: {
Expand Down Expand Up @@ -100,31 +100,31 @@ SwaggerEditor.controller('HeaderCtrl', function HeaderCtrl($scope, $uibModal,

$scope.openImportFile = function() {
$uibModal.open({
template: require('../templates/file-import.html'),
template: require('templates/file-import.html'),
controller: 'FileImportCtrl',
size: 'large'
});
};

$scope.openImportUrl = function() {
$uibModal.open({
template: require('../templates/url-import.html'),
template: require('templates/url-import.html'),
controller: 'UrlImportCtrl',
size: 'large'
});
};

$scope.openPasteJSON = function() {
$uibModal.open({
template: require('../templates/paste-json.html'),
template: require('templates/paste-json.html'),
controller: 'PasteJSONCtrl',
size: 'large'
});
};

$scope.openAbout = function() {
$uibModal.open({
template: require('../templates/about.html'),
template: require('templates/about.html'),
size: 'large',
controller: 'ModalCtrl'
});
Expand All @@ -138,7 +138,7 @@ SwaggerEditor.controller('HeaderCtrl', function HeaderCtrl($scope, $uibModal,
$scope.openEditorPreferences = Editor.showSettings;
$scope.resetSettings = function() {
$uibModal.open({
template: require('../templates/reset-editor.html'),
template: require('templates/reset-editor.html'),
controller: 'ConfirmReset',
size: 'large'
});
Expand All @@ -147,15 +147,15 @@ SwaggerEditor.controller('HeaderCtrl', function HeaderCtrl($scope, $uibModal,

$scope.openExamples = function() {
$uibModal.open({
template: require('../templates/open-examples.html'),
template: require('templates/open-examples.html'),
controller: 'OpenExamplesCtrl',
size: 'large'
});
};

$scope.openPreferences = function() {
$uibModal.open({
template: require('../templates/preferences.html'),
template: require('templates/preferences.html'),
controller: 'PreferencesCtrl',
size: 'large'
});
Expand Down
6 changes: 3 additions & 3 deletions scripts/controllers/security.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ SwaggerEditor.controller('SecurityCtrl', function SecurityCtrl($scope,
$scope.authenticate = function(securityName, security) {
if (security.type === 'basic') {
$uibModal.open({
template: require('../templates/auth/basic.html'),
template: require('templates/auth/basic.html'),
controller: ['$scope', '$uibModalInstance',
function BasicAuthAuthenticateCtrl($scope,
$uibModalInstance) {
Expand All @@ -34,7 +34,7 @@ SwaggerEditor.controller('SecurityCtrl', function SecurityCtrl($scope,
});
} else if (security.type === 'oauth2') {
$uibModal.open({
template: require('../templates/auth/oauth2.html'),
template: require('templates/auth/oauth2.html'),
controller: ['$scope', '$uibModalInstance',
function OAuth2AuthenticateCtrl($scope, $uibModalInstance) {
$scope.cancel = $uibModalInstance.close;
Expand All @@ -52,7 +52,7 @@ SwaggerEditor.controller('SecurityCtrl', function SecurityCtrl($scope,
});
} else if (security.type === 'apiKey') {
$uibModal.open({
template: require('../templates/auth/api-key.html'),
template: require('templates/auth/api-key.html'),
controller: ['$scope', '$uibModalInstance',
function APIKeyAuthenticateCtrl($scope, $uibModalInstance) {
$scope.cancel = $uibModalInstance.close;
Expand Down
2 changes: 1 addition & 1 deletion scripts/directives/operation.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SwaggerEditor.directive('swaggerOperation', function(defaults) {
return {
restrict: 'E',
replace: true,
template: require('../templates/operation.html'),
template: require('templates/operation.html'),
scope: false,
link: function($scope) {
$scope.isTryOpen = false;
Expand Down
2 changes: 1 addition & 1 deletion scripts/directives/schemamodel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var JSONSchemaView = require('json-schema-view-js');

SwaggerEditor.directive('schemaModel', function() {
return {
template: require('../templates/schema-model.html'),
template: require('templates/schema-model.html'),
restrict: 'E',
replace: true,
scope: {
Expand Down
3 changes: 2 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ function startServer(port, cb) {

var server = new WebpackDevServer(compiler, {
progress: true,
quiet: true,
stats: 'errors-only',
showModules: false,
publicPath: config.output.publicPath,
headers: {
'Set-Cookie':
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var config = {

resolve: {
extensions: ['', '.js', '.json'],
root: path.resolve(__dirname),
root: __dirname,
modulesDirectories: ['node_modules']
},

Expand Down

0 comments on commit 78fd501

Please sign in to comment.