Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(): migrate to monorepo, add bullmq integration #1129

Merged
merged 15 commits into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 23 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,23 @@ version: 2
aliases:
- &restore-cache
restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- &install-deps
run:
name: Install dependencies
command: npm ci
name: Install Dependencies
command: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
- &build-packages
run:
name: Build
command: npm run build
command: yarn build
- &save-cache
save_cache:
name: Save Yarn Package Cache
key: yarn-packages-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn

jobs:
build:
Expand All @@ -20,21 +28,12 @@ jobs:
- image: circleci/node:17
steps:
- checkout
- run:
name: Update NPM version
command: 'sudo npm install -g npm@latest'
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Install dependencies
command: npm ci
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- ./node_modules
- *restore-cache
- *install-deps
- *save-cache
- run:
name: Build
command: npm run build
command: yarn build

unit_tests:
working_directory: ~/nest
Expand All @@ -46,7 +45,7 @@ jobs:
- *install-deps
- run:
name: Unit tests
command: npm run test
command: yarn test

integration_tests:
working_directory: ~/nest
Expand All @@ -61,9 +60,12 @@ jobs:
- run:
name: Upgrade Node.js
command: |
nvm install v12
nvm install v16
node -v
nvm alias default v12
nvm alias default v16
- run:
name: Install Yarn
command: npm install -g yarn
- run:
name: Install Docker Compose
command: |
Expand All @@ -81,7 +83,7 @@ jobs:
command: docker ps
- run:
name: e2e tests
command: npm run test:e2e
command: yarn test:e2e

workflows:
version: 2
Expand Down
5 changes: 2 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
project: 'packages/tsconfig.build.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
],
root: true,
env: {
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ node_modules
# misc
npm-debug.log
.DS_Store
tsconfig.build.tsbuildinfo

# tests
/test
/coverage
coverage
/.nyc_output

# dist
/dist
dist
cc-test-reporter
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
20 changes: 10 additions & 10 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# source
e2e/
lib/
packages/**/e2e/
packages/**/lib/
.idea/
coverage/
coverage

# config
tsconfig.json
tslint.json
tsconfig.build.json
tsconfig.spec.json
.prettierignore
.prettierrc
.travis.yml
docker-compose.yml
jest.config.js
jest-e2e.config.js
renovate.json
sample.tsconfig.json
cc-test-reporter
lerna.json
.eslintignore
.eslintrc.js
.commitlintrc.json

# misc
sample/
.circleci/
.github/
FUNDING.yml
yarn.lock
8 changes: 0 additions & 8 deletions .release-it.json

This file was deleted.

12 changes: 0 additions & 12 deletions FUNDING.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Frédéric Woelffel
Copyright (c) Kamil Mysliwiec & Frédéric Woelffel

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,21 @@

## Description

[Bull](https://github.com/OptimalBits/bull) module for [Nest](https://github.com/nestjs/nest).
Monorepo containing Nest modules for [Bull](https://github.com/OptimalBits/bull) and [BullMQ](https://github.com/taskforcesh/bullmq) packages.

## Installation
## Installation (Bull)

```bash
$ npm i --save @nestjs/bull bull
$ npm i --save-dev @types/bull
```

## Installation (BullMQ)

```bash
$ npm i --save @nestjs/bullmq bullmq
```

## Quick Start

[Overview & Tutorial](https://docs.nestjs.com/techniques/queues)
Expand All @@ -41,8 +47,8 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors

## People

- Author - [Frederic Woelffel](https://fwoelffel.me)
- Maintainers - [Frederic Woelffel](https://fwoelffel.me) & [Kamil Myśliwiec](https://twitter.com/kammysliwiec)
- Maintainers - [Kamil Myśliwiec](https://twitter.com/kammysliwiec)
- Contributors - [Frederic Woelffel](https://fwoelffel.me)
- Website - [https://nestjs.com](https://nestjs.com/)

## License
Expand Down
14 changes: 0 additions & 14 deletions e2e/jest-e2e.json

This file was deleted.

17 changes: 0 additions & 17 deletions jest-e2e.config.js

This file was deleted.

17 changes: 0 additions & 17 deletions jest.config.js

This file was deleted.

16 changes: 16 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"packages": [
"packages/*"
],
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true,
"changelog": {
"labels": {
"feature": "Features",
"bug": "Bug fixes",
"enhancement": "Enhancements",
"dependencies": "Dependencies"
}
}
}
3 changes: 0 additions & 3 deletions lib/bull.constants.ts

This file was deleted.

5 changes: 0 additions & 5 deletions lib/decorators/inject-queue.decorator.ts

This file was deleted.

Loading