Skip to content

Commit 5dbfebd

Browse files
Eommljharb
andauthored
add: schema improvements (#18)
* fix docs * add format in schema validation * fix loggerr instance * Apply suggestions from code review Co-authored-by: Jordan Harband <[email protected]> Co-authored-by: Jordan Harband <[email protected]>
1 parent 47eb5da commit 5dbfebd

File tree

8 files changed

+21
-19
lines changed

8 files changed

+21
-19
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ jobs:
1111
strategy:
1212
matrix:
1313
node-version: [10.x, 12.x, 14.x]
14+
os: [ubuntu-latest, windows-latest]
15+
1416
steps:
15-
- uses: actions/checkout@v1
17+
- uses: actions/checkout@v2
1618
- name: Use Node.js ${{ matrix.node-version }}
1719
uses: actions/setup-node@v1
1820
with:

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
When an author releases an Open Source package there are many different levels
1313
of support they may intend to provide. The [Node.js Package Maintenence Working Group](https://github.com/nodejs/package-maintenance)
14-
is working to propose [a spec](https://github.com/nodejs/package-maintenance/issues/220) to help package authors declare their intended support goals. This package provides
14+
is working to propose [a spec](https://github.com/nodejs/package-maintenance/blob/HEAD/docs/PACKAGE-SUPPORT.md) to help package authors declare their intended support goals. This package provides
1515
some tooling around working with the format proposed.
1616

1717
This repository is managed by the [Package Maintenance Working Group](https://github.com/nodejs/package-maintenance), see [Governance](https://github.com/nodejs/package-maintenance/blob/master/Governance.md).
@@ -48,9 +48,9 @@ commands is provided in [command line usage](./doc/command-line-usage.md).
4848
The simplest way to run the tool is to simply run:
4949

5050
```
51-
npx support show
51+
npx @pkgjs/support show
5252
```
5353

5454
```
55-
npx support validate
55+
npx @pkgjs/support validate
5656
```

bin/support

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#! /usr/bin/env node
2-
require('../lib/cli')()(process.argv.slice(2))
2+
require('../lib/cli')()(process.argv.slice(2));

doc/command-line-usage.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ For example once node.js and the package support tool are installed to show
4141
the package support for a module (the support module itself in this example):
4242

4343
```shell
44-
npm install support
45-
cd node_modules/support
46-
npx support show
44+
npm install @pkgjs/support
45+
cd node_modules/@pkgjs/support
46+
npx @pkgjs/support show
4747
```
4848

4949
with a stripped down version of the the output to make it more easily readable being:
@@ -92,7 +92,7 @@ as when the package.json specifies that there is support info but it is not avai
9292
For example:
9393
9494
```
95-
npx show --canonical
95+
npx @pkgjs/support show --canonical
9696
```
9797
9898
@@ -129,7 +129,7 @@ add the `--fetch` option which will pull the remote support information when nec
129129
The following command/options will always show the most up to date package support information
130130
at the cost of fetching from remote sites.
131131
```
132-
npx show --canonical --fetch
132+
npx @pkgjs/support show --canonical --fetch
133133
```
134134
135135
`--fetch` can also be used without `--canonical` in which case the remote support
@@ -143,7 +143,7 @@ support info in these cases you can use the `--base-path` option to specify the
143143
most root from which packge support files can be read:
144144
145145
```shell
146-
npx support --base-path=${cwd}/../.. show
146+
npx @pkgjs/support --base-path=${cwd}/../.. show
147147
```
148148
149149
In the case where the required base path is not specified, and the file is outside
@@ -226,5 +226,5 @@ support info in these cases you can use the `--base-path` option to specify the
226226
most root from which packge support files can be read:
227227
228228
```shell
229-
npx support --base-path=${cwd}/../.. validate
229+
npx @pkgjs/support --base-path=${cwd}/../.. validate
230230
```

lib/cli/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
const yargs = require('yargs/yargs');
33
const path = require('path');
4-
const Loggerr = require('loggerr');
4+
const { Loggerr } = require('loggerr');
55

66
module.exports = (options = {}) => {
77
// Defaults cli configuration

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
"@npmcli/arborist": "^0.0.0",
2929
"ajv": "^6.11.0",
3030
"better-ajv-errors": "^0.6.7",
31+
"fs-extra": "^8.1.0",
3132
"got": "^11.1.3",
32-
"loggerr": "^3.0.0-0",
33+
"loggerr": "^3.0.0-2",
3334
"normalize-url": "^5.0.0",
34-
"fs-extra": "^8.1.0",
3535
"yargs": "^15.0.2"
3636
},
3737
"devDependencies": {

schema.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"required": ["version"],
2323
"properties": {
2424
"version": { "$ref": "#SemVerRange" },
25-
"expires": { "type": "string" },
25+
"expires": { "type": "string", "format": "date-time" },
2626
"target": { "$ref": "#SupportTarget" },
2727
"response": {
2828
"oneOf": [{
@@ -125,8 +125,8 @@
125125
"required": ["name"],
126126
"properties": {
127127
"name": { "type": "string" },
128-
"email": { "type": "string" },
129-
"url": { "type": "string" }
128+
"email": { "type": "string", "format": "email" },
129+
"url": { "type": "string", "format": "uri" }
130130
}
131131
},
132132

support-element-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"required": ["type", "url"],
3030
"properties": {
3131
"type": { "enum": [ "git" ] },
32-
"url": { "type": "string" },
32+
"url": { "type": "string", "format": "uri" },
3333
"directory": { "type": "string" }
3434
},
3535
"additionalProperties": false

0 commit comments

Comments
 (0)