@fulldecent/nice-checkers-plugin 1.3.8 → 1.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -54
- package/dist/index.cjs +322 -322
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +322 -322
- package/dist/index.js.map +1 -1
- package/package.json +6 -8
package/README.md
CHANGED
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Nice Checkers
|
|
2
2
|
|
|
3
|
-
[](https://github.com/fulldecent/html-validate-nice-checkers/actions/workflows/lint.yml)
|
|
4
|
+
[](https://github.com/fulldecent/html-validate-nice-checkers/actions/workflows/test.yml)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
## What this project does
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
Nice Checkers is an [HTML-validate](https://html-validate.org/) plugin with 11 rules for SEO, security, accessibility, and URLs.
|
|
8
9
|
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- :white_check_mark: **Comprehensive testing**: high test coverage with realistic fixtures
|
|
10
|
+
The npm package is [@fulldecent/nice-checkers-plugin](https://www.npmjs.com/package/@fulldecent/nice-checkers-plugin). It publishes ESM and CommonJS builds and TypeScript types. It runs in Node.js while a site is built. Some rules call other sites with `curl`. A `fetch()` implementation is blocked by [html-validate issue 317](https://gitlab.com/html-validate/html-validate/-/issues/317).
|
|
11
|
+
|
|
12
|
+
`engines` allows Node.js 22 and newer. [Tests](.github/workflows/test.yml) run on the Node.js 22, 24, and 26 release lines. [Lint](.github/workflows/lint.yml) checks Prettier and markdownlint. Local development uses the Node.js version in [.node-version](.node-version).
|
|
13
|
+
|
|
14
|
+
[GitHub Pages template](https://github.com/fulldecent/github-pages-template) is a site that uses this plugin, with Actions and Pages deployment.
|
|
15
15
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
|
18
|
-
These instructions assume
|
|
18
|
+
These instructions assume Nice Checkers is part of a web test suite running Node.js 22 or newer and [HTML-validate](https://html-validate.org/).
|
|
19
|
+
|
|
20
|
+
### Add the package
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
Install Nice Checkers as a dev dependency. It is used to test the site.
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
Yarn:
|
|
23
25
|
|
|
24
26
|
```sh
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
yarn add -D @fulldecent/nice-checkers-plugin
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
npm:
|
|
27
31
|
|
|
28
|
-
|
|
29
|
-
npm install
|
|
32
|
+
```sh
|
|
33
|
+
npm install -D @fulldecent/nice-checkers-plugin
|
|
30
34
|
```
|
|
31
35
|
|
|
32
36
|
### Update your HTML-validate configuration
|
|
@@ -547,36 +551,30 @@ See [issue #23](https://github.com/fulldecent/html-validate-nice-checkers/issues
|
|
|
547
551
|
|
|
548
552
|
## Development
|
|
549
553
|
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
### Install
|
|
554
|
+
Clone the repo:
|
|
553
555
|
|
|
554
556
|
```sh
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
557
|
+
git clone https://github.com/fulldecent/html-validate-nice-checkers.git ~/Developer/html-validate-nice-checkers
|
|
558
|
+
cd ~/Developer/html-validate-nice-checkers
|
|
559
|
+
```
|
|
558
560
|
|
|
559
|
-
|
|
560
|
-
nvm use
|
|
561
|
+
Use Node and yarn. The Node version is pinned in [.node-version](.node-version), and the Yarn version is pinned in [package.json](package.json). Quick start with [fnm](https://github.com/Schniz/fnm):
|
|
561
562
|
|
|
562
|
-
|
|
563
|
+
```sh
|
|
564
|
+
fnm install
|
|
565
|
+
fnm use
|
|
563
566
|
corepack enable
|
|
564
|
-
|
|
565
|
-
# Install dependencies
|
|
566
567
|
yarn install
|
|
568
|
+
yarn test
|
|
567
569
|
```
|
|
568
570
|
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
These notes are [from the Yarn project](https://yarnpkg.com/getting-started/editor-sdks#).
|
|
571
|
+
Format files the lint workflow checks:
|
|
572
572
|
|
|
573
573
|
```sh
|
|
574
|
-
yarn
|
|
574
|
+
yarn format
|
|
575
575
|
```
|
|
576
576
|
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
### [Development scripts](https://github.com/fulldecent/html-validate-nice-checkers/blob/main/package.json)
|
|
577
|
+
[Development scripts](package.json):
|
|
580
578
|
|
|
581
579
|
- `yarn build` builds the package
|
|
582
580
|
- `yarn build:watch` builds the package in watch mode
|
|
@@ -584,34 +582,57 @@ and YES, use workspace TypeScript version.
|
|
|
584
582
|
- `yarn test:watch` runs the tests in watch mode
|
|
585
583
|
- `yarn test:coverage` runs the tests and generates a coverage report
|
|
586
584
|
- `yarn lint` runs TypeScript type checking
|
|
587
|
-
- `yarn format` formats
|
|
585
|
+
- `yarn format` formats files with Prettier and markdownlint
|
|
586
|
+
|
|
587
|
+
Changes are ready to push when `yarn format && yarn lint && yarn test` passes.
|
|
588
|
+
|
|
589
|
+
### Editor setup for Yarn
|
|
590
|
+
|
|
591
|
+
Yarn installs with Plug'n'Play. An editor that loads TypeScript from a global install will not see this project's version. [Yarn's editor SDK instructions](https://yarnpkg.com/getting-started/editor-sdks) are:
|
|
592
|
+
|
|
593
|
+
```sh
|
|
594
|
+
yarn dlx @yarnpkg/sdks vscode
|
|
595
|
+
```
|
|
596
|
+
|
|
597
|
+
Then select the workspace TypeScript version.
|
|
598
|
+
|
|
599
|
+
`yarn format` and the lint workflow both run `npx prettier@latest`. The editor's Prettier extension can be a different version, so the command above is the one that matches CI.
|
|
588
600
|
|
|
589
601
|
### Testing notes
|
|
590
602
|
|
|
591
603
|
When running `yarn test` to test Nice Checkers itself, you may see two warnings about missing "root" paths. These come from the mock HTTP server (`@jaredwray/mockhttp`) which is only used in our test suite. The warnings are harmless and do not affect test results. We consider this an error in the upstream mock HTTP server package. These warnings do not appear for downstream users who install Nice Checkers to validate their own websites.
|
|
592
604
|
|
|
593
|
-
##
|
|
594
|
-
|
|
595
|
-
1. Add any features that will be in the release.
|
|
596
|
-
2. Bump yarn version if appropriate (`yarn set version latest`).
|
|
597
|
-
3. Bump yarn dependencies if appropriate (`yarn upgrade-interactive`).
|
|
598
|
-
4. Bump package.json `peerDependencies` if new `html-validate` is available.
|
|
599
|
-
5. Bump GitHub Actions `uses:` versions if appropriate.
|
|
600
|
-
6. Ensure `yarn && yarn format && yarn lint && yarn build && yarn test && echo ✅` all pass.
|
|
601
|
-
7. Ensure CI passes.
|
|
602
|
-
8. Bump package.json version. (Use a separate commit by itself for this.)
|
|
603
|
-
9. Use GitHub website to create a tag and a release.
|
|
605
|
+
## Releasing
|
|
604
606
|
|
|
605
|
-
|
|
607
|
+
Package versions use [Semantic Versioning](https://semver.org/).
|
|
606
608
|
|
|
607
|
-
|
|
609
|
+
1. Finish the changes that belong in the release.
|
|
610
|
+
1. Bump `peerDependencies` when a newly supported html-validate version requires it.
|
|
611
|
+
1. Run `yarn && yarn format && yarn lint && yarn build && yarn test`.
|
|
612
|
+
1. Bump `version` in package.json in a commit by itself.
|
|
613
|
+
1. Create a GitHub release for that version. [publish.yml](.github/workflows/publish.yml) publishes the package to npm.
|
|
608
614
|
|
|
609
|
-
|
|
615
|
+
## Maintenance and dependency updates
|
|
610
616
|
|
|
611
|
-
|
|
617
|
+
Do this every month or so and please send a PR here if you see updates available:
|
|
612
618
|
|
|
613
|
-
|
|
619
|
+
1. Identify external Actions in [.github/workflows](./.github/workflows) scripts and look for available new versions. Review and then update to the new version if it is safe. GitHub-supported Actions (i.e. under the actions/ organization) may require only cursory review.
|
|
620
|
+
1. Review the Node.js version in `.node-version`. Update it when a newer version is appropriate. `fnm install` reads that file. Also review the Node.js versions in [test.yml](.github/workflows/test.yml). Those versions are the maintenance, active, and current release lines allowed by `engines`, which is separate from the local pin.
|
|
621
|
+
1. Review the Yarn version in `package.json` (`packageManager`). Update it with `yarn set version stable && yarn` when a newer stable version is appropriate. [Yarn's install instructions](https://yarnpkg.com/getting-started/install) document that command.
|
|
622
|
+
1. Review direct dependencies with `yarn upgrade-interactive`.
|
|
623
|
+
1. Download the Schema.org vocabulary from <https://schema.org/docs/developers.html> and save it as `src/vendor/schemaorg-current-https.json`. Schema.org does not publish that file as an npm package, so the update is manual.
|
|
614
624
|
|
|
615
|
-
##
|
|
625
|
+
## References
|
|
616
626
|
|
|
617
|
-
|
|
627
|
+
1. We use title case for titles and proper nouns; not for headings and things. This includes our README above as well as our workflow rules and other configuration files. If you have a different policy, then please implement it throughout.
|
|
628
|
+
1. This project uses the MIT license, the same license as [node.js-template](https://github.com/fulldecent/node.js-template).
|
|
629
|
+
1. We would prefer if fnm supported build attestations since it is installed as a binary ([issue #1588](https://github.com/Schniz/fnm/issues/1588)).
|
|
630
|
+
1. Node.js ignore rules are inlined from [Node.gitignore](https://github.com/github/gitignore/blob/main/Node.gitignore). This project also ignores `/cache`, the fixture files that tests rewrite, and `package-lock.json`. `package-lock.json` is ignored because dependencies are locked with `yarn.lock`.
|
|
631
|
+
1. `.yarnrc.yml` sets `enableScripts` to true (Yarn 4.14 defaults to false) and `npmMinimalAgeGate` to 0 (Yarn 4.12 defaults to one day). `approvedGitRepositories` is `"**"`, which approves every git dependency. [Yarn: Security](https://yarnpkg.com/features/security)
|
|
632
|
+
1. Prettier options are in [.prettierrc](.prettierrc). [node.js-template](https://github.com/fulldecent/node.js-template) has no application source and therefore no Prettier config. Formatting still uses `npx prettier@latest`, the same command as that template's lint workflow.
|
|
633
|
+
1. `.prettierignore` ignores `*.md`, the same as the template. It also ignores `tests/fixtures` and `src/vendor`. Fixture HTML is the exact input for `required-reports.json`, which records line, column, and byte offset. `src/vendor/schemaorg-current-https.json` is a file downloaded from Schema.org.
|
|
634
|
+
1. markdownlint disables MD013, the same as the template, and sets MD024 `siblings_only`. Each rule section repeats the headings "Configuration" and "Configuration options". `siblings_only` allows that because each heading sits under a different rule.
|
|
635
|
+
1. [test.yml](.github/workflows/test.yml) runs `yarn lint`, `yarn test`, and `yarn build`, then packs the package and imports it from ESM and from CommonJS. The test script in node.js-template is `true`, which is enough for a package with no behavior of its own. This job also runs on Node.js 22, 24, and 26 because `engines` is `>=22` and those are the maintenance, active, and current release lines. `.node-version` stays at 24.
|
|
636
|
+
1. [publish.yml](.github/workflows/publish.yml) publishes to npm when a GitHub release is published. node.js-template sets `"private": true` and is not an npm package.
|
|
637
|
+
1. This project is built based on [best practices documented in node.js-template](https://github.com/fulldecent/node.js-template).
|
|
638
|
+
1. This project is built based on [best practices documented in project-template](https://github.com/fulldecent/project-template), release 1.0.0.
|