diff --git a/packages/audit-logger/package.json b/packages/audit-logger/package.json index 1dedba917..eb351258f 100644 --- a/packages/audit-logger/package.json +++ b/packages/audit-logger/package.json @@ -6,10 +6,12 @@ "types": "./dist/index.d.ts", "exports": { ".": { + "types": "./dist/index.d.ts", "require": "./dist/index.js", "import": "./dist/index.mjs" }, "./server": { + "types": "./dist/server.d.ts", "require": "./dist/server.js", "import": "./dist/server.mjs" }, @@ -39,7 +41,7 @@ "bundle": false, "platform": "node", "treeshake": true, - "target": "node16", + "target": "node18", "silent": true, "format": [ "cjs", diff --git a/packages/audit-logger/src/server.ts b/packages/audit-logger/src/server.ts index e4a2aa992..c67aa66c1 100644 --- a/packages/audit-logger/src/server.ts +++ b/packages/audit-logger/src/server.ts @@ -1,7 +1,7 @@ import superjson from "superjson"; import type { AuditLogActions } from "./index"; import { captureException } from "@sentry/node"; -import { AuditLog as _AuditLog } from "@snailycad/types"; +import type { AuditLog as _AuditLog } from "@snailycad/types"; export * from "./types/action-types"; export * from "./types/actions"; diff --git a/packages/audit-logger/tsconfig.json b/packages/audit-logger/tsconfig.json index 9585a0e72..679c0752c 100644 --- a/packages/audit-logger/tsconfig.json +++ b/packages/audit-logger/tsconfig.json @@ -1,12 +1,8 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./dist", - "target": "ESNext", - "module": "CommonJS", - "moduleResolution": "node", - "declaration": true, - "resolveJsonModule": true - }, - "exclude": ["dist", "node_modules"] + "moduleResolution": "Bundler", + "module": "ESNext", + "noEmit": true + } } diff --git a/packages/config/package.json b/packages/config/package.json index 88b7eba0c..5a6a4fef2 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -39,7 +39,7 @@ "bundle": false, "platform": "node", "treeshake": true, - "target": "node16", + "target": "node18", "silent": true, "format": [ "cjs", diff --git a/packages/config/tsconfig.json b/packages/config/tsconfig.json index 291a36bfe..679c0752c 100644 --- a/packages/config/tsconfig.json +++ b/packages/config/tsconfig.json @@ -1,11 +1,8 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./dist", - "target": "ESNext", - "module": "CommonJS", - "moduleResolution": "node", - "declaration": true - }, - "exclude": ["dist", "node_modules"] + "moduleResolution": "Bundler", + "module": "ESNext", + "noEmit": true + } } diff --git a/packages/permissions/package.json b/packages/permissions/package.json index 14b96f3e7..789dd2ca9 100644 --- a/packages/permissions/package.json +++ b/packages/permissions/package.json @@ -6,10 +6,12 @@ "types": "./dist/index.d.ts", "exports": { ".": { + "types": "./dist/index.d.ts", "require": "./dist/index.js", "import": "./dist/index.mjs" }, "./permissions": { + "types": "./dist/permissions.d.ts", "require": "./dist/permissions.js", "import": "./dist/permissions.mjs" }, @@ -42,7 +44,7 @@ "dts": true, "bundle": false, "platform": "node", - "target": "node16", + "target": "node18", "treeshake": true, "silent": true, "format": [ diff --git a/packages/permissions/tsconfig.json b/packages/permissions/tsconfig.json index b3ac61d0c..679c0752c 100644 --- a/packages/permissions/tsconfig.json +++ b/packages/permissions/tsconfig.json @@ -1,12 +1,8 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./dist", - "target": "ESNext", - "module": "CommonJS", - "moduleResolution": "node", - "declaration": true, - "skipLibCheck": true - }, - "exclude": ["dist", "node_modules"] + "moduleResolution": "Bundler", + "module": "ESNext", + "noEmit": true + } } diff --git a/packages/schemas/package.json b/packages/schemas/package.json index 004df9a6e..61c2232c3 100644 --- a/packages/schemas/package.json +++ b/packages/schemas/package.json @@ -6,10 +6,12 @@ "types": "./dist/index.d.ts", "exports": { ".": { + "types": "./dist/index.d.ts", "require": "./dist/index.js", "import": "./dist/index.mjs" }, "./dist/*": { + "types": "./dist/*.d.ts", "require": "./dist/*.js", "import": "./dist/*.mjs" }, @@ -39,7 +41,7 @@ "dts": true, "bundle": false, "platform": "node", - "target": "node16", + "target": "node18", "treeshake": true, "silent": true, "minify": true, diff --git a/packages/schemas/tsconfig.json b/packages/schemas/tsconfig.json index e7c2b64d5..679c0752c 100644 --- a/packages/schemas/tsconfig.json +++ b/packages/schemas/tsconfig.json @@ -1,13 +1,8 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./dist", - "target": "ESNext", - "module": "CommonJS", - "moduleResolution": "node", - "declaration": true, - "skipLibCheck": true, - "importHelpers": true - }, - "exclude": ["dist", "node_modules"] + "moduleResolution": "Bundler", + "module": "ESNext", + "noEmit": true + } } diff --git a/packages/types/package.json b/packages/types/package.json index f73f699c2..7783f24cb 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -51,7 +51,7 @@ "dts": true, "bundle": false, "platform": "node", - "target": "node16", + "target": "node18", "silent": true, "treeshake": true, "format": [ diff --git a/packages/types/src/api.ts b/packages/types/src/api.ts index f1b68856d..5efab2f69 100644 --- a/packages/types/src/api.ts +++ b/packages/types/src/api.ts @@ -1,7 +1,7 @@ import type * as Prisma from "./prisma/index"; import type * as Types from "./index.js"; -import { GetEmsFdActiveDeputy } from "./api.js"; -import { GetActiveOfficerData } from "./api.js"; +import type { GetEmsFdActiveDeputy } from "./api.js"; +import type { GetActiveOfficerData } from "./api.js"; export * from "./api/admin.js"; export * from "./api/dispatch.js"; diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 82396bbb1..1d7ccbe98 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -1,7 +1,7 @@ import type { Permissions } from "@snailycad/permissions"; import type * as Prisma from "./prisma/index"; import type * as Enums from "./enums"; -import { CadFeatureOptions } from "./lib/cad-feature"; +import type { CadFeatureOptions } from "./lib/cad-feature"; export * from "./enums"; export * from "./lib/cad-feature"; @@ -402,7 +402,7 @@ type _Record = Prisma.Record & { release?: Partial | null; call911?: Pick | null; }; -export { _Record as Record }; +export type { _Record as Record }; export type RecordRelease = Prisma.RecordRelease & { releasedBy: Citizen | null; diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json index b3ac61d0c..679c0752c 100644 --- a/packages/types/tsconfig.json +++ b/packages/types/tsconfig.json @@ -1,12 +1,8 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./dist", - "target": "ESNext", - "module": "CommonJS", - "moduleResolution": "node", - "declaration": true, - "skipLibCheck": true - }, - "exclude": ["dist", "node_modules"] + "moduleResolution": "Bundler", + "module": "ESNext", + "noEmit": true + } } diff --git a/packages/utils/package.json b/packages/utils/package.json index 44ab27b16..70c2afffe 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -89,7 +89,7 @@ "dts": true, "bundle": false, "platform": "node", - "target": "node16", + "target": "node18", "silent": true, "treeshake": true, "format": [ diff --git a/packages/utils/src/editor/index.ts b/packages/utils/src/editor/index.ts index 5c3245e21..68232272c 100644 --- a/packages/utils/src/editor/index.ts +++ b/packages/utils/src/editor/index.ts @@ -14,4 +14,4 @@ declare module "slate" { export * from "./types"; export { slateDataToString } from "./slate-data-to-string"; -export { Descendant }; +export type { Descendant }; diff --git a/packages/utils/src/editor/slate-data-to-string.ts b/packages/utils/src/editor/slate-data-to-string.ts index 0e2f7649d..ee1aec52f 100644 --- a/packages/utils/src/editor/slate-data-to-string.ts +++ b/packages/utils/src/editor/slate-data-to-string.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-unnecessary-condition */ -import { Editor, Element as SlateElement, Descendant } from "slate"; +import { Editor, Element as SlateElement, type Descendant } from "slate"; export function slateDataToString(data: Descendant[] | null) { const string: string[] = []; diff --git a/packages/utils/src/typeguards.ts b/packages/utils/src/typeguards.ts index ada813013..6eecce906 100644 --- a/packages/utils/src/typeguards.ts +++ b/packages/utils/src/typeguards.ts @@ -1,24 +1,24 @@ import { ValueType, - Value, - VehicleValue, - WeaponValue, - StatusValue, - DepartmentValue, - DivisionValue, - EmployeeValue, - DriversLicenseCategoryValue, - Officer, - CombinedLeoUnit, - EmsFdDeputy, - QualificationValue, - CallTypeValue, - PenalCode, - AnyValue, - ValueWithValueObj, - AddressValue, - EmergencyVehicleValue, - CombinedEmsFdUnit, + type Value, + type VehicleValue, + type WeaponValue, + type StatusValue, + type DepartmentValue, + type DivisionValue, + type EmployeeValue, + type DriversLicenseCategoryValue, + type Officer, + type CombinedLeoUnit, + type EmsFdDeputy, + type QualificationValue, + type CallTypeValue, + type PenalCode, + type AnyValue, + type ValueWithValueObj, + type AddressValue, + type EmergencyVehicleValue, + type CombinedEmsFdUnit, } from "@snailycad/types"; export function isPenalCodeValue(value: AnyValue): value is PenalCode { diff --git a/packages/utils/tsconfig.json b/packages/utils/tsconfig.json index 702bdc443..679c0752c 100644 --- a/packages/utils/tsconfig.json +++ b/packages/utils/tsconfig.json @@ -1,14 +1,8 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./dist", - "target": "ESNext", - "module": "CommonJS", - "moduleResolution": "node", - "declaration": true, - "skipLibCheck": true, - "importHelpers": true, - "esModuleInterop": true - }, - "exclude": ["dist", "node_modules"] + "moduleResolution": "Bundler", + "module": "ESNext", + "noEmit": true + } } diff --git a/tsconfig.base.json b/tsconfig.base.json index a9bcb5cda..846034b40 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1,15 +1,24 @@ { + "exclude": ["dist", "node_modules", ".dev-data", ".data"], "compilerOptions": { - "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. */, + /* Basic Options */ + "esModuleInterop": true, "skipLibCheck": true, - "verbatimModuleSyntax": false, + "target": "es2022", + "verbatimModuleSyntax": true, + "allowJs": true, + "resolveJsonModule": true, + "moduleDetection": "force", + + /* Strict */ + "strict": true, + "noImplicitAny": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "strictBindCallApply": true, + "strictPropertyInitialization": true, + "noImplicitThis": true, + "alwaysStrict": true, "pretty": true, /* Additional Checks */ @@ -18,7 +27,7 @@ "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, "noUncheckedIndexedAccess": true /* Include 'undefined' in index signature results */, - "allowUnreachableCode": false - }, - "exclude": ["dist", "node_modules", ".dev-data", ".data"] + "allowUnreachableCode": false, + "lib": ["es2022"] + } }