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

Dependabot #111

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e644d32
Bump @aws-sdk from 3.46.0 to 3.100.0
fbn-roussel Jun 5, 2022
058747f
Bump aws-xray-sdk-core from 3.3.4 to 3.3.6
fbn-roussel Jun 5, 2022
24dd9dc
Bump axios from 0.24.0 to 0.27.2
fbn-roussel Jun 5, 2022
913c3b3
Bump keyv from 4.0.5 to 4.3.0
fbn-roussel Jun 5, 2022
fcc017a
Bump node-html-parser from 5.2.0 to 5.3.3
fbn-roussel Jun 5, 2022
31b47f4
Bump pino from 7.6.3 to 8.0.0
fbn-roussel Jun 5, 2022
91b9384
Bump @types/aws-lambda from 8.10.89 to 8.10.98
fbn-roussel Jun 5, 2022
dcd536b
Bump @types/jest from 27.0.3 to 28.1.1
fbn-roussel Jun 5, 2022
d61963b
Bump @types/jsdom from 16.2.13 to 16.2.14
fbn-roussel Jun 5, 2022
7143103
Bump @types/keyv from 3.1.3 to 3.1.4
fbn-roussel Jun 5, 2022
6f806e5
Bump @types/lodash 4.14.178 to 4.14.182
fbn-roussel Jun 5, 2022
40dfb63
Bump @types/node from 14.18.0 to 14
fbn-roussel Jun 5, 2022
4ac20e7
Bump @types/randomstringfrom 1.1.7 to 1.1.8
fbn-roussel Jun 5, 2022
1889239
Bump @typescript-eslint from 5.4.0 to 5.27.0
fbn-roussel Jun 5, 2022
5347224
Bump copy-webpack-plugin from 10.0.0 to 11.0.0
fbn-roussel Jun 5, 2022
23a6ccb
Bump eslint from 8.2.0 to 8.17.0
fbn-roussel Jun 5, 2022
a73d551
Bump eslint-config-prettier from 8.3.0 to 8.5.0
fbn-roussel Jun 5, 2022
70406ea
Bump fs-extra from 10.0.0 to 10.1.0
fbn-roussel Jun 5, 2022
d7fc8b6
Bump jest from 27.3.1 to 28.1.0
fbn-roussel Jun 5, 2022
e67904e
Bump prettier from 2.5.1 to 2.6.2
fbn-roussel Jun 5, 2022
8a4a2b8
Bump randomstring from 1.2.1 to 1.2.2
fbn-roussel Jun 5, 2022
1834350
Bump ts-jest from 27.0.7 to 28.0.4
fbn-roussel Jun 5, 2022
7431bfa
Bump ts-loader from 9.2.6 to 9.3.0
fbn-roussel Jun 5, 2022
bf93730
Bump ts-node from 10.3.0 to 10.8.1
fbn-roussel Jun 5, 2022
ec85e24
Bump typescript from 4.5.2 to 4.7.3
fbn-roussel Jun 5, 2022
b485476
Bump webpack from 5.64.1 to 5.73.0
fbn-roussel Jun 5, 2022
daaca05
Bump webpack-cli from 4.9.1 to 4.9.2
fbn-roussel Jun 5, 2022
31bba1d
Add @hastobegood/crypto-bot-artillery
fbn-roussel Jun 8, 2022
d81c594
Bump @aws-sdk from 3.100.0 to 3.105.0
fbn-roussel Jun 8, 2022
aa706d3
Bump serialize-error from 9.0.0 to 9.1.1
fbn-roussel Jun 8, 2022
702524b
Remove serialize-error
fbn-roussel Jun 8, 2022
559b1b6
Bump @types/aws-lambda from 8.10.98 to 8.10.99
fbn-roussel Jun 8, 2022
44a8a44
Bump @typescript-eslint from 5.27.0 to 5.27.1
fbn-roussel Jun 8, 2022
022f7cc
Bump esbuild from 0.14.42 to 0.14.43
fbn-roussel Jun 8, 2022
ce2097a
Bump eslint from 8.16.0 to 8.17.0
fbn-roussel Jun 8, 2022
00079c7
Bump jest from 28.1.0 to 28.1.1
fbn-roussel Jun 8, 2022
ce7e808
Remove @tsconfig/node16-strictest-esm
fbn-roussel Jun 8, 2022
ac3a075
Update README
fbn-roussel Jun 8, 2022
34d1914
Fix code smell
fbn-roussel Jun 8, 2022
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
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

