From bea92dc5d5686eb964a4bee073c7af262efb42d7 Mon Sep 17 00:00:00 2001
From: Berend Sliedrecht <berend@animo.id>
Date: Mon, 27 Nov 2023 11:57:01 +0100
Subject: [PATCH] chore: move more to root of project setup

Signed-off-by: Berend Sliedrecht <berend@animo.id>
---
 apps/attestation-manager/.swcrc => .swcrc     |  2 +-
 apps/attestation-manager/jest.config.js       |  5 ++---
 apps/attestation-manager/nest-cli.json        | 11 ++++++----
 apps/attestation-manager/tsconfig.build.json  |  9 ++-------
 .../tsconfig.production.json                  |  9 ++-------
 apps/connection-manager/.swcrc                | 20 -------------------
 apps/connection-manager/jest.config.js        |  5 ++---
 apps/connection-manager/nest-cli.json         | 11 ++++++----
 apps/connection-manager/tsconfig.build.json   |  9 ++-------
 .../tsconfig.production.json                  |  9 ++-------
 apps/proof-manager/.swcrc                     | 20 -------------------
 apps/proof-manager/jest.config.js             |  5 ++---
 apps/proof-manager/nest-cli.json              | 11 ++++++----
 apps/proof-manager/tsconfig.build.json        |  9 +++++++--
 apps/proof-manager/tsconfig.production.json   |  9 ++-------
 apps/shared/.swcrc                            | 20 -------------------
 apps/shared/jest.config.js                    |  5 ++---
 apps/shared/nest-cli.json                     |  9 +++++++--
 apps/shared/tsconfig.build.json               |  9 ++-------
 apps/shared/tsconfig.production.json          |  9 ++-------
 apps/ssi-abstraction/.swcrc                   | 20 -------------------
 apps/ssi-abstraction/jest.config.js           |  5 ++---
 apps/ssi-abstraction/nest-cli.json            |  9 +++++++--
 apps/ssi-abstraction/tsconfig.build.json      |  9 ++-------
 apps/ssi-abstraction/tsconfig.production.json |  9 ++-------
 package.json                                  |  2 +-
 pnpm-lock.yaml                                |  4 ++--
 tsconfig.build.json                           | 10 ++++++++++
 tsconfig.production.json                      |  9 +++++++++
 29 files changed, 93 insertions(+), 180 deletions(-)
 rename apps/attestation-manager/.swcrc => .swcrc (88%)
 delete mode 100644 apps/connection-manager/.swcrc
 delete mode 100644 apps/proof-manager/.swcrc
 delete mode 100644 apps/shared/.swcrc
 delete mode 100644 apps/ssi-abstraction/.swcrc
 create mode 100644 tsconfig.build.json
 create mode 100644 tsconfig.production.json

diff --git a/apps/attestation-manager/.swcrc b/.swcrc
similarity index 88%
rename from apps/attestation-manager/.swcrc
rename to .swcrc
index f0831e4..dc58ed6 100644
--- a/apps/attestation-manager/.swcrc
+++ b/.swcrc
@@ -16,5 +16,5 @@
     "type": "es6"
   },
   "sourceMaps": true,
-  "exclude": [".spec.ts", ".e2e-spec.ts"]
+  "exclude": ["__tests__/.*.ts"]
 }
diff --git a/apps/attestation-manager/jest.config.js b/apps/attestation-manager/jest.config.js
index 1b2ee91..d8d3f8c 100644
--- a/apps/attestation-manager/jest.config.js
+++ b/apps/attestation-manager/jest.config.js
@@ -1,9 +1,8 @@
-/** @type {import('jest').Config} */
-
 import { readFileSync } from 'node:fs';
 
-const swcConfig = JSON.parse(readFileSync('./.swcrc', 'utf8'));
+const swcConfig = JSON.parse(readFileSync('../../.swcrc', 'utf8'));
 
