From fe01c843ffa9be3735f78c289c5729089a3daaf1 Mon Sep 17 00:00:00 2001 From: Manuel Spigolon Date: Sat, 23 Jan 2021 13:39:03 +0100 Subject: [PATCH 1/6] rename branch master to main --- .github/workflows/test.yml | 4 ++-- README.md | 2 +- doc/command-line-usage.md | 14 +++++++------- schema.json | 2 +- support-element-schema.json | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7d172d9..9b78c99 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,9 +1,9 @@ name: Test on: push: - branches: [ master ] + branches: [ main ] pull_request: - branches: [ master ] + branches: [ main ] jobs: test: diff --git a/README.md b/README.md index b3721fb..dcd941f 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ of support they may intend to provide. The [Node.js Package Maintenance Working 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 some tooling around working with the format proposed. -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). +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/main/Governance.md). ## Command line usage diff --git a/doc/command-line-usage.md b/doc/command-line-usage.md index 9edba4c..7786fc3 100644 --- a/doc/command-line-usage.md +++ b/doc/command-line-usage.md @@ -18,7 +18,7 @@ you can run the support tool using `npx @pkgjs/support`. The support tool helps package consumers review and understand the package support information provided by maintainers. See -[Package-support.md](https://github.com/nodejs/package-maintenance/blob/master/docs/PACKAGE-SUPPORT.md) +[Package-support.md](https://github.com/nodejs/package-maintenance/blob/main/docs/PACKAGE-SUPPORT.md) which documents the suggested best practice and the specific format of the package support information. @@ -97,7 +97,7 @@ npx @pkgjs/support show --canonical ``` -@pkgjs/support(0.0.2) - https://github.com/pkgjs/support/blob/master/package-support.json +@pkgjs/support(0.0.2) - https://github.com/pkgjs/support/blob/main/package-support.json @npmcli/arborist(0.0.0) - unknown @npmcli/installed-package-contents(1.0.5) - unknown npm-bundled(1.1.1) - unknown @@ -116,7 +116,7 @@ npx @pkgjs/support show --canonical ``` where the support info is listed as -`https://github.com/pkgjs/support/blob/master/package-support.json` +`https://github.com/pkgjs/support/blob/main/package-support.json` The --canonical option does not automatically pull the remote information so that the consumer can choose to find the locations without automatically triggering a number of @@ -151,7 +151,7 @@ of the package, the tool will simply print the url from which the support inform can be obtained versus displaying it. For example: ``` -@pkgjs/support-show-local-escape-ok(0.0.1) - https://github.com/pkgjs/support/blob/master/my-support-info.json +@pkgjs/support-show-local-escape-ok(0.0.1) - https://github.com/pkgjs/support/blob/main/my-support-info.json ``` where the `support` entry was: @@ -177,7 +177,7 @@ The `validate` command checks that both the information added to the package.jso and the file containing the support info (package-support.json by default) is valid. -[Integration into package.json](https://github.com/nodejs/package-maintenance/blob/master/docs/PACKAGE-SUPPORT.md#integration-into-packagejson) +[Integration into package.json](https://github.com/nodejs/package-maintenance/blob/main/docs/PACKAGE-SUPPORT.md#integration-into-packagejson) explains the options for providing support info and what goes into the package.json for each case. @@ -185,7 +185,7 @@ each case. Depending the how the `support` section in the package.json is configured validate will: * validate the format of the `support` section in the package.json conforms to the -documentation in [Integration into package.json](https://github.com/nodejs/package-maintenance/blob/master/docs/PACKAGE-SUPPORT.md#integration-into-packagejson) +documentation in [Integration into package.json](https://github.com/nodejs/package-maintenance/blob/main/docs/PACKAGE-SUPPORT.md#integration-into-packagejson) * calculate the file which contains the support info * if the file is available locally, use that data unless the `--canonical` option was specified. @@ -205,7 +205,7 @@ If the support information is not available locally or you have specified `--canonical` without `--fetch` you'll see something like: ```shell -support info not resolved: https://github.com/pkgjs/support/blob/master/package-support.json +support info not resolved: https://github.com/pkgjs/support/blob/main/package-support.json ``` in this case the file is local to the package, but --canonical was specified. The same diff --git a/schema.json b/schema.json index dfc1edc..ecc0ceb 100644 --- a/schema.json +++ b/schema.json @@ -1,5 +1,5 @@ { - "$id": "https://raw.githubusercontent.com/pkgjs/support/master/schema.json", + "$id": "https://raw.githubusercontent.com/pkgjs/support/main/schema.json", "$schema": "http://json-schema.org/draft-07/schema#", "title": "Package Support Information", diff --git a/support-element-schema.json b/support-element-schema.json index 4d7a699..e645705 100644 --- a/support-element-schema.json +++ b/support-element-schema.json @@ -1,5 +1,5 @@ { - "$id": "https://raw.githubusercontent.com/pkgjs/support/master/support-element-schema.json", + "$id": "https://raw.githubusercontent.com/pkgjs/support/main/support-element-schema.json", "$schema": "http://json-schema.org/draft-07/schema#", "title": "Package Support Package.json element", From 80f107f5a263d9d2e278f9ec424ed0d7a80a29ab Mon Sep 17 00:00:00 2001 From: Manuel Spigolon Date: Sun, 24 Jan 2021 11:31:39 +0100 Subject: [PATCH 2/6] Apply suggestions from code review Co-authored-by: Jordan Harband --- README.md | 2 +- doc/command-line-usage.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index dcd941f..d65474a 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ of support they may intend to provide. The [Node.js Package Maintenance Working 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 some tooling around working with the format proposed. -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/main/Governance.md). +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/HEAD/Governance.md). ## Command line usage diff --git a/doc/command-line-usage.md b/doc/command-line-usage.md index 7786fc3..fcf1fb8 100644 --- a/doc/command-line-usage.md +++ b/doc/command-line-usage.md @@ -18,7 +18,7 @@ you can run the support tool using `npx @pkgjs/support`. The support tool helps package consumers review and understand the package support information provided by maintainers. See -[Package-support.md](https://github.com/nodejs/package-maintenance/blob/main/docs/PACKAGE-SUPPORT.md) +[Package-support.md](https://github.com/nodejs/package-maintenance/blob/HEAD/docs/PACKAGE-SUPPORT.md) which documents the suggested best practice and the specific format of the package support information. @@ -97,7 +97,7 @@ npx @pkgjs/support show --canonical ``` -@pkgjs/support(0.0.2) - https://github.com/pkgjs/support/blob/main/package-support.json +@pkgjs/support(0.0.2) - https://github.com/pkgjs/support/blob/HEAD/package-support.json @npmcli/arborist(0.0.0) - unknown @npmcli/installed-package-contents(1.0.5) - unknown npm-bundled(1.1.1) - unknown From bd7a696b24117a2d1c15ec4ef032379daccabe90 Mon Sep 17 00:00:00 2001 From: Manuel Spigolon Date: Sun, 24 Jan 2021 11:33:48 +0100 Subject: [PATCH 3/6] fix master branch to read the HEAD one --- index.js | 2 +- test/cli/show-local-escape/expected | 2 +- test/cli/show-local-path2/expected | 2 +- test/cli/show-separate-repo-directory1/expected | 2 +- test/cli/show-separate-repo-directory2/expected | 2 +- test/cli/show-separate-repo-directory3/expected | 2 +- test/cli/show-separate-repo-fetch-missing/expected-errors | 2 +- test/cli/show-separate-repo-path1/expected | 2 +- test/cli/show-separate-repo-path2/expected | 2 +- test/cli/show-separate-repo/expected | 2 +- test/cli/validate-local-repository1/expected-errors | 2 +- test/cli/validate-non-resolved/expected-errors | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/index.js b/index.js index a7e9236..27b9268 100644 --- a/index.js +++ b/index.js @@ -60,7 +60,7 @@ module.exports.validate = (obj, cli = false) => { // extract the URL for the support info from the pkg info module.exports.getRemoteSupportInfoUrl = (repository, supportPath) => { - const gitHubInitialPath = '/blob/master/'; + const gitHubInitialPath = '/blob/HEAD/'; if (repository && (repository.type === 'git')) { const directory = repository.directory || ''; diff --git a/test/cli/show-local-escape/expected b/test/cli/show-local-escape/expected index 5f210f6..44ba60e 100644 --- a/test/cli/show-local-escape/expected +++ b/test/cli/show-local-escape/expected @@ -1 +1 @@ - @pkgjs/support-show-local-escape(0.0.1) - https://github.com/pkgjs/support/blob/master/my-support-info.json + @pkgjs/support-show-local-escape(0.0.1) - https://github.com/pkgjs/support/blob/HEAD/my-support-info.json diff --git a/test/cli/show-local-path2/expected b/test/cli/show-local-path2/expected index 756b8e1..144bb6b 100644 --- a/test/cli/show-local-path2/expected +++ b/test/cli/show-local-path2/expected @@ -1 +1 @@ - @pkgjs/show-local-path2(0.0.1) - https://github.com/pkgjs/show-local-path2/blob/master/subdir/my-support-info.json + @pkgjs/show-local-path2(0.0.1) - https://github.com/pkgjs/show-local-path2/blob/HEAD/subdir/my-support-info.json diff --git a/test/cli/show-separate-repo-directory1/expected b/test/cli/show-separate-repo-directory1/expected index c4aed5e..b7a3896 100644 --- a/test/cli/show-separate-repo-directory1/expected +++ b/test/cli/show-separate-repo-directory1/expected @@ -1 +1 @@ - @pkgjs/support-separate-repo-directory1(0.0.1) - https://github.com/pkgjs/support-separate-repo-other/blob/master/subdir2/my-support-package.json + @pkgjs/support-separate-repo-directory1(0.0.1) - https://github.com/pkgjs/support-separate-repo-other/blob/HEAD/subdir2/my-support-package.json diff --git a/test/cli/show-separate-repo-directory2/expected b/test/cli/show-separate-repo-directory2/expected index ff9d5ec..5655db0 100644 --- a/test/cli/show-separate-repo-directory2/expected +++ b/test/cli/show-separate-repo-directory2/expected @@ -1 +1 @@ - @pkgjs/support-separate-repo-directory2(0.0.1) - https://github.com/pkgjs/support-separate-repo-other/blob/master/subdir2/package-support.json + @pkgjs/support-separate-repo-directory2(0.0.1) - https://github.com/pkgjs/support-separate-repo-other/blob/HEAD/subdir2/package-support.json diff --git a/test/cli/show-separate-repo-directory3/expected b/test/cli/show-separate-repo-directory3/expected index f86d487..175e17e 100644 --- a/test/cli/show-separate-repo-directory3/expected +++ b/test/cli/show-separate-repo-directory3/expected @@ -1 +1 @@ - @pkgjs/support-separate-repo-directory3(0.0.1) - https://github.com/pkgjs/support-separate-repo-other/blob/master/subdir2/subdir1/my-support-package.json + @pkgjs/support-separate-repo-directory3(0.0.1) - https://github.com/pkgjs/support-separate-repo-other/blob/HEAD/subdir2/subdir1/my-support-package.json diff --git a/test/cli/show-separate-repo-fetch-missing/expected-errors b/test/cli/show-separate-repo-fetch-missing/expected-errors index 99b1d42..c77052e 100644 --- a/test/cli/show-separate-repo-fetch-missing/expected-errors +++ b/test/cli/show-separate-repo-fetch-missing/expected-errors @@ -1 +1 @@ - @pkgjs/support-separate-repo(0.0.1) - failed to fetch - https://github.com/pkgjs/support/blob/master/examples/does-not-exist.json + @pkgjs/support-separate-repo(0.0.1) - failed to fetch - https://github.com/pkgjs/support/blob/HEAD/examples/does-not-exist.json diff --git a/test/cli/show-separate-repo-path1/expected b/test/cli/show-separate-repo-path1/expected index 217a08a..c048f6a 100644 --- a/test/cli/show-separate-repo-path1/expected +++ b/test/cli/show-separate-repo-path1/expected @@ -1 +1 @@ - @pkgjs/support-separate-repo-path1(0.0.1) - https://github.com/pkgjs/support-separate-repo-other/blob/master/my-support-package.json + @pkgjs/support-separate-repo-path1(0.0.1) - https://github.com/pkgjs/support-separate-repo-other/blob/HEAD/my-support-package.json diff --git a/test/cli/show-separate-repo-path2/expected b/test/cli/show-separate-repo-path2/expected index 3ed280b..9cbceaa 100644 --- a/test/cli/show-separate-repo-path2/expected +++ b/test/cli/show-separate-repo-path2/expected @@ -1 +1 @@ - @pkgjs/support-separate-repo-path2(0.0.1) - https://github.com/pkgjs/support-separate-repo-other/blob/master/subdir1/my-support-package.json + @pkgjs/support-separate-repo-path2(0.0.1) - https://github.com/pkgjs/support-separate-repo-other/blob/HEAD/subdir1/my-support-package.json diff --git a/test/cli/show-separate-repo/expected b/test/cli/show-separate-repo/expected index e0d5384..340094e 100644 --- a/test/cli/show-separate-repo/expected +++ b/test/cli/show-separate-repo/expected @@ -1 +1 @@ - @pkgjs/support-separate-repo(0.0.1) - https://github.com/pkgjs/support-separate-repo-other/blob/master/package-support.json + @pkgjs/support-separate-repo(0.0.1) - https://github.com/pkgjs/support-separate-repo-other/blob/HEAD/package-support.json diff --git a/test/cli/validate-local-repository1/expected-errors b/test/cli/validate-local-repository1/expected-errors index 5ff6463..9363bd6 100644 --- a/test/cli/validate-local-repository1/expected-errors +++ b/test/cli/validate-local-repository1/expected-errors @@ -1 +1 @@ -support info not resolved: https://github.com/pkgjs/support-separate-repo-other/blob/master/subdir2/my-support-package.json +support info not resolved: https://github.com/pkgjs/support-separate-repo-other/blob/HEAD/subdir2/my-support-package.json diff --git a/test/cli/validate-non-resolved/expected-errors b/test/cli/validate-non-resolved/expected-errors index 43daa7d..f3ecf73 100644 --- a/test/cli/validate-non-resolved/expected-errors +++ b/test/cli/validate-non-resolved/expected-errors @@ -1 +1 @@ -support info not resolved: https://github.com/pkgjs/support/blob/master/package-support.json +support info not resolved: https://github.com/pkgjs/support/blob/HEAD/package-support.json From cad7252319ab1d12842e46215bcbaa0ab8c9fcda Mon Sep 17 00:00:00 2001 From: Manuel Spigolon Date: Mon, 8 Feb 2021 23:46:48 +0100 Subject: [PATCH 4/6] fix after review --- doc/command-line-usage.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/command-line-usage.md b/doc/command-line-usage.md index fcf1fb8..b1cca3e 100644 --- a/doc/command-line-usage.md +++ b/doc/command-line-usage.md @@ -116,7 +116,7 @@ npx @pkgjs/support show --canonical ``` where the support info is listed as -`https://github.com/pkgjs/support/blob/main/package-support.json` +`https://github.com/pkgjs/support/blob/HEAD/package-support.json` The --canonical option does not automatically pull the remote information so that the consumer can choose to find the locations without automatically triggering a number of @@ -151,7 +151,7 @@ of the package, the tool will simply print the url from which the support inform can be obtained versus displaying it. For example: ``` -@pkgjs/support-show-local-escape-ok(0.0.1) - https://github.com/pkgjs/support/blob/main/my-support-info.json +@pkgjs/support-show-local-escape-ok(0.0.1) - https://github.com/pkgjs/support/blob/HEAD/my-support-info.json ``` where the `support` entry was: @@ -205,7 +205,7 @@ If the support information is not available locally or you have specified `--canonical` without `--fetch` you'll see something like: ```shell -support info not resolved: https://github.com/pkgjs/support/blob/main/package-support.json +support info not resolved: https://github.com/pkgjs/support/blob/HEAD/package-support.json ``` in this case the file is local to the package, but --canonical was specified. The same From a438332a3c64af716b4bf75878cea214285d55c5 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Wed, 10 Feb 2021 13:57:31 -0500 Subject: [PATCH 5/6] Update doc/command-line-usage.md Co-authored-by: Jordan Harband --- doc/command-line-usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/command-line-usage.md b/doc/command-line-usage.md index b1cca3e..0d15f58 100644 --- a/doc/command-line-usage.md +++ b/doc/command-line-usage.md @@ -177,7 +177,7 @@ The `validate` command checks that both the information added to the package.jso and the file containing the support info (package-support.json by default) is valid. -[Integration into package.json](https://github.com/nodejs/package-maintenance/blob/main/docs/PACKAGE-SUPPORT.md#integration-into-packagejson) +[Integration into package.json](https://github.com/nodejs/package-maintenance/blob/HEAD/docs/PACKAGE-SUPPORT.md#integration-into-packagejson) explains the options for providing support info and what goes into the package.json for each case. From 916374a67d9d13c16e3b269e96c3a604f05cbe40 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Wed, 10 Feb 2021 13:57:36 -0500 Subject: [PATCH 6/6] Update doc/command-line-usage.md Co-authored-by: Jordan Harband --- doc/command-line-usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/command-line-usage.md b/doc/command-line-usage.md index 0d15f58..ace81e5 100644 --- a/doc/command-line-usage.md +++ b/doc/command-line-usage.md @@ -185,7 +185,7 @@ each case. Depending the how the `support` section in the package.json is configured validate will: * validate the format of the `support` section in the package.json conforms to the -documentation in [Integration into package.json](https://github.com/nodejs/package-maintenance/blob/main/docs/PACKAGE-SUPPORT.md#integration-into-packagejson) +documentation in [Integration into package.json](https://github.com/nodejs/package-maintenance/blob/HEAD/docs/PACKAGE-SUPPORT.md#integration-into-packagejson) * calculate the file which contains the support info * if the file is available locally, use that data unless the `--canonical` option was specified.