72 changes: 60 additions & 12 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,22 +1,70 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020
"ecmaVersion": 2021,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"prettier"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
"plugin:promise/recommended",
"plugin:import/recommended",
// must be the last extension
"plugin:prettier/recommended"
],
"env": {
"node": true
},
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": "./tsconfig.json"
},
"extends": [
"plugin:import/typescript",
"plugin:@typescript-eslint/recommended"
],
"settings": {
"import/resolver": {
"typescript": {
"alwaysTryTypes": true
}
}
},
"rules": {
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true
}
]
}
}
],
"rules": {
"no-console": "error",
"prettier/prettier": "error",
"@typescript-eslint/no-non-null-assertion": "off"
}
"import/no-unresolved": [
"error",
{
"ignore": [
"@hastobegood/crypto-bot-artillery"
]
}
],
"import/order": [
"error",
{
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
]
},
"ignorePatterns": [
"out"
]
}
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ updates:
directory: /
target-branch: dependabot
schedule:
interval: weekly
interval: monthly
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16
registry-url: https://npm.pkg.github.com
cache: yarn
- name: Cache node_modules
Expand All @@ -40,7 +40,7 @@ jobs:
- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16
registry-url: https://npm.pkg.github.com
cache: yarn
- name: Restore node_modules
Expand All @@ -65,7 +65,7 @@ jobs:
- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16
registry-url: https://npm.pkg.github.com
cache: yarn
- name: Restore node_modules
Expand All @@ -90,7 +90,7 @@ jobs:
- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16
registry-url: https://npm.pkg.github.com
cache: yarn
- name: Restore node_modules
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# NodeJS
node_modules
dist
out
reports

# AWS SAM
Expand Down
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"

yarn lint
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Supported deployment modes:

### Requirements

- NodeJS 14.x
- NodeJS 16.x
- Yarn 1.x
- AWS SAM 1.x

Expand Down
21 changes: 14 additions & 7 deletions jest.config.ts → jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import type { Config } from '@jest/types';

