Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update support policy, tooling, and docs #22

Merged
merged 22 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9942aa3
Remove Grunt and JSHint
danyalaytekin Nov 9, 2023
cc248b4
Require `npm@10`
danyalaytekin Nov 9, 2023
78e334f
Publish with Node 18
danyalaytekin Nov 9, 2023
74878d9
Introduce `eslint` and `pa11y-lint-config@3`
danyalaytekin Nov 9, 2023
03daceb
Remove comments where they repeat item name
danyalaytekin Nov 9, 2023
2081b23
Update `package.description` in common with webservice's description …
danyalaytekin Nov 9, 2023
6553217
Fix linting errors and warnings
danyalaytekin Nov 9, 2023
67370cc
Update readme to reflect renaming of `err` to `error`
danyalaytekin Nov 9, 2023
6930532
In the workflow, update `npm` and lint using commands that exist
danyalaytekin Nov 9, 2023
19bbfd0
Replace mentions of Grunt in readme
danyalaytekin Nov 9, 2023
4d38e37
Describe how to test the workflows locally
danyalaytekin Nov 9, 2023
99fe075
Upgrade to `sinon@17` from `16`
danyalaytekin Nov 9, 2023
85e2568
Rename `LICENSE.txt` to `LICENSE` to match our other repos
danyalaytekin Nov 10, 2023
6899a9e
Introduce the standard `.editorconfig`
danyalaytekin Nov 14, 2023
4df0eb0
Replace `npm` fixing to `10` with `lockfile-version` fixing to `2`
danyalaytekin Nov 14, 2023
dd22d1a
Set `.nvmrc` to current minimum, `18`
danyalaytekin Nov 14, 2023
5b79394
Pull out the linting step
danyalaytekin Nov 14, 2023
5a1280b
Rename publishing job to `publish` from `build`
danyalaytekin Nov 14, 2023
efa372c
Update support policy to agreed version
danyalaytekin Nov 15, 2023
122a30d
Update support table
danyalaytekin Nov 15, 2023
49445e8
Remove duplicated advice about opening issue
danyalaytekin Nov 15, 2023
9a68a2b
Fix link to license
danyalaytekin Nov 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
indent_style = space
trim_trailing_whitespace = false

[*.yml]
indent_style = space
indent_size = 2

[package.json]
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
coverage
12 changes: 12 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict';

const pa11yConfig = require('pa11y-lint-config/eslint/es2017');

const config = {
...pa11yConfig,
parserOptions: {
ecmaVersion: 2020
}
};

module.exports = config;
10 changes: 5 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ on:
workflow_dispatch:
inputs:
dryRun:
description: "Dry run only"
description: Dry run only
required: true
default: true
type: boolean

jobs:
build:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
node-version: 18
registry-url: https://registry.npmjs.org
- run: npm ci

- name: Publish package
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ on:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npm run lint

test:
runs-on: ubuntu-latest
strategy:
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lockfile-version=2
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
54 changes: 0 additions & 54 deletions Gruntfile.js

This file was deleted.

File renamed without changes.
86 changes: 55 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,100 +30,100 @@ client.tasks.create({
name: 'Nature Home Page',
url: 'nature.com',
standard: 'WCAG2AA'
}, function (err, task) {
}, function (error, task) {
// task = object representing the new task, or null if an error occurred
});

