From 4c2492e348ab13fc83beca234e29ba9be8095081 Mon Sep 17 00:00:00 2001 From: Artem Titoulenko Date: Wed, 8 Sep 2021 13:40:11 -0400 Subject: [PATCH] initial move to tsc --- .gitignore | 1 + package.json | 4 +++- src/{communicator.js => communicator.ts} | 0 src/{consts.js => consts.ts} | 0 src/{index.js => index.ts} | 0 ...n-registration.js => authorization-registration.ts} | 0 src/services/{base.js => base.ts} | 0 src/{structures.js => structures.ts} | 0 src/{util.js => util.ts} | 0 tsconfig.json | 9 +++++++++ yarn.lock | 10 ++++++++++ 11 files changed, 23 insertions(+), 1 deletion(-) rename src/{communicator.js => communicator.ts} (100%) rename src/{consts.js => consts.ts} (100%) rename src/{index.js => index.ts} (100%) rename src/services/{authorization-registration.js => authorization-registration.ts} (100%) rename src/services/{base.js => base.ts} (100%) rename src/{structures.js => structures.ts} (100%) rename src/{util.js => util.ts} (100%) create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore index 3c3629e..c860569 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +built diff --git a/package.json b/package.json index d8a0843..fea1d9a 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,8 @@ "start": "node ./src/index.js" }, "devDependencies": { - "nodemon": "^2.0.12" + "@tsconfig/node14": "^1.0.1", + "nodemon": "^2.0.12", + "typescript": "^4.4.2" } } diff --git a/src/communicator.js b/src/communicator.ts similarity index 100% rename from src/communicator.js rename to src/communicator.ts diff --git a/src/consts.js b/src/consts.ts similarity index 100% rename from src/consts.js rename to src/consts.ts diff --git a/src/index.js b/src/index.ts similarity index 100% rename from src/index.js rename to src/index.ts diff --git a/src/services/authorization-registration.js b/src/services/authorization-registration.ts similarity index 100% rename from src/services/authorization-registration.js rename to src/services/authorization-registration.ts diff --git a/src/services/base.js b/src/services/base.ts similarity index 100% rename from src/services/base.js rename to src/services/base.ts diff --git a/src/structures.js b/src/structures.ts similarity index 100% rename from src/structures.js rename to src/structures.ts diff --git a/src/util.js b/src/util.ts similarity index 100% rename from src/util.js rename to src/util.ts diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..3d56f92 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@tsconfig/node14/tsconfig.json", + "compilerOptions": { + "preserveConstEnums": true, + "outDir": "./built", + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "**/*.spec.ts"] +} diff --git a/yarn.lock b/yarn.lock index c7b809c..bcaee44 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14,6 +14,11 @@ dependencies: defer-to-connect "^1.0.1" +"@tsconfig/node14@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.1.tgz#95f2d167ffb9b8d2068b0b235302fafd4df711f2" + integrity sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg== + abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" @@ -723,6 +728,11 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" +typescript@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86" + integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ== + undefsafe@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.3.tgz#6b166e7094ad46313b2202da7ecc2cd7cc6e7aae"