From a61d255ed2565eadc8bc27b97c1f89e5cabc9837 Mon Sep 17 00:00:00 2001 From: Etienne Date: Sun, 9 Feb 2020 19:19:22 +0100 Subject: [PATCH] Fix nodemon debug --- .npmignore | 1 + nodemon.json | 15 ++++++++++++++ package-lock.json | 20 ++++++++++++++++++- package.json | 3 ++- .../{calendar.test.ts => calendar.spec.ts} | 0 src/routes/calendar/calendar.ts | 1 - .../{calendars.test.ts => calendars.spec.ts} | 0 .../locale/{locale.test.ts => locale.spec.ts} | 0 ...t-found.test.ts => page-not-found.spec.ts} | 0 .../{version.test.ts => version.spec.ts} | 0 tsconfig.json | 2 ++ 11 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 nodemon.json rename src/routes/calendar/{calendar.test.ts => calendar.spec.ts} (100%) rename src/routes/calendars/{calendars.test.ts => calendars.spec.ts} (100%) rename src/routes/locale/{locale.test.ts => locale.spec.ts} (100%) rename src/routes/page-not-found/{page-not-found.test.ts => page-not-found.spec.ts} (100%) rename src/routes/version/{version.test.ts => version.spec.ts} (100%) diff --git a/.npmignore b/.npmignore index d2ba6db..397c5bc 100644 --- a/.npmignore +++ b/.npmignore @@ -8,6 +8,7 @@ src .editorconfig .eslintcache .eslintrc.js +nodemon.json tsconfig.json webpack.config.js serverless.yml diff --git a/nodemon.json b/nodemon.json new file mode 100644 index 0000000..ab2b685 --- /dev/null +++ b/nodemon.json @@ -0,0 +1,15 @@ +{ + "watch": [ + "src" + ], + "ext": "ts", + "ignore": [ + "src/**/*.spec.ts", + "src/**/*.test.ts" + ], + "verbose": true, + "env": { + "NODE_ENV": "development" + }, + "exec": "node --inspect=0.0.0.0 --require ts-node/register --require tsconfig-paths/register src/server.ts" +} diff --git a/package-lock.json b/package-lock.json index caa1f1f..1488440 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "romcal-api", - "version": "1.0.0", + "version": "1.0.4", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1465,6 +1465,12 @@ "integrity": "sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==", "dev": true }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, "@types/mime": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.1.tgz", @@ -11989,6 +11995,18 @@ } } }, + "tsconfig-paths": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", + "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + } + }, "tslib": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", diff --git a/package.json b/package.json index 9030c2d..1a0943e 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "node": ">=8.0.0" }, "scripts": { - "start": "node_modules/.bin/nodemon src/server.ts --inspect", + "start": "node_modules/.bin/nodemon --config nodemon.json", "build": "webpack-cli --config webpack.config.js", "test": "jest", "test:watch": "jest --watch", @@ -63,6 +63,7 @@ "ts-jest": "^25.2.0", "ts-loader": "^6.2.1", "ts-node": "^8.6.2", + "tsconfig-paths": "^3.9.0", "typescript": "^3.7.5", "webpack": "^4.41.5", "webpack-cli": "^3.3.10", diff --git a/src/routes/calendar/calendar.test.ts b/src/routes/calendar/calendar.spec.ts similarity index 100% rename from src/routes/calendar/calendar.test.ts rename to src/routes/calendar/calendar.spec.ts diff --git a/src/routes/calendar/calendar.ts b/src/routes/calendar/calendar.ts index 49a61e2..7aa23e3 100644 --- a/src/routes/calendar/calendar.ts +++ b/src/routes/calendar/calendar.ts @@ -38,7 +38,6 @@ export default class Calendar { if (params.calendar === 'liturgical') config.type = 'liturgical'; // Country calendar - if (romcal.Countries.indexOf(params.country) === -1) { if (!params.country) { return res.status(404).send({ diff --git a/src/routes/calendars/calendars.test.ts b/src/routes/calendars/calendars.spec.ts similarity index 100% rename from src/routes/calendars/calendars.test.ts rename to src/routes/calendars/calendars.spec.ts diff --git a/src/routes/locale/locale.test.ts b/src/routes/locale/locale.spec.ts similarity index 100% rename from src/routes/locale/locale.test.ts rename to src/routes/locale/locale.spec.ts diff --git a/src/routes/page-not-found/page-not-found.test.ts b/src/routes/page-not-found/page-not-found.spec.ts similarity index 100% rename from src/routes/page-not-found/page-not-found.test.ts rename to src/routes/page-not-found/page-not-found.spec.ts diff --git a/src/routes/version/version.test.ts b/src/routes/version/version.spec.ts similarity index 100% rename from src/routes/version/version.test.ts rename to src/routes/version/version.spec.ts diff --git a/tsconfig.json b/tsconfig.json index fba137b..25fd5f8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,6 +6,7 @@ "noUnusedLocals": true, "noUnusedParameters": true, "sourceMap": true, + "baseUrl": "./", "target": "es2017", "outDir": "lib", "resolveJsonModule": true, @@ -13,6 +14,7 @@ }, "include": ["./**/*.ts"], "exclude": [ + "./src/**/*.spec.ts", "./src/**/*.test.ts", "node_modules/**/*", ".serverless/**/*",