// Get all tasks
client.tasks.get({}, function (err, tasks) {
client.tasks.get({}, function (error, tasks) {
// tasks = array of objects representing tasks, or null if an error occurred
});

// Get all tasks with last results included for each
client.tasks.get({
lastres: true
}, function (err, tasks) {
}, function (error, tasks) {
// tasks = array of objects representing tasks, or null if an error occurred
});

// Get results for all tasks
client.tasks.results({}, function (err, results) {
client.tasks.results({}, function (error, results) {
// results = array of objects representing results, or null if an error occurred
});

// Get results for all tasks within a date range
client.tasks.results({
from: '2023-01-01',
to: '2023-01-31'
}, function (err, results) {
}, function (error, results) {
// results = array of objects representing results, or null if an error occurred
});

// Get results for all tasks with full details
client.tasks.results({
full: true
}, function (err, results) {
}, function (error, results) {
// results = array of objects representing results, or null if an error occurred
});

// Get a task by ID
client.task('5231c687bbdf0f94fa000007').get({}, function (err, task) {
client.task('5231c687bbdf0f94fa000007').get({}, function (error, task) {
// task = object representing the requested task, or null if an error occurred
});

// Get a task by ID with last results included
client.task('5231c687bbdf0f94fa000007').get({
lastres: true
}, function (err, task) {
}, function (error, task) {
// task = object representing the requested task, or null if an error occurred
});

// Edit a task by ID
client.task('5231c687bbdf0f94fa000007').edit({
name: 'New name'
}, function (err, task) {
}, function (error, task) {
// task = object representing the newly updated task, or null if an error occurred
});

// Delete a task by ID
client.task('5231c687bbdf0f94fa000007').remove(function (err) {
client.task('5231c687bbdf0f94fa000007').remove(function (error) {
// err = null if task was deleted, or an Error object if something went wrong
});

// Run a task by ID
client.task('5231c687bbdf0f94fa000007').run(function (err) {
client.task('5231c687bbdf0f94fa000007').run(function (error) {
// err = null if task is running, or an Error object if something went wrong
});

// Get results for a task
client.task('5231c687bbdf0f94fa000007').results({}, function (err, results) {
client.task('5231c687bbdf0f94fa000007').results({}, function (error, results) {
// results = array of objects representing results, or null if an error occurred
});

// Get results for a task within a date range
client.task('5231c687bbdf0f94fa000007').results({
from: '2023-01-01',
to: '2023-01-31'
}, function (err, results) {
}, function (error, results) {
// results = array of objects representing results, or null if an error occurred
});

// Get results for a task with full details
client.task('5231c687bbdf0f94fa000007').results({
full: true
}, function (err, results) {
}, function (error, results) {
// results = array of objects representing results, or null if an error occurred
});

// Get a result by ID
client.task('5231c687bbdf0f94fa000007').result('523c0ee0ca452f0000000009').get({}, function (err, result) {
client.task('5231c687bbdf0f94fa000007').result('523c0ee0ca452f0000000009').get({}, function (error, result) {
// task = object representing the requested result, or null if an error occurred
});

// Get a result by ID with full details
client.task('5231c687bbdf0f94fa000007').result('523c0ee0ca452f0000000009').get({
full: true
}, function (err, result) {
}, function (error, result) {
// task = object representing the requested result, or null if an error occurred
});
```
Expand All @@ -136,40 +136,64 @@ If you'd like to contribute code, get started by cloning the repo and running `n

```sh
# Lint your contribution
grunt lint
npm run lint
```

```sh
# Test your contribution
grunt test
npm test
```

### Testing the GitHub Actions workflows

This project's GitHub Actions workflows can be tested locally using [nektos/act](https://github.com/nektos/act), which can be installed with Homebrew:

```sh
brew install act
```

To validate the syntax of a workflow:

```sh
# Validate the publishing workflow, by triggering a 'release' event
act --dryrun release
```

```sh
# Lint and test with a single command
grunt
# Validate the testing workflow
act --dryrun push
```

To run the testing workflow locally:

```sh
# Run the testing workflow, with Node.js 18 only
act push --matrix node-version:18
```

Add `--verbose` for more output.

## Support and Migration

Major versions are normally supported for 6 months after their last minor release. This means that patch-level changes will be added and bugs will be fixed. The table below outlines the end-of-support dates for major versions, and the last minor release for that version.
> [!NOTE]
> We maintain a [migration guide](MIGRATION.md) to help you migrate between major versions.

We also maintain a [migration guide](MIGRATION.md) to help you migrate.
When we release a new major version we will continue to support the previous major version for 6 months. This support will be limited to fixes for critical bugs and security issues. If you're opening an issue related to this project, please mention the specific version that the issue affects.

| :grey_question: | Major Version | Last Release | Node.js Versions | Support End Date |
| :-------------- | :------------ | :----------- | :--------------- | :--------------- |
| :heart: | 3 | N/A | 12+ | N/A |
| :hourglass: | 2 | 2.0.0 | 8+ | 2022-05-26 |
| :skull: | 1 | 1.2.1 | 0.10+ | 2020-01-05 |
The following table lists the major versions available and, for each previous major version, its end-of-support date, and its final minor version released.

If you're opening issues related to these, please mention the version that the issue relates to.
| Major version | Final minor version | Node.js support | Support end date |
| :-------------- | :------------------ | :----------------------- | :--------------- |
| `3` | | `>= 12` | ✅ Current major version |
| `2` | `2.0` | `8`, `10` | 2022-05-26 |
| `1` | `1.2` | `0.10`, `0.12`, `4`, `6` | 2020-01-05 |

## License

Licensed under the [GNU General Public License 3.0](LICENSE.txt).<br/>
Copyright &copy; 20132023, Team Pa11y
Licensed under the [GNU General Public License 3.0][info-license].
danyalaytekin marked this conversation as resolved.
Show resolved Hide resolved
Copyright &copy; 2013-2023, Team Pa11y

[gpl]: http://www.gnu.org/licenses/gpl-3.0.html
[grunt]: http://gruntjs.com/
[pa11y-webservice]: https://github.com/pa11y/pa11y-webservice
[wiki-web-service]: https://github.com/pa11y/pa11y-webservice/wiki/Web-Service-Endpoints
[info-build]: https://github.com/pa11y/pa11y-webservice-client-node/actions/workflows/tests.yml
Expand Down
Loading
Loading