Skip to content

Commit f769fce

Browse files
committed
Initial commit
0 parents  commit f769fce

15 files changed

+9921
-0
lines changed

.codeclimate.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
version: "2"
2+
3+
checks:
4+
argument-count:
5+
enabled: false
6+
complex-logic:
7+
enabled: false
8+
file-lines:
9+
enabled: false
10+
method-complexity:
11+
enabled: false
12+
method-count:
13+
enabled: false
14+
method-lines:
15+
enabled: false
16+
nested-control-flow:
17+
enabled: false
18+
return-statements:
19+
enabled: false
20+
similar-code:
21+
enabled: false
22+
identical-code:
23+
enabled: false
24+
25+
plugins:
26+
duplication:
27+
enabled: false
28+
config:
29+
languages:
30+
- javascript
31+
eslint:
32+
enabled: true
33+
channel: "eslint-4"
34+
fixme:
35+
enabled: true
36+
37+
exclude_paths:
38+
- test/
39+
- benchmark/
40+
- examples/
41+
- typings/

.eslintrc.js

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module.exports = {
2+
root: true,
3+
"env": {
4+
"node": true,
5+
"commonjs": true,
6+
"es6": true,
7+
"jquery": false,
8+
"jest": true,
9+
"jasmine": true
10+
},
11+
"extends": "eslint:recommended",
12+
"parserOptions": {
13+
"sourceType": "module",
14+
"ecmaVersion": "2018"
15+
},
16+
"rules": {
17+
"indent": [
18+
"warn",
19+
"tab"
20+
],
21+
"quotes": [
22+
"warn",
23+
"double"
24+
],
25+
"semi": [
26+
"error",
27+
"always"
28+
],
29+
"no-var": [
30+
"error"
31+
],
32+
"no-console": [
33+
"off"
34+
],
35+
"no-unused-vars": [
36+
"warn"
37+
]
38+
}
39+
};

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.DS_Store
2+
node_modules/
3+
coverage/
4+
npm-debug.log
5+
stats.json
6+
yarn-error.log

.travis.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: node_js
2+
cache:
3+
directories:
4+
- node_modules
5+
node_js:
6+
- "9"
7+
- "8"
8+
- "6"
9+
after_success:
10+
- npm run coverall

.vscode/launch.json

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
// Use IntelliSense to learn about possible Node.js debug attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
8+
{
9+
"type": "node",
10+
"request": "launch",
11+
"name": "Launch demo",
12+
"program": "${workspaceRoot}\\examples\\index.js",
13+
"cwd": "${workspaceRoot}",
14+
"args": [
15+
"simple"
16+
]
17+
},
18+
{
19+
"type": "node",
20+
"request": "launch",
21+
"name": "Jest",
22+
"program": "${workspaceRoot}\\node_modules\\jest-cli\\bin\\jest.js",
23+
"args": ["--runInBand"],
24+
"cwd": "${workspaceRoot}",
25+
"runtimeArgs": [
26+
"--nolazy"
27+
]
28+
}
29+
]
30+
}

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 MoleculerJS
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

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
![Moleculer logo](http://moleculer.services/images/banner.png)
2+
3+
[![Build Status](https://travis-ci.org/moleculerjs/moleculer-macrometa.svg?branch=master)](https://travis-ci.org/moleculerjs/moleculer-macrometa)
4+
[![Coverage Status](https://coveralls.io/repos/github/moleculerjs/moleculer-macrometa/badge.svg?branch=master)](https://coveralls.io/github/moleculerjs/moleculer-macrometa?branch=master)
5+
[![Known Vulnerabilities](https://snyk.io/test/github/moleculerjs/moleculer-macrometa/badge.svg)](https://snyk.io/test/github/moleculerjs/moleculer-macrometa)
6+
7+
# [WIP] moleculer-macrometa [![NPM version](https://img.shields.io/npm/v/moleculer-macrometa.svg)](https://www.npmjs.com/package/moleculer-macrometa)
8+
9+
Data access service for [MacroMeta.co](https://www.macrometa.co/).
10+
11+
## Features
12+
13+
## Install
14+
```
15+
npm install moleculer-macrometa --save
16+
```
17+
18+
## Usage
19+
20+
21+
## Test
22+
```
23+
$ npm test
24+
```
25+
26+
In development with watching
27+
28+
```
29+
$ npm run ci
30+
```
31+
32+
## Contribution
33+
Please send pull requests improving the usage and fixing bugs, improving documentation and providing better examples, or providing some testing, because these things are important.
34+
35+
## License
36+
The project is available under the [MIT license](https://tldrlegal.com/license/mit-license).
37+
38+
## Contact
39+
Copyright (c) 2019 MoleculerJS
40+
41+
[![@MoleculerJS](https://img.shields.io/badge/github-moleculerjs-green.svg)](https://github.com/moleculerjs) [![@MoleculerJS](https://img.shields.io/badge/twitter-MoleculerJS-blue.svg)](https://twitter.com/MoleculerJS)

examples/index.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"use strict";
2+
3+
const moduleName = process.argv[2] || "simple";
4+
process.argv.splice(2, 1);
5+
6+
require("./" + moduleName);

examples/simple/index.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"use strict";
2+
3+
let { ServiceBroker } = require("moleculer");
4+
let MyService = require("../../index");
5+
6+
// Create broker
7+
let broker = new ServiceBroker({
8+
});
9+
10+
// Load my service
11+
broker.createService(MyService, {
12+
settings: {
13+
fabric: {
14+
collection: "posts"
15+
}
16+
}
17+
});
18+
19+
// Start server
20+
broker.start().then(async () => {
21+
try {
22+
// Call action
23+
//const res = await broker.call("macrometa.create", { name: "Jane Doe" })
24+
const res = await broker.call("macrometa.find", {});
25+
broker.logger.info("Result:", res);
26+
27+
} catch(err) {
28+
broker.logger.error(err);
29+
}
30+
31+
broker.repl();
32+
});

index.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* moleculer-macrometa
3+
* Copyright (c) 2019 MoleculerJS (https://github.com/moleculerjs/moleculer-macrometa)
4+
* MIT Licensed
5+
*/
6+
7+
"use strict";
8+
9+
module.exports = require("./src");

0 commit comments

Comments
 (0)