Skip to content
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
],
"scripts": {
"foreach": "yarn workspaces foreach --no-private --parallel --verbose",
"build": "yarn build:tsc --build --verbose",
"build:watch": "concurrently --raw --kill-others 'tsc --build --verbose --watch --inlineSourceMap'",
Comment thread
PranitaJainB marked this conversation as resolved.
Outdated
"build:clean": "tsc --build --clean && yarn foreach clean",
"version": "yarn changeset version && yarn install --mode=update-lockfile",
"publish": "yarn foreach npm publish --tolerate-republish",
"postinstall": "yarn foreach run prepack",
Expand Down
55 changes: 55 additions & 0 deletions packages/client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
Comment thread
stellarhoof marked this conversation as resolved.
//Inherits settings from ../tsconfig.all.jsonc which is at root level
"extends": ["../../tsconfig.all.jsonc"],

//Tells TypeScript to only compile files inside the src/ folder and its subdirectories.
//It includes .ts, .tsx, .js, and .jsx
"include": ["src/**/*"],

//compilerOptions inherited from tsconfig.all.jsonc are overridden here.
// i have taken reference from spark/web compilerOptions.In that also we are overridding
Comment thread
PranitaJainB marked this conversation as resolved.
Outdated
"compilerOptions": {
//Provides Node.js global types and includes types for Vitest which is used by test files
"types": ["node", "vitest"],

//In Spark we are creating dist in 2 folders named 'common' and 'common-node' ,
//and those dist files are further consumed by other packages like web etc.
//Do we need to create dist folder for web? "noEmit": true will not create dist folder at all
"noEmit": true,

//Allow Importing TypeScript Extensions, for future support
"allowImportingTsExtensions": true,

//same as what we do in Spark , a node_modules folder at root level , with in a subfolder named 'client'
"tsBuildInfoFile": "../../node_modules/.buildinfo/client",

//Allows TypeScript to compile JavaScript files
"allowJs": true,

//Disables type checking on .js files.
"checkJs": false,

//Ensures that functions always return a value.for example there is whole code of function wrapped under IF statment,
//then it will throw Error: Not all code paths return a value.
"noImplicitReturns": true,

//Forces explicit undefined checks when accessing arrays or objects.
//for example let x = arr[0]; // Error: x might be undefined.
//to fix this let x: number[] | undefined or let x = arr[0] as number;
"noUncheckedIndexedAccess": true,

//Ensures function parameters are used.// Error: 'name' is unused.
"noUnusedParameters": true,

//strict it self holds 6 different type of checks
//strictNullChecks-Error: Type 'null' is not assignable to 'string'
//noImplicitAny-Error: Parameter 'name' implicitly has an 'any' type
//strictFunctionTypes-Error: Type '(age: number) => void' is not assignable to type '(name: string) => void'
//strictBindCallApply-
//strictPropertyInitialization-
//noImplicitThis-
"strict": true,

"isolatedModules": true
}
}
55 changes: 55 additions & 0 deletions packages/export/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
//Inherits settings from ../tsconfig.all.jsonc which is at root level
"extends": ["../../tsconfig.all.jsonc"],

//Tells TypeScript to only compile files inside the src/ folder and its subdirectories.
//It includes .ts, .tsx, .js, and .jsx
"include": ["src/**/*"],

