Browse Source

fix: typescript setup

Karol Sójko 3 years ago
parent
commit
6e1e6fa291

+ 0 - 5
packages/scheduler/.eslintrc

@@ -1,5 +0,0 @@
-{
-  "extends": [
-    "../../node_modules/@standardnotes/config/src/.eslintrc"
-  ]
-}

+ 5 - 3
packages/scheduler/package.json

@@ -24,13 +24,16 @@
   "dependencies": {
     "@newrelic/native-metrics": "7.0.2",
     "@newrelic/winston-enricher": "^2.1.0",
+    "@standardnotes/common": "^1.23.0",
     "@standardnotes/domain-events": "^2.32.0",
     "@standardnotes/domain-events-infra": "^1.5.0",
     "@standardnotes/scheduler": "^1.1.0",
     "@standardnotes/time": "^1.7.0",
+    "aws-sdk": "^2.1158.0",
+    "dayjs": "^1.11.3",
     "dotenv": "8.2.0",
     "inversify": "5.0.5",
-    "ioredis": "^4.28.3",
+    "ioredis": "^5.0.6",
     "mysql2": "^2.3.3",
     "newrelic": "8.6.0",
     "reflect-metadata": "0.1.13",
@@ -38,12 +41,11 @@
     "winston": "3.3.3"
   },
   "devDependencies": {
-    "@standardnotes/config": "^2.4.3",
     "@types/ioredis": "^4.28.10",
     "@types/newrelic": "^7.0.2"
   },
   "jest": {
-    "preset": "../../node_modules/@standardnotes/config/src/jest.json",
+    "preset": "../../.yarn/unplugged/@standardnotes-config-npm-2.4.3-f16699e480/node_modules/@standardnotes/config/src/jest.json",
     "coveragePathIgnorePatterns": [
       "/node_modules/",
       "/Bootstrap/"

+ 3 - 3
packages/scheduler/src/Bootstrap/Container.ts

@@ -1,5 +1,5 @@
 import * as winston from 'winston'
-import * as IORedis from 'ioredis'
+import Redis from 'ioredis'
 import * as AWS from 'aws-sdk'
 import { Container } from 'inversify'
 import {
@@ -53,9 +53,9 @@ export class ContainerConfigLoader {
     const isRedisInClusterMode = redisUrl.indexOf(',') > 0
     let redis
     if (isRedisInClusterMode) {
-      redis = new IORedis.Cluster(redisUrl.split(','))
+      redis = new Redis.Cluster(redisUrl.split(','))
     } else {
-      redis = new IORedis(redisUrl)
+      redis = new Redis(redisUrl)
     }
 
     container.bind(TYPES.Redis).toConstantValue(redis)

+ 5 - 4
packages/scheduler/tsconfig.json

@@ -1,12 +1,13 @@
 {
-  "extends": "../../node_modules/@standardnotes/config/src/tsconfig.json",
+  "extends": "../../tsconfig.json",
   "compilerOptions": {
-    "target": "esnext",
-    "outDir": "dist"
+    "composite": true,
+    "outDir": "./dist",
   },
   "include": [
     "src/**/*",
     "bin/**/*",
     "migrations/**/*",
-  ]
+  ],
+  "references": []
 }

+ 29 - 0
tsconfig.json

@@ -0,0 +1,29 @@
+{
+  "compilerOptions": {
+    "alwaysStrict": true,
+    "declaration": true,
+    "incremental": true,
+    "emitDecoratorMetadata": true,
+    "experimentalDecorators": true,
+    "module": "commonjs",
+    "moduleResolution": "node",
+    "noFallthroughCasesInSwitch": true,
+    "noImplicitAny": true,
+    "noImplicitOverride": true,
+    "noImplicitReturns": true,
+    "noImplicitThis": true,
+    "noUnusedLocals": true,
+    "noUnusedParameters": true,
+    "removeComments": false,
+    "skipLibCheck": true,
+    "strict": true,
+    "strictNullChecks": true,
+    "target": "es2022",
+  },
+  "exclude": ["**/*.spec.ts", "dist", "test-setup.ts"],
+  "references": [
+    {
+      "path": "./packages/scheduler"
+    }
+  ]
+}