-
Notifications
You must be signed in to change notification settings - Fork 10
VIDSOL-296: migrating to nx #276
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| #!/usr/bin/env sh | ||
| . "$(dirname "$0")/_/husky.sh" | ||
|
|
||
| # Exit on error and unset variables | ||
| set -eu | ||
|
|
||
| # skip on CI or if deps aren't installed yet | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change prevents Husky from running in CI or when dependencies are not installed. |
||
| [ -n "${CI:-}" ] && exit 0 | ||
|
|
||
| # Run your quality checks | ||
| yarn --silent quality-check | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,17 @@ | ||
| # some individual files | ||
| .eslintrc.cjs | ||
| *.json | ||
| *.md | ||
| # Generated or irrelevant files | ||
| *.d.ts | ||
| *.log | ||
|
|
||
| # Documentation [todo]: We should be able to use prettier for this to ensure consistent formatting | ||
| *.md | ||
|
|
||
| # some directories | ||
| */dist/ | ||
| */node_modules/ | ||
| # Build and dependency folders | ||
| dist/ | ||
| node_modules/ | ||
| coverage/ | ||
| .nx/ | ||
| .turbo/ | ||
|
|
||
| # Public compiled assets | ||
| public/js/ | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import globals from 'globals'; | ||
| import baseConfig from '../eslint.config.mjs'; | ||
|
|
||
| export default [ | ||
| { | ||
| ...baseConfig, | ||
|
|
||
| files: ['**/*.{ts,tsx,js,jsx}'], | ||
| languageOptions: { | ||
| globals: globals.node, | ||
| }, | ||
| }, | ||
| ]; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,45 +4,7 @@ | |
| "description": "Express-based backend with authenticated routes.", | ||
| "main": "index.js", | ||
| "type": "module", | ||
| "scripts": { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. scripts are moved to project.json |
||
| "dev": "nodemon --watch . --ext ts,tsx,json --ignore dist --exec \"sh -c 'yarn ts-check && node --import tsx index.ts'\"", | ||
| "start": "node --import tsx index.ts", | ||
| "debug": "nodemon --watch . --ext ts,tsx,json --ignore dist --exec \"sh -c 'yarn ts-check && node --inspect --import tsx index.ts'\"", | ||
| "test": "NODE_OPTIONS=\"--experimental-vm-modules\" jest --maxWorkers=1 --coverage", | ||
| "test:watch": "yarn test --watch", | ||
| "ts-check": "tsc --noEmit -p tsconfig.json --pretty true" | ||
| }, | ||
| "author": "", | ||
| "license": "MIT", | ||
| "dependencies": { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dependencies are now centralize... only one version of each package for the whole project. |
||
| "@vonage/auth": "^1.11.0", | ||
| "@vonage/server-sdk": "^3.16.0", | ||
| "@vonage/vcr-sdk": "^1.3.0", | ||
| "@vonage/video": "^1.23.2", | ||
| "axios": "^1.12.0", | ||
| "body-parser": "^1.20.3", | ||
| "cors": "^2.8.5", | ||
| "dotenv": "^16.0.3", | ||
| "express": "^4.21.2", | ||
| "form-data": "^4.0.4", | ||
| "opentok": "^2.16.0", | ||
| "opentok-jwt": "^0.1.5", | ||
| "tsx": "^4.10.5", | ||
| "validator": "13.15.15" | ||
| }, | ||
| "devDependencies": { | ||
| "@jest/globals": "^29.7.0", | ||
| "@types/body-parser": "^1.19.2", | ||
| "@types/cors": "^2.8.13", | ||
| "@types/express": "^4.17.17", | ||
| "@types/jest": "^29.5.12", | ||
| "@types/node": "^20.12.7", | ||
| "@types/opentok": "^2.14.0", | ||
| "@types/supertest": "^6.0.2", | ||
| "@types/validator": "^13.15.2", | ||
| "jest": "^29.7.0", | ||
| "nodemon": "^3.1.10", | ||
| "supertest": "^7.0.0", | ||
| "ts-jest": "^29.1.2" | ||
| } | ||
| "private": true | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| { | ||
| "$schema": "../node_modules/nx/schemas/project-schema.json", | ||
| "name": "backend", | ||
| "projectType": "application", | ||
| "root": "backend", | ||
| "sourceRoot": "backend", | ||
| "targets": { | ||
| "serve": { | ||
| "executor": "nx:run-commands", | ||
| "options": { | ||
| "cwd": "backend", | ||
| "command": "nodemon --watch . --ext ts,tsx,json --ignore dist --exec \"sh -c 'tsc --noEmit -p tsconfig.json --pretty true && node --import tsx index.ts'\"" | ||
| } | ||
| }, | ||
| "start": { | ||
| "executor": "nx:run-commands", | ||
| "options": { | ||
| "cwd": "backend", | ||
| "command": "node --import tsx index.ts" | ||
| } | ||
| }, | ||
| "debug": { | ||
| "executor": "nx:run-commands", | ||
| "options": { | ||
| "cwd": "backend", | ||
| "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'\"" | ||
| } | ||
| }, | ||
| "test": { | ||
| "executor": "nx:run-commands", | ||
| "options": { | ||
| "cwd": "backend", | ||
| "command": "NODE_OPTIONS=\"--experimental-vm-modules\" jest --maxWorkers=1 --coverage" | ||
| }, | ||
| "configurations": { | ||
| "watch": { | ||
| "command": "NODE_OPTIONS=\"--experimental-vm-modules\" jest --maxWorkers=1 --coverage --watch" | ||
| } | ||
| }, | ||
| "inputs": ["default", "^default", { "externalDependencies": ["jest", "ts-jest"] }] | ||
| }, | ||
| "test:debug": { | ||
| "executor": "nx:run-commands", | ||
| "options": { | ||
| "cwd": "backend", | ||
| "command": "NODE_OPTIONS=\"--experimental-vm-modules --inspect-brk\" jest --runInBand --detectOpenHandles --verbose" | ||
| }, | ||
| "inputs": ["default", "^default", { "externalDependencies": ["jest", "ts-jest"] }] | ||
| }, | ||
| "ts-check": { | ||
| "executor": "nx:run-commands", | ||
| "options": { | ||
| "cwd": "backend", | ||
| "command": "tsc --noEmit -p tsconfig.json --pretty true" | ||
| } | ||
| } | ||
| }, | ||
| "tags": [] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "extends": "./tsconfig.json", | ||
| "include": ["src", "index.ts", "scripts"] | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disable Nx caching for CI/CD. The pipelines always run in fully isolated, fresh installations of the app, so caching provides no benefit.