Skip to content

Commit

Permalink
adds cause option to errors and updates compiler option to es2022
Browse files Browse the repository at this point in the history
Signed-off-by: Neeraj Gartia <[email protected]>
  • Loading branch information
NeerajGartia21 committed Jan 15, 2024
1 parent 3ad61cc commit 4e2a7e2
Show file tree
Hide file tree
Showing 19 changed files with 38 additions and 38 deletions.
4 changes: 2 additions & 2 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"test": "jest --verbose",
"lint": "eslint ./",
"clean": "shx rm -rf ./dist",
"build:web-esm": "esbuild src/index.ts --bundle --external:@openfeature/core --sourcemap --target=es2016 --platform=browser --format=esm --outfile=./dist/esm/index.js --analyze",
"build:web-cjs": "esbuild src/index.ts --bundle --external:@openfeature/core --sourcemap --target=es2016 --platform=browser --format=cjs --outfile=./dist/cjs/index.js --analyze",
"build:web-esm": "esbuild src/index.ts --bundle --external:@openfeature/core --sourcemap --target=es2022 --platform=browser --format=esm --outfile=./dist/esm/index.js --analyze",
"build:web-cjs": "esbuild src/index.ts --bundle --external:@openfeature/core --sourcemap --target=es2022 --platform=browser --format=cjs --outfile=./dist/cjs/index.js --analyze",
"build:rollup-types": "rollup -c ../../rollup.config.mjs",
"build": "npm run clean && npm run build:web-esm && npm run build:web-cjs && npm run build:rollup-types",
"postbuild": "shx cp ./../../package.esm.json ./dist/esm/package.json",
Expand Down
4 changes: 2 additions & 2 deletions packages/client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/* Language and Environment */
"target": "ES2015", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"lib": [
"ES2020",
"ES2022",
"DOM"
], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
Expand All @@ -24,7 +24,7 @@
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
/* Modules */
"module": "ES2020", /* Specify what module code is generated. */
"module": "ES2022", /* Specify what module code is generated. */
// "rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
Expand Down
4 changes: 2 additions & 2 deletions packages/nest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"test": "jest --verbose",
"lint": "eslint ./",
"clean": "shx rm -rf ./dist",
"build:esm": "esbuild src/index.ts --bundle --external:@nestjs/* --external:@openfeature/server-sdk --sourcemap --target=es2016 --platform=node --format=esm --outfile=./dist/esm/index.js --analyze",
"build:cjs": "esbuild src/index.ts --bundle --external:@nestjs/* --external:@openfeature/server-sdk --sourcemap --target=es2016 --platform=node --format=cjs --outfile=./dist/cjs/index.js --analyze",
"build:esm": "esbuild src/index.ts --bundle --external:@nestjs/* --external:@openfeature/server-sdk --sourcemap --target=es2022 --platform=node --format=esm --outfile=./dist/esm/index.js --analyze",
"build:cjs": "esbuild src/index.ts --bundle --external:@nestjs/* --external:@openfeature/server-sdk --sourcemap --target=es2022 --platform=node --format=cjs --outfile=./dist/cjs/index.js --analyze",
"build:rollup-types": "rollup -c ../../rollup.config.mjs",
"build": "npm run clean && npm run build:esm && npm run build:cjs && npm run build:rollup-types",
"postbuild": "shx cp ./../../package.esm.json ./dist/esm/package.json",
Expand Down
4 changes: 2 additions & 2 deletions packages/nest/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"target": "ES2015",
/* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"lib": [
"ES2020"
"ES2022"
],
/* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
Expand All @@ -27,7 +27,7 @@
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
/* Modules */
"module": "ES2020",
"module": "ES2022",
/* Specify what module code is generated. */
// "rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "node",
Expand Down
4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"test": "jest --verbose",
"lint": "eslint ./",
"clean": "shx rm -rf ./dist",
"build:react-esm": "esbuild src/index.ts --bundle --external:react --external:@openfeature/web-sdk --sourcemap --target=es2016 --platform=browser --format=esm --outfile=./dist/esm/index.js --analyze",
"build:react-cjs": "esbuild src/index.ts --bundle --external:react --external:@openfeature/web-sdk --sourcemap --target=es2016 --platform=browser --format=cjs --outfile=./dist/cjs/index.js --analyze",
"build:react-esm": "esbuild src/index.ts --bundle --external:react --external:@openfeature/web-sdk --sourcemap --target=es2022 --platform=browser --format=esm --outfile=./dist/esm/index.js --analyze",
"build:react-cjs": "esbuild src/index.ts --bundle --external:react --external:@openfeature/web-sdk --sourcemap --target=es2022 --platform=browser --format=cjs --outfile=./dist/cjs/index.js --analyze",
"build:rollup-types": "rollup -c ../../rollup.config.mjs",
"build": "npm run clean && npm run build:react-esm && npm run build:react-cjs && npm run build:rollup-types",
"postbuild": "shx cp ./../../package.esm.json ./dist/esm/package.json",
Expand Down
4 changes: 2 additions & 2 deletions packages/react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/* Language and Environment */
"target": "ES2015", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"lib": [
"ES2020",
"ES2022",
"DOM"
], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
Expand All @@ -25,7 +25,7 @@
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
/* Modules */
"module": "ES2020", /* Specify what module code is generated. */
"module": "ES2022", /* Specify what module code is generated. */
// "rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
Expand Down
4 changes: 2 additions & 2 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"test": "jest --verbose",
"lint": "eslint ./",
"clean": "shx rm -rf ./dist",
"build:esm": "esbuild src/index.ts --bundle --external:@openfeature/core --sourcemap --target=es2016 --platform=node --format=esm --outfile=./dist/esm/index.js --analyze",
"build:cjs": "esbuild src/index.ts --bundle --external:@openfeature/core --sourcemap --target=es2016 --platform=node --format=cjs --outfile=./dist/cjs/index.js --analyze",
"build:esm": "esbuild src/index.ts --bundle --external:@openfeature/core --sourcemap --target=es2022 --platform=node --format=esm --outfile=./dist/esm/index.js --analyze",
"build:cjs": "esbuild src/index.ts --bundle --external:@openfeature/core --sourcemap --target=es2022 --platform=node --format=cjs --outfile=./dist/cjs/index.js --analyze",
"build:rollup-types": "rollup -c ../../rollup.config.mjs",
"build": "npm run clean && npm run build:esm && npm run build:cjs && npm run build:rollup-types",
"postbuild": "shx cp ./../../package.esm.json ./dist/esm/package.json",
Expand Down
4 changes: 2 additions & 2 deletions packages/server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/* Language and Environment */
"target": "ES2015", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"lib": [
"ES2020",
"ES2022",
], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
Expand All @@ -23,7 +23,7 @@
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
/* Modules */
"module": "ES2020", /* Specify what module code is generated. */
"module": "ES2022", /* Specify what module code is generated. */
// "rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"lint": "eslint ./",
"clean": "shx rm -rf ./dist",
"type": "tsc --project ./tsconfig.json --declaration --emitDeclarationOnly",
"build:esm": "esbuild src/index.ts --bundle --external:events --sourcemap --target=es2016 --format=esm --outfile=./dist/esm/index.js --analyze",
"build:cjs": "esbuild src/index.ts --bundle --external:events --sourcemap --target=es2016 --format=cjs --outfile=./dist/cjs/index.js --analyze",
"build:esm": "esbuild src/index.ts --bundle --external:events --sourcemap --target=es2022 --format=esm --outfile=./dist/esm/index.js --analyze",
"build:cjs": "esbuild src/index.ts --bundle --external:events --sourcemap --target=es2022 --format=cjs --outfile=./dist/cjs/index.js --analyze",
"build:rollup-types": "rollup -c ../../rollup.config.mjs",
"build": "npm run clean && npm run build:esm && npm run build:cjs && npm run build:rollup-types",
"postbuild": "shx cp ./../../package.esm.json ./dist/esm/package.json",
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/src/errors/flag-not-found-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { ErrorCode } from '../evaluation';