+/** @type {import('jest').Config} */
 export default {
   moduleFileExtensions: ['js', 'ts'],
   testEnvironment: 'node',
diff --git a/apps/attestation-manager/nest-cli.json b/apps/attestation-manager/nest-cli.json
index 681ff0f..89bab11 100644
--- a/apps/attestation-manager/nest-cli.json
+++ b/apps/attestation-manager/nest-cli.json
@@ -1,10 +1,13 @@
 {
+  "$schema": "https://json.schemastore.org/nest-cli",
   "collection": "@nestjs/schematics",
   "sourceRoot": "src",
   "compilerOptions": {
-    "builder": "swc",
-    "typeCheck": true,
-
-    "assets": ["**/*.prisma"]
+    "builder": {
+      "type": "swc",
+      "options": {
+        "swcrcPath": "../../.swcrc"
+      }
+    }
   }
 }
diff --git a/apps/attestation-manager/tsconfig.build.json b/apps/attestation-manager/tsconfig.build.json
index b7dacb2..3e5ab43 100644
--- a/apps/attestation-manager/tsconfig.build.json
+++ b/apps/attestation-manager/tsconfig.build.json
@@ -1,14 +1,9 @@
 {
-  "extends": "./tsconfig.json",
+  "extends": "../../tsconfig.build.json",
   "compilerOptions": {
-    "removeComments": false,
-    "declaration": true,
-    "sourceMap": true,
-
-    "incremental": true,
     "baseUrl": ".",
     "outDir": "./dist",
     "rootDir": "./src"
   },
-  "exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
+  "exclude": ["node_modules", "**/test", "**/dist", "**/*spec.ts"]
 }
diff --git a/apps/attestation-manager/tsconfig.production.json b/apps/attestation-manager/tsconfig.production.json
index 0f476e0..45f85df 100644
--- a/apps/attestation-manager/tsconfig.production.json
+++ b/apps/attestation-manager/tsconfig.production.json
@@ -1,14 +1,9 @@
 {
-  "extends": "./tsconfig.json",
+  "extends": "../../tsconfig.production.json",
   "compilerOptions": {
-    "composite": false,
-    "removeComments": true,
-    "declaration": false,
-    "sourceMap": false,
-
     "baseUrl": ".",
     "outDir": "./dist",
     "rootDir": "./src"
   },
-  "exclude": ["node_modules", "dist", "**/*spec.ts"]
+  "exclude": ["node_modules", "**/test", "**/dist", "**/*spec.ts"]
 }
diff --git a/apps/connection-manager/.swcrc b/apps/connection-manager/.swcrc
deleted file mode 100644
index f0831e4..0000000
--- a/apps/connection-manager/.swcrc
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "jsc": {
-    "preserveAllComments": true,
-    "parser": {
-      "syntax": "typescript",
-      "tsx": false,
-      "decorators": true
-    },
-    "transform": {
-      "legacyDecorator": true,
-      "decoratorMetadata": true
-    },
-    "target": "es2022"
-  },
-  "module": {
-    "type": "es6"
-  },
-  "sourceMaps": true,
-  "exclude": [".spec.ts", ".e2e-spec.ts"]
-}
diff --git a/apps/connection-manager/jest.config.js b/apps/connection-manager/jest.config.js
index 1b2ee91..d8d3f8c 100644
--- a/apps/connection-manager/jest.config.js
+++ b/apps/connection-manager/jest.config.js
@@ -1,9 +1,8 @@
-/** @type {import('jest').Config} */
-
 import { readFileSync } from 'node:fs';
 
-const swcConfig = JSON.parse(readFileSync('./.swcrc', 'utf8'));
+const swcConfig = JSON.parse(readFileSync('../../.swcrc', 'utf8'));
 
