From d79ec470b3862ec1df3e190611d01d3175ff19dc Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Fri, 31 Jan 2025 13:05:46 -0800 Subject: [PATCH] Release v1.3.9 (#70) - vm_harness: access local files in plugin directory (#68) - dep(all): bump versions - dep(eslint): upgrade to v9 --- .codeclimate.yml | 4 ++-- .eslintrc.yaml | 10 ---------- .github/workflows/publish.yml | 2 ++ .prettierrc | 2 -- .release | 2 +- CHANGELOG.md | 7 +++++++ CONTRIBUTORS.md | 5 +++-- README.md | 4 ---- eslint.config.mjs | 29 +++++++++++++++++++++++++++++ lib/vm_harness.js | 11 ++++------- package.json | 24 ++++++++++++++---------- 11 files changed, 62 insertions(+), 38 deletions(-) delete mode 100644 .eslintrc.yaml delete mode 100644 .prettierrc create mode 100644 eslint.config.mjs diff --git a/.codeclimate.yml b/.codeclimate.yml index 019e888..e010599 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -1,9 +1,9 @@ engines: eslint: enabled: true - channel: 'eslint-8' + channel: 'eslint-9' config: - config: '.eslintrc.yaml' + config: 'eslint.config.mjs' ratings: paths: diff --git a/.eslintrc.yaml b/.eslintrc.yaml deleted file mode 100644 index fbb3253..0000000 --- a/.eslintrc.yaml +++ /dev/null @@ -1,10 +0,0 @@ -env: - es6: true - node: true - mocha: true - es2022: true - -extends: ['@haraka'] - -rules: - no-unused-vars: ['warn'] diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d97a994..e81c15f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,6 +4,8 @@ on: push: branches: - master + paths: + - package.json env: CI: true diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 8ded5e0..0000000 --- a/.prettierrc +++ /dev/null @@ -1,2 +0,0 @@ -singleQuote: true -semi: false diff --git a/.release b/.release index afb1db8..7307651 160000 --- a/.release +++ b/.release @@ -1 +1 @@ -Subproject commit afb1db801607dda5e859f39b600f0dd0111e4651 +Subproject commit 73076513e83c2057a32515831b638771c15b1d83 diff --git a/CHANGELOG.md b/CHANGELOG.md index 90c7f29..f6a83da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). ### Unreleased +### [1.3.9] - 2025-01-31 + +- vm_harness: access local files in plugin directory #68 +- dep(all): bump versions +- dep(eslint): upgrade to v9 + ### [1.3.8] - 2024-09-27 - bumped dep versions: @@ -220,3 +226,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). [1.3.6]: https://github.com/haraka/test-fixtures/releases/tag/v1.3.6 [1.3.7]: https://github.com/haraka/test-fixtures/releases/tag/v1.3.7 [1.3.8]: https://github.com/haraka/test-fixtures/releases/tag/v1.3.8 +[1.3.9]: https://github.com/haraka/test-fixtures/releases/tag/v1.3.9 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index da5e476..124fe86 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -2,7 +2,8 @@ This handcrafted artisinal software is brought to you by: -|
msimerson (63) |
kcberg (1) |
baudehlo (1) |
smfreegard (1) |
lnedry (1) | +|
msimerson (64) |
kcberg (1) |
baudehlo (1) |
smfreegard (1) |
lnedry (1) | | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | -this file is maintained by [.release](https://github.com/msimerson/.release) +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/README.md b/README.md index e52bf93..0d40dfc 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ [![Code Coverage][cov-img]][cov-url] [![Code Climate][clim-img]][clim-url] -[![NPM][npm-img]][npm-url] - # haraka-test-fixtures Fixtures for testing Haraka and plugins @@ -50,5 +48,3 @@ These fixtures are analogs of their like-named siblings in Haraka with varying l [cov-url]: https://codecov.io/github/haraka/test-fixtures [clim-img]: https://codeclimate.com/github/haraka/test-fixtures/badges/gpa.svg [clim-url]: https://codeclimate.com/github/haraka/test-fixtures -[npm-img]: https://nodei.co/npm/haraka-test-fixtures.png -[npm-url]: https://www.npmjs.com/package/haraka-test-fixtures diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..0377960 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,29 @@ +import globals from 'globals' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import js from '@eslint/js' +import { FlatCompat } from '@eslint/eslintrc' + +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, +}) + +export default [ + ...compat.extends('@haraka'), + { + languageOptions: { + globals: { + ...globals.node, + ...globals.mocha, + }, + }, + + rules: { + 'no-unused-vars': ['warn'], + }, + }, +] diff --git a/lib/vm_harness.js b/lib/vm_harness.js index a7e7445..599b5dd 100644 --- a/lib/vm_harness.js +++ b/lib/vm_harness.js @@ -15,17 +15,14 @@ function dot_files(element) { function find_haraka_lib(id) { // For local files in the project root directory // e.g. "require('./example.js')" - if (id.includes('./') && id.includes('.js')) { + if (id.startsWith('./') && id.endsWith('.js')) { id = id.substring(2, (id.length - 3)) } - for (let i = 0; i < dir_paths.length; i++) { - const dirPath = `${dir_paths[i]}${id}.js` - // console.log('dirPath: ' + dirPath); + for (const dp of dir_paths) { + const dirPath = `${dp}${id}.js` try { const stats = fs.statSync(dirPath) - if (stats.isFile()) { - return dirPath - } + if (stats.isFile()) return dirPath } catch (ignore) { // console.error(ignore.message); } diff --git a/package.json b/package.json index dd852c9..454456e 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "name": "haraka-test-fixtures", "license": "MIT", "description": "Haraka Test Fixtures", - "version": "1.3.8", + "version": "1.3.9", "repository": { "type": "git", "url": "git@github.com:haraka/test-fixtures.git" @@ -18,28 +18,32 @@ "node": ">=12" }, "dependencies": { - "address-rfc2821": "^2.1.2", - "haraka-config": "^1.4.0", + "address-rfc2821": "^2.1.3", + "haraka-config": "^1.4.2", "haraka-constants": "^1.0.7", - "haraka-email-message": "^1.2.4", - "haraka-notes": "^1.1.0", - "haraka-results": "^2.2.4", + "haraka-email-message": "^1.2.5", + "haraka-notes": "^1.1.1", + "haraka-results": "^2.2.5", "haraka-utils": "^1.1.3" }, "devDependencies": { - "@haraka/eslint-config": "^1.1.5" + "@haraka/eslint-config": "^2.0.2" }, "bugs": { "url": "https://github.com/haraka/test-fixtures/issues" }, "scripts": { "format": "npm run prettier:fix && npm run lint:fix", - "lint": "npx eslint@^8 *.js lib test", - "lint:fix": "npx eslint@^8 *.js lib test --fix", + "lint": "npx eslint@^9 *.js lib test", + "lint:fix": "npx eslint@^9 *.js lib test --fix", "prettier": "npx prettier . --check", "prettier:fix": "npx prettier . --write --log-level=warn", - "test": "npx mocha@^10", + "test": "npx mocha@^11", "versions": "npx dependency-version-checker check", "versions:fix": "npx dependency-version-checker update" + }, + "prettier": { + "singleQuote": true, + "semi": false } }