Skip to content

Commit c54a36e

Browse files
authored
refactor!: renovate (#451)
* refactor: renovate * ci: fix build script * ci: try to fix mariadb * ci: try to fix mariadb * ci: try to fix mysql
1 parent 7c0cbf5 commit c54a36e

30 files changed

+10591
-13515
lines changed

.eslintrc.json

Lines changed: 0 additions & 158 deletions
This file was deleted.

.github/workflows/nodejs.yml

Lines changed: 103 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,44 +11,121 @@ env:
1111
MYSQL_DATABASE: sequelize
1212
MYSQL_PASSWORD: password
1313

14+
MARIADB_USER: sequelize
15+
MARIADB_DATABASE: sequelize
16+
MARIADB_PASSWORD: password
17+
1418
jobs:
15-
build:
19+
lint:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Use Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 22.x
27+
- run: npm install
28+
- run: npm run lint
29+
env:
30+
CI: true
31+
32+
test-sqlite:
33+
runs-on: ubuntu-latest
34+
strategy:
35+
matrix:
36+
node-version: [20.x, 22.x]
37+
38+
steps:
39+
- uses: actions/checkout@v4
40+
- name: Use Node.js ${{ matrix.node-version }}
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: ${{ matrix.node-version }}
44+
- run: npm install
45+
- run: DB=sqlite npm test
46+
env:
47+
CI: true
1648

49+
test-postgres:
1750
runs-on: ubuntu-latest
1851

52+
strategy:
53+
matrix:
54+
node-version: [20.x, 22.x]
55+
postgres-version: [14, 15, 16, 17, latest] # see https://hub.docker.com/_/postgres
56+
1957
services:
2058
postgres:
21-
image: postgres:12.12
59+
image: postgres:${{ matrix.postgres-version }}
2260
env:
2361
POSTGRES_USER: ${{ env.POSTGRES_USER }}
2462
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
2563
POSTGRES_DB: ${{ env.POSTGRES_DB }}
2664
ports:
2765
- 5432:5432
28-
# needed because the postgres container does not provide a healthcheck
2966
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
3067

68+
steps:
69+
- uses: actions/checkout@v4
70+
- name: Use Node.js ${{ matrix.node-version }}
71+
uses: actions/setup-node@v4
72+
with:
73+
node-version: ${{ matrix.node-version }}
74+
- run: npm install
75+
- run: DB=postgres npm test
76+
env:
77+
CI: true
78+
79+
test-mysql:
80+
runs-on: ubuntu-latest
81+
82+
strategy:
83+
matrix:
84+
node-version: [20.x, 22.x]
85+
mysql-version: [lts, latest] # see https://hub.docker.com/_/mysql/
86+
87+
services:
3188
mysql:
32-
image: mysql:8.4
89+
image: mysql:${{ matrix.mysql-version }}
3390
env:
34-
# The MySQL docker container requires these environment variables to be set
35-
# so we can create and migrate the test database.
36-
# See: https://hub.docker.com/_/mysql
3791
MYSQL_DATABASE: ${{ env.MYSQL_DATABASE }}
3892
MYSQL_ROOT_PASSWORD: ${{ env.MYSQL_PASSWORD }}
3993
MYSQL_USER: ${{ env.MYSQL_USER }}
4094
MYSQL_PASSWORD: ${{ env.MYSQL_PASSWORD }}
4195
ports:
42-
# Opens port 3306 on service container and host
43-
# https://docs.github.com/en/actions/using-containerized-services/about-service-containers
4496
- 3306:3306
45-
# Before continuing, verify the mysql container is reachable from the ubuntu host
4697
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries 5
4798

99+
steps:
100+
- uses: actions/checkout@v4
101+
- name: Use Node.js ${{ matrix.node-version }}
102+
uses: actions/setup-node@v4
103+
with:
104+
node-version: ${{ matrix.node-version }}
105+
- run: npm install
106+
- run: DB=mysql npm test
107+
env:
108+
CI: true
109+
110+
test-mariadb:
111+
runs-on: ubuntu-latest
112+
48113
strategy:
49114
matrix:
50-
node-version: [18.x, 20.x, 22.x]
51-
database: ['sqlite', 'postgres', 'mysql']
115+
node-version: [20.x, 22.x]
116+
mariadb-version: [10, 11, lts, latest] # see https://hub.docker.com/_/mariadb
117+
118+
services:
119+
mariadb:
120+
image: mariadb:${{ matrix.mariadb-version }}
121+
env:
122+
MARIADB_DATABASE: ${{ env.MARIADB_DATABASE }}
123+
MARIADB_ROOT_PASSWORD: ${{ env.MARIADB_PASSWORD }}
124+
MARIADB_USER: ${{ env.MARIADB_USER }}
125+
MARIADB_PASSWORD: ${{ env.MARIADB_PASSWORD }}
126+
ports:
127+
- 3306:3306
128+
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3
52129

53130
steps:
54131
- uses: actions/checkout@v3
@@ -57,6 +134,19 @@ jobs:
57134
with:
58135
node-version: ${{ matrix.node-version }}
59136
- run: npm install
60-
- run: DB=${{matrix.database}} npm test
137+
- run: DB=mariadb npm test
138+
env:
139+
CI: true
140+
141+
build:
142+
runs-on: ubuntu-latest
143+
steps:
144+
- uses: actions/checkout@v4
145+
- name: Use Node.js
146+
uses: actions/setup-node@v4
147+
with:
148+
node-version: 22.x
149+
- run: npm install
150+
- run: npm run compile
61151
env:
62152
CI: true

.mocharc.cjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict'
2+
const path = require('node:path')
3+
4+
/**
5+
* @type {import('mocha').MochaOptions}
6+
*/
7+
module.exports = {
8+
extension: ['ts', 'js'],
9+
package: path.join(__dirname, './package.json'),
10+
ui: 'bdd',
11+
require: ['tsx'],
12+
spec: ['./test/**/*.test.*'],
13+
exit: true,
14+
}

.mocharc.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

.vscode/launch.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
"name": "Mocha Tests",
1212
"program": "${workspaceFolder}/node_modules/mocha/bin/mocha",
1313
"args": [
14-
"--require",
15-
"ts-node/register",
1614
"--timeout",
17-
"10000",
15+
"60000",
1816
"--colors",
1917
"--recursive"
2018
],

LICENSE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2022 Feathers
3+
Copyright (c) 2025 Feathers
44

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

build.config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { defineBuildConfig } from 'unbuild'
2+
import pkg from './package.json'
3+
4+
export default defineBuildConfig({
5+
entries: ['./src/index'],
6+
outDir: './dist',
7+
declaration: true,
8+
externals: [
9+
...Object.keys(pkg.dependencies),
10+
...Object.keys(pkg.devDependencies),
11+
],
12+
rollup: {
13+
emitCJS: true,
14+
},
15+
replace: {
16+
'import.meta.vitest': 'undefined',
17+
},
18+
})

0 commit comments

Comments
 (0)