//compilerOptions inherited from tsconfig.all.jsonc are overridden here.
// i have taken reference from spark/web compilerOptions.In that also we are overridding
"compilerOptions": {
//Provides Node.js global types and includes types for Vitest which is used by test files
"types": ["node", "vitest"],

//In Spark we are creating dist in 2 folders named 'common' and 'common-node' ,
//and those dist files are further consumed by other packages like web etc.
//Do we need to create dist folder for web? "noEmit": true will not create dist folder at all
"noEmit": true,

//Allow Importing TypeScript Extensions, for future support
"allowImportingTsExtensions": true,

//same as what we do in Spark , a node_modules folder at root level , with in a subfolder named 'export'
"tsBuildInfoFile": "../../node_modules/.buildinfo/export",

//Allows TypeScript to compile JavaScript files
"allowJs": true,

//Disables type checking on .js files.
"checkJs": false,

//Ensures that functions always return a value.for example there is whole code of function wrapped under IF statment,
//then it will throw Error: Not all code paths return a value.
"noImplicitReturns": true,

//Forces explicit undefined checks when accessing arrays or objects.
//for example let x = arr[0]; // Error: x might be undefined.
//to fix this let x: number[] | undefined or let x = arr[0] as number;
"noUncheckedIndexedAccess": true,

//Ensures function parameters are used.// Error: 'name' is unused.
"noUnusedParameters": true,

//strict it self holds 6 different type of checks
//strictNullChecks-Error: Type 'null' is not assignable to 'string'
//noImplicitAny-Error: Parameter 'name' implicitly has an 'any' type
//strictFunctionTypes-Error: Type '(age: number) => void' is not assignable to type '(name: string) => void'
//strictBindCallApply-
//strictPropertyInitialization-
//noImplicitThis-
"strict": true,

"isolatedModules": true
}
}
55 changes: 55 additions & 0 deletions packages/provider-elasticsearch/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
//Inherits settings from ../tsconfig.all.jsonc which is at root level
"extends": ["../../tsconfig.all.jsonc"],

//Tells TypeScript to only compile files inside the src/ folder and its subdirectories.
//It includes .ts, .tsx, .js, and .jsx
"include": ["src/**/*"],

//compilerOptions inherited from tsconfig.all.jsonc are overridden here.
// i have taken reference from spark/web compilerOptions.In that also we are overridding
"compilerOptions": {
//Provides Node.js global types and includes types for Vitest which is used by test files
"types": ["node", "vitest"],

//In Spark we are creating dist in 2 folders named 'common' and 'common-node' ,
//and those dist files are further consumed by other packages like web etc.
//Do we need to create dist folder for web? "noEmit": true will not create dist folder at all
"noEmit": true,

//Allow Importing TypeScript Extensions, for future support
"allowImportingTsExtensions": true,

//same as what we do in Spark , a node_modules folder at root level , with in a subfolder named 'provider-elasticsearch'
"tsBuildInfoFile": "../../node_modules/.buildinfo/provider-elasticsearch",

//Allows TypeScript to compile JavaScript files
"allowJs": true,

//Disables type checking on .js files.
"checkJs": false,

//Ensures that functions always return a value.for example there is whole code of function wrapped under IF statment,
//then it will throw Error: Not all code paths return a value.
"noImplicitReturns": true,

//Forces explicit undefined checks when accessing arrays or objects.
//for example let x = arr[0]; // Error: x might be undefined.
//to fix this let x: number[] | undefined or let x = arr[0] as number;
"noUncheckedIndexedAccess": true,

//Ensures function parameters are used.// Error: 'name' is unused.
"noUnusedParameters": true,

//strict it self holds 6 different type of checks
//strictNullChecks-Error: Type 'null' is not assignable to 'string'
//noImplicitAny-Error: Parameter 'name' implicitly has an 'any' type
//strictFunctionTypes-Error: Type '(age: number) => void' is not assignable to type '(name: string) => void'
//strictBindCallApply-
//strictPropertyInitialization-
//noImplicitThis-
"strict": true,

"isolatedModules": true
}
}
55 changes: 55 additions & 0 deletions packages/provider-mongo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
//Inherits settings from ../tsconfig.all.jsonc which is at root level
"extends": ["../../tsconfig.all.jsonc"],

//Tells TypeScript to only compile files inside the src/ folder and its subdirectories.
//It includes .ts, .tsx, .js, and .jsx
"include": ["src/**/*"],

