Skip to content

Commit 70d3f55

Browse files
johnny/VIDSOL-296-migrating-to-nx
1 parent aacc903 commit 70d3f55

File tree

124 files changed

+11451
-4737
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+11451
-4737
lines changed

.eslintrc

Lines changed: 0 additions & 102 deletions
This file was deleted.

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
- name: Run unit tests
109109
if: steps.check-skip-ci.outputs.result == 'false'
110110
run: |
111-
yarn test
111+
NX_DAEMON=false yarn test
112112
113113
- name: SonarCloud Scan On PR
114114
if: steps.check-skip-ci.outputs.result == 'false' && github.event.pull_request.head.repo.fork == false

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,11 @@ build
5252

5353
vcr.yml
5454
.scannerwork/
55+
56+
.nx/cache
57+
.nx/workspace-data
58+
.cursor/rules/nx-rules.mdc
59+
.github/instructions/nx.instructions.md
60+
vite.config.*.timestamp*
61+
vitest.config.*.timestamp*
62+
*.tsbuildinfo

.husky/pre-commit

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/env sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
4-
# Exit on error and unset variables
52
set -eu
63

4+
# skip on CI or if deps aren't installed yet
5+
[ -n "${CI:-}" ] && exit 0
6+
[ ! -f node_modules/.bin/yarn ] && exit 0
7+
8+
# Run your quality checks
79
yarn --silent quality-check

.prettierignore

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
# some individual files
2-
.eslintrc.cjs
3-
*.json
4-
*.md
1+
# Generated or irrelevant files
52
*.d.ts
3+
*.log
4+
5+
# Documentation [todo]: We should be able to use prettier for this to ensure consistent formatting
6+
*.md
67

7-
# some directories
8-
*/dist/
9-
*/node_modules/
8+
# Build and dependency folders
9+
dist/
10+
node_modules/
11+
coverage/
12+
.nx/
13+
.turbo/
14+
15+
# Public compiled assets
1016
public/js/
17+

backend/eslint.config.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import globals from 'globals';
2+
import baseConfig from '../eslint.config.mjs';
3+
4+
export default [
5+
{
6+
...baseConfig,
7+
8+
files: ['**/*.{ts,tsx,js,jsx}'],
9+
languageOptions: {
10+
globals: globals.node,
11+
},
12+
},
13+
];

backend/helpers/config.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@ const loadConfig = (): Config => {
2626
throw new Error('Missing config values for Vonage');
2727
}
2828

29-
return {
30-
...feedbackConfig,
31-
applicationId,
32-
privateKey,
33-
provider: 'vonage',
34-
};
29+
return { ...feedbackConfig, applicationId, privateKey, provider: 'vonage' };
3530
}
3631
if (provider === 'opentok') {
3732
const apiKey = process.env.OT_API_KEY ?? '';
@@ -41,12 +36,7 @@ const loadConfig = (): Config => {
4136
throw new Error('Missing config values for OpenTok');
4237
}
4338

44-
return {
45-
...feedbackConfig,
46-
apiKey,
47-
apiSecret,
48-
provider: 'opentok',
49-
};
39+
return { ...feedbackConfig, apiKey, apiSecret, provider: 'opentok' };
5040
}
5141
throw new Error('Unknown video service provider');
5242
};

