feat: migrate backend to cosmiconfig

This commit is contained in:
2023-04-25 15:54:06 +02:00
parent d8c79256c9
commit 0a76427ba8
70 changed files with 1786 additions and 1635 deletions

View File

@@ -18,26 +18,25 @@
"main": "lib/app.js",
"bin": "app.js",
"scripts": {
"build": "tsup --dts",
"dev": "tsup --watch",
"build": "tsup",
"dev": "tsup --watch --onSuccess \"pnpm run start\"",
"format": "prettier . --ignore-path ../../.gitignore",
"format:fix": "prettier --write . --ignore-path ../../.gitignore",
"lint": "eslint --ext .ts src/",
"lint": "tsc --noEmit && eslint --ext .ts src/",
"lint:fix": "eslint --fix --ext .ts src/",
"start": "NODE_CONFIG_ENV=elasticsearch ALLOW_NO_TRANSPORT=true node ./lib/cli.js",
"start-debug": "STAPPS_LOG_LEVEL=31 NODE_CONFIG_ENV=elasticsearch ALLOW_NO_TRANSPORT=true node ./lib/cli.js --require ts-node/register",
"test": "pnpm run test-unit && pnpm run test-integration",
"test-integration": "docker-compose -f integration-test.yml pull && docker-compose -f integration-test.yml up --build --abort-on-container-exit --exit-code-from apicli",
"test-unit": "cross-env NODE_CONFIG_ENV=elasticsearch ALLOW_NO_TRANSPORT=true STAPPS_LOG_LEVEL=0 nyc mocha --require ts-node/register --exit 'test/**/*.spec.ts'"
"start": "cross-env NODE_CONFIG_ENV=elasticsearch ALLOW_NO_TRANSPORT=true node app.js",
"start:debug": "cross-env STAPPS_LOG_LEVEL=31 NODE_CONFIG_ENV=elasticsearch ALLOW_NO_TRANSPORT=true node app.js",
"test": "cross-env NODE_CONFIG_ENV=elasticsearch ALLOW_NO_TRANSPORT=true STAPPS_LOG_LEVEL=0 c8 mocha",
"test:integration": "docker-compose -f integration-test.yml pull && docker-compose -f integration-test.yml up --build --abort-on-container-exit --exit-code-from apicli",
"test:unit": "cross-env NODE_CONFIG_ENV=elasticsearch ALLOW_NO_TRANSPORT=true STAPPS_LOG_LEVEL=0 nyc mocha --require ts-node/register --exit 'test/**/*.spec.ts'"
},
"dependencies": {
"@elastic/elasticsearch": "8.4.0",
"@openstapps/core": "workspace:*",
"@openstapps/core-tools": "workspace:*",
"@openstapps/logger": "workspace:*",
"@redocly/cli": "1.0.0-beta.125",
"@types/node": "14.18.43",
"config": "3.3.9",
"body-parser": "1.20.2",
"cosmiconfig": "8.1.3",
"cors": "2.8.5",
"express": "4.18.2",
"express-prom-bundle": "6.6.0",
@@ -45,11 +44,11 @@
"got": "12.6.0",
"moment": "2.29.4",
"morgan": "1.10.0",
"nock": "13.3.1",
"nock": "13.3.0",
"node-cache": "5.1.2",
"node-cron": "3.0.2",
"nodemailer": "6.9.1",
"prom-client": "14.2.0",
"prom-client": "14.1.1",
"promise-queue": "2.2.5",
"ts-node": "10.9.1",
"uuid": "8.3.2"
@@ -61,6 +60,7 @@
"@openstapps/prettier-config": "workspace:*",
"@openstapps/tsconfig": "workspace:*",
"@testdeck/mocha": "0.3.3",
"@types/body-parser": "1.19.2",
"@types/chai": "4.3.4",
"@types/chai-as-promised": "7.1.5",
"@types/config": "3.3.0",
@@ -73,24 +73,20 @@
"@types/node-cron": "3.0.7",
"@types/nodemailer": "6.4.7",
"@types/promise-queue": "2.2.0",
"@types/sinon": "10.0.14",
"@types/sinon-express-mock": "1.3.9",
"@types/supertest": "2.0.12",
"@types/uuid": "8.3.4",
"chai": "4.3.7",
"chai-as-promised": "7.1.1",
"conventional-changelog-cli": "2.2.2",
"cross-env": "7.0.3",
"eslint": "8.39.0",
"eslint-config-prettier": "8.8.0",
"eslint-plugin-jsdoc": "39.9.1",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-unicorn": "45.0.2",
"conventional-changelog-cli": "2.2.2",
"get-port": "5.1.1",
"mocha": "10.2.0",
"mocked-env": "1.3.5",
"nyc": "15.1.0",
"c8": "7.13.0",
"redoc-cli": "0.13.20",
"sinon": "14.0.2",
"sinon": "15.0.4",
"sinon-express-mock": "2.2.1",
"supertest": "6.3.3",
"tsup": "6.7.0",
@@ -99,11 +95,11 @@
},
"tsup": {
"entry": [
"src/app.ts",
"src/app.ts"
"src/cli.ts"
],
"sourcemap": true,
"clean": true,
"target": "es2022",
"format": "esm",
"outDir": "lib"
},
@@ -113,9 +109,6 @@
"@openstapps"
]
},
"nyc": {
"extends": "@openstapps/nyc-config"
},
"openstapps-configuration": {
"overrides": [
"test"