Skip to content

Commit 23ce6e2

Browse files
authored
Release 3.0.0 alpha.7 (#34)
- updates to sync with dependencies - sql: update - prettier
1 parent 42e0b74 commit 23ce6e2

34 files changed

+160
-261
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
name: CI
22

33
on:
4-
push:
5-
paths-ignore:
6-
- '*.md'
74
pull_request:
5+
types: [opened, synchronize, reopened]
86

97
env:
108
CI: true
@@ -23,7 +21,7 @@ jobs:
2321
- uses: actions/setup-node@v4
2422
with:
2523
node-version: ${{ env.NODE_VER }}
26-
- uses: actions/checkout@v4
24+
- uses: actions/checkout@v6
2725
- run: npm install
2826
- name: Initialize MySQL
2927
run: sh sql/init-mysql.sh
@@ -56,12 +54,12 @@ jobs:
5654
strategy:
5755
matrix:
5856
os: [ubuntu-latest]
59-
node-version: ${{ fromJson(needs.get-lts.outputs.active) }}
57+
node-version: ${{ fromJson(needs.get-lts.outputs.lts) }}
6058
fail-fast: false
6159
steps:
6260
- run: sudo /etc/init.d/mysql start
63-
- uses: actions/checkout@v4
64-
- uses: actions/setup-node@v4
61+
- uses: actions/checkout@v6
62+
- uses: actions/setup-node@v6
6563
with:
6664
node-version: ${{ matrix.node-version }}
6765
- run: sh sql/init-mysql.sh
@@ -73,15 +71,15 @@ jobs:
7371
runs-on: macos-latest
7472
strategy:
7573
matrix:
76-
node-version: ${{ fromJson(needs.get-lts.outputs.active) }}
74+
node-version: ${{ fromJson(needs.get-lts.outputs.lts) }}
7775
fail-fast: false
7876
steps:
7977
- name: Install & Start MySQL
8078
run: |
8179
brew install [email protected]
8280
brew services start [email protected]
83-
- uses: actions/checkout@v4
84-
- uses: actions/setup-node@v4
81+
- uses: actions/checkout@v6
82+
- uses: actions/setup-node@v6
8583
name: Node ${{ matrix.node-version }} on ${{ matrix.os }}
8684
with:
8785
node-version: ${{ matrix.node-version }}
@@ -95,15 +93,15 @@ jobs:
9593
runs-on: windows-latest
9694
strategy:
9795
matrix:
98-
node-version: ${{ fromJson(needs.get-lts.outputs.active) }}
96+
node-version: ${{ fromJson(needs.get-lts.outputs.lts) }}
9997
experimental: [true]
10098
fail-fast: false
10199
steps:
102100
- name: Install MySQL
103101
run: |
104102
choco install mysql
105-
- uses: actions/checkout@v4
106-
- uses: actions/setup-node@v4
103+
- uses: actions/checkout@v6
104+
- uses: actions/setup-node@v6
107105
name: Node ${{ matrix.node-version }}
108106
with:
109107
node-version: ${{ matrix.node-version }}

.github/workflows/publish.yml

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
name: publish
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
paths:
8-
- package.json
9-
release:
10-
types: [published]
4+
release:
5+
types: [published]
116

127
env:
138
CI: true
14-
node-version: 20
9+
node-version: 22
1510

1611
jobs:
1712
build:
1813
runs-on: ubuntu-latest
1914
steps:
2015
- run: sudo /etc/init.d/mysql start
21-
- uses: actions/checkout@v4
22-
- uses: actions/setup-node@v4
16+
- uses: actions/checkout@v6
17+
- uses: actions/setup-node@v6
2318
with:
2419
node-version: ${{ env.node-version }}
2520
- run: sh sql/init-mysql.sh
@@ -30,25 +25,19 @@ jobs:
3025
needs: build
3126
runs-on: ubuntu-latest
3227
steps:
33-
- uses: actions/setup-node@v4
28+
- uses: actions/setup-node@v6
3429
name: Node ${{ env.node-version }}
3530
with:
3631
node-version: ${{ env.node-version }}
3732
registry-url: https://registry.npmjs.org/
3833

39-
- uses: actions/checkout@v4
34+
- uses: actions/checkout@v6
4035
with:
4136
fetch-depth: 0
4237
# fetch-depth 0 needed by GitHub Release
4338

4439
- name: publish to NPM
4540
run: npm publish --access=public
46-
env:
47-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
48-
49-
- name: GitHub Release
50-
uses: justincy/[email protected]
51-
id: release
5241

5342
publish-gpr:
5443
needs: build
@@ -57,8 +46,8 @@ jobs:
5746
contents: read
5847
packages: write
5948
steps:
60-
- uses: actions/checkout@v4
61-
- uses: actions/setup-node@v4
49+
- uses: actions/checkout@v6
50+
- uses: actions/setup-node@v6
6251
with:
6352
node-version: ${{ env.node-version }}
6453
registry-url: https://npm.pkg.github.com/

.prettierrc.yml

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

CHANGELOG.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1+
# Changelog
2+
3+
The format is based on [Keep a Changelog](https://keepachangelog.com/).
4+
15
# CHANGES
26

37
### Unreleased
48

9+
### [3.0.0-alpha.7] - 2026-03-13
10+
11+
- fixes
12+
513
### [3.0.0-alpha.6] - 2025-04-08
614

715
- dep(eslint): upgraded to v9
@@ -39,7 +47,11 @@
3947
- lib/user.get: convert booleans
4048

4149

50+
[3.0.0-alpha.0]: https://github.com/NicTool/api/releases/tag/3.0.0-alpha.0
51+
[3.0.0-alpha.1]: https://github.com/NicTool/api/releases/tag/3.0.0-alpha.1
52+
[3.0.0-alpha.2]: https://github.com/NicTool/api/releases/tag/3.0.0-alpha.2
4253
[3.0.0-alpha.3]: https://github.com/NicTool/api/releases/tag/3.0.0-alpha.3
43-
[3.0.0-alpha.4]: https://github.com/NicTool/api/releases/tag/3.0.0-alpha.4
44-
[3.0.0-alpha.5]: https://github.com/NicTool/api/releases/tag/3.0.0-alpha.5
45-
[3.0.0-alpha.6]: https://github.com/NicTool/api/releases/tag/3.0.0-alpha.6
54+
[3.0.0-alpha.4]: https://github.com/NicTool/api/releases/tag/v3.0.0-alpha.4
55+
[3.0.0-alpha.5]: https://github.com/NicTool/api/releases/tag/v3.0.0-alpha.5
56+
[3.0.0-alpha.6]: https://github.com/NicTool/api/releases/tag/v3.0.0-alpha.6
57+
[3.0.0-alpha.7]: https://github.com/NicTool/api/releases/tag/v3.0.0-alpha.7

CONTRIBUTORS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Contributors
2+
3+
This handcrafted artisanal software is brought to you by:
4+
5+
| <img height="80" src="https://avatars.githubusercontent.com/u/261635?v=4"><br><a href="https://github.com/msimerson">msimerson</a> (<a href="https://github.com/NicTool/api/commits?author=msimerson">14</a>)|
6+
| :---: |
7+
8+
<sub>this file is generated by [.release](https://github.com/msimerson/.release).
9+
Contribute to this project to get your GitHub profile included here.</sub>

lib/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Config {
1212
this.getEnv(opts)
1313
}
1414

15-
async getEnv(opts = {}) {
15+
getEnv(opts = {}) {
1616
this.env = process.env.NODE_ENV ?? opts.env ?? ''
1717
this.debug = Boolean(process.env.NODE_DEBUG)
1818
if (this.debug) console.log(`debug: true, env: ${this.env}`)

lib/config.test.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,12 @@ describe('config', () => {
3939

4040
it(`detects NODE_DEBUG env`, async () => {
4141
process.env.NODE_DEBUG = 1
42-
let cfg = await Config.get('mysql', 'test')
42+
await Config.get('mysql', 'test')
4343
assert.equal(Config.debug, true)
4444

4545
process.env.NODE_DEBUG = ''
46-
cfg = await Config.get('mysql', 'test')
46+
await Config.get('mysql', 'test')
4747
assert.equal(Config.debug, false)
48-
49-
cfg = await Config.get('mysql', 'test')
50-
assert.equal(cfg.user, 'root')
5148
})
5249
})
5350
})

lib/group.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ class Group {
1515
if (g.length === 1) return g[0].id
1616
}
1717

18-
return await Mysql.execute(
19-
...Mysql.insert(`nt_group`, mapToDbColumn(args, groupDbMap)),
20-
)
18+
return await Mysql.execute(...Mysql.insert(`nt_group`, mapToDbColumn(args, groupDbMap)))
2119
}
2220

2321
async get(args) {
@@ -48,11 +46,7 @@ class Group {
4846
const id = args.id
4947
delete args.id
5048
const r = await Mysql.execute(
51-
...Mysql.update(
52-
`nt_group`,
53-
`nt_group_id=${id}`,
54-
mapToDbColumn(args, groupDbMap),
55-
),
49+
...Mysql.update(`nt_group`, `nt_group_id=${id}`, mapToDbColumn(args, groupDbMap)),
5650
)
5751
return r.changedRows === 1
5852
}
@@ -67,9 +61,7 @@ class Group {
6761
}
6862

6963
async destroy(args) {
70-
const r = await Mysql.execute(
71-
...Mysql.delete(`nt_group`, { nt_group_id: args.id }),
72-
)
64+
const r = await Mysql.execute(...Mysql.delete(`nt_group`, { nt_group_id: args.id }))
7365
return r.affectedRows === 1
7466
}
7567
}

lib/mysql.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ class Mysql {
1818
if (_debug) console.log(cfg)
1919

2020
this.dbh = await mysql.createConnection(cfg)
21-
if (_debug)
22-
console.log(`MySQL connection id ${this.dbh.connection.connectionId}`)
21+
if (_debug) console.log(`MySQL connection id ${this.dbh.connection.connectionId}`)
2322
return this.dbh
2423
}
2524

@@ -54,10 +53,7 @@ class Mysql {
5453
}
5554

5655
update(table, where, params = {}) {
57-
return [
58-
`UPDATE ${table} SET ${Object.keys(params).join('=?,')}=? WHERE ${where}`,
59-
Object.values(params),
60-
]
56+
return [`UPDATE ${table} SET ${Object.keys(params).join('=?,')}=? WHERE ${where}`, Object.values(params)]
6157
}
6258

6359
delete(table, params) {

0 commit comments

Comments
 (0)