backend/package.json

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,7 @@
44
"description": "Express-based backend with authenticated routes.",
55
"main": "index.js",
66
"type": "module",
7-
"scripts": {
8-
"dev": "nodemon --watch . --ext ts,tsx,json --ignore dist --exec \"sh -c 'yarn ts-check && node --import tsx index.ts'\"",
9-
"start": "node --import tsx index.ts",
10-
"debug": "nodemon --watch . --ext ts,tsx,json --ignore dist --exec \"sh -c 'yarn ts-check && node --inspect --import tsx index.ts'\"",
11-
"test": "NODE_OPTIONS=\"--experimental-vm-modules\" jest --maxWorkers=1 --coverage",
12-
"test:watch": "yarn test --watch",
13-
"ts-check": "tsc --noEmit -p tsconfig.json --pretty true"
14-
},
157
"author": "",
168
"license": "MIT",
17-
"dependencies": {
18-
"@vonage/auth": "^1.11.0",
19-
"@vonage/server-sdk": "^3.16.0",
20-
"@vonage/vcr-sdk": "^1.3.0",
21-
"@vonage/video": "^1.23.2",
22-
"axios": "^1.12.0",
23-
"body-parser": "^1.20.3",
24-
"cors": "^2.8.5",
25-
"dotenv": "^16.0.3",
26-
"express": "^4.21.2",
27-
"form-data": "^4.0.4",
28-
"opentok": "^2.16.0",
29-
"opentok-jwt": "^0.1.5",
30-
"tsx": "^4.10.5",
31-
"validator": "13.15.15"
32-
},
33-
"devDependencies": {
34-
"@jest/globals": "^29.7.0",
35-
"@types/body-parser": "^1.19.2",
36-
"@types/cors": "^2.8.13",
37-
"@types/express": "^4.17.17",
38-
"@types/jest": "^29.5.12",
39-
"@types/node": "^20.12.7",
40-
"@types/opentok": "^2.14.0",
41-
"@types/supertest": "^6.0.2",
42-
"@types/validator": "^13.15.2",
43-
"jest": "^29.7.0",
44-
"nodemon": "^3.1.10",
45-
"supertest": "^7.0.0",
46-
"ts-jest": "^29.1.2"
47-
}
9+
"private": true
4810
}

backend/project.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"$schema": "../node_modules/nx/schemas/project-schema.json",
3+
"name": "backend",
4+
"projectType": "application",
5+
"root": "backend",
6+
"sourceRoot": "backend",
7+
"targets": {
8+
"serve": {
9+
"executor": "nx:run-commands",
10+
"options": {
11+
"cwd": "backend",
12+
"command": "nodemon --watch . --ext ts,tsx,json --ignore dist --exec \"sh -c 'tsc --noEmit -p tsconfig.json --pretty true && node --import tsx index.ts'\""
13+
}
14+
},
15+
"start": {
16+
"executor": "nx:run-commands",
17+
"options": {
18+
"cwd": "backend",
19+
"command": "node --import tsx index.ts"
20+
}
21+
},
22+
"debug": {
23+
"executor": "nx:run-commands",
24+
"options": {
25+
"cwd": "backend",
26+
"command": "nodemon --watch . --ext ts,tsx,json --ignore dist --exec \"sh -c 'tsc --noEmit -p tsconfig.json --pretty true && node --inspect --import tsx index.ts'\""
27+
}
28+
},
29+
"test": {
30+
"executor": "nx:run-commands",
31+
"options": {
32+
"cwd": "backend",
33+
"command": "NODE_OPTIONS=\"--experimental-vm-modules\" jest --maxWorkers=1 --coverage"
34+
},
35+
"configurations": {
36+
"watch": {
37+
"command": "NODE_OPTIONS=\"--experimental-vm-modules\" jest --maxWorkers=1 --coverage --watch"
38+
}
39+
},
40+
"inputs": ["default", "^default", { "externalDependencies": ["jest", "ts-jest"] }]
41+
},
42+
"test:debug": {
43+
"executor": "nx:run-commands",
44+
"options": {
45+
"cwd": "backend",
46+
"command": "NODE_OPTIONS=\"--experimental-vm-modules --inspect-brk\" jest --runInBand --detectOpenHandles --verbose"
47+
},
48+
"inputs": ["default", "^default", { "externalDependencies": ["jest", "ts-jest"] }]
49+
},
50+
"ts-check": {
51+
"executor": "nx:run-commands",
52+
"options": {
53+
"cwd": "backend",
54+
"command": "tsc --noEmit -p tsconfig.json --pretty true"
55+
}
56+
}
57+
},
58+
"tags": []
59+
}

backend/tsconfig.app.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"include": ["src", "index.ts", "scripts"]
4+
}

0 commit comments

Comments
 (0)