Skip to content

Commit

Permalink
Updated package versions, added prettier and eslint. Added github act…
Browse files Browse the repository at this point in the history
…ion.
  • Loading branch information
danships committed Oct 14, 2023
1 parent 985ff5a commit 585b321
Show file tree
Hide file tree
Showing 14 changed files with 5,442 additions and 189 deletions.
11 changes: 11 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": ["daangemist"],
"env": {
"browser": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
}
}
26 changes: 26 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Node.js CI

on:
push:
branches: [develop]
pull_request:
branches: [develop]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build
- run: npm run lint
- run: npm run audit
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,18 @@ initializing SuperPlug. Update the path to have it point to the folder the proje

In the code where the plugins are to be initialized, use the SuperPlug class:

const { SuperPlug } = require('superplug')
const superPlug = new SuperPlug({location: __dirname}) // See configuration section for more details on configuration.

const foundPlugins = await superPlug.getPlugins();
//do something with the returned plugins
foundPlugins.forEach((plugin => {
// In this example a plugin is expected to return an object that exposes a method called start.
const pluginModule = await plugin.getPlugin();
pluginModule.start()
})
```js
const { SuperPlug } = require('superplug')
const superPlug = new SuperPlug({location: __dirname}) // See configuration section for more details on configuration.

const foundPlugins = await superPlug.getPlugins();
//do something with the returned plugins
foundPlugins.forEach((plugin => {
// In this example a plugin is expected to return an object that exposes a method called start.
const pluginModule = await plugin.getPlugin();
pluginModule.start()
})
```
In the example above, foundPlugins is an array with Plugin classes. Each Plugin class
has the following attributes/methods:
Expand Down Expand Up @@ -72,10 +74,10 @@ that the plugin should return: an object, functions, properties, etc.
The SuperPlug constructor expects an options object argument.
| Property | Required | Description | Default Value |
| -------- |-------- |----------- | ------------- |
| location | Yes | The path to look for the _package.json_ file. This must be an absolute path. | |
| packageProperty | No | The name of the property to search for in the _package.json_ file. | superplug |
| Property | Required | Description | Default Value |
| --------------- | -------- | ---------------------------------------------------------------------------- | ------------- |
| location | Yes | The path to look for the _package.json_ file. This must be an absolute path. | |
| packageProperty | No | The name of the property to search for in the _package.json_ file. | superplug |
# Roadmap
Expand Down
Loading

0 comments on commit 585b321

Please sign in to comment.