Skip to content

Commit c7c5fd7

Browse files
committed
Fixed the examples job path
1 parent 4630960 commit c7c5fd7

File tree

3 files changed

+295
-31
lines changed

3 files changed

+295
-31
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ pnpm run dev
136136
3. Create a new temporary Next.js app in examples directory
137137

138138
```sh
139-
pnpm create next-app@latest
139+
pnpm create next-app@latest test-cli --ts --no-eslint --tailwind --app --src-dir --import-alias "@/*"
140140
```
141141

142142
Follow the prompts to create a TypeScript project using the App Directory.
@@ -145,14 +145,15 @@ Follow the prompts to create a TypeScript project using the App Directory.
145145

146146
```json
147147
{
148+
// other package.json properties
148149
"devDependencies": { "@trigger.dev/cli": "workspace:*" }
149150
}
150151
```
151152
152153
5. Open a new terminal window, navigate into the example, and initialize the CLI:
153154
154155
```sh
155-
cd examples/your-newly-created-nextjs-project
156+
cd examples/test-cli
156157
pnpm i
157158
pnpm exec trigger-cli init
158159
```

packages/cli/src/commands/init.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,7 @@ async function detectUseOfSrcDir(path: string): Promise<boolean> {
280280

281281
// Detect the use of pages or app dir in the Next.js project
282282
// Import the next.config.js file and check for experimental: { appDir: true }
283-
async function detectPagesOrAppDir(
284-
path: string,
285-
usesSrcDir = false,
286-
): Promise<"pages" | "app"> {
283+
async function detectPagesOrAppDir(path: string, usesSrcDir = false): Promise<"pages" | "app"> {
287284
const nextConfigPath = pathModule.join(path, "next.config.js");
288285
const importedConfig = await import(pathToFileURL(nextConfigPath).toString()).catch(() => ({}));
289286

@@ -554,9 +551,7 @@ export * from "./examples"
554551
examplesIndexContent
555552
);
556553

557-
logger.success(
558-
`✅ Created example job at ${usesSrcDir ? "src/" : ""}jobs/examples/examplesFileName`
559-
);
554+
logger.success(`✅ Created example job at ${usesSrcDir ? "src/" : ""}jobs/examples.ts`);
560555
}
561556
}
562557

0 commit comments

Comments
 (0)