//compilerOptions inherited from tsconfig.all.jsonc are overridden here.
// i have taken reference from spark/web compilerOptions.In that also we are overridding
"compilerOptions": {
//Provides Node.js global types and includes types for Vitest which is used by test files
"types": ["node", "vitest"],

//In Spark we are creating dist in 2 folders named 'common' and 'common-node' ,
//and those dist files are further consumed by other packages like web etc.
//Do we need to create dist folder for web? "noEmit": true will not create dist folder at all
"noEmit": true,

//Allow Importing TypeScript Extensions, for future support
"allowImportingTsExtensions": true,

//same as what we do in Spark , a node_modules folder at root level , with in a subfolder named 'provider-mongo'
"tsBuildInfoFile": "../../node_modules/.buildinfo/provider-mongo",

//Allows TypeScript to compile JavaScript files
"allowJs": true,

//Disables type checking on .js files.
"checkJs": false,

//Ensures that functions always return a value.for example there is whole code of function wrapped under IF statment,
//then it will throw Error: Not all code paths return a value.
"noImplicitReturns": true,

//Forces explicit undefined checks when accessing arrays or objects.
//for example let x = arr[0]; // Error: x might be undefined.
//to fix this let x: number[] | undefined or let x = arr[0] as number;
"noUncheckedIndexedAccess": true,

//Ensures function parameters are used.// Error: 'name' is unused.
"noUnusedParameters": true,

//strict it self holds 6 different type of checks
//strictNullChecks-Error: Type 'null' is not assignable to 'string'
//noImplicitAny-Error: Parameter 'name' implicitly has an 'any' type
//strictFunctionTypes-Error: Type '(age: number) => void' is not assignable to type '(name: string) => void'
//strictBindCallApply-
//strictPropertyInitialization-
//noImplicitThis-
"strict": true,

"isolatedModules": true
}
}
55 changes: 55 additions & 0 deletions packages/server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
//Inherits settings from ../tsconfig.all.jsonc which is at root level
"extends": ["../../tsconfig.all.jsonc"],

//Tells TypeScript to only compile files inside the src/ folder and its subdirectories.
//It includes .ts, .tsx, .js, and .jsx
"include": ["src/**/*"],

//compilerOptions inherited from tsconfig.all.jsonc are overridden here.
// i have taken reference from spark/web compilerOptions.In that also we are overridding
"compilerOptions": {
//Provides Node.js global types and includes types for Vitest which is used by test files
"types": ["node", "vitest"],

//In Spark we are creating dist in 2 folders named 'common' and 'common-node' ,
//and those dist files are further consumed by other packages like web etc.
//Do we need to create dist folder for web? "noEmit": true will not create dist folder at all
"noEmit": true,

//Allow Importing TypeScript Extensions, for future support
"allowImportingTsExtensions": true,

//same as what we do in Spark , a node_modules folder at root level , with in a subfolder named 'server'
"tsBuildInfoFile": "../../node_modules/.buildinfo/server",

//Allows TypeScript to compile JavaScript files
"allowJs": true,

//Disables type checking on .js files.
"checkJs": false,

//Ensures that functions always return a value.for example there is whole code of function wrapped under IF statment,
//then it will throw Error: Not all code paths return a value.
"noImplicitReturns": true,

//Forces explicit undefined checks when accessing arrays or objects.
//for example let x = arr[0]; // Error: x might be undefined.
//to fix this let x: number[] | undefined or let x = arr[0] as number;
"noUncheckedIndexedAccess": true,

//Ensures function parameters are used.// Error: 'name' is unused.
"noUnusedParameters": true,

//strict it self holds 6 different type of checks
//strictNullChecks-Error: Type 'null' is not assignable to 'string'
//noImplicitAny-Error: Parameter 'name' implicitly has an 'any' type
//strictFunctionTypes-Error: Type '(age: number) => void' is not assignable to type '(name: string) => void'
//strictBindCallApply-
//strictPropertyInitialization-
//noImplicitThis-
"strict": true,

"isolatedModules": true
}
}
55 changes: 55 additions & 0 deletions packages/util/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
//Inherits settings from ../tsconfig.all.jsonc which is at root level
"extends": ["../../tsconfig.all.jsonc"],