export class FlagNotFoundError extends OpenFeatureError {
code: ErrorCode;
constructor(message?: string) {
super(message);
constructor(message?: string, options?: ErrorOptions) {
super(message, options);
Object.setPrototypeOf(this, FlagNotFoundError.prototype);
this.name = 'FlagNotFoundError';
this.code = ErrorCode.FLAG_NOT_FOUND;
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/src/errors/general-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { ErrorCode } from '../evaluation';

export class GeneralError extends OpenFeatureError {
code: ErrorCode;
constructor(message?: string) {
super(message);
constructor(message?: string, options?: ErrorOptions) {
super(message, options);
Object.setPrototypeOf(this, GeneralError.prototype);
this.name = 'GeneralError';
this.code = ErrorCode.GENERAL;
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/src/errors/invalid-context-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { ErrorCode } from '../evaluation';

export class InvalidContextError extends OpenFeatureError {
code: ErrorCode;
constructor(message?: string) {
super(message);
constructor(message?: string, options?: ErrorOptions) {
super(message, options);
Object.setPrototypeOf(this, InvalidContextError.prototype);
this.name = 'InvalidContextError';
this.code = ErrorCode.INVALID_CONTEXT;
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/src/errors/open-feature-error-abstract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { ErrorCode } from '../evaluation';

export abstract class OpenFeatureError extends Error {
abstract code: ErrorCode;
constructor(message?: string) {
super(message);
constructor(message?: string, options?: ErrorOptions) {
super(message, options);
Object.setPrototypeOf(this, OpenFeatureError.prototype);
this.name = 'OpenFeatureError';
}
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/src/errors/parse-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { ErrorCode } from '../evaluation';

export class ParseError extends OpenFeatureError {
code: ErrorCode;
constructor(message?: string) {
super(message);
constructor(message?: string, options?: ErrorOptions) {
super(message, options);
Object.setPrototypeOf(this, ParseError.prototype);
this.name = 'ParseError';
this.code = ErrorCode.PARSE_ERROR;
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/src/errors/provider-not-ready-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { ErrorCode } from '../evaluation';

export class ProviderNotReadyError extends OpenFeatureError {
code: ErrorCode;
constructor(message?: string) {
super(message);
constructor(message?: string, options?: ErrorOptions) {
super(message, options);
Object.setPrototypeOf(this, ProviderNotReadyError.prototype);
this.name = 'ProviderNotReadyError';
this.code = ErrorCode.PROVIDER_NOT_READY;
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/src/errors/targeting-key-missing-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { ErrorCode } from '../evaluation';

export class TargetingKeyMissingError extends OpenFeatureError {
code: ErrorCode;
constructor(message?: string) {
super(message);
constructor(message?: string, options?: ErrorOptions) {
super(message, options);
Object.setPrototypeOf(this, TargetingKeyMissingError.prototype);
this.name = 'TargetingKeyMissingError';
this.code = ErrorCode.TARGETING_KEY_MISSING;
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/src/errors/type-mismatch-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { ErrorCode } from '../evaluation';

export class TypeMismatchError extends OpenFeatureError {
code: ErrorCode;
constructor(message?: string) {
super(message);
constructor(message?: string, options?: ErrorOptions) {
super(message, options);
Object.setPrototypeOf(this, TypeMismatchError.prototype);
this.name = 'TypeMismatchError';
this.code = ErrorCode.TYPE_MISMATCH;
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/* Language and Environment */
"target": "ES2015", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"lib": [
"ES2020"
"ES2022"
], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
Expand All @@ -23,7 +23,7 @@
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
/* Modules */
"module": "ES2020", /* Specify what module code is generated. */
"module": "ES2022", /* Specify what module code is generated. */
// "rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/* Language and Environment */
"target": "ES2015", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"lib": [
"ES2020",
"ES2022",
"DOM"
], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
Expand All @@ -24,7 +24,7 @@
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
/* Modules */
"module": "ES2020", /* Specify what module code is generated. */
"module": "ES2022", /* Specify what module code is generated. */
// "rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
Expand Down

0 comments on commit 4e2a7e2

Please sign in to comment.