Skip to content
This repository was archived by the owner on Mar 28, 2022. It is now read-only.

Commit a474522

Browse files
committed
Add package structure
1 parent c1ff88b commit a474522

13 files changed

+7064
-2
lines changed

.eslintrc.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"env": {
3+
"node": true,
4+
"es6": true
5+
},
6+
"parserOptions": {
7+
"ecmaVersion": "2018"
8+
},
9+
"plugins": ["prettier"],
10+
"rules": {
11+
"prettier/prettier": [
12+
"error",
13+
{
14+
"printWidth": 99,
15+
"parser": "flow"
16+
}
17+
],
18+
"no-undef": "error",
19+
"no-unused-vars": ["error", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }]
20+
},
21+
"extends": ["prettier"],
22+
"root": true
23+
}

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
#environment variables
4+
.env
5+
6+
# dependencies
7+
/node_modules
8+
9+
# tests
10+
/coverage
11+
/dist
12+
13+
# misc
14+
.DS_Store
15+
.env.local
16+
.env.development.local
17+
.env.test.local
18+
.env.production.local
19+
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*
23+
24+
# ides
25+
.idea
26+
.vs

.travis.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
language: node_js
2+
3+
node_js:
4+
- "10"
5+
6+
cache:
7+
directories:
8+
- ~/.npm
9+
- node_modules
10+
- ~/.sonar/cache
11+
12+
addons:
13+
sonarcloud:
14+
organization: "mocks-server"
15+
branch:
16+
name: "$TRAVIS_CURRENT_BRANCH"
17+
18+
script:
19+
- npm run lint
20+
- npm run test:ci
21+
- npm run coveralls
22+
- 'if [ -n "$SONAR_TOKEN" ]; then sonar-scanner -Dsonar.login=${SONAR_TOKEN}; fi'
23+
24+
deploy:
25+
provider: npm
26+
email: "javier.brea@gmail.com"
27+
api_key: "$NPM_TOKEN"
28+
on:
29+
tags: true
30+
skip_cleanup: true

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Change Log
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
5+
and this project adheres to [Semantic Versioning](http://semver.org/).
6+
7+
## [unreleased]
8+
### Added
9+
### Changed
10+
### Fixed
11+
### Removed
12+
13+
## [1.0.0] - 2019-12-24
14+
- First release

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Javier Brea
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,42 @@
1-
# admin-api-paths
2-
admin-api-plugin api paths
1+
[![Build status][travisci-image]][travisci-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Quality Gate][quality-gate-image]][quality-gate-url]
2+
3+
[![NPM dependencies][npm-dependencies-image]][npm-dependencies-url] [![Last commit][last-commit-image]][last-commit-url] [![Last release][release-image]][release-url]
4+
5+
[![NPM downloads][npm-downloads-image]][npm-downloads-url] [![License][license-image]][license-url]
6+
7+
8+
# Api paths of the Mocks-Server Plugin Admin Api
9+
10+
Constants defining API paths of the [Mocks Server plugin-admin-api][plugin-admin-api-url]. Use them to build plugin clients.
11+
12+
## Usage
13+
14+
```js
15+
import { SETTINGS } from "@mocks-server/admin-api-paths";
16+
17+
console.log(SETTINGS); // /settings
18+
```
19+
20+
## Contributing
21+
22+
Contributors are welcome.
23+
Please read the [contributing guidelines](.github/CONTRIBUTING.md) and [code of conduct](.github/CODE_OF_CONDUCT.md).
24+
25+
[plugin-admin-api-url]: https://github.com/mocks-server/plugin-admin-api
26+
27+
[coveralls-image]: https://coveralls.io/repos/github/mocks-server/admin-api-path/badge.svg
28+
[coveralls-url]: https://coveralls.io/github/mocks-server/admin-api-path
29+
[travisci-image]: https://travis-ci.com/mocks-server/admin-api-path.svg?branch=master
30+
[travisci-url]: https://travis-ci.com/mocks-server/admin-api-path
31+
[last-commit-image]: https://img.shields.io/github/last-commit/mocks-server/admin-api-path.svg
32+
[last-commit-url]: https://github.com/mocks-server/admin-api-path/commits
33+
[license-image]: https://img.shields.io/npm/l/@mocks-server/admin-api-path.svg
34+
[license-url]: https://github.com/mocks-server/admin-api-path/blob/master/LICENSE
35+
[npm-downloads-image]: https://img.shields.io/npm/dm/@mocks-server/admin-api-path.svg
36+
[npm-downloads-url]: https://www.npmjs.com/package/@mocks-server/admin-api-path
37+
[npm-dependencies-image]: https://img.shields.io/david/mocks-server/admin-api-path.svg
38+
[npm-dependencies-url]: https://david-dm.org/mocks-server/admin-api-path
39+
[quality-gate-image]: https://sonarcloud.io/api/project_badges/measure?project=mocks-server-admin-api-path&metric=alert_status
40+
[quality-gate-url]: https://sonarcloud.io/dashboard?id=mocks-server-admin-api-path
41+
[release-image]: https://img.shields.io/github/release-date/mocks-server/admin-api-path.svg
42+
[release-url]: https://github.com/mocks-server/admin-api-path/releases

index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
DEFAULT_BASE_PATH: "/admin",
3+
SETTINGS: "/settings",
4+
BEHAVIORS: "/behaviors",
5+
FIXTURES: "/fixtures",
6+
ABOUT: "/about"
7+
};

jest.config.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// For a detailed explanation regarding each configuration property, visit:
2+
// https://jestjs.io/docs/en/configuration.html
3+
4+
module.exports = {
5+
// Automatically clear mock calls and instances between every test
6+
clearMocks: true,
7+
8+
// Indicates whether the coverage information should be collected while executing the test
9+
collectCoverage: true,
10+
11+
// An array of glob patterns indicating a set of files for which coverage information should be collected
12+
collectCoverageFrom: ["index.js"],
13+
14+
// The directory where Jest should output its coverage files
15+
coverageDirectory: "coverage",
16+
17+
// An object that configures minimum threshold enforcement for coverage results
18+
coverageThreshold: {
19+
global: {
20+
branches: 100,
21+
functions: 100,
22+
lines: 100,
23+
statements: 100
24+
}
25+
},
26+
27+
// The glob patterns Jest uses to detect test files
28+
testMatch: ["**/test/**/?(*.)+(spec|test).js?(x)"],
29+
30+
// The test environment that will be used for testing
31+
testEnvironment: "node"
32+
};

0 commit comments

Comments
 (0)