From 3d89a754521945715670330b632fc1a20bfabee0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 11:25:28 +0400 Subject: [PATCH] chore(deps-dev): bump prettier from 3.3.0 to 3.4.1 (#1895) * chore(deps-dev): bump prettier from 3.3.0 to 3.4.1 Bumps [prettier](https://github.com/prettier/prettier) from 3.3.0 to 3.4.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.3.0...3.4.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * remove prettier warnings --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Denis Ah-Kang --- README.md | 184 ++++++++++++++++++++++---------------------- doc/Presentation.md | 74 +++++++++--------- package-lock.json | 8 +- package.json | 2 +- 4 files changed, 134 insertions(+), 134 deletions(-) diff --git a/README.md b/README.md index 57dd410a5..1e6d884e0 100644 --- a/README.md +++ b/README.md @@ -135,10 +135,10 @@ The following example run tests to all the documents, but limit to `copyright` r $ RULE=copyright TYPE=noCopyright npm run test ``` -- http://localhost:8001/doc-views/TR/Recommendation/WD?rule=copyright&type=noCopyright -- http://localhost:8001/doc-views/TR/Registry/CRYD/?rule=copyright&type=noCopyright -- http://localhost:8001/doc-views/TR/Note/DNOTE-Echidna?rule=copyright&type=noCopyright -- ... and all profiles +- http://localhost:8001/doc-views/TR/Recommendation/WD?rule=copyright&type=noCopyright +- http://localhost:8001/doc-views/TR/Registry/CRYD/?rule=copyright&type=noCopyright +- http://localhost:8001/doc-views/TR/Note/DNOTE-Echidna?rule=copyright&type=noCopyright +- ... and all profiles ## 4. JS API @@ -161,14 +161,14 @@ const specberus = new Specberus(apiKey); This method takes an object with the following fields: -- `url`: URL of the content to check. One of `url`, `source`, `file`, or `document` must be - specified and if several are they will be used in this order. -- `source`: A `String` with the content to check. -- `file`: A file system path to the content to check. -- `document`: A DOM `Document` object to be checked. -- `profile`: A profile object which defines the validation. Required. See below. -- `events`: An event sink which supports the same interface as the Node.js `EventEmitter`. Required. See - below for the events that get generated. +- `url`: URL of the content to check. One of `url`, `source`, `file`, or `document` must be + specified and if several are they will be used in this order. +- `source`: A `String` with the content to check. +- `file`: A file system path to the content to check. +- `document`: A DOM `Document` object to be checked. +- `profile`: A profile object which defines the validation. Required. See below. +- `events`: An event sink which supports the same interface as the Node.js `EventEmitter`. Required. See + below for the events that get generated. ### `extractMetadata(options)` @@ -180,24 +180,24 @@ goals of this method). `this.meta` will be an `Object` and may include up to 16 properties described below: -- `profile` -- `title`: The (possible) title of the document. -- `docDate`: The date associated to the document. -- `thisVersion`: URL of this version of the document. -- `latestVersion`: URL of the latest version of the document. -- `previousVersion`: URL of the previous version of the document (the last one, if multiple are shown). -- `editorsDraft`: URL of the latest editor's draft. -- `delivererIDs`: ID(s) of the deliverer(s); an `Array` of `Number`s. -- `editorIDs`: ID(s) of the editor(s) responsible for the document; an `Array` of `Number`s. -- `informative`: Whether the document in informative or not. -- `process`: The process rules link. -- `sameWorkAs`: The previous shortlink if any. -- `implementationFeedbackDue`: The implementation review date for CRs. -- `prReviewsDue`: The review date for PRs. -- `implementationReport`: Implementation report link for CRs, PRs and RECs. -- `errata`: The errata link of the document. -- `substantiveChanges`: Whether the document is a REC and has proposed amendments -- `newFeatures`: Whether the document is a REC and has proposed additions +- `profile` +- `title`: The (possible) title of the document. +- `docDate`: The date associated to the document. +- `thisVersion`: URL of this version of the document. +- `latestVersion`: URL of the latest version of the document. +- `previousVersion`: URL of the previous version of the document (the last one, if multiple are shown). +- `editorsDraft`: URL of the latest editor's draft. +- `delivererIDs`: ID(s) of the deliverer(s); an `Array` of `Number`s. +- `editorIDs`: ID(s) of the editor(s) responsible for the document; an `Array` of `Number`s. +- `informative`: Whether the document in informative or not. +- `process`: The process rules link. +- `sameWorkAs`: The previous shortlink if any. +- `implementationFeedbackDue`: The implementation review date for CRs. +- `prReviewsDue`: The review date for PRs. +- `implementationReport`: Implementation report link for CRs, PRs and RECs. +- `errata`: The errata link of the document. +- `substantiveChanges`: Whether the document is a REC and has proposed amendments +- `newFeatures`: Whether the document is a REC and has proposed additions If some of these pieces of metadata cannot be deduced, that key will not exist, or its value will not be defined. @@ -302,11 +302,11 @@ e.g. https://www.w3.org/pubrules/api/validate?url=https://www.w3.org/TR/2021/WD- Methods `metadata` and `validate` return a JSON object with these properties: -- `success` (`boolean`): whether the operation succeeded, or not. -- `errors` (`array`): all errors found. -- `warnings` (`array`): all warnings. -- `info` (`array`): additional, informative messages. -- `metadata` (`object`): extracted metadata; [see structure here](#extractmetadataoptions). +- `success` (`boolean`): whether the operation succeeded, or not. +- `errors` (`array`): all errors found. +- `warnings` (`array`): all warnings. +- `info` (`array`): additional, informative messages. +- `metadata` (`object`): extracted metadata; [see structure here](#extractmetadataoptions). If there is an internal error, the document cannot be retrieved or is not recognised, or validation fails, both methods would return HTTP status code `400`. Also, in the case of `validate`, `success` would be `false` and `errors.length > 0`. @@ -354,8 +354,8 @@ When the profile is given by the user (instead of being set to `auto`), fewer it Profiles are simple objects that support the following API: -- name: A `String` being the name of this profile. -- rules: An `Array` of rule objects which are checked in this profile. +- name: A `String` being the name of this profile. +- rules: An `Array` of rule objects which are checked in this profile. A profile is basically a configuration of what to check. You can load a specific profile from under `lib/profiles` or create your own. @@ -363,56 +363,56 @@ A profile is basically a configuration of what to check. You can load a specific Here follows the current hierarchy of profiles. Each profile inherits all rules from its parent profile. Profiles that are identical to its parent profile, ie that do not add any new rules, are marked too. -- `base` - - `TR` - - `WD` - - `WD-Echidna` - - `FPWD` (identical) - - `PR` - - `CR` - - `CR-Echidna` - - `CRD` - - `CRD-Echidna` - - `REC` - - `REC-OBSOLETE` - - `REC-RSCND` - - `REC-SUPERSEDED` - - `DNOTE` - - `DNOTE-Echidna` - - `NOTE` - - `NOTE-Echidna` - - `STMT` - - `DRY` - - `CRY` - - `CRYD` - - `RY` - - `Submission` - - `SUBM` - - `MEM-SUBM` +- `base` + - `TR` + - `WD` + - `WD-Echidna` + - `FPWD` (identical) + - `PR` + - `CR` + - `CR-Echidna` + - `CRD` + - `CRD-Echidna` + - `REC` + - `REC-OBSOLETE` + - `REC-RSCND` + - `REC-SUPERSEDED` + - `DNOTE` + - `DNOTE-Echidna` + - `NOTE` + - `NOTE-Echidna` + - `STMT` + - `DRY` + - `CRY` + - `CRYD` + - `RY` + - `Submission` + - `SUBM` + - `MEM-SUBM` ## 7. Validation events For a given checking run, the event sink you specify will be receiving a bunch of events as indicated below. Events are shown as having parameters since those are passed to the event handler. -- `start-all(profile-name)`: Fired first to indicate that the profile's checking has started. -- `end-all(profile-name)`: Fired last to indicate that the profile's checking has completed. When - you receive this you are promised that all testing operations, including asynchronous ones, have - terminated. -- `done(rule-name)`: Fired when a specific rule has finished processing, including its asynchronous - tasks. -- `ok(rule-name)`: Fired to indicate that a rule has succeeded. There is only one `ok` per rule. - There cannot also be `err` events but there can be `warning` events. -- `err(error-name, data)`: Fired when an error is detected. The `data` contains further details, - that depend on the error but _should_ feature a `message` field. There can be multiple errors for - a given rule. There cannot also be `ok` events but there can be `warning`s. -- `warning(warnings-name, data)`: Fired for non-fatal problems with the document that may - nevertheless require investigation. There may be several for a rule. -- `info(info-name, data)`: Fired for additional information items detected by the validator. -- `metadata(key, value)`: Fired for every piece of document metadata found by the validator. -- `exception(message)`: Fired when there is a system error, such as a _File not found_ error. `message` - contains details about this error. All exceptions are displayed on the error console in addition to - this event being fired. +- `start-all(profile-name)`: Fired first to indicate that the profile's checking has started. +- `end-all(profile-name)`: Fired last to indicate that the profile's checking has completed. When + you receive this you are promised that all testing operations, including asynchronous ones, have + terminated. +- `done(rule-name)`: Fired when a specific rule has finished processing, including its asynchronous + tasks. +- `ok(rule-name)`: Fired to indicate that a rule has succeeded. There is only one `ok` per rule. + There cannot also be `err` events but there can be `warning` events. +- `err(error-name, data)`: Fired when an error is detected. The `data` contains further details, + that depend on the error but _should_ feature a `message` field. There can be multiple errors for + a given rule. There cannot also be `ok` events but there can be `warning`s. +- `warning(warnings-name, data)`: Fired for non-fatal problems with the document that may + nevertheless require investigation. There may be several for a rule. +- `info(info-name, data)`: Fired for additional information items detected by the validator. +- `metadata(key, value)`: Fired for every piece of document metadata found by the validator. +- `exception(message)`: Fired when there is a system error, such as a _File not found_ error. `message` + contains details about this error. All exceptions are displayed on the error console in addition to + this event being fired. ## 8. Writing rules @@ -422,14 +422,14 @@ they're done. The Specberus object exposes the following API that's useful for validation: -- `loader`. The loader object that loaded the content, which exposes the content's `url` and - `source` if they are known. -- `sink`. The event target on which to fire validation events. -- `version`. The Specberus version. -- `checkSelector(selector, rule-name, cb)`. Some rules need to do nothing other than to check that a - selector returns some content. For this case, the rule can just call this method with the selector - and its callback, and Specberus will conveniently take care of all the rest. -- `norm(text)`. Returns a whitespace-normalised version of the text. -- `getDocumentDate()`. Returns a Date object that matches the document's date as specified in the - headers' `stateElement` (id="w3c-state"). -- `getDocumentStateElement()`. Returns the element that contains the document's date. +- `loader`. The loader object that loaded the content, which exposes the content's `url` and + `source` if they are known. +- `sink`. The event target on which to fire validation events. +- `version`. The Specberus version. +- `checkSelector(selector, rule-name, cb)`. Some rules need to do nothing other than to check that a + selector returns some content. For this case, the rule can just call this method with the selector + and its callback, and Specberus will conveniently take care of all the rest. +- `norm(text)`. Returns a whitespace-normalised version of the text. +- `getDocumentDate()`. Returns a Date object that matches the document's date as specified in the + headers' `stateElement` (id="w3c-state"). +- `getDocumentStateElement()`. Returns the element that contains the document's date. diff --git a/doc/Presentation.md b/doc/Presentation.md index f3212005d..e237dba5c 100644 --- a/doc/Presentation.md +++ b/doc/Presentation.md @@ -20,10 +20,10 @@ _Specberus_ is expected to replace the [current pubrules tool](https://www.w3.or -- -- Complex maintenance. -- XSLT is not flexible enough. -- There is no clear separation between the documentation (_human-readable publication rules_) and the automatic checker (_the software_). -- Difficult to integrate within the broader publication workflow. +- Complex maintenance. +- XSLT is not flexible enough. +- There is no clear separation between the documentation (_human-readable publication rules_) and the automatic checker (_the software_). +- Difficult to integrate within the broader publication workflow. --- @@ -140,20 +140,20 @@ Using [Jenkins](https://jenkins-ci.org/). `# apt-get install`: -- [`nodejs`](https://nodejs.org/) -- [`npm`](https://github.com/isaacs/npm) +- [`nodejs`](https://nodejs.org/) +- [`npm`](https://github.com/isaacs/npm) -- `$ npm install` (but you can do `npm install -d` instead to install all at once): -- [`express`](https://www.npmjs.org/package/express) (web framework) -- [`express-rest`](https://www.npmjs.org/package/express-rest) (REST server framework) -- [`socket.io`](https://www.npmjs.org/package/socket.io) (realtime application server and client) -- [`safe-url-input-checker`](https://www.npmjs.org/package/safe-url-input-checker) (URL checker) -- [`superagent`](https://www.npmjs.org/package/superagent) (HTTP request library) -- [`whacko`](https://www.npmjs.org/package/whacko) (HTML parser) +- [`express`](https://www.npmjs.org/package/express) (web framework) +- [`express-rest`](https://www.npmjs.org/package/express-rest) (REST server framework) +- [`socket.io`](https://www.npmjs.org/package/socket.io) (realtime application server and client) +- [`safe-url-input-checker`](https://www.npmjs.org/package/safe-url-input-checker) (URL checker) +- [`superagent`](https://www.npmjs.org/package/superagent) (HTTP request library) +- [`whacko`](https://www.npmjs.org/package/whacko) (HTML parser) --- @@ -161,14 +161,14 @@ Using [Jenkins](https://jenkins-ci.org/). Necessary for development, testing and debugging: -- [`mocha`](https://www.npmjs.org/package/mocha) (JavaScript test framework) -- [`expect.js`](https://www.npmjs.org/package/expect.js) (assertion library) +- [`mocha`](https://www.npmjs.org/package/mocha) (JavaScript test framework) +- [`expect.js`](https://www.npmjs.org/package/expect.js) (assertion library) -- Nice to have for debugging: -- [`node-debug`](https://www.npmjs.org/package/debug) +- [`node-debug`](https://www.npmjs.org/package/debug) --- @@ -176,19 +176,19 @@ Nice to have for debugging: `0.3.3` → `0.4.0` -- Recursive validation of compound documents. -- Better heuristics to detect and check dates, WG's, etc. -- Better output, more detailed feedback to the user: - - Colour-coding error/warning messages. - - Informative messages can be displayed, too. - - Ability to include markup in the output, eg hyperlinks. -- Added a _summary of results_, with internal links. -- Implemented a few new rules. -- Some enhancements related to usability and design. -- Extended the suite of tests (there are 63 individual tests now). -- Bug-fixing. -- Deployed on a dedicated _Node.js_ server. -- Exposing a REST API to enable integration within the broader publication workflow [WIP]. +- Recursive validation of compound documents. +- Better heuristics to detect and check dates, WG's, etc. +- Better output, more detailed feedback to the user: + - Colour-coding error/warning messages. + - Informative messages can be displayed, too. + - Ability to include markup in the output, eg hyperlinks. +- Added a _summary of results_, with internal links. +- Implemented a few new rules. +- Some enhancements related to usability and design. +- Extended the suite of tests (there are 63 individual tests now). +- Bug-fixing. +- Deployed on a dedicated _Node.js_ server. +- Exposing a REST API to enable integration within the broader publication workflow [WIP]. --- @@ -212,8 +212,8 @@ Nice to have for debugging: You are encouraged to try this new checker, and especially to submit bug reports and suggestions. -- General feedback about the publication workflow: [`public-pubrules-comments@w3.org`](public-pubrules-comments@w3.org) -- Specific bugs or ideas about the pubrules checker: [`https://github.com/w3c/specberus/issues`](https://github.com/w3c/specberus/issues) +- General feedback about the publication workflow: [`public-pubrules-comments@w3.org`](public-pubrules-comments@w3.org) +- Specific bugs or ideas about the pubrules checker: [`https://github.com/w3c/specberus/issues`](https://github.com/w3c/specberus/issues) --- @@ -231,15 +231,15 @@ The `#pubrules` channel on [irc.w3.org](https://irc.w3.org/) is a good place if ## Deployments for testing -- Up to `v0.3.3-1`: [`https://pubrules.jit.su/`](https://pubrules.jit.su/). -- From: `V0.4.0` onwards: [`https://www.w3.org/2014/10/pubrules/`](https://www.w3.org/2014/10/pubrules). +- Up to `v0.3.3-1`: [`https://pubrules.jit.su/`](https://pubrules.jit.su/). +- From: `V0.4.0` onwards: [`https://www.w3.org/2014/10/pubrules/`](https://www.w3.org/2014/10/pubrules). --- # Who -- [Robin](https://github.com/darobin). -- [Denis](https://github.com/deniak). -- [Guillaume](https://github.com/guibbs). -- [Antonio](https://github.com/tripu). -- You!? +- [Robin](https://github.com/darobin). +- [Denis](https://github.com/deniak). +- [Guillaume](https://github.com/guibbs). +- [Antonio](https://github.com/tripu). +- You!? diff --git a/package-lock.json b/package-lock.json index 79ae43754..e11edccbc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,7 @@ "nock": "13.5.0", "nodemon": "3.0.1", "nyc": "17.1.0", - "prettier": "3.3.0" + "prettier": "3.4.1" }, "engines": { "node": "18 || 20 || 22", @@ -7237,9 +7237,9 @@ } }, "node_modules/prettier": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.0.tgz", - "integrity": "sha512-J9odKxERhCQ10OC2yb93583f6UnYutOeiV5i0zEDS7UGTdUt0u+y8erxl3lBKvwo/JHyyoEdXjwp4dke9oyZ/g==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.1.tgz", + "integrity": "sha512-G+YdqtITVZmOJje6QkXQWzl3fSfMxFwm1tjTyo9exhkmWSqC4Yhd1+lug++IlR2mvRVAxEDDWYkQdeSztajqgg==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" diff --git a/package.json b/package.json index ba2448df4..9cae8792a 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "nock": "13.5.0", "nodemon": "3.0.1", "nyc": "17.1.0", - "prettier": "3.3.0" + "prettier": "3.4.1" }, "scripts": { "build": "npm run lint && npm run test",