Skip to content

Commit

Permalink
docs(readme): replace David DM badges with Libraries.io badges
Browse files Browse the repository at this point in the history
david-dm.org is no longer available.
This site has been down for a long time.
see alanshaw/david#182

For this reason we are replaced the badges showing dependencies status with Libraries.io.
  • Loading branch information
sounisi5011 committed Jan 7, 2023
1 parent 6fb0689 commit c977071
Show file tree
Hide file tree
Showing 12 changed files with 102 additions and 41 deletions.
13 changes: 12 additions & 1 deletion .package-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,48 @@
* This file is used by `./scripts/update-package-list`
*/

/** @type {import("./scripts/update-package-list/index.mjs").HeaderData['getVersionLink']} */
/** @type {import("./scripts/update-package-list/index.mjs").GetVersionLinkFn} */
function createNpmBadge(data) {
const npmBadge = `![npm](https://img.shields.io/npm/v/${data.name}.svg)`;
return `[${npmBadge}](https://www.npmjs.com/package/${data.name})`;
}

/** @type {import("./scripts/update-package-list/index.mjs").GetDependenciesLinkFn} */
function createLibrariesioBadge(data) {
return `![Dependencies Status](https://img.shields.io/librariesio/release/npm/${data.name})`;
}

/** @type {import("./scripts/update-package-list/index.mjs").HeaderTable} */
const list = {
'packages': {
header: 'Packages',
getVersionLink: createNpmBadge,
getDependenciesLink: createLibrariesioBadge,
},
'packages/cli': {
header: 'CLI',
getVersionLink: createNpmBadge,
getDependenciesLink: createLibrariesioBadge,
},
'packages/cli-utils': {
header: 'CLI Utilities',
getVersionLink: createNpmBadge,
getDependenciesLink: createLibrariesioBadge,
},
'packages/ts-utils': {
header: 'TypeScript Utilities',
getVersionLink: createNpmBadge,
getDependenciesLink: createLibrariesioBadge,
},
'packages/ts-type-utils': {
header: 'TypeScript Type Utilities',
getVersionLink: createNpmBadge,
getDependenciesLink: createLibrariesioBadge,
},
'packages/jest-matchers': {
header: 'Jest Matchers',
getVersionLink: createNpmBadge,
getDependenciesLink: createLibrariesioBadge,
},
'actions': 'GitHub Actions',
};
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,43 @@

