🎨 use typescript plugin that converts to relative paths

This commit is contained in:
Flam3rboy
2021-09-18 01:50:20 +02:00
parent 69550e535e
commit 1e331b7c9d
16 changed files with 35 additions and 52 deletions
+6
View File
@@ -0,0 +1,6 @@
module.exports = {
presets: [
["@babel/preset-env", { targets: { node: "current" } }],
["@babel/preset-typescript", { allowDeclareFields: true }]
]
};
BIN
View File
Binary file not shown.
+11 -3
View File
@@ -5,16 +5,18 @@
"main": "dist/Server.js",
"types": "dist/Server.d.ts",
"scripts": {
"test:only": "node -r ./scripts/tsconfig-paths-bootstrap.js node_modules/.bin/jest --coverage --verbose --forceExit ./tests",
"prepare": "ts-patch install -s",
"test:only": "jest --coverage --verbose --forceExit ./tests",
"test": "npm run build && npm run test:only",
"test:watch": "jest --watch",
"start": "npm run build && node -r ./scripts/tsconfig-paths-bootstrap.js dist/start",
"start": "npm run build && node dist/start",
"build": "npx tsc -b .",
"build-docker": "tsc -p tsconfig-docker.json",
"dev": "tsnd --respawn src/start.ts",
"patch": "npx patch-package",
"postinstall": "npm run patch",
"generate:docs": "ts-node scripts/generate_openapi_schema.ts",
"generate:test": "ts-node scripts/generate_test_schema.ts",
"generate:schema": "ts-node scripts/generate_body_schema.ts"
},
"repository": {
@@ -36,6 +38,9 @@
},
"homepage": "https://fosscord.com",
"devDependencies": {
"@babel/core": "^7.15.5",
"@babel/preset-env": "^7.15.6",
"@babel/preset-typescript": "^7.15.0",
"@types/amqplib": "^0.8.1",
"@types/bcrypt": "^5.0.0",
"@types/express": "^4.17.9",
@@ -49,14 +54,17 @@
"@types/multer": "^1.4.5",
"@types/node": "^14.17.9",
"@types/node-fetch": "^2.5.7",
"@types/supertest": "^2.0.11",
"@zerollup/ts-transform-paths": "^1.7.18",
"0x": "^4.10.2",
"babel-jest": "^27.2.0",
"caxa": "^2.1.0",
"image-size": "^1.0.0",
"jest": "^26.6.3",
"saslprep": "^1.0.3",
"ts-node": "^9.1.1",
"ts-node-dev": "^1.1.6",
"ts-patch": "^1.4.4",
"typescript": "^4.4.2",
"typescript-json-schema": "0.50.1"
},
@@ -96,7 +104,7 @@
"setupFiles": [
"<rootDir>/jest/setup.js"
],
"globalSetup": "<rootDir>/scripts/globalSetup.js",
"globalSetup": "<rootDir>/jest/globalSetup.js",
"verbose": true
}
}
+3 -2
View File
@@ -66,8 +66,9 @@
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */,
"baseUrl": ".",
"paths": {
"@fosscord/api": ["src/index.ts"],
"@fosscord/api": ["src/index"],
"@fosscord/api/*": ["src/*"]
}
},
"plugins": [{ "transform": "@zerollup/ts-transform-paths" }]
}
}