Skip to content

Commit

Permalink
Requires Node >= 16
Browse files Browse the repository at this point in the history
  • Loading branch information
dex4er committed Jun 21, 2024
1 parent 9eafcc9 commit d7f3883
Show file tree
Hide file tree
Showing 23 changed files with 348 additions and 103 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

21 changes: 0 additions & 21 deletions .eslintrc.yaml

This file was deleted.

83 changes: 83 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI

on:
push:
branches:
- '**'
pull_request:
branches:
- main
- master
workflow_dispatch: {}

permissions:
contents: read

jobs:
node_current:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: current

- name: Install required dependencies
run: npm install

- name: Audit dependencies
run: npm audit --audit-level high

- name: Run linters
run: npm run lint

- name: Pack
run: npm pack

- name: Run tests with coverage
run: npm run test:coverage:spec

- name: Show coverage report
run: npm run test:coverage:report

- name: Send coverage report
run: npx coveralls < coverage/lcov.info
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

- name: Clean after tests
run: npm run clean

- name: Check untracked files
run: for f in $(git ls-files --others --exclude-standard); do git diff --no-index --stat --exit-code /dev/null $f; done

node:
strategy:
fail-fast: false
matrix:
node-version:
- '22'
- '20'
- '18'
- '16'

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install required dependencies
run: npm install

- name: Run tests
run: npm run test:spec
52 changes: 52 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release

on:
push:
tags:
- '*'
workflow_dispatch: {}

permissions:
contents: write

jobs:
release:
name: Release

permissions:
id-token: write
contents: write

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check if package version matches
run: test "${GITHUB_REF_NAME}" = "v$(jq -r .version package.json)"

- name: Check if changelog version matches
run: grep "^## ${GITHUB_REF_NAME//./\\.} " CHANGELOG.md

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: current
registry-url: https://registry.npmjs.org

- name: Install required dependencies
run: npm install

- name: Publish package
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

- name: Parse changelog
run: sed -n -e '/^## /{n; :a; /^## /q; p; n; ba}' -e 1d CHANGELOG.md | sed '1d' > ${{ github.workspace }}-CHANGELOG.txt

- name: Create release
uses: softprops/action-gh-release@v2
with:
body_path: ${{ github.workspace }}-CHANGELOG.txt
31 changes: 31 additions & 0 deletions .github/workflows/trunk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Trunk Check

on:
- pull_request
- push
- workflow_dispatch

permissions:
contents: read

jobs:
trunk:
name: Trunk Check
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '22'

- name: Install required dependencies
run: npm install

- name: Trunk Check
uses: trunk-io/trunk-action@v1
with:
check-mode: all
6 changes: 5 additions & 1 deletion .mocharc.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
color: true
diff: true
loader: ts-node/esm
no-warnings: true
node-option:
- experimental-specifier-resolution=node
- no-warnings
- loader=ts-node/esm
package: ./package.json
spec:
- test/*.ts
reporter: dot
timeout: 90000
throw-deprecation: true
ui: bdd
29 changes: 29 additions & 0 deletions .renovaterc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
"group:definitelyTyped",
"group:linters",
"group:monorepos",
"group:testNonMajor",
"group:typescript-eslintMonorepo",
"group:allNonMajor",
"workarounds:typesNodeVersioning"
],
"rangeStrategy": "bump",
"semanticCommits": "disabled",
"packageRules": [
{
"description": "Don't bump engines field in package.json",
"matchPackageNames": ["node"],
"matchManagers": ["npm"],
"matchDepTypes": ["engines"],
"rangeStrategy": "auto"
},
{
"description": "Typescript updates are always separate",
"matchPackageNames": ["typescript"],
"separateMinorPatch": true
}
]
}
1 change: 0 additions & 1 deletion .tool-versions

This file was deleted.

21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

9 changes: 9 additions & 0 deletions .trunk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*out
*logs
*actions
*notifications
*tools
plugins
user_trunk.yaml
user.yaml
tmp
36 changes: 36 additions & 0 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This file controls the behavior of Trunk: https://docs.trunk.io/cli
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
version: 0.1
cli:
version: 1.22.2
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
plugins:
sources:
- id: trunk
ref: v1.6.0
uri: https://github.com/trunk-io/plugins
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
runtimes:
enabled:
- [email protected]
- [email protected]
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
lint:
disabled:
- renovate
enabled:
- [email protected]
- [email protected]
- [email protected]
- git-diff-check
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
actions:
enabled:
- trunk-announce
- trunk-check-pre-push
- trunk-fmt-pre-commit
- trunk-upgrade-available
7 changes: 7 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rules:
quoted-strings:
required: only-when-needed
extra-allowed: ['{|}']
key-duplicates: {}
octal-values:
forbid-implicit-octal: true
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v1.0.1 2024-06-21

- Requires Node >= 16.

## v1.0.0 2021-10-24

- Convert to ESM module.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GPL-2.0

Copyright (c) 2018-2021 Piotr Roszatycki <[email protected]>
Copyright (c) 2018-2024 Piotr Roszatycki <[email protected]>

GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

<!-- markdownlint-disable MD013 -->

[![Build Status](https://api.travis-ci.com/dex4er/js-polish-vehicle-registration-certificate-decoder.svg)](https://app.travis-ci.com/github/dex4er/js-polish-vehicle-registration-certificate-decoder) [![Coverage Status](https://coveralls.io/repos/github/dex4er/js-polish-vehicle-registration-certificate-decoder/badge.svg)](https://coveralls.io/github/dex4er/js-polish-vehicle-registration-certificate-decoder) [![npm](https://img.shields.io/npm/v/polish-vehicle-registration-certificate-decoder.svg)](https://www.npmjs.com/package/polish-vehicle-registration-certificate-decoder)
[![GitHub](https://img.shields.io/github/v/release/dex4er/js-polish-vehicle-registration-certificate-decoder?display_name=tag&sort=semver)](https://github.com/dex4er/js-polish-vehicle-registration-certificate-decoder)
[![CI](https://github.com/dex4er/js-polish-vehicle-registration-certificate-decoder/actions/workflows/ci.yaml/badge.svg)](https://github.com/dex4er/js-polish-vehicle-registration-certificate-decoder/actions/workflows/ci.yaml)
[![Trunk Check](https://github.com/dex4er/js-polish-vehicle-registration-certificate-decoder/actions/workflows/trunk.yaml/badge.svg)](https://github.com/dex4er/js-polish-vehicle-registration-certificate-decoder/actions/workflows/trunk.yaml)
[![Coverage Status](https://coveralls.io/repos/github/dex4er/js-polish-vehicle-registration-certificate-decoder/badge.svg)](https://coveralls.io/github/dex4er/js-polish-vehicle-registration-certificate-decoder)
[![npm](https://img.shields.io/npm/v/polish-vehicle-registration-certificate-decoder.svg)](https://www.npmjs.com/package/polish-vehicle-registration-certificate-decoder)

<!-- markdownlint-enable MD013 -->

Decode Polish Vehicle Registration Certificate Aztec 2D barcode data.

## Requirements

This is ESM module which requires ES2020 and Node >= 14.
This is ESM module which requires ES2020 and Node >= 16.

## Installation

Expand Down Expand Up @@ -407,6 +411,6 @@ Output:

## License

Copyright (c) 2018-2021 Piotr Roszatycki <[email protected]>
Copyright (c) 2018-2024 Piotr Roszatycki <[email protected]>

[GPL-2.0](https://opensource.org/licenses/GPL-2.0)
Loading

0 comments on commit d7f3883

Please sign in to comment.