From 9aee1b50ed1406fbc0a8539362099d4f57c42aa9 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Sat, 25 Jul 2026 20:25:37 -0700 Subject: [PATCH 1/3] test and start fixes - doc(CHANGELOG): add commit messages for 0.2.2 - add eslint config - use caret ranges - deps: version bumps --- .gitignore | 1 + .release | 2 +- CHANGELOG.md | 6 +++++- CONTRIBUTORS.md | 4 ++-- bin/start.js | 0 eslint.config.mjs | 21 +++++++++++++++++++++ package.json | 17 ++++++++++------- test/jwt-proxy.test.js | 16 ++++++---------- 8 files changed, 46 insertions(+), 21 deletions(-) mode change 100644 => 100755 bin/start.js create mode 100644 eslint.config.mjs diff --git a/.gitignore b/.gitignore index 0253345..6648e1e 100644 --- a/.gitignore +++ b/.gitignore @@ -115,3 +115,4 @@ conf.d # Playwright test-results/ playwright-report/ +.release/ diff --git a/.release b/.release index a6911a9..290b441 160000 --- a/.release +++ b/.release @@ -1 +1 @@ -Subproject commit a6911a90f1b15486fb319d844341421c78035b2a +Subproject commit 290b441b2052b219585e0690da703c56ee1e698e diff --git a/CHANGELOG.md b/CHANGELOG.md index 5671271..e2ee4a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). ### Unreleased +### [0.2.2] - 2026-07-25 + +- test and start fixes + ### [0.2.0] - 2026-07-24 - move group list to left nav @@ -18,6 +22,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). - wiring up forms to object models - improve configurator - [0.2.0]: https://github.com/NicTool/server/releases/tag/v0.2.0 [0.0.2]: https://github.com/NicTool/server/releases/tag/v0.0.2 +[0.2.2]: https://github.com/NicTool/server/releases/tag/v0.2.2 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 6c8aef8..89b3948 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -2,8 +2,8 @@ This handcrafted artisanal software is brought to you by: -|
msimerson (6) | -| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +|
msimerson (14) | +| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | this file is generated by [.release](https://github.com/msimerson/.release). Contribute to this project to get your GitHub profile included here. diff --git a/bin/start.js b/bin/start.js old mode 100644 new mode 100755 diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..efb8018 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,21 @@ +import globals from 'globals' +import js from '@eslint/js' + +export default [ + { + ignores: ['**/package-lock.json', 'node_modules/**', '.release/**'], + }, + js.configs.recommended, + { + languageOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + globals: { + ...globals.node, + }, + }, + rules: { + 'no-unused-vars': 'warn', + }, + }, +] diff --git a/package.json b/package.json index 73cc1d0..a1d1f93 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nictool/server", - "version": "0.2.0", + "version": "0.2.2", "description": "NicTool server, the DNS managers server component", "main": "index.js", "type": "module", @@ -47,13 +47,13 @@ }, "homepage": "https://github.com/NicTool/server#readme", "dependencies": { - "@nictool/api": "3.0.0-alpha.12", - "@nictool/dns-nameserver": "file:../dns-nameserver", - "@nictool/dns-resource-record": "file:../dns-resource-record", - "@nictool/dns-zone": "file:../dns-zone", + "@nictool/api": "^3.0.2", + "@nictool/dns-nameserver": "^0.8.0", + "@nictool/dns-resource-record": "^1.8.1", + "@nictool/dns-zone": "^1.2.3", "joi": "^18.2.3", "mysql2": "^3.23.1", - "smol-toml": "^1.7.0" + "smol-toml": "^1.7.1" }, "prettier": { "printWidth": 90, @@ -61,7 +61,10 @@ "semi": false }, "devDependencies": { - "@playwright/test": "^1.61.1", + "@eslint/js": "^10.0.1", + "eslint": "^10.8.0", + "globals": "^17.8.0", + "@playwright/test": "^1.62.0", "jsdom": "^29.1.1", "lit": "^3.3.3", "vite": "^8.1.5" diff --git a/test/jwt-proxy.test.js b/test/jwt-proxy.test.js index 7bff9d3..08166ba 100644 --- a/test/jwt-proxy.test.js +++ b/test/jwt-proxy.test.js @@ -15,7 +15,9 @@ import os from 'node:os' import path from 'node:path' import { fileURLToPath } from 'node:url' -const apiDir = fileURLToPath(new URL('../node_modules/@nictool/api/', import.meta.url)) +const apiDir = fileURLToPath( + new URL('./', import.meta.resolve('@nictool/api/package.json')), +) const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'nt-jwt-')) const store = path.join(tmp, 'store') fs.mkdirSync(store) @@ -63,12 +65,8 @@ before(async () => { process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0' process.chdir(apiDir) // the API loads config from ./conf.d relative to cwd - const { default: Group } = await import( - new URL('../node_modules/@nictool/api/lib/group/index.js', import.meta.url) - ) - const { default: User } = await import( - new URL('../node_modules/@nictool/api/lib/user/index.js', import.meta.url) - ) + const { default: Group } = await import('@nictool/api/lib/group/index.js') + const { default: User } = await import('@nictool/api/lib/user/index.js') const groupCase = JSON.parse( fs.readFileSync(path.join(apiDir, 'routes/test/group.json')), ) @@ -81,9 +79,7 @@ before(async () => { password: userCase.password, } - const { init: initAPI } = await import( - new URL('../node_modules/@nictool/api/routes/index.js', import.meta.url) - ) + const { init: initAPI } = await import('@nictool/api/routes/index.js') const apiServer = await initAPI() const { startServer } = await import(new URL('../index.js', import.meta.url)) From 436ffe0ded3cdff7744daa8208af07d18b155ae8 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Sun, 26 Jul 2026 14:11:33 -0700 Subject: [PATCH 2/3] lint --- eslint.config.mjs | 12 +++++++++++- package.json | 2 +- web/src/app.js | 5 +++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index efb8018..79e4b21 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -3,7 +3,7 @@ import js from '@eslint/js' export default [ { - ignores: ['**/package-lock.json', 'node_modules/**', '.release/**'], + ignores: ['**/package-lock.json', 'node_modules/**', '.release/**', 'html/dist/**'], }, js.configs.recommended, { @@ -18,4 +18,14 @@ export default [ 'no-unused-vars': 'warn', }, }, + { + files: ['web/src/**/*.js'], + languageOptions: { + globals: { + ...globals.browser, + // loaded as a script tag from the CDN bundle in html/index.html + bootstrap: 'readonly', + }, + }, + }, ] diff --git a/package.json b/package.json index a1d1f93..08ec41a 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "clean": "rm -rf coverage node_modules package-lock.json html/dist", "format:check": "npm run prettier; npm run lint", "format": "npm run prettier -- --write && npm run lint:fix", - "lint": "npx eslint **/*.js", + "lint": "npx eslint .", "lint:fix": "npm run lint -- --fix", "prettier": "npx prettier --ignore-path .gitignore --check .", "prettier:fix": "npx prettier --ignore-path .gitignore --write .", diff --git a/web/src/app.js b/web/src/app.js index ab81b48..f4cf4f6 100644 --- a/web/src/app.js +++ b/web/src/app.js @@ -937,8 +937,9 @@ function getRdataInput(field, value = '', rr, placeholder = ' ') { input += `` } input += `` - } else if (rr.get('type') === 'NAPTR' && field === 'flags') { - } else { + // NAPTR flags are characters (S/A/U/P, RFC 3403), so they keep the text + // input rather than the number input the 'flags' case below would give them. + } else if (!(rr.get('type') === 'NAPTR' && field === 'flags')) { switch (field) { case 'cert type': case 'hash algorithm': From 24af347c1914ab3ac26e1620e1ca670e23ff8437 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Sun, 26 Jul 2026 15:03:26 -0700 Subject: [PATCH 3/3] fix path for windows --- index.js | 4 +++- web/src/app.js | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index c7099fc..ac7f9cc 100644 --- a/index.js +++ b/index.js @@ -2,11 +2,13 @@ import http from 'node:http' import https from 'node:https' import path from 'node:path' import fs from 'node:fs/promises' +import { fileURLToPath } from 'node:url' import { stringify } from 'smol-toml' import mysql from 'mysql2/promise' -const __dirname = new URL('.', import.meta.url).pathname +// .pathname is drive-relative on Windows ("/D:/a/server") +const __dirname = fileURLToPath(new URL('.', import.meta.url)) const MIME = { '.html': 'text/html; charset=utf-8', diff --git a/web/src/app.js b/web/src/app.js index f4cf4f6..448dd3d 100644 --- a/web/src/app.js +++ b/web/src/app.js @@ -937,8 +937,7 @@ function getRdataInput(field, value = '', rr, placeholder = ' ') { input += `` } input += `` - // NAPTR flags are characters (S/A/U/P, RFC 3403), so they keep the text - // input rather than the number input the 'flags' case below would give them. + // NAPTR flags are characters, not numeric (RFC 3403) } else if (!(rr.get('type') === 'NAPTR' && field === 'flags')) { switch (field) { case 'cert type':