Skip to content

Commit

Permalink
Release v2.1.2 (#49)
Browse files Browse the repository at this point in the history
* load npm version of punycode (specify / after require)
- dep(mocha): remove dev dep (installed by npx)
- dep(punycode): bump 2.3.0 to 2.3.1
* switch to haraka shared workflow
* ci: remove coveralls workflow (dupe)
* exclude .gitmodules from npm publish
* test: use strict assertions
  • Loading branch information
msimerson authored Feb 23, 2024
1 parent 7fc8925 commit ca24eae
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 72 deletions.
33 changes: 9 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,14 @@ jobs:
lint:
uses: haraka/.github/.github/workflows/lint.yml@master

coverage:
uses: haraka/.github/.github/workflows/coverage.yml@master
secrets: inherit

test:
needs: [ lint, get-lts ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
node-version: ${{ fromJson(needs.get-lts.outputs.active) }}
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
name: Node ${{ matrix.node-version }} on ${{ matrix.os }}
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
needs: [ lint ]
uses: haraka/.github/.github/workflows/ubuntu.yml@master

get-lts:
runs-on: ubuntu-latest
steps:
- id: get
uses: msimerson/node-lts-versions@v1
outputs:
active: ${{ steps.get.outputs.active }}
lts: ${{ steps.get.outputs.lts }}
min: ${{ steps.get.outputs.min }}
windows:
needs: [ lint ]
uses: haraka/.github/.github/workflows/windows.yml@master
32 changes: 0 additions & 32 deletions .github/workflows/coveralls.yml

This file was deleted.

1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ node_modules
.lock-wscript
package-lock.json
.eslintrc.yaml
.gitmodules
9 changes: 9 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@

### Unreleased


### [2.1.2] - 2024-02-23

- load npm version of punycode (specify / after require)
- dep(mocha): remove dev dep (installed by npx)
- dep(punycode): bump 2.3.0 to 2.3.1


### 2.1.1 - 2023-08-22

- feat: bundle grammar.js, build with prepack, fixes #46
Expand Down Expand Up @@ -77,3 +85,4 @@
- replaced null host or user values with empty strings
[2.1.0]: https://github.com/haraka/node-address-rfc2821/releases/tag/2.1.0
[2.1.1]: https://github.com/haraka/node-address-rfc2821/releases/tag/2.1.1
[2.1.2]: https://github.com/haraka/node-address-rfc2821/releases/tag/2.1.2
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const punycode = require('punycode');
const punycode = require('punycode/');
const nearley = require('nearley');

const grammar = nearley.Grammar.fromCompiled(require('./grammar.js'));
Expand Down
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "address-rfc2821",
"version": "2.1.1",
"version": "2.1.2",
"description": "RFC-5321 (Envelope) email address parser",
"author": {
"name": "The Haraka Team",
Expand All @@ -27,7 +27,6 @@
},
"scripts": {
"grammar": "npx -p nearley nearleyc grammar.ne -o grammar.js",
"cover": "NODE_ENV=cov npx nyc --reporter=lcovonly npm run test",
"lint": "npx eslint index.js test/*.js",
"lintfix": "npx eslint --fix index.js test/*.js",
"prepack": "npm run grammar",
Expand All @@ -39,13 +38,12 @@
"url": "https://github.com/haraka/node-address-rfc2821.git"
},
"devDependencies": {
"eslint": "*",
"eslint-plugin-haraka": "*",
"mocha": "*"
"eslint": "8.56.0",
"eslint-plugin-haraka": "1.0.15"
},
"license": "MIT",
"dependencies": {
"nearley": "^2.20.1",
"punycode": "^2.3.0"
"punycode": "^2.3.1"
}
}
14 changes: 5 additions & 9 deletions test/address.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const assert = require('assert');
const assert = require('node:assert/strict');

const Address = require('../index').Address;

Expand Down Expand Up @@ -119,29 +119,25 @@ describe('isNull', function () {
})

describe('format()', function () {
it('works', function (done) {
it('works', function () {
const addr = new Address('<[email protected]>');
assert.equal(addr.user, 'matt');
assert.equal(addr.host, 'example.com');
assert.equal(addr.format(), '<[email protected]>');
done();
})

it('lower cases hostnames', function (done) {
it('lower cases hostnames', function () {
const addr = new Address('<[email protected]>');
assert.equal(addr.host, 'example.com');
done();
})

it('no latin escaping', function (done) {
it('no latin escaping', function () {
const addr = new Address('<přílišžluťoučkýkůň@přílišžluťoučkýkůň.cz>');
assert.equal(addr.format(), '<přílišžluťoučkýkůň@přílišžluťoučkýkůň.cz>');
done();
})

it('spaces inside a quoted string', function (done) {
it('spaces inside a quoted string', function () {
const addr = new Address('<"pří lišžlu ťoučkýkůň"@přílišžluťoučkýkůň.cz>');
assert.equal(addr.format(), '<"pří lišžlu ťoučkýkůň"@přílišžluťoučkýkůň.cz>');
done();
})
})

0 comments on commit ca24eae

Please sign in to comment.