From 39991373226f80a224381e22dde0488e2fe73dec Mon Sep 17 00:00:00 2001 From: Alexander O'Mara Date: Sun, 3 Nov 2024 16:09:40 -0500 Subject: [PATCH] Added keywords --- README.md | 13 +++++++++++++ scripts/npm.ts | 10 +++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b9ec8aa..c49ded9 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,19 @@ CRC functions with a parameterized engine optimized for both speed and size +![crc](https://img.shields.io/badge/crc-grey) +![digest](https://img.shields.io/badge/digest-grey) +![checksum](https://img.shields.io/badge/checksum-grey) +![hash](https://img.shields.io/badge/hash-grey) +![typescript](https://img.shields.io/badge/typescript-grey) +![esm](https://img.shields.io/badge/esm-grey) +![streamable](https://img.shields.io/badge/streamable-grey) +![crc-8](https://img.shields.io/badge/crc--8-grey) +![crc-16](https://img.shields.io/badge/crc--16-grey) +![crc-24](https://img.shields.io/badge/crc--24-grey) +![crc-32](https://img.shields.io/badge/crc--32-grey) +![crc-64](https://img.shields.io/badge/crc--64-grey) + # Features - Pure TypeScript, run anywhere diff --git a/scripts/npm.ts b/scripts/npm.ts index a001d08..f446483 100644 --- a/scripts/npm.ts +++ b/scripts/npm.ts @@ -10,10 +10,13 @@ if (Deno.args.length !== 1 || !/^(dev|prod)$/.test(Deno.args[0])) { } const [env] = Deno.args; + const GITHUB_REPOSITORY = Deno.env.get('GITHUB_REPOSITORY'); -const [description] = (await Deno.readTextFile('README.md')) - .split(/[\r\n]+/) - .filter((s) => /^\w/.test(s)); +const readme = (await Deno.readTextFile('README.md')).split(/[\r\n]+/); +const [description] = readme.filter((s) => /^\w/.test(s)); +const keywords = readme.map((s) => s.match(/^\!\[(.*)\]\((.*)\)/)) + .filter((m) => m && m[2].startsWith('https://img.shields.io/badge/')) + .map((m) => m![1]); await emptyDir('./npm'); await build({ @@ -29,6 +32,7 @@ await build({ name: denoJson.name, version: denoJson.version, description, + keywords, license: denoJson.license, sideEffects: false, ...(env !== 'prod' ? { private: true } : {}),