Skip to content

Commit

Permalink
⬆️ feat: Update dependencies to support nodejs 20
Browse files Browse the repository at this point in the history
  • Loading branch information
kms0219kms committed Jun 22, 2024
1 parent 6a0f560 commit 74dd999
Show file tree
Hide file tree
Showing 9 changed files with 3,165 additions and 2,511 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/coverage-reporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@ jobs:
runs-on: ubuntu-latest
name: coverage-reporter
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-node@v1
- uses: pnpm/action-setup@v4
with:
node-version: 12
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install and build libraries
run: |
npm i
npm run build
pnpm install --frozen-lockfile
pnpm build
- name: Run coverage-reporter
run: |
export CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}
Expand Down
36 changes: 22 additions & 14 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,37 @@ jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
node-version: 12
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
registry-url: https://registry.npmjs.org/
- run: npm i
- run: tsc
- run: npm publish --access public
- run: pnpm install --frozen-lockfile
- run: pnpm compile
- run: pnpm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.PUBLISH_TOKEN_NPM}}

publish-gpr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 12
node-version: 20
cache: 'pnpm'
registry-url: https://npm.pkg.github.com/
scope: '@HaileyBot'
- run: npm i
- run: tsc
- run: echo registry=https://npm.pkg.github.com/HaileyBot >> .npmrc
- run: npm publish
scope: '@nguard-security'
- run: pnpm install --frozen-lockfile
- run: pnpm compile
- run: echo registry=https://npm.pkg.github.com/NGuard-Security >> .npmrc
- run: pnpm publish
env:
NODE_AUTH_TOKEN: ${{secrets.PUBLISH_TOKEN_GITHUB}}
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ examples/*.jpeg
node_modules
src
.gitattributes
CODE_OF_CONDUCT.md
tsconfig.json
47 changes: 0 additions & 47 deletions CODE_OF_CONDUCT.md

This file was deleted.

27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<h1 align="center">Captcha Generator</h1>
<p align="center">
<a href="https://www.npmjs.com/package/@haileybot/captcha-generator" title="NPM version"><img alt="NPM version" src="https://img.shields.io/npm/v/@haileybot/captcha-generator?logo=npm"/></a>
<a href="https://www.npmjs.com/package/@haileybot/captcha-generator" title="NPM downloads"><img alt="NPM downloads" src="https://img.shields.io/npm/dt/@haileybot/captcha-generator?logo=npm"/></a>
<a href="https://david-dm.org/HaileyBot/captcha-generator" title="Dependencies"><img alt="Dependencies" src="https://img.shields.io/david/HaileyBot/captcha-generator?logo=npm"/></a>
<a href="https://www.npmjs.com/package/@nguard-security/captcha-generator" title="NPM version"><img alt="NPM version" src="https://img.shields.io/npm/v/@nguard-security/captcha-generator?logo=npm"/></a>
<a href="https://www.npmjs.com/package/@nguard-security/captcha-generator" title="NPM downloads"><img alt="NPM downloads" src="https://img.shields.io/npm/dt/@nguard-security/captcha-generator?logo=npm"/></a>
<a href="https://david-dm.org/NGuard-Security/captcha-generator" title="Dependencies"><img alt="Dependencies" src="https://img.shields.io/david/NGuard-Security/captcha-generator?logo=npm"/></a>
<br>
<a href="https://github.com/HaileyBot/captcha-generator/blob/master/LICENSE" title="License"><img alt="License" src="https://img.shields.io/github/license/HaileyBot/captcha-generator?logo=github&logoColor=black"/></a>
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2FHaileyBot%2Fcaptcha-generator?ref=badge_shield" title="FOSSA Status"><img alt="FOSSA Status" src="https://app.fossa.com/api/projects/git%2Bgithub.com%2FHaileyBot%2Fcaptcha-generator.svg?type=shield"/></a>
<a href="https://codecov.io/gh/HaileyBot/captcha-generator" title="Code Coverage"><img alt="Code Coverage" src="https://codecov.io/gh/HaileyBot/captcha-generator/branch/master/graph/badge.svg?token=OW7Q7Y1B2A"/></a>
<a href="https://github.com/NGuard-Security/captcha-generator/blob/master/LICENSE" title="License"><img alt="License" src="https://img.shields.io/github/license/NGuard-Security/captcha-generator?logo=github&logoColor=black"/></a>
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2FNGuard-Security%2Fcaptcha-generator?ref=badge_shield" title="FOSSA Status"><img alt="FOSSA Status" src="https://app.fossa.com/api/projects/git%2Bgithub.com%2FNGuard-Security%2Fcaptcha-generator.svg?type=shield"/></a>
<a href="https://codecov.io/gh/NGuard-Security/captcha-generator" title="Code Coverage"><img alt="Code Coverage" src="https://codecov.io/gh/NGuard-Security/captcha-generator/branch/master/graph/badge.svg?token=OW7Q7Y1B2A"/></a>
<br>
<a href="https://github.com/sponsors/cheesits456" title="GitHub Sponsors"><img alt="GitHub Sponsors" src="https://img.shields.io/github/sponsors/cheesits456?color=EA4AAA&logo=github-sponsors"/></a>
<a href="https://donate.haileybot.com" title="PayPal"><img alt="PayPal" src="https://img.shields.io/badge/donate-paypal-13e?logo=paypal"/></a>
<a href="https://github.com/sponsors/kms0219kms" title="GitHub Sponsors"><img alt="GitHub Sponsors" src="https://img.shields.io/github/sponsors/kms0219kms?color=EA4AAA&logo=github-sponsors"/></a>
</p>

Captcha Generator is a Node library for quickly and easily generating captcha images that can be used through an authorized bot to verify human users on a chat platform such as Slack or Discord.
Expand All @@ -19,7 +18,7 @@ Captcha Generator is a Node library for quickly and easily generating captcha im
Use the package manager [npm](https://www.npmjs.com/) to install Captcha Generator

```bash
npm i @haileybot/captcha-generator
npm i @nguard-security/captcha-generator
```

## Usage
Expand All @@ -28,7 +27,7 @@ npm i @haileybot/captcha-generator

```js
// Import the module
const Captcha = require("@haileybot/captcha-generator");
const Captcha = require("@nguard-security/captcha-generator");

// Create a new Captcha object
// - Optional argument to specify image height (250 to 400px, default 250)
Expand All @@ -47,7 +46,7 @@ console.log(captcha.value);
```js
const path = require("path"),
fs = require("fs"),
Captcha = require("@haileybot/captcha-generator");
Captcha = require("@nguard-security/captcha-generator");

let captcha = new Captcha();
captcha.PNGStream.pipe(fs.createWriteStream(path.join(__dirname, `${captcha.value}.png`)));
Expand All @@ -59,7 +58,7 @@ captcha.JPEGStream.pipe(fs.createWriteStream(path.join(__dirname, `${captcha.val
This example assumes you already have the core framework of a Discord Bot set up

```js
const Captcha = require("@haileybot/captcha-generator");
const Captcha = require("@nguard-security/captcha-generator");

// Use this function for blocking certain commands or features from automated self-bots
function verifyHuman(msg) {
Expand All @@ -79,6 +78,6 @@ function verifyHuman(msg) {

## License

This project is licensed under [GPL-3.0](https://github.com/HaileyBot/captcha-generator/blob/master/LICENSE)
This project is licensed under [GPL-3.0](https://github.com/NGuard-Security/captcha-generator/blob/master/LICENSE)

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FHaileyBot%2Fcaptcha-generator.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FHaileyBot%2Fcaptcha-generator?ref=badge_large)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FNGuard-Security%2Fcaptcha-generator.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FNGuard-Security%2Fcaptcha-generator?ref=badge_large)
Loading

0 comments on commit 74dd999

Please sign in to comment.