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
158 changes: 0 additions & 158 deletions .eslintrc.json

This file was deleted.

116 changes: 103 additions & 13 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,121 @@ env:
MYSQL_DATABASE: sequelize
MYSQL_PASSWORD: password

MARIADB_USER: sequelize
MARIADB_DATABASE: sequelize
MARIADB_PASSWORD: password

jobs:
build:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
- run: npm install
- run: npm run lint
env:
CI: true

test-sqlite:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: DB=sqlite npm test
env:
CI: true

test-postgres:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x, 22.x]
postgres-version: [14, 15, 16, 17, latest] # see https://hub.docker.com/_/postgres

services:
postgres:
image: postgres:12.12
image: postgres:${{ matrix.postgres-version }}
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ env.POSTGRES_DB }}
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: DB=postgres npm test
env:
CI: true

test-mysql:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x, 22.x]
mysql-version: [lts, latest] # see https://hub.docker.com/_/mysql/

services:
mysql:
image: mysql:8.4
image: mysql:${{ matrix.mysql-version }}
env:
# The MySQL docker container requires these environment variables to be set
# so we can create and migrate the test database.
# See: https://hub.docker.com/_/mysql
MYSQL_DATABASE: ${{ env.MYSQL_DATABASE }}
MYSQL_ROOT_PASSWORD: ${{ env.MYSQL_PASSWORD }}
MYSQL_USER: ${{ env.MYSQL_USER }}
MYSQL_PASSWORD: ${{ env.MYSQL_PASSWORD }}
ports:
# Opens port 3306 on service container and host
# https://docs.github.com/en/actions/using-containerized-services/about-service-containers
- 3306:3306
# Before continuing, verify the mysql container is reachable from the ubuntu host
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries 5

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: DB=mysql npm test
env:
CI: true

test-mariadb:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
database: ['sqlite', 'postgres', 'mysql']
node-version: [20.x, 22.x]
mariadb-version: [10, 11, lts, latest] # see https://hub.docker.com/_/mariadb

services:
mariadb:
image: mariadb:${{ matrix.mariadb-version }}
env:
MARIADB_DATABASE: ${{ env.MARIADB_DATABASE }}
MARIADB_ROOT_PASSWORD: ${{ env.MARIADB_PASSWORD }}
MARIADB_USER: ${{ env.MARIADB_USER }}
MARIADB_PASSWORD: ${{ env.MARIADB_PASSWORD }}
ports:
- 3306:3306
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- uses: actions/checkout@v3
Expand All @@ -57,6 +134,19 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: DB=${{matrix.database}} npm test
- run: DB=mariadb npm test
env:
CI: true

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
- run: npm install
- run: npm run compile
env:
CI: true
14 changes: 14 additions & 0 deletions .mocharc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict'
const path = require('node:path')

/**
* @type {import('mocha').MochaOptions}
*/
module.exports = {
extension: ['ts', 'js'],
package: path.join(__dirname, './package.json'),
ui: 'bdd',
require: ['tsx'],
spec: ['./test/**/*.test.*'],
exit: true,
}
12 changes: 0 additions & 12 deletions .mocharc.js

This file was deleted.

4 changes: 1 addition & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
"name": "Mocha Tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/mocha",
"args": [
"--require",
"ts-node/register",
"--timeout",
"10000",
"60000",
"--colors",
"--recursive"
],
Expand Down
3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 Feathers
Copyright (c) 2025 Feathers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

18 changes: 18 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { defineBuildConfig } from 'unbuild'
import pkg from './package.json'

export default defineBuildConfig({
entries: ['./src/index'],
outDir: './dist',
declaration: true,
externals: [
...Object.keys(pkg.dependencies),
...Object.keys(pkg.devDependencies),
],
rollup: {
emitCJS: true,
},
replace: {
'import.meta.vitest': 'undefined',
},
})
Loading