+/** @type {import('jest').Config} */
 export default {
   moduleFileExtensions: ['js', 'ts'],
   testEnvironment: 'node',
diff --git a/apps/connection-manager/nest-cli.json b/apps/connection-manager/nest-cli.json
index 681ff0f..89bab11 100644
--- a/apps/connection-manager/nest-cli.json
+++ b/apps/connection-manager/nest-cli.json
@@ -1,10 +1,13 @@
 {
+  "$schema": "https://json.schemastore.org/nest-cli",
   "collection": "@nestjs/schematics",
   "sourceRoot": "src",
   "compilerOptions": {
-    "builder": "swc",
-    "typeCheck": true,
-
-    "assets": ["**/*.prisma"]
+    "builder": {
+      "type": "swc",
+      "options": {
+        "swcrcPath": "../../.swcrc"
+      }
+    }
   }
 }
diff --git a/apps/connection-manager/tsconfig.build.json b/apps/connection-manager/tsconfig.build.json
index b7dacb2..3e5ab43 100644
--- a/apps/connection-manager/tsconfig.build.json
+++ b/apps/connection-manager/tsconfig.build.json
@@ -1,14 +1,9 @@
 {
-  "extends": "./tsconfig.json",
+  "extends": "../../tsconfig.build.json",
   "compilerOptions": {
-    "removeComments": false,
-    "declaration": true,
-    "sourceMap": true,
-
-    "incremental": true,
     "baseUrl": ".",
     "outDir": "./dist",
     "rootDir": "./src"
   },
-  "exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
+  "exclude": ["node_modules", "**/test", "**/dist", "**/*spec.ts"]
 }
diff --git a/apps/connection-manager/tsconfig.production.json b/apps/connection-manager/tsconfig.production.json
index 0f476e0..a18350c 100644
--- a/apps/connection-manager/tsconfig.production.json
+++ b/apps/connection-manager/tsconfig.production.json
@@ -1,14 +1,9 @@
 {
-  "extends": "./tsconfig.json",
+  "extends": "../../tsconfig.production.json",
   "compilerOptions": {
-    "composite": false,
-    "removeComments": true,
-    "declaration": false,
-    "sourceMap": false,
-
     "baseUrl": ".",
     "outDir": "./dist",
     "rootDir": "./src"
   },
-  "exclude": ["node_modules", "dist", "**/*spec.ts"]
+  "exclude": ["node_modules", "**/test" ,"**/dist", "**/*spec.ts"]
 }
diff --git a/apps/proof-manager/.swcrc b/apps/proof-manager/.swcrc
deleted file mode 100644
index f0831e4..0000000
--- a/apps/proof-manager/.swcrc
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "jsc": {
-    "preserveAllComments": true,
-    "parser": {
-      "syntax": "typescript",
-      "tsx": false,
-      "decorators": true
-    },
-    "transform": {
-      "legacyDecorator": true,
-      "decoratorMetadata": true
-    },
-    "target": "es2022"
-  },
-  "module": {
-    "type": "es6"
-  },
-  "sourceMaps": true,
-  "exclude": [".spec.ts", ".e2e-spec.ts"]
-}
diff --git a/apps/proof-manager/jest.config.js b/apps/proof-manager/jest.config.js
index 1b2ee91..d8d3f8c 100644
--- a/apps/proof-manager/jest.config.js
+++ b/apps/proof-manager/jest.config.js
@@ -1,9 +1,8 @@
-/** @type {import('jest').Config} */
-
 import { readFileSync } from 'node:fs';
 
-const swcConfig = JSON.parse(readFileSync('./.swcrc', 'utf8'));
+const swcConfig = JSON.parse(readFileSync('../../.swcrc', 'utf8'));
 
+/** @type {import('jest').Config} */
 export default {
   moduleFileExtensions: ['js', 'ts'],
   testEnvironment: 'node',
diff --git a/apps/proof-manager/nest-cli.json b/apps/proof-manager/nest-cli.json
index 681ff0f..89bab11 100644
--- a/apps/proof-manager/nest-cli.json
+++ b/apps/proof-manager/nest-cli.json
@@ -1,10 +1,13 @@
 {
+  "$schema": "https://json.schemastore.org/nest-cli",
   "collection": "@nestjs/schematics",
   "sourceRoot": "src",
   "compilerOptions": {
-    "builder": "swc",
-    "typeCheck": true,
-
-    "assets": ["**/*.prisma"]
+    "builder": {
+      "type": "swc",
+      "options": {
+        "swcrcPath": "../../.swcrc"
+      }
+    }
   }
 }
diff --git a/apps/proof-manager/tsconfig.build.json b/apps/proof-manager/tsconfig.build.json
index 64f86c6..3e5ab43 100644
--- a/apps/proof-manager/tsconfig.build.json
+++ b/apps/proof-manager/tsconfig.build.json
@@ -1,4 +1,9 @@
 {
-  "extends": "./tsconfig.json",
-  "exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
+  "extends": "../../tsconfig.build.json",
+  "compilerOptions": {
+    "baseUrl": ".",
+    "outDir": "./dist",
+    "rootDir": "./src"
+  },
+  "exclude": ["node_modules", "**/test", "**/dist", "**/*spec.ts"]
 }
diff --git a/apps/proof-manager/tsconfig.production.json b/apps/proof-manager/tsconfig.production.json
index 0f476e0..45f85df 100644
--- a/apps/proof-manager/tsconfig.production.json
+++ b/apps/proof-manager/tsconfig.production.json
@@ -1,14 +1,9 @@
 {
-  "extends": "./tsconfig.json",
+  "extends": "../../tsconfig.production.json",
   "compilerOptions": {
-    "composite": false,
-    "removeComments": true,
-    "declaration": false,
-    "sourceMap": false,
-
     "baseUrl": ".",
     "outDir": "./dist",
     "rootDir": "./src"
   },
-  "exclude": ["node_modules", "dist", "**/*spec.ts"]
+  "exclude": ["node_modules", "**/test", "**/dist", "**/*spec.ts"]
 }
diff --git a/apps/shared/.swcrc b/apps/shared/.swcrc
deleted file mode 100644
index f0831e4..0000000
--- a/apps/shared/.swcrc
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "jsc": {
-    "preserveAllComments": true,
-    "parser": {
-      "syntax": "typescript",
-      "tsx": false,
-      "decorators": true
-    },
-    "transform": {
-      "legacyDecorator": true,
-      "decoratorMetadata": true
-    },
-    "target": "es2022"
-  },
-  "module": {
-    "type": "es6"
-  },
-  "sourceMaps": true,
-  "exclude": [".spec.ts", ".e2e-spec.ts"]
-}
diff --git a/apps/shared/jest.config.js b/apps/shared/jest.config.js
index 1b2ee91..d8d3f8c 100644
--- a/apps/shared/jest.config.js
+++ b/apps/shared/jest.config.js
@@ -1,9 +1,8 @@
-/** @type {import('jest').Config} */
-
 import { readFileSync } from 'node:fs';
 
