diff --git a/boilerplate/backend/koa/appInfo.ts b/boilerplate/backend/koa/appInfo.ts deleted file mode 100644 index a1a2e3f7..00000000 --- a/boilerplate/backend/koa/appInfo.ts +++ /dev/null @@ -1,6 +0,0 @@ -export const appInfo = { - // learn more about this on https://supertokens.com/docs/thirdpartyemailpassword/appinfo - appName: "SuperTokens Koa demo app", - apiDomain: "http://localhost:3001", - websiteDomain: "http://localhost:3000", -}; diff --git a/boilerplate/backend/koa/config.ts b/boilerplate/backend/koa/config.ts index e2dd9e93..c2936806 100644 --- a/boilerplate/backend/koa/config.ts +++ b/boilerplate/backend/koa/config.ts @@ -1,15 +1,27 @@ -import EmailPassword from "supertokens-node/recipe/emailpassword"; -import Session from "supertokens-node/recipe/session"; -import Dashboard from "supertokens-node/recipe/dashboard"; -import UserRoles from "supertokens-node/recipe/userroles"; -import { appInfo } from "./appInfo"; import { TypeInput } from "supertokens-node/types"; -import SuperTokens from "supertokens-node"; + +export function getApiDomain() { + return ""; +} + +export function getWebsiteDomain() { + return ""; +} export const SuperTokensConfig: TypeInput = { - appInfo, supertokens: { - connectionURI: "https://try.supertokens.io", + // this is the location of the SuperTokens core. + connectionURI: "", }, + appInfo: { + // learn more about this on https://supertokens.com/docs/thirdpartyemailpassword/appinfo + appName: "", + apiDomain: "", + websiteDomain: "", + }, + // recipeList contains all the modules that you want to + // use from SuperTokens. See the full list here: https://supertokens.com/docs/guides recipeList: [], }; + +export const recipeList = []; diff --git a/boilerplate/backend/koa/config/all_auth.ts b/boilerplate/backend/koa/config/all_auth.ts index d61606d5..08a5c287 100644 --- a/boilerplate/backend/koa/config/all_auth.ts +++ b/boilerplate/backend/koa/config/all_auth.ts @@ -1,19 +1,35 @@ import EmailPassword from "supertokens-node/recipe/emailpassword"; import Session from "supertokens-node/recipe/session"; import Dashboard from "supertokens-node/recipe/dashboard"; -import { appInfo } from "./appInfo"; import ThirdParty from "supertokens-node/recipe/thirdparty"; import Passwordless from "supertokens-node/recipe/passwordless"; import { TypeInput } from "supertokens-node/types"; import UserRoles from "supertokens-node/recipe/userroles"; -import SuperTokens from "supertokens-node"; + +export function getApiDomain() { + const apiPort = process.env.VITE_APP_API_PORT || 3001; + const apiUrl = process.env.VITE_APP_API_URL || `http://localhost:${apiPort}`; + return apiUrl; +} + +export function getWebsiteDomain() { + const websitePort = process.env.VITE_APP_WEBSITE_PORT || 3000; + const websiteUrl = process.env.VITE_APP_WEBSITE_URL || `http://localhost:${websitePort}`; + return websiteUrl; +} export const SuperTokensConfig: TypeInput = { framework: "koa", supertokens: { + // this is the location of the SuperTokens core. connectionURI: "https://try.supertokens.com", }, - appInfo, + appInfo: { + // learn more about this on https://supertokens.com/docs/thirdpartyemailpassword/appinfo + appName: "SuperTokens Koa demo app", + apiDomain: getApiDomain(), + websiteDomain: getWebsiteDomain(), + }, // recipeList contains all the modules that you want to // use from SuperTokens. See the full list here: https://supertokens.com/docs/guides recipeList: [ diff --git a/boilerplate/backend/koa/config/emailpassword.ts b/boilerplate/backend/koa/config/emailpassword.ts index 1d56286f..a0b4334e 100644 --- a/boilerplate/backend/koa/config/emailpassword.ts +++ b/boilerplate/backend/koa/config/emailpassword.ts @@ -3,13 +3,30 @@ import Session from "supertokens-node/recipe/session"; import { TypeInput } from "supertokens-node/types"; import Dashboard from "supertokens-node/recipe/dashboard"; import UserRoles from "supertokens-node/recipe/userroles"; -import { appInfo } from "./appInfo"; + +export function getApiDomain() { + const apiPort = process.env.VITE_APP_API_PORT || 3001; + const apiUrl = process.env.VITE_APP_API_URL || `http://localhost:${apiPort}`; + return apiUrl; +} + +export function getWebsiteDomain() { + const websitePort = process.env.VITE_APP_WEBSITE_PORT || 3000; + const websiteUrl = process.env.VITE_APP_WEBSITE_URL || `http://localhost:${websitePort}`; + return websiteUrl; +} export const SuperTokensConfig: TypeInput = { framework: "koa", supertokens: { + // this is the location of the SuperTokens core. connectionURI: "https://try.supertokens.com", }, - appInfo, + appInfo: { + // learn more about this on https://supertokens.com/docs/thirdpartyemailpassword/appinfo + appName: "SuperTokens Koa demo app", + apiDomain: getApiDomain(), + websiteDomain: getWebsiteDomain(), + }, recipeList: [EmailPassword.init(), Session.init(), Dashboard.init(), UserRoles.init()], }; diff --git a/boilerplate/backend/koa/config/multifactorauth.ts b/boilerplate/backend/koa/config/multifactorauth.ts index 84cd72d7..a5c00032 100644 --- a/boilerplate/backend/koa/config/multifactorauth.ts +++ b/boilerplate/backend/koa/config/multifactorauth.ts @@ -8,9 +8,19 @@ import MultiFactorAuth from "supertokens-node/recipe/multifactorauth"; import AccountLinking from "supertokens-node/recipe/accountlinking"; import EmailVerification from "supertokens-node/recipe/emailverification"; import TOTP from "supertokens-node/recipe/totp"; -import { appInfo } from "./appInfo"; import { TypeInput } from "supertokens-node/types"; -import SuperTokens from "supertokens-node"; + +export function getApiDomain() { + const apiPort = process.env.VITE_APP_API_PORT || 3001; + const apiUrl = process.env.VITE_APP_API_URL || `http://localhost:${apiPort}`; + return apiUrl; +} + +export function getWebsiteDomain() { + const websitePort = process.env.VITE_APP_WEBSITE_PORT || 3000; + const websiteUrl = process.env.VITE_APP_WEBSITE_URL || `http://localhost:${websitePort}`; + return websiteUrl; +} export const SuperTokensConfig: TypeInput = { framework: "koa", @@ -18,7 +28,12 @@ export const SuperTokensConfig: TypeInput = { // this is the location of the SuperTokens core. connectionURI: "https://try.supertokens.com", }, - appInfo, + appInfo: { + // learn more about this on https://supertokens.com/docs/thirdpartyemailpassword/appinfo + appName: "SuperTokens Koa demo app", + apiDomain: getApiDomain(), + websiteDomain: getWebsiteDomain(), + }, // recipeList contains all the modules that you want to // use from SuperTokens. See the full list here: https://supertokens.com/docs/guides recipeList: [ diff --git a/boilerplate/backend/koa/config/multitenancy.ts b/boilerplate/backend/koa/config/multitenancy.ts index f0e76d3a..9c900efc 100644 --- a/boilerplate/backend/koa/config/multitenancy.ts +++ b/boilerplate/backend/koa/config/multitenancy.ts @@ -2,19 +2,34 @@ import Passwordless from "supertokens-node/recipe/passwordless"; import Session from "supertokens-node/recipe/session"; import Dashboard from "supertokens-node/recipe/dashboard"; import UserRoles from "supertokens-node/recipe/userroles"; -import { appInfo } from "./appInfo"; import { TypeInput } from "supertokens-node/types"; -import SuperTokens from "supertokens-node"; import ThirdParty from "supertokens-node/recipe/thirdparty"; import EmailPassword from "supertokens-node/recipe/emailpassword"; +export function getApiDomain() { + const apiPort = process.env.VITE_APP_API_PORT || 3001; + const apiUrl = process.env.VITE_APP_API_URL || `http://localhost:${apiPort}`; + return apiUrl; +} + +export function getWebsiteDomain() { + const websitePort = process.env.VITE_APP_WEBSITE_PORT || 3000; + const websiteUrl = process.env.VITE_APP_WEBSITE_URL || `http://localhost:${websitePort}`; + return websiteUrl; +} + export const SuperTokensConfig: TypeInput = { framework: "koa", supertokens: { // this is the location of the SuperTokens core. connectionURI: "https://try.supertokens.com", }, - appInfo, + appInfo: { + // learn more about this on https://supertokens.com/docs/thirdpartyemailpassword/appinfo + appName: "SuperTokens Koa demo app", + apiDomain: getApiDomain(), + websiteDomain: getWebsiteDomain(), + }, // recipeList contains all the modules that you want to // use from SuperTokens. See the full list here: https://supertokens.com/docs/guides recipeList: [ diff --git a/boilerplate/backend/koa/config/passwordless.ts b/boilerplate/backend/koa/config/passwordless.ts index 1428dd8c..a280f2e9 100644 --- a/boilerplate/backend/koa/config/passwordless.ts +++ b/boilerplate/backend/koa/config/passwordless.ts @@ -2,9 +2,19 @@ import Passwordless from "supertokens-node/recipe/passwordless"; import Session from "supertokens-node/recipe/session"; import Dashboard from "supertokens-node/recipe/dashboard"; import UserRoles from "supertokens-node/recipe/userroles"; -import { appInfo } from "./appInfo"; import { TypeInput } from "supertokens-node/types"; -import SuperTokens from "supertokens-node"; + +export function getApiDomain() { + const apiPort = process.env.VITE_APP_API_PORT || 3001; + const apiUrl = process.env.VITE_APP_API_URL || `http://localhost:${apiPort}`; + return apiUrl; +} + +export function getWebsiteDomain() { + const websitePort = process.env.VITE_APP_WEBSITE_PORT || 3000; + const websiteUrl = process.env.VITE_APP_WEBSITE_URL || `http://localhost:${websitePort}`; + return websiteUrl; +} export const SuperTokensConfig: TypeInput = { framework: "koa", @@ -12,7 +22,12 @@ export const SuperTokensConfig: TypeInput = { // this is the location of the SuperTokens core. connectionURI: "https://try.supertokens.com", }, - appInfo, + appInfo: { + // learn more about this on https://supertokens.com/docs/thirdpartyemailpassword/appinfo + appName: "SuperTokens Koa demo app", + apiDomain: getApiDomain(), + websiteDomain: getWebsiteDomain(), + }, // recipeList contains all the modules that you want to // use from SuperTokens. See the full list here: https://supertokens.com/docs/guides recipeList: [ diff --git a/boilerplate/backend/koa/config/thirdparty.ts b/boilerplate/backend/koa/config/thirdparty.ts index ed6ce8ab..f397373a 100644 --- a/boilerplate/backend/koa/config/thirdparty.ts +++ b/boilerplate/backend/koa/config/thirdparty.ts @@ -2,9 +2,19 @@ import ThirdParty from "supertokens-node/recipe/thirdparty"; import Session from "supertokens-node/recipe/session"; import Dashboard from "supertokens-node/recipe/dashboard"; import UserRoles from "supertokens-node/recipe/userroles"; -import { appInfo } from "./appInfo"; import { TypeInput } from "supertokens-node/types"; -import SuperTokens from "supertokens-node"; + +export function getApiDomain() { + const apiPort = process.env.VITE_APP_API_PORT || 3001; + const apiUrl = process.env.VITE_APP_API_URL || `http://localhost:${apiPort}`; + return apiUrl; +} + +export function getWebsiteDomain() { + const websitePort = process.env.VITE_APP_WEBSITE_PORT || 3000; + const websiteUrl = process.env.VITE_APP_WEBSITE_URL || `http://localhost:${websitePort}`; + return websiteUrl; +} export const SuperTokensConfig: TypeInput = { framework: "koa", @@ -12,7 +22,12 @@ export const SuperTokensConfig: TypeInput = { // this is the location of the SuperTokens core. connectionURI: "https://try.supertokens.com", }, - appInfo, + appInfo: { + // learn more about this on https://supertokens.com/docs/thirdpartyemailpassword/appinfo + appName: "SuperTokens Koa demo app", + apiDomain: getApiDomain(), + websiteDomain: getWebsiteDomain(), + }, // recipeList contains all the modules that you want to // use from SuperTokens. See the full list here: https://supertokens.com/docs/guides recipeList: [ diff --git a/boilerplate/backend/koa/config/thirdpartyemailpassword.ts b/boilerplate/backend/koa/config/thirdpartyemailpassword.ts index 9d3d32c2..b67eacbf 100644 --- a/boilerplate/backend/koa/config/thirdpartyemailpassword.ts +++ b/boilerplate/backend/koa/config/thirdpartyemailpassword.ts @@ -3,9 +3,19 @@ import EmailPassword from "supertokens-node/recipe/emailpassword"; import Session from "supertokens-node/recipe/session"; import Dashboard from "supertokens-node/recipe/dashboard"; import UserRoles from "supertokens-node/recipe/userroles"; -import { appInfo } from "./appInfo"; import { TypeInput } from "supertokens-node/types"; -import SuperTokens from "supertokens-node"; + +export function getApiDomain() { + const apiPort = process.env.VITE_APP_API_PORT || 3001; + const apiUrl = process.env.VITE_APP_API_URL || `http://localhost:${apiPort}`; + return apiUrl; +} + +export function getWebsiteDomain() { + const websitePort = process.env.VITE_APP_WEBSITE_PORT || 3000; + const websiteUrl = process.env.VITE_APP_WEBSITE_URL || `http://localhost:${websitePort}`; + return websiteUrl; +} export const SuperTokensConfig: TypeInput = { framework: "koa", @@ -13,12 +23,17 @@ export const SuperTokensConfig: TypeInput = { // this is the location of the SuperTokens core. connectionURI: "https://try.supertokens.com", }, - appInfo, + appInfo: { + // learn more about this on https://supertokens.com/docs/thirdpartyemailpassword/appinfo + appName: "SuperTokens Koa demo app", + apiDomain: getApiDomain(), + websiteDomain: getWebsiteDomain(), + }, // recipeList contains all the modules that you want to // use from SuperTokens. See the full list here: https://supertokens.com/docs/guides recipeList: [ - EmailPasswordNode.init(), - ThirdPartyNode.init({ + EmailPassword.init(), + ThirdParty.init({ signInAndUpFeature: { providers: [ // We have provided you with development keys which you can use for testing. @@ -76,7 +91,7 @@ export const SuperTokensConfig: TypeInput = { ], }, }), - SessionNode.init(), + Session.init(), Dashboard.init(), UserRoles.init(), ], diff --git a/boilerplate/backend/koa/config/thirdpartypasswordless.ts b/boilerplate/backend/koa/config/thirdpartypasswordless.ts index 2dcf2af2..9f40995b 100644 --- a/boilerplate/backend/koa/config/thirdpartypasswordless.ts +++ b/boilerplate/backend/koa/config/thirdpartypasswordless.ts @@ -3,9 +3,19 @@ import Passwordless from "supertokens-node/recipe/passwordless"; import Session from "supertokens-node/recipe/session"; import Dashboard from "supertokens-node/recipe/dashboard"; import UserRoles from "supertokens-node/recipe/userroles"; -import { appInfo } from "./appInfo"; import { TypeInput } from "supertokens-node/types"; -import SuperTokens from "supertokens-node"; + +export function getApiDomain() { + const apiPort = process.env.VITE_APP_API_PORT || 3001; + const apiUrl = process.env.VITE_APP_API_URL || `http://localhost:${apiPort}`; + return apiUrl; +} + +export function getWebsiteDomain() { + const websitePort = process.env.VITE_APP_WEBSITE_PORT || 3000; + const websiteUrl = process.env.VITE_APP_WEBSITE_URL || `http://localhost:${websitePort}`; + return websiteUrl; +} export const SuperTokensConfig: TypeInput = { framework: "koa", @@ -13,7 +23,12 @@ export const SuperTokensConfig: TypeInput = { // this is the location of the SuperTokens core. connectionURI: "https://try.supertokens.com", }, - appInfo, + appInfo: { + // learn more about this on https://supertokens.com/docs/thirdpartyemailpassword/appinfo + appName: "SuperTokens Koa demo app", + apiDomain: getApiDomain(), + websiteDomain: getWebsiteDomain(), + }, // recipeList contains all the modules that you want to // use from SuperTokens. See the full list here: https://supertokens.com/docs/guides recipeList: [ diff --git a/boilerplate/backend/koa/eslint.config.mjs b/boilerplate/backend/koa/eslint.config.mjs new file mode 100644 index 00000000..ab18bca5 --- /dev/null +++ b/boilerplate/backend/koa/eslint.config.mjs @@ -0,0 +1,11 @@ +import globals from "globals"; +import pluginJs from "@eslint/js"; +import tseslint from "typescript-eslint"; + +/** @type {import('eslint').Linter.Config[]} */ +export default [ + { files: ["**/*.{js,mjs,cjs,ts}"] }, + { languageOptions: { globals: globals.node } }, + pluginJs.configs.recommended, + ...tseslint.configs.recommended, +]; diff --git a/boilerplate/backend/koa/main.ts b/boilerplate/backend/koa/main.ts index 7164594c..6b138123 100644 --- a/boilerplate/backend/koa/main.ts +++ b/boilerplate/backend/koa/main.ts @@ -2,35 +2,50 @@ import Koa from "koa"; import cors from "@koa/cors"; import supertokens from "supertokens-node"; import { middleware } from "supertokens-node/framework/koa"; -import { SuperTokensConfig } from "./config"; -import { appInfo } from "./appInfo"; +import { getWebsiteDomain, SuperTokensConfig } from "./config"; import KoaRouter from "koa-router"; import { verifySession } from "supertokens-node/recipe/session/framework/koa"; import { SessionContext } from "supertokens-node/framework/koa"; +import Multitenancy from "supertokens-node/recipe/multitenancy"; supertokens.init(SuperTokensConfig); -let app = new Koa(); +const app = new Koa(); -let router = new KoaRouter(); +const router = new KoaRouter(); app.use( cors({ - origin: appInfo.websiteDomain, + origin: getWebsiteDomain(), allowHeaders: ["content-type", ...supertokens.getAllCORSHeaders()], credentials: true, }) ); +// This exposes all the APIs from SuperTokens to the client. app.use(middleware()); -router.get("/sessioninfo", verifySession(), (ctx: SessionContext, next) => { - let userId = ctx.session!.getUserId(); - let sessionHandle = ctx.session!.getHandle(); - let accessTokenPayload = ctx.session?.getAccessTokenPayload(); +// This endpoint can be accessed regardless of +// having a session with SuperTokens +router.get("/hello", (ctx: SessionContext) => { + ctx.body = "hello"; +}); + +// An example API that requires session verification +router.get("/sessioninfo", verifySession(), (ctx: SessionContext) => { + const userId = ctx.session!.getUserId(); + const sessionHandle = ctx.session!.getHandle(); + const accessTokenPayload = ctx.session?.getAccessTokenPayload(); ctx.body = JSON.stringify({ userId, sessionHandle, accessTokenPayload }, null, 4); }); +// This API is used by the frontend to create the tenants drop down when the app loads. +// Depending on your UX, you can remove this API. +router.get("/tenants", async (ctx: SessionContext) => { + const tenants = await Multitenancy.listAllTenants(); + ctx.body = JSON.stringify({ tenants }, null, 4); +}); + app.use(router.routes()); if (!module.parent) app.listen(3001, () => console.log("API Server listening on port 3001")); diff --git a/boilerplate/backend/koa/package.json b/boilerplate/backend/koa/package.json index 46ea1c18..9e95cffc 100644 --- a/boilerplate/backend/koa/package.json +++ b/boilerplate/backend/koa/package.json @@ -1,23 +1,23 @@ { "scripts": { - "start": "npx ts-node-dev --project ./tsconfig.json ./main.ts" + "start": "npx vite-node ./main.ts", + "lint": "eslint .", + "build": "tsc" }, "dependencies": { - "koa": "^2.15.3", "@koa/cors": "^5.0.0", - "morgan": "^1.10.0", - "helmet": "^5.1.0", + "koa": "^2.15.3", "koa-router": "^12.0.0", - "ts-node-dev": "^2.0.0", - "typescript": "^4.7.2", - "supertokens-node": "latest" + "supertokens-node": "latest", + "typescript": "^4.7.2" }, "devDependencies": { - "@types/cors": "^2.8.12", + "@eslint/js": "^9.17.0", "@types/koa__cors": "^4.0.0", "@types/koa-router": "^7.4.4", - "@types/morgan": "^1.9.3", - "@types/node": "^16.11.38", - "nodemon": "^2.0.16" + "eslint": "^9.17.0", + "globals": "^15.13.0", + "typescript-eslint": "^8.18.1", + "vite-node": "^2.1.8" } } diff --git a/boilerplate/backend/koa/tsconfig.json b/boilerplate/backend/koa/tsconfig.json index 8a91acaa..e58cff36 100644 --- a/boilerplate/backend/koa/tsconfig.json +++ b/boilerplate/backend/koa/tsconfig.json @@ -1,62 +1,30 @@ { "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ /* Basic Options */ - // "incremental": true, /* Enable incremental compilation */ - "target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, - "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, - // "lib": [], /* Specify library files to be included in the compilation. */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "checkJs": true, /* Report errors in .js files. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - // "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - // "outDir": "./", /* Redirect output structure to the directory. */ - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "composite": true, /* Enable project compilation */ - // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - /* Strict Type-Checking Options */ - "strict": true /* Enable all strict type-checking options. */, - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "strictFunctionTypes": true, /* Enable strict checking of function types. */ - // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ - // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + "target": "ES2022", + "outDir": "./dist", + "rootDir": "./", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "types": ["node"], + "noEmitOnError": true, + /* Source Map Options */ - // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - /* Advanced Options */ - "skipLibCheck": true /* Skip type checking of declaration files. */, - "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ - } + "sourceMap": true, + + /* Module Resolution Options */ + "moduleResolution": "node", + "baseUrl": "./", + + /* Additional Checks */ + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["./*.ts"], + "exclude": ["node_modules"] }