Skip to content

Commit 591422b

Browse files
committed
CLI: added whoami command, fixed TypeScript error
1 parent bbaa6ba commit 591422b

File tree

4 files changed

+271
-169
lines changed

4 files changed

+271
-169
lines changed

.changeset/soft-glasses-repair.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/cli": patch
3+
---
4+
5+
Added whoami command, fixed TypeScript error

packages/cli/src/commands/whoami.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { z } from "zod";
2-
import { logger } from "../utils/logger.js";
3-
import { resolvePath } from "../utils/parseNameAndPath.js";
4-
import { TriggerApi } from "../utils/triggerApi.js";
5-
import { DevCommandOptions, getEndpointIdFromPackageJson, getTriggerApiDetails } from "./dev.js";
2+
import { logger } from "../utils/logger";
3+
import { resolvePath } from "../utils/parseNameAndPath";
4+
import { TriggerApi } from "../utils/triggerApi";
5+
import { DevCommandOptions, getEndpointIdFromPackageJson, getTriggerApiDetails } from "./dev";
66
import ora from "ora";
77

88
export const WhoAmICommandOptionsSchema = z.object({
9-
envFile: z.string()
9+
envFile: z.string(),
1010
});
1111

1212
export type WhoAmICommandOptions = z.infer<typeof WhoAmICommandOptionsSchema>;

packages/cli/tsconfig.json

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,52 @@
11
{
2-
"extends": "@trigger.dev/tsconfig/node18.json",
32
"include": ["src/globals.d.ts", "./src/**/*.ts", "tsup.config.ts", "./test/**/*.ts"],
43
"compilerOptions": {
4+
/* LANGUAGE COMPILATION OPTIONS */
5+
"target": "ES2020",
6+
"lib": ["DOM", "DOM.Iterable", "ES2020"],
7+
"module": "ESNext",
8+
"moduleResolution": "node",
9+
"resolveJsonModule": true,
10+
"allowJs": true,
11+
"checkJs": true,
12+
13+
/* EMIT RULES */
14+
"outDir": "./dist",
15+
"noEmit": true, // TSUP takes care of emitting js for us, in a MUCH faster way
16+
"declaration": true,
17+
"declarationMap": true,
18+
"sourceMap": true,
19+
"removeComments": true,
20+
21+
/* TYPE CHECKING RULES */
22+
"strict": true,
23+
// "noImplicitAny": true, // Included in "Strict"
24+
// "noImplicitThis": true, // Included in "Strict"
25+
// "strictBindCallApply": true, // Included in "Strict"
26+
// "strictFunctionTypes": true, // Included in "Strict"
27+
// "strictNullChecks": true, // Included in "Strict"
28+
// "strictPropertyInitialization": true, // Included in "Strict"
29+
"noFallthroughCasesInSwitch": true,
30+
"noImplicitOverride": true,
31+
"noImplicitReturns": true,
32+
"noUnusedLocals": false,
33+
"noUnusedParameters": false,
34+
"useUnknownInCatchVariables": true,
35+
"noUncheckedIndexedAccess": true, // TLDR - Checking an indexed value (array[0]) now forces type <T | undefined> as there is no confirmation that index exists
36+
// THE BELOW ARE EXTRA STRICT OPTIONS THAT SHOULD ONLY BY CONSIDERED IN VERY SAFE PROJECTS
37+
// "exactOptionalPropertyTypes": true, // TLDR - Setting to undefined is not the same as a property not being defined at all
38+
// "noPropertyAccessFromIndexSignature": true, // TLDR - Use dot notation for objects if youre sure it exists, use ['index'] notaion if unsure
39+
40+
/* OTHER OPTIONS */
41+
"allowSyntheticDefaultImports": true,
42+
"esModuleInterop": true,
43+
// "emitDecoratorMetadata": true,
44+
// "experimentalDecorators": true,
45+
"forceConsistentCasingInFileNames": true,
46+
"skipLibCheck": true,
47+
"useDefineForClassFields": true,
548
"experimentalDecorators": true,
649
"emitDecoratorMetadata": true,
7-
"declaration": false,
8-
"declarationMap": false,
950
"types": ["jest"]
1051
},
1152
"exclude": ["node_modules"]

0 commit comments

Comments
 (0)