Skip to content

Commit

Permalink
Revert "Add elysia adapter (#769)"
Browse files Browse the repository at this point in the history
This reverts commit f07c544
  • Loading branch information
felixmosh committed Nov 13, 2024
1 parent 9f294ae commit 4b175fa
Show file tree
Hide file tree
Showing 19 changed files with 56 additions and 955 deletions.
96 changes: 46 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ With this library you get a beautiful UI for visualizing what's happening with e
## Packages

| Name | Version |
| ------------------------------------------------------------------------ | ----------------------------------------------------------------- |
|--------------------------------------------------------------------------|-------------------------------------------------------------------|
| [@bull-board/api](https://www.npmjs.com/package/@bull-board/api) | ![npm (scoped)](https://img.shields.io/npm/v/@bull-board/api) |
| [@bull-board/ui](https://www.npmjs.com/package/@bull-board/ui) | ![npm (scoped)](https://img.shields.io/npm/v/@bull-board/ui) |
| [@bull-board/express](https://www.npmjs.com/package/@bull-board/express) | ![npm (scoped)](https://img.shields.io/npm/v/@bull-board/express) |
Expand All @@ -29,7 +29,6 @@ With this library you get a beautiful UI for visualizing what's happening with e
| [@bull-board/nestjs](https://www.npmjs.com/package/@bull-board/nestjs) | ![npm (scoped)](https://img.shields.io/npm/v/@bull-board/nestjs) |
| [@bull-board/hono](https://www.npmjs.com/package/@bull-board/hono) | ![npm (scoped)](https://img.shields.io/npm/v/@bull-board/hono) |
| [@bull-board/h3](https://www.npmjs.com/package/@bull-board/h3) | ![npm (scoped)](https://img.shields.io/npm/v/@bull-board/h3) |
| [@bull-board/elysia](https://www.npmjs.com/package/@bull-board/elysia) | ![npm (scoped)](https://img.shields.io/npm/v/@bull-board/elysia) |

## Notes

Expand Down Expand Up @@ -60,12 +59,9 @@ yarn add @bull-board/nestjs
yarn add @bull-board/hono
# or
yarn add @bull-board/h3
# or
bun add @bull-board/elysia
```

### NestJS specific setup

@bull-board provides a module for easy integration with NestJS, for reference on how to use the module refer to the [NestJS Module](https://github.com/felixmosh/bull-board/tree/master/packages/nestjs) package

## Hello World
Expand Down Expand Up @@ -108,8 +104,8 @@ app.listen(3000, () => {

That's it! Now you can access the `/admin/queues` route, and you will be able to monitor everything that is happening in your queues 😁

For more advanced usages check the `examples` folder, currently it contains:

For more advanced usages check the `examples` folder, currently it contains:
1. [Basic authentication example](https://github.com/felixmosh/bull-board/tree/master/examples/with-express-auth)
2. [Multiple instance of the board](https://github.com/felixmosh/bull-board/tree/master/examples/with-multiple-instances)
3. [With Fastify server](https://github.com/felixmosh/bull-board/tree/master/examples/with-fastify)
Expand All @@ -118,24 +114,23 @@ For more advanced usages check the `examples` folder, currently it contains:
6. [With Nest.js server using the built-in module](https://github.com/felixmosh/bull-board/tree/master/examples/with-nestjs-module) (Thanx to @dennissnijder)
7. [With Nest.js server using the express adapter](https://github.com/felixmosh/bull-board/tree/master/examples/with-nestjs) (Thanx to @lodi-g)
8. [With Hono server](https://github.com/felixmosh/bull-board/tree/master/examples/with-hono) (Thanks to @nihalgonsalves)
9. [With H3 server using the h3 adapter](https://github.com/felixmosh/bull-board/tree/master/examples/with-h3) (Thanx to @genu)
10. [With Elysia server using the Elysia adapter](https://github.com/felixmosh/bull-board/tree/master/examples/with-elysia) (Thanx to @genu)
8. [With H3 server using the h3 adapter](https://github.com/felixmosh/bull-board/tree/master/examples/with-h3) (Thanx to @genu)

### Board options

### Board options
1. `uiConfig.boardTitle` (default: `Bull Dashboard`)
The Board and page titles
The Board and page titles
2. `uiConfig.boardLogo` (default: `empty`) `{ path: string; width?: number | string; height?: number | string }`
An object that allows you to specify a different logo
An object that allows you to specify a different logo
3. `uiConfig.miscLinks` (default: `empty`) `Array< { text: string; url: string }>`
An array of misc link that you can add to the dashboard, such as logout link.
An array of misc link that you can add to the dashboard, such as logout link.
4. uiConfig.favIcon (default: `{ default: 'static/images/logo.svg', alternative: 'static/favicon-32x32.png', }`) `{ default: string; alternative: 'string' }`
An object that allows you to specify the default and alternative favicons.
An object that allows you to specify the default and alternative favicons.

```js
const QueueMQ = require('bullmq');
const { createBullBoard } = require('@bull-board/api');
const { BullMQAdapter } = require('@bull-board/api/bullMQAdapter');
const {createBullBoard} = require('@bull-board/api');
const {BullMQAdapter} = require('@bull-board/api/bullMQAdapter');

const queueMQ = new QueueMQ();

Expand All @@ -150,7 +145,7 @@ createBullBoard({
width: '100px',
height: 200,
},
miscLinks: [{ text: 'Logout', url: '/logout' }],
miscLinks: [{text: 'Logout', url: '/logout'}],
favIcon: {
default: 'static/images/logo.svg',
alternative: 'static/favicon-32x32.png',
Expand All @@ -161,46 +156,45 @@ createBullBoard({
```

### Queue options

1. `readOnlyMode` (default: `false`)
Makes the UI as read only, hides all queue & job related actions
Makes the UI as read only, hides all queue & job related actions

```js
const Queue = require('bull');
const QueueMQ = require('bullmq');
const { createBullBoard } = require('@bull-board/api');
const { BullMQAdapter } = require('@bull-board/api/bullMQAdapter');
const { BullAdapter } = require('@bull-board/api/bullAdapter');
const Queue = require('bull')
const QueueMQ = require('bullmq')
const { createBullBoard } = require('@bull-board/api')
const { BullMQAdapter } = require('@bull-board/api/bullMQAdapter')
const { BullAdapter } = require('@bull-board/api/bullAdapter')

const someQueue = new Queue();
const queueMQ = new QueueMQ();
const someQueue = new Queue()
const queueMQ = new QueueMQ()

createBullBoard({
queues: [
new BullAdapter(someQueue, { readOnlyMode: true }), // only this queue will be in read only mode
new BullMQAdapter(queueMQ, { readOnlyMode: true }),
],
});
]
})
```

2. `allowRetries` (default: `true`)
When set to `false` the UI removes the job retry buttons for a queue. This option will be ignored if `readOnlyMode` is `true`.
When set to `false` the UI removes the job retry buttons for a queue. This option will be ignored if `readOnlyMode` is `true`.

```js
const QueueMQ = require('bullmq');
const { createBullBoard } = require('@bull-board/api');
const { BullMQAdapter } = require('@bull-board/api/bullMQAdapter');
const { BullAdapter } = require('@bull-board/api/bullAdapter');
const QueueMQ = require('bullmq')
const { createBullBoard } = require('@bull-board/api')
const { BullMQAdapter } = require('@bull-board/api/bullMQAdapter')
const { BullAdapter } = require('@bull-board/api/bullAdapter')

const someQueue = new Queue();
const queueMQ = new QueueMQ();
const someQueue = new Queue()
const queueMQ = new QueueMQ()

createBullBoard({
queues: [
new BullAdapter(someQueue, { allowRetries: false }), // No retry buttons
new BullMQAdapter(queueMQ, { allowRetries: true, readOnlyMode: true }), // allowRetries will be ignored in this case in lieu of readOnlyMode
],
});
]
})
```

3. `description` (default: `empty`)
Expand All @@ -218,40 +212,42 @@ const { createBullBoard } = require('@bull-board/api');
const { BullMQAdapter } = require('@bull-board/api/bullMQAdapter');

const redact = fastRedact({
paths: ['headers.cookie', 'password', 'access_token'],
});
paths: ['headers.cookie', 'password', 'access_token']
})

const queueMQ = new QueueMQ();
const queueMQ = new QueueMQ()
const queueAdapter = new BullMQAdapter(queueMQ);
queueAdapter.setFormatter('name', (job) => `#Queue1 - ${job.name}`);
queueAdapter.setFormatter('data', (data) => redact(data));
queueAdapter.setFormatter('returnValue', (returnValue) => redact(returnValue));

createBullBoard({
queues: [queueAdapter],
});
queues: [queueAdapter]
})
```

### Hosting router on a sub path

If you host your express service on a different path than root (/) ie. https://<server_name>/<sub_path>/, then you can add the following code to provide the configuration to the bull-board router. In this example the sub path will be `my-base-path`.

```js
const Queue = require('bull');
const { createBullBoard } = require('@bull-board/api');
const { BullAdapter } = require('@bull-board/api/bullAdapter');
const { ExpressAdapter } = require('@bull-board/express');
const Queue = require('bull')
const { createBullBoard } = require('@bull-board/api')
const { BullAdapter } = require('@bull-board/api/bullAdapter')
const { ExpressAdapter } = require('@bull-board/express')

const basePath = '/my-base-path';

const someQueue = new Queue('someQueueName');
const someQueue = new Queue('someQueueName')
const serverAdapter = new ExpressAdapter();
serverAdapter.setBasePath(basePath);
serverAdapter.setBasePath(basePath)

createBullBoard({
queues: [new BullAdapter(someQueue)],
serverAdapter,
});
queues: [
new BullAdapter(someQueue),
],
serverAdapter
})

// ... express server configuration

Expand Down
3 changes: 0 additions & 3 deletions examples/with-elysia/README.md

This file was deleted.

64 changes: 0 additions & 64 deletions examples/with-elysia/index.ts

This file was deleted.

18 changes: 0 additions & 18 deletions examples/with-elysia/package.json

This file was deleted.

15 changes: 0 additions & 15 deletions examples/with-elysia/tsconfig.json

This file was deleted.

Loading

0 comments on commit 4b175fa

Please sign in to comment.