const config: Config.InitialOptions = {
const config = {
// All imported modules in your tests should be mocked automatically
// automock: false,

Expand Down Expand Up @@ -57,7 +55,11 @@ const config: Config.InitialOptions = {
// globalTeardown: undefined,

// A set of global variables that need to be available in all test environments
// globals: {},
globals: {
'ts-jest': {
useESM: true,
},
},

// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
// maxWorkers: "50%",
Expand All @@ -78,7 +80,12 @@ const config: Config.InitialOptions = {
// ],

// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
// moduleNameMapper: {},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
'^lodash-es$': 'lodash',
'^@hastobegood\\/crypto-bot-artillery\\/(?!test)(.*)$': '<rootDir>/node_modules/@hastobegood/crypto-bot-artillery/lib/cjs/src/$1/index.js',
'^@hastobegood\\/crypto-bot-artillery\\/test\\/(.*)$': '<rootDir>/node_modules/@hastobegood/crypto-bot-artillery/lib/cjs/test/$1/index.js',
},

// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
// modulePathIgnorePatterns: [],
Expand All @@ -90,7 +97,7 @@ const config: Config.InitialOptions = {
// notifyMode: "failure-change",

// A preset that is used as a base for Jest's configuration
preset: 'ts-jest',
preset: 'ts-jest/presets/js-with-ts-esm',

// Run tests from one or more projects
// projects: undefined,
Expand Down Expand Up @@ -122,7 +129,7 @@ const config: Config.InitialOptions = {
// runner: "jest-runner",

// The paths to modules that run some code to configure or set up the testing environment before each test
// setupFiles: [],
setupFiles: ['./jest.env.js'],

// A list of paths to modules that run some code to configure or set up the testing framework before each test
// setupFilesAfterEnv: [],
Expand Down
4 changes: 4 additions & 0 deletions jest.env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* eslint-disable */
process.env.LOG_LEVEL = 'info';
process.env.ENV = 'local';
process.env.REGION = 'eu-local-1';
9 changes: 0 additions & 9 deletions package-empty.json

This file was deleted.

97 changes: 44 additions & 53 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,73 +3,64 @@
"version": "0.1.0",
"license": "MIT",
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/hastobegood/crypto-bot-bloodhound.git"
},
"engines": {
"node": "^14"
"node": "16"
},
"type": "module",
"scripts": {
"clean": "rm -rf dist .aws-sam reports",
"prepare": "yarn husky install",
"clean": "rm -rf .aws-sam out reports",
"build": "yarn tsc",
"bundle": "yarn webpack",
"bundle:analyze": "yarn webpack && yarn webpack-bundle-analyzer dist/webpack/stats.json",
"bundle": "sam build --parallel --beta-features",
"test": "yarn jest",
"test:coverage": "yarn jest --collectCoverage",
"lint": "yarn eslint . --ext .ts",
"lint:fix": "yarn eslint . --ext .ts --fix",
"lint:report": "yarn eslint . --ext .ts --format json -o reports/eslint-report.json ",
"deploy:prod": "sam build && sam deploy --config-env prod"
"lint": "yarn eslint . --ext .ts,.js",
"lint:fix": "yarn eslint . --ext .ts,.js --fix",
"lint:report": "yarn eslint . --ext .ts,.js --format json -o reports/eslint-report.json",
"deploy:prod": "sam deploy --config-env prod --tags Environment=prod Application=CryptoBotBloodhound"
},
"dependencies": {
"@aws-sdk/client-dynamodb": "^3.46.0",
"@aws-sdk/client-eventbridge": "^3.46.0",
"@aws-sdk/client-secrets-manager": "^3.46.0",
"@aws-sdk/client-sns": "^3.46.0",
"@aws-sdk/lib-dynamodb": "^3.46.0",
"@hastobegood/crypto-clients-binance": "^0.2.3",
"aws-xray-sdk-core": "^3.3.4",
"axios": "^0.24.0",
"keyv": "^4.0.5",
"lodash": "^4.17.21",
"node-html-parser": "^5.2.0",
"pino": "^7.6.3",
"serialize-error": "^9.0.0",
"source-map-support": "^0.5.21",
"uuid": "^8.3.2"
"@aws-sdk/client-dynamodb": "^3.105.0",
"@aws-sdk/client-eventbridge": "^3.105.0",
"@aws-sdk/client-secrets-manager": "^3.105.0",
"@aws-sdk/client-sns": "^3.105.0",
"@aws-sdk/lib-dynamodb": "^3.105.0",
"@hastobegood/crypto-bot-artillery": "^0.17.0",
"aws-xray-sdk-core": "^3.3.6",
"axios": "^0.27.2",
"lodash-es": "^4.17.21",
"node-html-parser": "^5.3.3",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/aws-lambda": "^8.10.89",
"@types/copy-webpack-plugin": "^8.0.1",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^27.0.3",
"@types/jsdom": "^16.2.13",
"@types/keyv": "^3.1.3",
"@types/lodash": "^4.14.178",
"@types/node": "^14.18.0",
"@types/pino": "^7.0.5",
"@types/randomstring": "^1.1.7",
"@types/aws-lambda": "^8.10.99",
"@types/jest": "^28.1.1",
"@types/lodash-es": "^4.17.6",
"@types/node": "16",
"@types/randomstring": "^1.1.8",
"@types/source-map-support": "^0.5.4",
"@types/uuid": "^8.3.4",
"@types/webpack-bundle-analyzer": "^4.4.1",
"@types/webpack-node-externals": "^2.5.3",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.9.1",
"copy-webpack-plugin": "^10.0.0",
"eslint": "^8.2.0",
"eslint-config-prettier": "^8.3.0",
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/parser": "^5.27.1",
"esbuild": "^0.14.43",
"eslint": "^8.17.0",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^2.7.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.0.0",
"fs-extra": "^10.0.0",
"jest": "^27.3.1",
"eslint-plugin-promise": "^6.0.0",
"husky": "^8.0.1",
"jest": "^28.1.1",
"jest-sonar-reporter": "^2.0.0",
"mockdate": "^3.0.5",
"prettier": "^2.5.1",
"randomstring": "^1.2.1",
"ts-jest": "^27.0.7",
"ts-loader": "^9.2.6",
"ts-node": "^10.3.0",
"typescript": "^4.5.2",
"webpack": "^5.64.1",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.9.1",
"webpack-node-externals": "^3.0.0"
"prettier": "^2.6.2",
"randomstring": "^1.2.2",
"ts-jest": "^28.0.4",
"ts-node": "^10.8.1",
"typescript": "^4.7.3"
},
"jestSonar": {
"reportPath": "reports"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { logger } from '../../configuration/log/logger';
import { logger } from '@hastobegood/crypto-bot-artillery/common';
import { EventBridgeEvent } from 'aws-lambda';
import { CoinListingEvent } from '../../infrastructure/coin-listing/eb-coin-listing-publisher';
import { NotifyCoinListingService } from '../../domain/coin-listing/notify-coin-listing-service';

import { CoinListing } from '../../domain/coin-listing/model/coin-listing';
import { NotifyCoinListingService } from '../../domain/coin-listing/notify-coin-listing-service';
import { CoinListingEvent } from '../../infrastructure/coin-listing/eb-coin-listing-publisher';

export class NotifyCoinListingRecordConsumer {
constructor(private notifyCoinListingService: NotifyCoinListingService) {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { logger } from '../../configuration/log/logger';
import { ScanCoinListingService } from '../../domain/coin-listing/scan-coin-listing-service';
import { logger } from '@hastobegood/crypto-bot-artillery/common';

import { CoinListingExchange } from '../../domain/coin-listing/model/coin-listing';
import { ScanCoinListingService } from '../../domain/coin-listing/scan-coin-listing-service';

const exchanges: CoinListingExchange[] = ['Binance'];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { logger } from '../../configuration/log/logger';
import { logger } from '@hastobegood/crypto-bot-artillery/common';
import { EventBridgeEvent } from 'aws-lambda';
import { CoinListingEvent } from '../../infrastructure/coin-listing/eb-coin-listing-publisher';

import { CoinListing } from '../../domain/coin-listing/model/coin-listing';
import { TradeCoinListingService } from '../../domain/coin-listing/trade-coin-listing-service';
import { CoinListingEvent } from '../../infrastructure/coin-listing/eb-coin-listing-publisher';

export class TradeCoinListingRecordConsumer {
constructor(private tradeCoinListingService: TradeCoinListingService) {}
Expand Down
6 changes: 3 additions & 3 deletions src/code/configuration/aws/dynamodb.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { captureAWSv3Client } from 'aws-xray-sdk-core';
import { DynamoDBDocumentClient, TranslateConfig } from '@aws-sdk/lib-dynamodb';
import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
import { DynamoDBDocumentClient, TranslateConfig } from '@aws-sdk/lib-dynamodb';
import { captureAWSv3Client } from 'aws-xray-sdk-core';

const translateConfig: TranslateConfig = {
marshallOptions: {
Expand All @@ -12,7 +12,7 @@ const translateConfig: TranslateConfig = {

let client = DynamoDBDocumentClient.from(new DynamoDBClient({ region: process.env.REGION }), translateConfig);
if (process.env.TRACING) {
client = captureAWSv3Client(client);
client = captureAWSv3Client(client as any);
}

export const ddbClient = client;
Loading