Skip to content

Commit

Permalink
fix: make service compatible with new pylon versions
Browse files Browse the repository at this point in the history
  • Loading branch information
schettn committed Apr 21, 2024
1 parent 688ade0 commit 0e1138d
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
Binary file modified bun.lockb
Binary file not shown.
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
]
}
},
"pylon": {
"external": [
"bull"
]
},
"files": [
"src/client",
"package.json"
],
"config": {
Expand Down
6 changes: 3 additions & 3 deletions src/errors/translator.errors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ServiceError } from "@snek-at/function";
import { ServiceError } from "@cronitio/pylon";

export class TaskNotFoundError extends ServiceError {
constructor(id: string) {
Expand All @@ -7,7 +7,7 @@ export class TaskNotFoundError extends ServiceError {
super(message, {
statusCode: 404,
code: "TASK_NOT_FOUND",
message,
details: { message },
});
}
}
Expand All @@ -17,7 +17,7 @@ export class TaskCreationError extends ServiceError {
super(message, {
statusCode: 500,
code: "TASK_CREATION_ERROR",
message,
details: { message },
});
}
}
32 changes: 32 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"compilerOptions": {
// project options
"lib": ["ES2020"], // specifies which default set of type definitions to use ("DOM", "ES6", etc)
"outDir": "dist", // .js (as well as .d.ts, .js.map, etc.) files will be emitted into this directory.,
"removeComments": true, // Strips all comments from TypeScript files when converting into JavaScript- you rarely read compiled code so this saves space
"target": "ES2020", // Target environment. Most modern browsers support ES6, but you may want to set it to newer or older. (defaults to ES3)
"module": "ESNext",


// Module resolution
"baseUrl": "./", // Lets you set a base directory to resolve non-absolute module names.
"esModuleInterop": true, // fixes some issues TS originally had with the ES6 spec where TypeScript treats CommonJS/AMD/UMD modules similar to ES6 module
"moduleResolution": "node", // Pretty much always node for modern JS. Other option is "classic"

// Source Map
"sourceMap": true, // enables the use of source maps for debuggers and error reporting etc
"sourceRoot": "/", // Specify the location where a debugger should locate TypeScript files instead of relative source locations.

// Strict Checks
"strictNullChecks": true, // When strictNullChecks is true, null and undefined have their own distinct types and you’ll get a type error if you try to use them where a concrete value is expected.

"declaration": true, // Generates a declaration .d.ts file for every .ts file.
"skipLibCheck": true, // Skip type checking of all declaration files (*.d.ts).
"allowSyntheticDefaultImports": true, // Allow default imports from modules with no default export. This does not affect code emit, just typechecking.
// "resolveJsonModule": true, // Allow importing .json files
"typeRoots": ["node_modules/@types", "src/@types"], // Specify multiple folders that act like `./node_modules/@types`.
"types": ["node"],
"experimentalDecorators": true,
"resolveJsonModule": true
}
}

0 comments on commit 0e1138d

Please sign in to comment.