Skip to content

Commit

Permalink
fix pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
tichon29 committed Feb 4, 2021
2 parents 2ed721d + 18cbadd commit 7b66d56
Show file tree
Hide file tree
Showing 13 changed files with 89 additions and 32 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ jobs:
echo ::set-output name=SHOULD_RELEASE::true
echo current version is $CURRENT
fi
- name: Documentation
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.ACCESS_TOKEN }}
publish_dir: ./docs/dist
- name: Release
if: github.event_name == 'push' && steps.env.outputs.SHOULD_RELEASE == 'true'
run: npx release-it --ci --verbose --disable-metrics --increment=${{steps.env.outputs.VERSION}}
Expand Down
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ When everything is falling apart, it stops the classic flow and uses modules to

## Documentation

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

## Installation

Expand Down Expand Up @@ -56,12 +55,10 @@ await circuit.fn(yourFunction).execute('dummy');
The point of `Mollitia` is to get every **Resilience patterns** into one library.
It is very similar at what does [Resilience4j](https://github.com/resilience4j/resilience4j) on **Java**, but on **Node**.

<!-- TODO change links -->

- Works on Node and on browser (even **Internet Explorer 11**, wow).
- Implements a wide variety of Resilience patterns, [more on that here.](http://135.39.45.156:8080)
- Implements a wide variety of Resilience patterns.
- Has **Method Agnostic** circuits, meaning you don't have to create one circuit per function.
- Supports addons, [more on that here.](http://135.39.45.156:8080)
- Supports addons.

## Comparison with other libraries

Expand Down
24 changes: 24 additions & 0 deletions docs/components/global/pg-img.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<img :src="`${publicPath}${src}`" :alt="alt" />
</template>

<script>
export default {
name: 'pg-img',
props: {
src: {
type: String,
required: true
},
alt: {
type: String,
required: true
}
},
computed: {
publicPath () {
return this.$router.options.base.slice(0, -1);
}
}
};
</script>
2 changes: 1 addition & 1 deletion docs/content/_navbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ links:
# path: /playground
# TODO change url
github:
link: https://github.com/mollitia/mollitia
link: https://github.com/genesys/mollitia
---
10 changes: 5 additions & 5 deletions docs/content/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ links:
path: /api/module/breaker/sliding/count
- title: Time Breaker
path: /api/module/breaker/sliding/time
- group: Core Addons
links:
- title: Prometheus
# TODO change link
path: http://135.39.45.156:8081
# TODO add when possible
# - group: Core Addons
# links:
# - title: Prometheus
# path: http://135.39.45.156:8081
- group: Customization
links:
- title: Create a module
Expand Down
2 changes: 1 addition & 1 deletion docs/content/api/circuit.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Mollitia - API - Circuit

The `Circuit` is the container of your **Resilience** logic.

<p class="flex-center-row" align="center"><img src="/img/circuit-architecture.png" alt="Circuit - Architecture"/></p>
<p class="flex-center-row" align="center"><pg-img src="/img/circuit-architecture.png" alt="Circuit - Architecture"></pg-img></p>

## Usage

Expand Down
11 changes: 10 additions & 1 deletion docs/content/api/create-addon.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ title: Mollitia - API - Create an addon
---
# Create an addon

Creating an addon is similar as [creating a module](/api/create-module), you should implement the **Addon** interface:
Creating an addon is similar as [creating a module](/api/create-module), you should implement the **Mollitia.Addon** interface.

You can then overload some useful methods in order to modify the base `Mollitia` behavior.

The best way to understand what you can do with an addon is to check out existing ones.

Feel free to check out the [Prometheus Addon](https://github.com/genesys/mollitia-prometheus) as learning base.

``` javascript
// Imports the library
Expand All @@ -20,4 +26,7 @@ class UselessAddon implements Mollitia.Addon {
// Feel free to modify the module behavior, and add properties to it
}
}

// Usage:
Mollitia.use(new UselessAddon());
```
11 changes: 9 additions & 2 deletions docs/content/api/create-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ title: Mollitia - API - Create a module
---
# Create a module

Creating a new module is easy, you can extends the base **Module** class and use it like so:
You want to create your own module in order to customize your circuit.

You need to create a new class that extends the base **Mollitia.Module** class and implement the `execute` method.

In the example below, the module just logs a message everytime the circuit is executed.
You can use it as a template for your own module.

``` javascript
// Imports the library
Expand All @@ -20,7 +25,9 @@ class UselessModule extends Module {
async execute (circuit, promise, ...params) {
// circuit: Circuit being executed
// promise: The Circuit Function being used
// params[]: The list of parameters being used
// params[]: The list of parameters that needs to be passed to the promise
// Uncomment the line below to get the parameters that have been passed to the execute() function
// const _params = this.getExecParams(circuit, params);
console.info(`${circuit.name} - ${this.message}`); // That's some useful stuff
return promise(...params); // This just executes normally the method
}
Expand Down
2 changes: 1 addition & 1 deletion docs/content/api/module/breaker/sliding/count.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ When the circuit is closed, a sliding window is used to store the outcome of cal
The count-based sliding window calculates the outcome of the last N calls, and decides if the circuit should be opened (if the failure or slow call rate thresholds are exceeded)
For example, if the count window size is 10, the circular array has always 10 measurements.

<p class="flex-center-row" align="center"><img src="/img/circuit-breaker-diagram.png" alt="Circuit Breaker - Diagram"/></p>
<p class="flex-center-row" align="center"><pg-img src="/img/circuit-breaker-diagram.png" alt="Circuit Breaker - Diagram"></pg-img></p>

## Options

Expand Down
2 changes: 1 addition & 1 deletion docs/content/api/module/breaker/sliding/time.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ When the circuit is closed, a sliding window is used to store the outcome of cal
The time-based sliding window calculates the outcome of the last calls receiving during the last N milliseconds, and decides if the circuit should be opened (if the failure or slow call rate thresholds are exceeded)
For example, if the count window size is 10000, the circular array stores the requests that occurred during the last 10s (with a maximum of 1000 elements in the array)

<p class="flex-center-row" align="center"><img src="/img/circuit-breaker-diagram.png" alt="Circuit Breaker - Diagram"/></p>
<p class="flex-center-row" align="center"><pg-img src="/img/circuit-breaker-diagram.png" alt="Circuit Breaker - Diagram"></pg-img></p>

## Options

Expand Down
9 changes: 3 additions & 6 deletions docs/content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ When everything is falling apart, it stops the classic flow and uses modules to

## Documentation

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

## Installation

Expand Down Expand Up @@ -59,12 +58,10 @@ await circuit.fn(yourFunction).execute('dummy');
The point of `Mollitia` is to get every **Resilience patterns** into one library.
It is very similar at what does [Resilience4j](https://github.com/resilience4j/resilience4j) on **Java**, but on **Node**.

<!-- TODO change links -->

- Works on Node and on browser (even **Internet Explorer 11**, wow).
- Implements a wide variety of Resilience patterns, [more on that here.](http://135.39.45.156:8080)
- Implements a wide variety of Resilience patterns.
- Has **Method Agnostic** circuits, meaning you don't have to create one circuit per function.
- Supports addons, [more on that here.](http://135.39.45.156:8080)
- Supports addons.

## Comparison with other libraries

Expand Down
19 changes: 15 additions & 4 deletions docs/content/overview/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ You can then execute a asynchronous operation on the circuit, and the attached m
<!-- TODO add playground examples, accessible with /api/playground#example-1 -->
<!-- * The order of modules have importance, and you can do cool stuff with it, [more on that in the Playground examples.](/api/playground). -->

## Modules

`Modules` can be attached to your circuit, you should take a look at [the circuit documentation](/api/circuit) before looking at them.

You can modify your circuit behavior by adding `modules`, some basic resiliency patterns are already available directly in the library, find the list *just below*.

If your application need a more specific behavior, you can create your own module, [folowing this documentation](/api/create-module).

## Core Modules

* **[Fallback](/api/module/fallback)**: Allows filtering and planning when errors are happening.
Expand All @@ -31,9 +39,12 @@ You can then execute a asynchronous operation on the circuit, and the attached m

## Addons

`Mollitia` has been designed to be customized.
[Modules can be created](/api/create-module), and [addons can be added](/api/create-addon).
`Addons` can modify or add features of `Mollitia`, for example, it can be useful to create an addon in order to modify the behavior of all modules.

If you want to create your own, [find out how here](/api/create-addon).

A list of official `addons` can be found *just below*.

### Core Addons
<!-- TODO change link -->
* **[Prometheus](http://135.39.45.156:8081)**: Adds multiple metrics to your modules and circuits.
<!-- TODO add prometheus link -->
<!-- * **[Prometheus](http://135.39.45.156:8081)**: Adds multiple metrics to your modules and circuits. -->
14 changes: 10 additions & 4 deletions docs/nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
const dev = process.env.NODE_ENV === 'development';
const publicPath = dev ? '' : '/mollitia/';

export default {
// Target (https://go.nuxtjs.dev/config-target)
target: 'static',
Expand All @@ -11,9 +14,9 @@ export default {
{ hid: 'description', name: 'description', content: 'JavaScript Resilience Library' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'stylesheet', type: 'text/css', href: '/roboto/font.css' },
{ rel: 'stylesheet', type: 'text/css', href: '/material-icons/font.css' }
{ rel: 'icon', type: 'image/x-icon', href: `${publicPath}favicon.ico` },
{ rel: 'stylesheet', type: 'text/css', href: `${publicPath}roboto/font.css` },
{ rel: 'stylesheet', type: 'text/css', href: `${publicPath}material-icons/font.css` }
]
},

Expand Down Expand Up @@ -58,9 +61,12 @@ export default {
}
}
},

router: {
base: publicPath
},
// Build Configuration (https://go.nuxtjs.dev/config-build)
build: {
publicPath: dev ? '/_nuxt/' : './_nuxt/'
},
generate: {
routes: [
Expand Down

0 comments on commit 7b66d56

Please sign in to comment.