Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .eslintignore

This file was deleted.

239 changes: 0 additions & 239 deletions .eslintrc

This file was deleted.

20 changes: 17 additions & 3 deletions .github/workflows/feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,34 @@ on:
branches: [master]

jobs:
build:
featureTests:
name: FeatureTests
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x, 15.x]
node-version: [18.x, 20.x, 22.x]
mongodb-version: ['6.0', '7.0', '8.0']

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.12.0
with:
mongodb-version: ${{ matrix.mongodb-version }}

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Setup env
run: cp ./env-cucumber.json .env-cucumber.json

- name: Run Cucumber Tests
run: npm run feature-tests
run: npm run test:features
31 changes: 31 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Quality

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
quality:
name: Quality
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install

- name: Prettier
run: npm run prettier:check

- name: Eslint
run: npm run eslint
5 changes: 3 additions & 2 deletions .github/workflows/ut.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ on:
branches: [master]

jobs:
build:
tests:
name: Tests
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x, 15.x]
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v2
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ dist/
coverage/
node_modules/
__pycache__/
package-lock.json
.idea/
.env*
.env.webpack
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,22 @@
![Unit Tests](https://github.com/monolithst/functional-models-orm-mongo/actions/workflows/ut.yml/badge.svg?branch=master)
![Feature Tests](https://github.com/monolithst/functional-models-orm-mongo/actions/workflows/feature.yml/badge.svg?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/monolithst/functional-models-orm-mongo/badge.svg?branch=master)](https://coveralls.io/github/monolithst/functional-models-orm-mongo?branch=master)

A [Functional Models](https://monolithst.github.io/functional-models/) datastoreAdapter implementation for mongo databases.

## Example

```javascript
const { MongoClient } = require('mongodb')
const { createOrm } = require('functional-models')
const {
datastoreAdapter: mongoAdapter,
} = require('functional-models-orm-mongo')

const datastoreAdapter = mongoAdapter({
mongoClient: client,
databaseName: 'your-database-name',
})

const orm = createOrm({ datastoreAdapter })
```
Loading