Skip to content

Commit

Permalink
first draft
Browse files Browse the repository at this point in the history
  • Loading branch information
cadgerfeast committed Oct 19, 2020
1 parent c4c832b commit ea98156
Show file tree
Hide file tree
Showing 28 changed files with 23,764 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/coverage
/dist
/docs
/node_modules
/src
/test
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 200
indent_size = 2

[*.md]
trim_trailing_whitespace = false
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/coverage
/dist
/docs
/node_modules
/madoc.config.js
/vue.config.js
12 changes: 12 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
]
}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/.docs
/coverage
/dist
/docs/vue/dist
/node_modules
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM nginx:alpine

COPY ./devops/nginx.conf /etc/nginx/conf.d/default.conf

COPY ./.docs /usr/share/nginx/html
65 changes: 64 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,64 @@
# mollithia
# Mollitia

> JavaScript Resilience Library
<!-- TODO Description -->

## Documentation

<!-- TODO Change -->
[Full documentation website can be find here.](http://135.39.45.156:8080)

## Installation

### With Node or any web UI Framework

``` bash
# Install the dependency
npm install mollitia --save
```

``` javascript
// Javascript
const { Circuit } = require('mollitia');
```

``` typescript
// ES6 or TypeScript
import { Circuit } from 'mollitia';
```

### With CDN

``` html
<!-- CDN -->
<script type="text/javascript" src="https://unpkg.com/mollitia"></script>
<script>
const { Circuit } = window.Mollitia;
</script>
```

## Usage

<!-- TODO change -->
``` javascript
const myCircuit = new Circuit({
name: 'dummy',
options: {
// Customize the circuit here
}
});
// First param is your async function
// Other params will directly be passed to this function
myCircuit.execute(anyAsyncFunction, param1, param2, ...);
```

## Features

<!-- TODO update -->

- Works on Node and on browser (even **IE11**, wow).
- Can add `timeout` to your async methods.
- Customize your circuit with [a wide variety of options](/api/options).

<!-- TODO comparison with resilience4j -->
3 changes: 3 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
npm run build
docker build -t 135.39.45.156:80/genesys/mollitia:latest .
docker push 135.39.45.156:80/genesys/mollitia:latest
9 changes: 9 additions & 0 deletions devops/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
server {
listen 80;
listen [::]:80;
server_name localhost;
root /usr/share/nginx/html;
location / {
try_files $uri $uri/ /index.html;
}
}
19 changes: 19 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
transform: {
".(ts|tsx)": "ts-jest"
},
testEnvironment: "node",
testRegex: "(/test/.*|\\.spec)\\.ts$",
moduleFileExtensions: [
"ts",
"js"
],
coveragePathIgnorePatterns: [
"/node_modules",
"/test"
],
collectCoverage: true,
collectCoverageFrom: [
"src/**/*.ts"
]
};
24 changes: 24 additions & 0 deletions madoc.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const pkg = require('./package.json');

module.exports = {
title: 'Mollitia',
description: pkg.description,
distPath: '.docs',
assets: [
{
src: './dist/mollitia.umd.js'
},
{
src: './docs/assets'
}
],
head: [
'<script src="/assets/mollitia.umd.js"></script>'
],
watch: [
'./dist'
],
components: [
require('./docs/vue/index.js')
]
};
Loading

0 comments on commit ea98156

Please sign in to comment.