| Package | Version | Dependencies |
|-|-|-|
| [`@sounisi5011/check-pid-file`](./packages/check-pid-file) | [![npm](https://img.shields.io/npm/v/@sounisi5011/check-pid-file.svg)](https://www.npmjs.com/package/@sounisi5011/check-pid-file) | [![Dependency Status](https://status.david-dm.org/gh/sounisi5011/npm-packages.svg?path=packages%2Fcheck-pid-file)](https://david-dm.org/sounisi5011/npm-packages?path=packages%2Fcheck-pid-file) |
| [`@sounisi5011/encrypted-archive`](./packages/encrypted-archive) | [![npm](https://img.shields.io/npm/v/@sounisi5011/encrypted-archive.svg)](https://www.npmjs.com/package/@sounisi5011/encrypted-archive) | [![Dependency Status](https://status.david-dm.org/gh/sounisi5011/npm-packages.svg?path=packages%2Fencrypted-archive)](https://david-dm.org/sounisi5011/npm-packages?path=packages%2Fencrypted-archive) |
| [`@sounisi5011/stream-transform-from`](./packages/stream-transform-from) | [![npm](https://img.shields.io/npm/v/@sounisi5011/stream-transform-from.svg)](https://www.npmjs.com/package/@sounisi5011/stream-transform-from) | [![Dependency Status](https://status.david-dm.org/gh/sounisi5011/npm-packages.svg?path=packages%2Fstream-transform-from)](https://david-dm.org/sounisi5011/npm-packages?path=packages%2Fstream-transform-from) |
| [`@sounisi5011/check-pid-file`](./packages/check-pid-file) | [![npm](https://img.shields.io/npm/v/@sounisi5011/check-pid-file.svg)](https://www.npmjs.com/package/@sounisi5011/check-pid-file) | ![Dependencies Status](https://img.shields.io/librariesio/release/npm/@sounisi5011/check-pid-file) |
| [`@sounisi5011/encrypted-archive`](./packages/encrypted-archive) | [![npm](https://img.shields.io/npm/v/@sounisi5011/encrypted-archive.svg)](https://www.npmjs.com/package/@sounisi5011/encrypted-archive) | ![Dependencies Status](https://img.shields.io/librariesio/release/npm/@sounisi5011/encrypted-archive) |
| [`@sounisi5011/stream-transform-from`](./packages/stream-transform-from) | [![npm](https://img.shields.io/npm/v/@sounisi5011/stream-transform-from.svg)](https://www.npmjs.com/package/@sounisi5011/stream-transform-from) | ![Dependencies Status](https://img.shields.io/librariesio/release/npm/@sounisi5011/stream-transform-from) |

### CLI

| Package | Version | Dependencies |
|-|-|-|
| [`@sounisi5011/run-if-supported`](./packages/cli/run-if-supported) | [![npm](https://img.shields.io/npm/v/@sounisi5011/run-if-supported.svg)](https://www.npmjs.com/package/@sounisi5011/run-if-supported) | [![Dependency Status](https://status.david-dm.org/gh/sounisi5011/npm-packages.svg?path=packages%2Fcli%2Frun-if-supported)](https://david-dm.org/sounisi5011/npm-packages?path=packages%2Fcli%2Frun-if-supported) |
| [`@sounisi5011/run-if-supported`](./packages/cli/run-if-supported) | [![npm](https://img.shields.io/npm/v/@sounisi5011/run-if-supported.svg)](https://www.npmjs.com/package/@sounisi5011/run-if-supported) | ![Dependencies Status](https://img.shields.io/librariesio/release/npm/@sounisi5011/run-if-supported) |

### CLI Utilities

| Package | Version | Dependencies |
|-|-|-|
| [`@sounisi5011/cli-utils-top-level-await`](./packages/cli-utils/top-level-await-cli) | [![npm](https://img.shields.io/npm/v/@sounisi5011/cli-utils-top-level-await.svg)](https://www.npmjs.com/package/@sounisi5011/cli-utils-top-level-await) | [![Dependency Status](https://status.david-dm.org/gh/sounisi5011/npm-packages.svg?path=packages%2Fcli-utils%2Ftop-level-await-cli)](https://david-dm.org/sounisi5011/npm-packages?path=packages%2Fcli-utils%2Ftop-level-await-cli) |
| [`@sounisi5011/cli-utils-top-level-await`](./packages/cli-utils/top-level-await-cli) | [![npm](https://img.shields.io/npm/v/@sounisi5011/cli-utils-top-level-await.svg)](https://www.npmjs.com/package/@sounisi5011/cli-utils-top-level-await) | ![Dependencies Status](https://img.shields.io/librariesio/release/npm/@sounisi5011/cli-utils-top-level-await) |

### TypeScript Utilities

| Package | Version | Dependencies |
|-|-|-|
| [`@sounisi5011/ts-utils-is-property-accessible`](./packages/ts-utils/is-property-accessible) | [![npm](https://img.shields.io/npm/v/@sounisi5011/ts-utils-is-property-accessible.svg)](https://www.npmjs.com/package/@sounisi5011/ts-utils-is-property-accessible) | [![Dependency Status](https://status.david-dm.org/gh/sounisi5011/npm-packages.svg?path=packages%2Fts-utils%2Fis-property-accessible)](https://david-dm.org/sounisi5011/npm-packages?path=packages%2Fts-utils%2Fis-property-accessible) |
| [`@sounisi5011/ts-utils-is-property-accessible`](./packages/ts-utils/is-property-accessible) | [![npm](https://img.shields.io/npm/v/@sounisi5011/ts-utils-is-property-accessible.svg)](https://www.npmjs.com/package/@sounisi5011/ts-utils-is-property-accessible) | ![Dependencies Status](https://img.shields.io/librariesio/release/npm/@sounisi5011/ts-utils-is-property-accessible) |

### TypeScript Type Utilities

| Package | Version | Dependencies |
|-|-|-|
| [`@sounisi5011/ts-type-util-has-own-property`](./packages/ts-type-utils/has-own-property) | [![npm](https://img.shields.io/npm/v/@sounisi5011/ts-type-util-has-own-property.svg)](https://www.npmjs.com/package/@sounisi5011/ts-type-util-has-own-property) | [![Dependency Status](https://status.david-dm.org/gh/sounisi5011/npm-packages.svg?path=packages%2Fts-type-utils%2Fhas-own-property)](https://david-dm.org/sounisi5011/npm-packages?path=packages%2Fts-type-utils%2Fhas-own-property) |
| [`@sounisi5011/ts-type-util-is-readonly-array`](./packages/ts-type-utils/is-readonly-array) | [![npm](https://img.shields.io/npm/v/@sounisi5011/ts-type-util-is-readonly-array.svg)](https://www.npmjs.com/package/@sounisi5011/ts-type-util-is-readonly-array) | [![Dependency Status](https://status.david-dm.org/gh/sounisi5011/npm-packages.svg?path=packages%2Fts-type-utils%2Fis-readonly-array)](https://david-dm.org/sounisi5011/npm-packages?path=packages%2Fts-type-utils%2Fis-readonly-array) |
| [`@sounisi5011/ts-type-util-has-own-property`](./packages/ts-type-utils/has-own-property) | [![npm](https://img.shields.io/npm/v/@sounisi5011/ts-type-util-has-own-property.svg)](https://www.npmjs.com/package/@sounisi5011/ts-type-util-has-own-property) | ![Dependencies Status](https://img.shields.io/librariesio/release/npm/@sounisi5011/ts-type-util-has-own-property) |
| [`@sounisi5011/ts-type-util-is-readonly-array`](./packages/ts-type-utils/is-readonly-array) | [![npm](https://img.shields.io/npm/v/@sounisi5011/ts-type-util-is-readonly-array.svg)](https://www.npmjs.com/package/@sounisi5011/ts-type-util-is-readonly-array) | ![Dependencies Status](https://img.shields.io/librariesio/release/npm/@sounisi5011/ts-type-util-is-readonly-array) |

### Jest Matchers

| Package | Version | Dependencies |
|-|-|-|
| [`@sounisi5011/jest-binary-data-matchers`](./packages/jest-matchers/binary-data) | [![npm](https://img.shields.io/npm/v/@sounisi5011/jest-binary-data-matchers.svg)](https://www.npmjs.com/package/@sounisi5011/jest-binary-data-matchers) | [![Dependency Status](https://status.david-dm.org/gh/sounisi5011/npm-packages.svg?path=packages%2Fjest-matchers%2Fbinary-data)](https://david-dm.org/sounisi5011/npm-packages?path=packages%2Fjest-matchers%2Fbinary-data) |
| [`@sounisi5011/jest-binary-data-matchers`](./packages/jest-matchers/binary-data) | [![npm](https://img.shields.io/npm/v/@sounisi5011/jest-binary-data-matchers.svg)](https://www.npmjs.com/package/@sounisi5011/jest-binary-data-matchers) | ![Dependencies Status](https://img.shields.io/librariesio/release/npm/@sounisi5011/jest-binary-data-matchers) |

### GitHub Actions

| Package | Version | Dependencies |
|-|-|-|
| [`monorepo-workspace-submodules-finder-action`](./actions/monorepo-workspace-submodules-finder) | [`v1.3.2`](https://github.com/sounisi5011/npm-packages/tree/monorepo-workspace-submodules-finder-action-v1.3.2/actions/monorepo-workspace-submodules-finder) | [![Dependency Status](https://status.david-dm.org/gh/sounisi5011/npm-packages.svg?path=actions%2Fmonorepo-workspace-submodules-finder)](https://david-dm.org/sounisi5011/npm-packages?path=actions%2Fmonorepo-workspace-submodules-finder) |
| Package | Version |
|-|-|
| [`monorepo-workspace-submodules-finder-action`](./actions/monorepo-workspace-submodules-finder) | [`v1.3.2`](https://github.com/sounisi5011/npm-packages/tree/monorepo-workspace-submodules-finder-action-v1.3.2/actions/monorepo-workspace-submodules-finder) |
2 changes: 1 addition & 1 deletion packages/check-pid-file/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Minified Bundle Size Details](https://img.shields.io/bundlephobia/min/@sounisi5011/check-pid-file)](https://bundlephobia.com/result?p=%40sounisi5011%2Fcheck-pid-file)
[![Install Size Details](https://packagephobia.com/badge?p=%40sounisi5011%2Fcheck-pid-file)](https://packagephobia.com/result?p=%40sounisi5011%2Fcheck-pid-file)
[![Dependencies Status](https://status.david-dm.org/gh/sounisi5011/npm-packages.svg?path=packages%2Fcheck-pid-file)](https://david-dm.org/sounisi5011/npm-packages?path=packages%2Fcheck-pid-file)
![Dependencies Status](https://img.shields.io/librariesio/release/npm/@sounisi5011/check-pid-file)
[![Build Status](https://github.com/sounisi5011/npm-packages/actions/workflows/ci.yaml/badge.svg)](https://github.com/sounisi5011/npm-packages/actions/workflows/ci.yaml)
[![Maintainability Status](https://api.codeclimate.com/v1/badges/26495b68302f7ff963c3/maintainability)](https://codeclimate.com/github/sounisi5011/npm-packages/maintainability)

Expand Down
2 changes: 1 addition & 1 deletion packages/cli-utils/top-level-await-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Minified Bundle Size Details](https://img.shields.io/bundlephobia/min/@sounisi5011/cli-utils-top-level-await)](https://bundlephobia.com/result?p=%40sounisi5011%2Fcli-utils-top-level-await)
[![Install Size Details](https://packagephobia.com/badge?p=%40sounisi5011%2Fcli-utils-top-level-await)](https://packagephobia.com/result?p=%40sounisi5011%2Fcli-utils-top-level-await)
[![Dependencies Status](https://status.david-dm.org/gh/sounisi5011/npm-packages.svg?path=packages%2Fcli-utils%2Ftop-level-await-cli)](https://david-dm.org/sounisi5011/npm-packages?path=packages%2Fcli-utils%2Ftop-level-await-cli)
![Dependencies Status](https://img.shields.io/librariesio/release/npm/@sounisi5011/cli-utils-top-level-await)
[![Build Status](https://github.com/sounisi5011/npm-packages/actions/workflows/ci.yaml/badge.svg)](https://github.com/sounisi5011/npm-packages/actions/workflows/ci.yaml)
[![Maintainability Status](https://api.codeclimate.com/v1/badges/26495b68302f7ff963c3/maintainability)](https://codeclimate.com/github/sounisi5011/npm-packages/maintainability)

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/run-if-supported/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Minified Bundle Size Details](https://img.shields.io/bundlephobia/min/@sounisi5011/run-if-supported)](https://bundlephobia.com/result?p=%40sounisi5011%2Frun-if-supported)
[![Install Size Details](https://packagephobia.com/badge?p=%40sounisi5011%2Frun-if-supported)](https://packagephobia.com/result?p=%40sounisi5011%2Frun-if-supported)
[![Dependencies Status](https://status.david-dm.org/gh/sounisi5011/npm-packages.svg?path=packages%2Fcli%2Frun-if-supported)](https://david-dm.org/sounisi5011/npm-packages?path=packages%2Fcli%2Frun-if-supported)
![Dependencies Status](https://img.shields.io/librariesio/release/npm/@sounisi5011/run-if-supported)
[![Build Status](https://github.com/sounisi5011/npm-packages/actions/workflows/ci.yaml/badge.svg)](https://github.com/sounisi5011/npm-packages/actions/workflows/ci.yaml)
[![Maintainability Status](https://api.codeclimate.com/v1/badges/26495b68302f7ff963c3/maintainability)](https://codeclimate.com/github/sounisi5011/npm-packages/maintainability)

Expand Down
2 changes: 1 addition & 1 deletion packages/encrypted-archive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Minified Bundle Size Details](https://img.shields.io/bundlephobia/min/@sounisi5011/encrypted-archive)](https://bundlephobia.com/result?p=%40sounisi5011%2Fencrypted-archive)
[![Install Size Details](https://packagephobia.com/badge?p=%40sounisi5011%2Fencrypted-archive)](https://packagephobia.com/result?p=%40sounisi5011%2Fencrypted-archive)
[![Dependencies Status](https://status.david-dm.org/gh/sounisi5011/npm-packages.svg?path=packages%2Fencrypted-archive)](https://david-dm.org/sounisi5011/npm-packages?path=packages%2Fencrypted-archive)
![Dependencies Status](https://img.shields.io/librariesio/release/npm/@sounisi5011/encrypted-archive)
[![Build Status](https://github.com/sounisi5011/npm-packages/actions/workflows/ci.yaml/badge.svg)](https://github.com/sounisi5011/npm-packages/actions/workflows/ci.yaml)
[![Maintainability Status](https://api.codeclimate.com/v1/badges/26495b68302f7ff963c3/maintainability)](https://codeclimate.com/github/sounisi5011/npm-packages/maintainability)

Expand Down
2 changes: 1 addition & 1 deletion packages/jest-matchers/binary-data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Minified Bundle Size Details](https://img.shields.io/bundlephobia/min/@sounisi5011/jest-binary-data-matchers)](https://bundlephobia.com/result?p=%40sounisi5011%2Fjest-binary-data-matchers)
[![Install Size Details](https://packagephobia.com/badge?p=%40sounisi5011%2Fjest-binary-data-matchers)](https://packagephobia.com/result?p=%40sounisi5011%2Fjest-binary-data-matchers)
[![Dependencies Status](https://status.david-dm.org/gh/sounisi5011/npm-packages.svg?path=packages%2Fjest-matchers%2Fbinary-data)](https://david-dm.org/sounisi5011/npm-packages?path=packages%2Fjest-matchers%2Fbinary-data)
![Dependencies Status](https://img.shields.io/librariesio/release/npm/@sounisi5011/jest-binary-data-matchers)
[![Build Status](https://github.com/sounisi5011/npm-packages/actions/workflows/ci.yaml/badge.svg)](https://github.com/sounisi5011/npm-packages/actions/workflows/ci.yaml)
[![Maintainability Status](https://api.codeclimate.com/v1/badges/26495b68302f7ff963c3/maintainability)](https://codeclimate.com/github/sounisi5011/npm-packages/maintainability)

Expand Down
2 changes: 1 addition & 1 deletion packages/stream-transform-from/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Minified Bundle Size Details](https://img.shields.io/bundlephobia/min/@sounisi5011/stream-transform-from)](https://bundlephobia.com/result?p=%40sounisi5011%2Fstream-transform-from)
[![Install Size Details](https://packagephobia.com/badge?p=%40sounisi5011%2Fstream-transform-from)](https://packagephobia.com/result?p=%40sounisi5011%2Fstream-transform-from)
[![Dependencies Status](https://status.david-dm.org/gh/sounisi5011/npm-packages.svg?path=packages%2Fstream-transform-from)](https://david-dm.org/sounisi5011/npm-packages?path=packages%2Fstream-transform-from)
![Dependencies Status](https://img.shields.io/librariesio/release/npm/@sounisi5011/stream-transform-from)
[![Build Status](https://github.com/sounisi5011/npm-packages/actions/workflows/ci.yaml/badge.svg)](https://github.com/sounisi5011/npm-packages/actions/workflows/ci.yaml)
[![Maintainability Status](https://api.codeclimate.com/v1/badges/26495b68302f7ff963c3/maintainability)](https://codeclimate.com/github/sounisi5011/npm-packages/maintainability)

Expand Down
2 changes: 1 addition & 1 deletion packages/ts-utils/is-property-accessible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Minified Bundle Size Details](https://img.shields.io/bundlephobia/min/@sounisi5011/ts-utils-is-property-accessible)](https://bundlephobia.com/result?p=%40sounisi5011%2Fts-utils-is-property-accessible)
[![Install Size Details](https://packagephobia.com/badge?p=%40sounisi5011%2Fts-utils-is-property-accessible)](https://packagephobia.com/result?p=%40sounisi5011%2Fts-utils-is-property-accessible)
[![Dependencies Status](https://status.david-dm.org/gh/sounisi5011/npm-packages.svg?path=packages%2Fts-utils%2Fis-property-accessible)](https://david-dm.org/sounisi5011/npm-packages?path=packages%2Fts-utils%2Fis-property-accessible)
![Dependencies Status](https://img.shields.io/librariesio/release/npm/@sounisi5011/ts-utils-is-property-accessible)
[![Build Status](https://github.com/sounisi5011/npm-packages/actions/workflows/ci.yaml/badge.svg)](https://github.com/sounisi5011/npm-packages/actions/workflows/ci.yaml)
[![Maintainability Status](https://api.codeclimate.com/v1/badges/26495b68302f7ff963c3/maintainability)](https://codeclimate.com/github/sounisi5011/npm-packages/maintainability)

Expand Down
7 changes: 6 additions & 1 deletion scripts/publish-convert-readme.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ function reportError(message) {
*/
function replaceURL(urlStr, { pkg, rootURL }) {
if (pkg.version) {
if (urlStr.startsWith('https://img.shields.io/bundlephobia/') && !/\/\d+(?:\.\d+){2}$/.test(urlStr)) {
if (
(
urlStr.startsWith('https://img.shields.io/bundlephobia/')
|| urlStr.startsWith('https://img.shields.io/librariesio/release/npm/')
) && !/\/\d+(?:\.\d+){2}$/.test(urlStr)
) {
return `${urlStr}/${pkg.version}`;
}
if (
Expand Down
Loading

0 comments on commit c977071

Please sign in to comment.