finally it works!

This commit is contained in:
Moriz Wahl 2023-12-04 10:56:20 +01:00
parent 881158c11e
commit ee867b6679
4 changed files with 10 additions and 23 deletions

10
package-lock.json generated
View File

@ -39,7 +39,6 @@
"remark-preset-lint-markdown-style-guide": "^5.1.3", "remark-preset-lint-markdown-style-guide": "^5.1.3",
"remark-preset-lint-recommended": "^6.1.3", "remark-preset-lint-recommended": "^6.1.3",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"tsc": "^2.0.4",
"tsc-watch": "^6.0.4", "tsc-watch": "^6.0.4",
"tsconfig-paths": "^4.2.0", "tsconfig-paths": "^4.2.0",
"typescript": "^5.3.2" "typescript": "^5.3.2"
@ -12756,15 +12755,6 @@
} }
} }
}, },
"node_modules/tsc": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/tsc/-/tsc-2.0.4.tgz",
"integrity": "sha512-fzoSieZI5KKJVBYGvwbVZs/J5za84f2lSTLPYf6AGiIf43tZ3GNrI1QzTLcjtyDDP4aLxd46RTZq1nQxe7+k5Q==",
"dev": true,
"bin": {
"tsc": "bin/tsc"
}
},
"node_modules/tsc-watch": { "node_modules/tsc-watch": {
"version": "6.0.4", "version": "6.0.4",
"resolved": "https://registry.npmjs.org/tsc-watch/-/tsc-watch-6.0.4.tgz", "resolved": "https://registry.npmjs.org/tsc-watch/-/tsc-watch-6.0.4.tgz",

View File

@ -2,8 +2,7 @@
"name": "boilerplate-backend", "name": "boilerplate-backend",
"version": "1.0.0", "version": "1.0.0",
"description": "The IT4C Boilerplate for backends", "description": "The IT4C Boilerplate for backends",
"main": "build/index.js", "main": "build/index.ts",
"type": "module",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/IT4Change/boilerplate-backend.git" "url": "git+https://github.com/IT4Change/boilerplate-backend.git"
@ -16,8 +15,14 @@
"url": "https://github.com/IT4Change/boilerplate-backend/issues" "url": "https://github.com/IT4Change/boilerplate-backend/issues"
}, },
"scripts": { "scripts": {
"watch": "nodemon --watch './**/*.{ts,graphql}' --exec 'node --loader ts-node/esm' src/index.ts", "build": "tsc",
"dev": "tsc-watch --noClear --onSuccess \"npm run watch\"", "server": "node --loader ts-node/esm ./src/index.ts",
"server:dev": "npm run server",
"server:prod": "NODE_ENV=production npm run server",
"gdd": "TZ=UTC nodemon -w src --ext ts,pug,json,css --exec ts-node -r tsconfig-paths/register src/index.ts",
"watch2": "nodemon -w src --ext ts,pug,json,css --exec ts-node -r tsconfig-paths/register src/index.ts",
"watch": "nodemon --watch './**/*.{ts,graphql}' --exec 'node --no-warnings=ExperimentalWarning --loader ts-node/esm' src/index.ts",
"dev": "tsc-watch --noClear --onSuccess \"npm run watch\"",
"test:lint": "npm run test:lint:eslint && npm run test:lint:remark", "test:lint": "npm run test:lint:eslint && npm run test:lint:remark",
"test:lint:eslint": "eslint --ext .ts,.tsx,.js,.jsx,.json,.yml,.yaml --max-warnings 0 --ignore-path .gitignore .", "test:lint:eslint": "eslint --ext .ts,.tsx,.js,.jsx,.json,.yml,.yaml --max-warnings 0 --ignore-path .gitignore .",
"test:lint:remark": "remark . --quiet --frail" "test:lint:remark": "remark . --quiet --frail"
@ -53,7 +58,6 @@
"remark-preset-lint-markdown-style-guide": "^5.1.3", "remark-preset-lint-markdown-style-guide": "^5.1.3",
"remark-preset-lint-recommended": "^6.1.3", "remark-preset-lint-recommended": "^6.1.3",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"tsc": "^2.0.4",
"tsc-watch": "^6.0.4", "tsc-watch": "^6.0.4",
"tsconfig-paths": "^4.2.0", "tsconfig-paths": "^4.2.0",
"typescript": "^5.3.2" "typescript": "^5.3.2"

View File

@ -1,12 +1,8 @@
import path from 'path' import path from 'path'
import { fileURLToPath } from 'url'
import { GraphQLSchema } from 'graphql' import { GraphQLSchema } from 'graphql'
import { buildSchema } from 'type-graphql' import { buildSchema } from 'type-graphql'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
export const schema = async (): Promise<GraphQLSchema> => { export const schema = async (): Promise<GraphQLSchema> => {
return buildSchema({ return buildSchema({
resolvers: [path.join(__dirname, 'resolvers', `!(*.spec).{ts,js}`)], resolvers: [path.join(__dirname, 'resolvers', `!(*.spec).{ts,js}`)],

View File

@ -3,7 +3,7 @@
"target": "ESNext", "target": "ESNext",
"experimentalDecorators": true, "experimentalDecorators": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"module": "ESNext", "module": "commonjs",
"moduleResolution": "node", "moduleResolution": "node",
"baseUrl": ".", "baseUrl": ".",
"lib": ["ESNext"], "lib": ["ESNext"],
@ -14,8 +14,5 @@
"esModuleInterop": true, "esModuleInterop": true,
"strict": true, "strict": true,
"skipLibCheck": true "skipLibCheck": true
},
"ts-node": {
"experimentalSpecifierResolution": "node"
} }
} }