//Tells TypeScript to only compile files inside the src/ folder and its subdirectories.
//It includes .ts, .tsx, .js, and .jsx
"include": ["src/**/*"],

//compilerOptions inherited from tsconfig.all.jsonc are overridden here.
// i have taken reference from spark/web compilerOptions.In that also we are overridding
"compilerOptions": {
//Provides Node.js global types and includes types for Vitest which is used by test files
"types": ["node", "vitest"],

//In Spark we are creating dist in 2 folders named 'common' and 'common-node' ,
//and those dist files are further consumed by other packages like web etc.
//Do we need to create dist folder for web? "noEmit": true will not create dist folder at all
"noEmit": true,

//Allow Importing TypeScript Extensions, for future support
"allowImportingTsExtensions": true,

//same as what we do in Spark , a node_modules folder at root level , with in a subfolder named 'util'
"tsBuildInfoFile": "../../node_modules/.buildinfo/util",

//Allows TypeScript to compile JavaScript files
"allowJs": true,

//Disables type checking on .js files.
"checkJs": false,

//Ensures that functions always return a value.for example there is whole code of function wrapped under IF statment,
//then it will throw Error: Not all code paths return a value.
"noImplicitReturns": true,

//Forces explicit undefined checks when accessing arrays or objects.
//for example let x = arr[0]; // Error: x might be undefined.
//to fix this let x: number[] | undefined or let x = arr[0] as number;
"noUncheckedIndexedAccess": true,

//Ensures function parameters are used.// Error: 'name' is unused.
"noUnusedParameters": true,

//strict it self holds 6 different type of checks
//strictNullChecks-Error: Type 'null' is not assignable to 'string'
//noImplicitAny-Error: Parameter 'name' implicitly has an 'any' type
//strictFunctionTypes-Error: Type '(age: number) => void' is not assignable to type '(name: string) => void'
//strictBindCallApply-
//strictPropertyInitialization-
//noImplicitThis-
"strict": true,

"isolatedModules": true
}
}
19 changes: 19 additions & 0 deletions tsconfig.all.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"allowUnreachableCode": false, // Prevents accidental execution of unreachable code.
"allowUnusedLabels": false, // Disallows unused labels to avoid confusion in code.
"noFallthroughCasesInSwitch": true, // Ensures every switch case explicitly handles its execution flow.
"noUnusedLocals": true, // Reports unused local variables to keep the code clean.
"noErrorTruncation": true, // Prevents truncation of error messages for better debugging.
"isolatedModules": true, // Ensures each module can be transpiled independently for better tooling support.
"verbatimModuleSyntax": true, // Enforces explicit use of `type` imports for type-only dependencies.
"module": "nodenext", // Uses the ES module system compatible with Node.js.
"moduleResolution": "nodenext", // Resolves modules as per Node.js ESM standards.
"resolveJsonModule": true, // Allows importing JSON files as modules.
"types": ["vite/client", "vitest/globals"], // Restricts the global scope to these type definitions.
"jsx": "react", // Specifies JSX transformation method for React applications.
"noEmitOnError": true, // Prevents output generation if there are TypeScript errors.
"incremental": true, // Enables incremental builds for better performance.
"skipLibCheck": true // Skips type checking of library declaration files to speed up compilation.
}
}
14 changes: 14 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Good reference for project references in a monorepo setting
// https://moonrepo.dev/docs/guides/javascript/typescript-project-refs
{
// Do not doubly build files (they're already being built via references).
"files": [],
"references": [
{ "path": "./packages/client/tsconfig.json" },
{ "path": "./packages/export/tsconfig.json" },
{ "path": "./packages/provider-elasticsearch/tsconfig.json" },
{ "path": "./packages/provider-mongo/tsconfig.json" },
{ "path": "./packages/server/tsconfig.json" },
{ "path": "./packages/util/tsconfig.json" }
]
}