Skip to content

Commit

Permalink
Merge pull request #4 from mocks-server/v1.0.2
Browse files Browse the repository at this point in the history
V1.0.2
  • Loading branch information
javierbrea authored Nov 8, 2019
2 parents 961ca67 + b5b7e32 commit e4d159b
Show file tree
Hide file tree
Showing 64 changed files with 615 additions and 44 deletions.
13 changes: 6 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,25 @@ node_js:

cache:
directories:
- "node_modules"
- "$HOME/.sonar/cache"
- ~/.npm
- node_modules
- ~/.sonar/cache

addons:
sonarcloud:
organization: "javierbrea"
token:
secure: "$SONAR_TOKEN"
organization: "mocks-server"
branch:
name: "$TRAVIS_CURRENT_BRANCH"

script:
- npm run lint
- npm run test-ci
- npm run coveralls
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sonar-scanner; fi'
- sonar-scanner -Dsonar.login=${SONAR_TOKEN}

deploy:
provider: npm
email: "devops@xbyorange.com"
email: "javier.brea@gmail.com"
api_key: "$NPM_TOKEN"
on:
tags: true
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
### Removed

## [1.0.2] - 2019-11-08
### Changed
- Project forked from xbyorange/mocks-server. Fixed license. Read NOTICE for further details

### Fixed
- Fix some minor Sonar bugs and code smells.

## [1.0.1] - 2019-06-04
### Fixed
- Upgrade dependencies to fix potential security vulnerability
Expand Down
26 changes: 2 additions & 24 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -175,27 +175,5 @@

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Copyright 2019 Javier Brea and contributors
Copyright 2019 XbyOrange
6 changes: 6 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
mocks-server. Main distribution
Copyright 2019 Javier Brea

Portions of this software were developed at XbyOrange company.
XByOrange npm-file-link v1.0.1, distributed under The Apache Software License, Version 2.0.
Github repository "xbyorange/mocks-server" (https://github.com/XbyOrange/mocks-server), branch master, commit 961ca6702569091ed863679a8e675788c6f4fded. The original project files were wrongly licensed because an error of the main maintainer, Javier Brea, who received instructions from the XbyOrange company about licensing it as Apache2.0, but didn't include the appropiate license header in all repository files by error. The error has been fixed and license headers has been added to all original files, as it was the real intention of the XbyOrange company.
10 changes: 10 additions & 0 deletions bin/mocks-server
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,13 @@
"use strict";

require("../lib/start").start();

/*
Copyright 2019 XbyOrange
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
Copyright 2019 XbyOrange
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

"use strict";

const Cli = require("./lib/Cli");
Expand Down
15 changes: 14 additions & 1 deletion lib/Cli.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/*
Copyright 2019 Javier Brea
Copyright 2019 XbyOrange
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

"use strict";

const chalk = require("chalk");
Expand Down Expand Up @@ -132,7 +143,9 @@ class Cli {
if (!input || !input.length) {
return Promise.resolve(featuresNames);
}
return Promise.resolve(featuresNames.filter(feature => feature.includes(input)));
return Promise.resolve(
featuresNames.filter(currentFeature => currentFeature.includes(input))
);
}
});
this._features.current = feature;
Expand Down
10 changes: 10 additions & 0 deletions lib/Server.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
Copyright 2019 XbyOrange
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

"use strict";

const path = require("path");
Expand Down
10 changes: 10 additions & 0 deletions lib/Settings.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
Copyright 2019 XbyOrange
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

"use strict";

class Settings {
Expand Down
10 changes: 10 additions & 0 deletions lib/api/Api.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
Copyright 2019 XbyOrange
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

"use strict";

const express = require("express");
Expand Down
10 changes: 10 additions & 0 deletions lib/api/Features.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
Copyright 2019 XbyOrange
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

"use strict";

const express = require("express");
Expand Down
10 changes: 10 additions & 0 deletions lib/api/Settings.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
Copyright 2019 XbyOrange
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

"use strict";

const express = require("express");
Expand Down
10 changes: 10 additions & 0 deletions lib/base-cli/Inquirer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
Copyright 2019 XbyOrange
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

"use strict";

const chalk = require("chalk");
Expand Down
10 changes: 10 additions & 0 deletions lib/base-cli/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
Copyright 2019 XbyOrange
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

"use strict";

const { Inquirer } = require("./Inquirer");
Expand Down
10 changes: 10 additions & 0 deletions lib/common/constants.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
Copyright 2019 XbyOrange
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

module.exports = {
FUNCTION_TYPE: "function",
WATCH_RELOAD: "watch-reload"
Expand Down
10 changes: 10 additions & 0 deletions lib/common/helpers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
Copyright 2019 XbyOrange
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

"use strict";

const stringToBoolean = val => {
Expand Down
10 changes: 10 additions & 0 deletions lib/common/options.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
Copyright 2019 XbyOrange
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

"use strict";

const commander = require("commander");
Expand Down
10 changes: 10 additions & 0 deletions lib/common/tracer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
Copyright 2019 XbyOrange
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

"use strict";

const winston = require("winston");
Expand Down
10 changes: 10 additions & 0 deletions lib/features/Feature.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
Copyright 2019 XbyOrange
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

"use strict";

const { cloneDeep, map, sum } = require("lodash");
Expand Down
10 changes: 10 additions & 0 deletions lib/features/Features.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
Copyright 2019 XbyOrange
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

"use strict";

const Boom = require("boom");
Expand Down
10 changes: 10 additions & 0 deletions lib/middlewares.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
Copyright 2019 XbyOrange
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

"use strict";

const bodyParser = require("body-parser");
Expand Down
10 changes: 10 additions & 0 deletions lib/start.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
Copyright 2019 XbyOrange
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

"use strict";

const Boom = require("boom");
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xbyorange/mocks-server",
"version": "1.0.1",
"name": "@mocks-server/main",
"version": "1.0.2",
"description": "Mocks server with extensible fixtures groupables in predefined behaviors. Behavior can be changed using CLI or REST API",
"keywords": [
"mocks",
Expand All @@ -14,9 +14,9 @@
"testing",
"development"
],
"author": "XByOrange",
"author": "Javier Brea",
"license": "Apache-2.0",
"repository": "https://github.com/XbyOrange/mocks-server",
"repository": "https://github.com/mocks-server/main",
"publishConfig": {
"access": "public"
},
Expand Down
15 changes: 10 additions & 5 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
sonar.organization=javierbrea
sonar.projectKey=xbyorange-mocks-server
sonar.projectVersion=1.0.1
sonar.organization=mocks-server
sonar.projectKey=mocks-server-main
sonar.projectVersion=1.0.2

sonar.sources=lib,test
sonar.exclusions=node_modules/**
sonar.javascript.file.suffixes=.js
sonar.sourceEncoding=UTF-8
sonar.exclusions=node_modules/**,*.config.js
sonar.test.exclusions=test/**/*
sonar.coverage.exclusions=test/**/*
sonar.cpd.exclusions=test/**
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.host.url=https://sonarcloud.io

sonar.issue.ignore.multicriteria=j1
sonar.issue.ignore.multicriteria.j1.ruleKey=javascript:S4144
sonar.issue.ignore.multicriteria.j1.resourceKey=test/**/*
Loading

0 comments on commit e4d159b

Please sign in to comment.