-const swcConfig = JSON.parse(readFileSync('./.swcrc', 'utf8'));
+const swcConfig = JSON.parse(readFileSync('../../.swcrc', 'utf8'));
 
+/** @type {import('jest').Config} */
 export default {
   moduleFileExtensions: ['js', 'ts'],
   testEnvironment: 'node',
diff --git a/apps/shared/nest-cli.json b/apps/shared/nest-cli.json
index 0a947a5..89bab11 100644
--- a/apps/shared/nest-cli.json
+++ b/apps/shared/nest-cli.json
@@ -1,8 +1,13 @@
 {
+  "$schema": "https://json.schemastore.org/nest-cli",
   "collection": "@nestjs/schematics",
   "sourceRoot": "src",
   "compilerOptions": {
-    "builder": "swc",
-    "typeCheck": true
+    "builder": {
+      "type": "swc",
+      "options": {
+        "swcrcPath": "../../.swcrc"
+      }
+    }
   }
 }
diff --git a/apps/shared/tsconfig.build.json b/apps/shared/tsconfig.build.json
index b7dacb2..3e5ab43 100644
--- a/apps/shared/tsconfig.build.json
+++ b/apps/shared/tsconfig.build.json
@@ -1,14 +1,9 @@
 {
-  "extends": "./tsconfig.json",
+  "extends": "../../tsconfig.build.json",
   "compilerOptions": {
-    "removeComments": false,
-    "declaration": true,
-    "sourceMap": true,
-
-    "incremental": true,
     "baseUrl": ".",
     "outDir": "./dist",
     "rootDir": "./src"
   },
-  "exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
+  "exclude": ["node_modules", "**/test", "**/dist", "**/*spec.ts"]
 }
diff --git a/apps/shared/tsconfig.production.json b/apps/shared/tsconfig.production.json
index 0f476e0..45f85df 100644
--- a/apps/shared/tsconfig.production.json
+++ b/apps/shared/tsconfig.production.json
@@ -1,14 +1,9 @@
 {
-  "extends": "./tsconfig.json",
+  "extends": "../../tsconfig.production.json",
   "compilerOptions": {
-    "composite": false,
-    "removeComments": true,
-    "declaration": false,
-    "sourceMap": false,
-
     "baseUrl": ".",
     "outDir": "./dist",
     "rootDir": "./src"
   },
-  "exclude": ["node_modules", "dist", "**/*spec.ts"]
+  "exclude": ["node_modules", "**/test", "**/dist", "**/*spec.ts"]
 }
diff --git a/apps/ssi-abstraction/.swcrc b/apps/ssi-abstraction/.swcrc
deleted file mode 100644
index f0831e4..0000000
--- a/apps/ssi-abstraction/.swcrc
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "jsc": {
-    "preserveAllComments": true,
-    "parser": {
-      "syntax": "typescript",
-      "tsx": false,
-      "decorators": true
-    },
-    "transform": {
-      "legacyDecorator": true,
-      "decoratorMetadata": true
-    },
-    "target": "es2022"
-  },
-  "module": {
-    "type": "es6"
-  },
-  "sourceMaps": true,
-  "exclude": [".spec.ts", ".e2e-spec.ts"]
-}
diff --git a/apps/ssi-abstraction/jest.config.js b/apps/ssi-abstraction/jest.config.js
index 1b2ee91..d8d3f8c 100644
--- a/apps/ssi-abstraction/jest.config.js
+++ b/apps/ssi-abstraction/jest.config.js
@@ -1,9 +1,8 @@
-/** @type {import('jest').Config} */
-
 import { readFileSync } from 'node:fs';
 
-const swcConfig = JSON.parse(readFileSync('./.swcrc', 'utf8'));
+const swcConfig = JSON.parse(readFileSync('../../.swcrc', 'utf8'));
 
