diff --git a/.dockerignore b/.dockerignore index c74d2f83d3e..dc570e2cd93 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,3 @@ .git node_modules -app/bower_components .*.swp diff --git a/.eslintrc.js b/.eslintrc.js index f2ddd9cea5a..354ab15ea77 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,3 +1,3 @@ module.exports = { - "extends": "google" + extends: 'google' }; \ No newline at end of file diff --git a/.gitignore b/.gitignore index 0d51e001f97..38259008394 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ node_modules/grunt-newer/.cache npm-debug.log dist/ node_modules -app/bower_components *.sublime-workspace .*.swp buttons.diff diff --git a/.travis.yml b/.travis.yml index 5ba9bccbe44..c309d21e836 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,13 +10,11 @@ services: script: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - - npm install -g bower - npm cache clean - npm install - npm run-script build - - bower install - if [ $DOCKER_HUB_USERNAME ]; then docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build -t $DOCKER_IMAGE_NAME . && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_IMAGE_NAME:latest $DOCKER_IMAGE_NAME:$TRAVIS_TAG; fi && docker push $DOCKER_IMAGE_NAME; fi -env: +env: - DOCKER_IMAGE_NAME=swaggerapi/swagger-editor diff --git a/docs/development.md b/docs/development.md index c97c184fbaa..258a3629f8f 100644 --- a/docs/development.md +++ b/docs/development.md @@ -10,9 +10,9 @@ PORT=81 npm start ### Installing dependencies -This app have npm and Bower dependencies. To install all dependencies in one line, run +This app have npm dependencies. To install all dependencies in one line, run ```shell -npm i; bower i +npm install; ``` ### Running in development mode @@ -34,7 +34,7 @@ or PORT=3000 npm run develop ``` -For development it's preferred to have `grunt` installed globally on your machine. +For development it's preferred to have `grunt` installed globally on your machine. ### Building To build the project just run: @@ -48,7 +48,7 @@ This will build a new version of the web app, ready for production in `/dist` fo Swagger Editor will make an XHR GET call to `/config/defaults.json` to get it's settings before launch. If you are using Swagger Editor as a dependency or serving it statically, you can provide your own `defaults.json` at this endpoint to override default settings. Swagger Editor is configured with a file, [`defaults.json`](../app/config/defaults.json). -Read the [configuration guide](./config.md) and additional details +Read the [configuration guide](./config.md) and additional details in [`defaults.json.guide.js`](../app/config/defaults.json.guide.js) to learn how to configure Swagger Editor. diff --git a/package.json b/package.json index 27cb1960e6f..6cc9739f44e 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,6 @@ "karma-ng-scenario": "^0.1.0", "less-loader": "^2.2.2", "lodash": "^4.6.1", - "main-bower-files": "^2.9.0", "mocha": "^2.4.5", "mversion": "^1.10.0", "ng-file-upload": "^12.0.4", diff --git a/test/.eslintrc.js b/test/.eslintrc.js new file mode 100644 index 00000000000..71e159d9f10 --- /dev/null +++ b/test/.eslintrc.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = { + extends: "../.eslintrc.js", + env: { + jasmine: true + } +}; diff --git a/test/.jscsrc b/test/.jscsrc deleted file mode 100644 index 2dcbee974e7..00000000000 --- a/test/.jscsrc +++ /dev/null @@ -1,72 +0,0 @@ -{ - "excludeFiles": [ - "app/scripts/analytics/google.js", - "app/scripts/plugins/*.js", - "app/scripts/ace/themes/theme-atom_dark.js" - ], - "requireCurlyBraces": [ - "if", - "else", - "for", - "while", - "do", - "try", - "catch" - ], - "requireSpaceAfterKeywords": [ - "if", - "else", - "for", - "while", - "do", - "switch", - "case", - "return", - "try", - "catch", - "function", - "typeof" - ], - "requireSpaceBeforeBlockStatements": true, - "requireParenthesesAroundIIFE": true, - "requireSpacesInConditionalExpression": true, - "disallowSpacesInNamedFunctionExpression": { - "beforeOpeningRoundBrace": true - }, - "disallowSpacesInFunctionDeclaration": { - "beforeOpeningRoundBrace": true - }, - "requireBlocksOnNewline": 1, - "disallowEmptyBlocks": true, - "disallowSpacesInsideArrayBrackets": true, - "disallowSpacesInsideParentheses": true, - "disallowQuotedKeysInObjects": true, - "disallowSpaceAfterObjectKeys": true, - "requireCommaBeforeLineBreak": true, - "disallowSpaceAfterPrefixUnaryOperators": true, - "disallowSpaceBeforePostfixUnaryOperators": true, - "disallowSpaceBeforeBinaryOperators": [ - "," - ], - "requireSpaceBeforeBinaryOperators": true, - "requireSpaceAfterBinaryOperators": true, - "requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties", - "disallowKeywords": [ - "with" - ], - "disallowMultipleLineBreaks": true, - "validateLineBreaks": "LF", - "validateQuoteMarks": "'", - "validateIndentation": 2, - "disallowMixedSpacesAndTabs": true, - "disallowTrailingWhitespace": true, - "disallowTrailingComma": true, - "disallowKeywordsOnNewLine": [ - "else" - ], - "requireLineFeedAtFileEnd": true, - "requireCapitalizedConstructors": true, - "requireDotNotation": true, - "disallowYodaConditions": true, - "maximumLineLength": 80 -} diff --git a/test/.jshintrc b/test/.jshintrc deleted file mode 100644 index b1be025b81d..00000000000 --- a/test/.jshintrc +++ /dev/null @@ -1,36 +0,0 @@ -{ - "node": true, - "browser": true, - "esnext": true, - "bitwise": true, - "camelcase": true, - "curly": true, - "eqeqeq": true, - "immed": true, - "indent": 2, - "latedef": true, - "newcap": true, - "noarg": true, - "quotmark": "single", - "regexp": true, - "undef": true, - "unused": true, - "strict": true, - "trailing": true, - "smarttabs": true, - "globals": { - "after": false, - "afterEach": false, - "angular": false, - "before": false, - "beforeEach": false, - "browser": false, - "describe": false, - "expect": false, - "inject": false, - "it": false, - "jasmine": false, - "spyOn": false - } -} - diff --git a/test/unit/karma.conf.js b/test/unit/karma.conf.js index eee821f100b..2608098ae5c 100644 --- a/test/unit/karma.conf.js +++ b/test/unit/karma.conf.js @@ -1,36 +1,6 @@ // Karma configuration // http://karma-runner.github.io/0.10/config/configuration-file.html -var path = require('path'); - -var files = require('main-bower-files')({ - filter: /\.js$/, - includeDev: true - }) - .map(function (filePath) { - - // make paths relative - return path.relative(path.join(__dirname, '../../app'), filePath); - }) - .filter(function (filePath) { - - // angular-scenario is added in runner.html file already - return !/angular\-scenario/.test(filePath); - }) - .concat([ - - // Worker files - {pattern: 'bower_components/sway-worker/index.js', served: true}, - - // App source Code - 'scripts/*.js', - 'scripts/**/*.js', - - // Test files - '../test/unit/defaults.js', - '../test/unit/bootstrap.js', - '../test/unit/spec/**/*.js' - ]); module.exports = function (config) { config.set({ @@ -41,7 +11,7 @@ module.exports = function (config) { }, // base path, that will be used to resolve files and exclude - basePath: '../../app', + basePath: '../..', // testing framework to use (jasmine/mocha/qunit/...) frameworks: ['mocha', 'sinon-chai', 'chai', 'chai-as-promised'],