+/** @type {import('jest').Config} */
 export default {
   moduleFileExtensions: ['js', 'ts'],
   testEnvironment: 'node',
diff --git a/apps/ssi-abstraction/nest-cli.json b/apps/ssi-abstraction/nest-cli.json
index 0a947a5..89bab11 100644
--- a/apps/ssi-abstraction/nest-cli.json
+++ b/apps/ssi-abstraction/nest-cli.json
@@ -1,8 +1,13 @@
 {
+  "$schema": "https://json.schemastore.org/nest-cli",
   "collection": "@nestjs/schematics",
   "sourceRoot": "src",
   "compilerOptions": {
-    "builder": "swc",
-    "typeCheck": true
+    "builder": {
+      "type": "swc",
+      "options": {
+        "swcrcPath": "../../.swcrc"
+      }
+    }
   }
 }
diff --git a/apps/ssi-abstraction/tsconfig.build.json b/apps/ssi-abstraction/tsconfig.build.json
index b7dacb2..3e5ab43 100644
--- a/apps/ssi-abstraction/tsconfig.build.json
+++ b/apps/ssi-abstraction/tsconfig.build.json
@@ -1,14 +1,9 @@
 {
-  "extends": "./tsconfig.json",
+  "extends": "../../tsconfig.build.json",
   "compilerOptions": {
-    "removeComments": false,
-    "declaration": true,
-    "sourceMap": true,
-
-    "incremental": true,
     "baseUrl": ".",
     "outDir": "./dist",
     "rootDir": "./src"
   },
-  "exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
+  "exclude": ["node_modules", "**/test", "**/dist", "**/*spec.ts"]
 }
diff --git a/apps/ssi-abstraction/tsconfig.production.json b/apps/ssi-abstraction/tsconfig.production.json
index 0f476e0..45f85df 100644
--- a/apps/ssi-abstraction/tsconfig.production.json
+++ b/apps/ssi-abstraction/tsconfig.production.json
@@ -1,14 +1,9 @@
 {
-  "extends": "./tsconfig.json",
+  "extends": "../../tsconfig.production.json",
   "compilerOptions": {
-    "composite": false,
-    "removeComments": true,
-    "declaration": false,
-    "sourceMap": false,
-
     "baseUrl": ".",
     "outDir": "./dist",
     "rootDir": "./src"
   },
-  "exclude": ["node_modules", "dist", "**/*spec.ts"]
+  "exclude": ["node_modules", "**/test", "**/dist", "**/*spec.ts"]
 }
diff --git a/package.json b/package.json
index 973e734..2c3442e 100644
--- a/package.json
+++ b/package.json
@@ -26,7 +26,7 @@
     "eslint-import-resolver-typescript": "^3.6.1",
     "eslint-plugin-import": "^2.29.0",
     "eslint-plugin-prettier": "^5.0.1",
-    "eslint-plugin-workspaces": "^0.9.0",
+    "eslint-plugin-workspaces": "^0.10.0",
     "husky": "^8.0.0",
     "lint-staged": "^15.1.0",
     "prettier": "^3.1.0"
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 33d3924..bbea83a 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -9,10 +9,10 @@ importers:
   .:
     devDependencies:
       '@commitlint/cli':
-        specifier: ^18.4.3
+        specifier: ^18.4.2
         version: 18.4.3(typescript@5.3.2)
       '@commitlint/config-conventional':
-        specifier: ^18.4.3
+        specifier: ^18.4.2
         version: 18.4.3
       '@typescript-eslint/eslint-plugin':
         specifier: ^6.12.0
diff --git a/tsconfig.build.json b/tsconfig.build.json
new file mode 100644
index 0000000..8df0a4a
--- /dev/null
+++ b/tsconfig.build.json
@@ -0,0 +1,10 @@
+{
+  "extends": "./tsconfig.json",
+  "compilerOptions": {
+    "removeComments": false,
+    "declaration": true,
+    "sourceMap": true,
+    "incremental": true
+  },
+  "exclude": ["node_modules", "**/test", "**/dist", "**/__tests__", "**/*.spec.ts"]
+}
diff --git a/tsconfig.production.json b/tsconfig.production.json
new file mode 100644
index 0000000..8cd30fa
--- /dev/null
+++ b/tsconfig.production.json
@@ -0,0 +1,9 @@
+{
+  "extends": "./tsconfig.build.json",
+  "compilerOptions": {
+    "composite": false,
+    "removeComments": true,
+    "declaration": false,
+    "sourceMap": false
+  }
+}
-- 
GitLab