Skip to content

Commit 4282af0

Browse files
committed
chore(create-pyth-package): responded to PR feedback about removing the yargs helper function
also fixed some of the generated contents
1 parent d5d22e9 commit 4282af0

File tree

8 files changed

+6
-24
lines changed

8 files changed

+6
-24
lines changed

packages/create-pyth-package/src/templates/cli/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ TODO: Fill out readme with more instructions
99
From the root of this repo:
1010

1111
```
12-
pnpm --dir ./{{relativeFolder}} start
12+
pnpm --dir ./{{relativeFolder}} start:dev
1313
```
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env node
22

3-
import "./dist/index.mjs";
3+
import "./dist/cli.mjs";

packages/create-pyth-package/src/templates/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"clean": "rm -rf dist/",
2424
"fix:lint": "eslint src/ --fix --max-warnings 0",
2525
"fix:format": "prettier --write \"src/**/*.ts\"",
26-
"start:dev": "tsx ./src/index.ts",
26+
"start:dev": "tsx ./src/cli.ts",
2727
"test:lint": "eslint src/ --max-warnings 0",
2828
"test:format": "prettier --check \"src/**/*.ts\"",
2929
"test:unit": "jest"

packages/create-pyth-package/src/templates/cli/src/cli.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import createCLI from "yargs";
22
import { hideBin } from "yargs/helpers";
3+
34
import { setupHelloWorldCommand } from "./commands/hello-world-cmd.js";
45

56
async function setupCLI() {
@@ -8,7 +9,7 @@ async function setupCLI() {
89

910
const { _ } = await yargs.help().argv;
1011

11-
if (!_.length) {
12+
if (_.length === 0) {
1213
yargs.showHelp();
1314
return;
1415
}

packages/create-pyth-package/src/templates/cli/src/commands/hello-world-cmd.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import type { Argv } from "yargs";
2-
import { createCommand } from "../create-command.js";
32

43
export function setupHelloWorldCommand(yargs: Argv) {
5-
return createCommand(
6-
yargs,
4+
return yargs.command(
75
"hello-world",
86
"prints hello world and your name, if provided",
97
(y) =>

packages/create-pyth-package/src/templates/cli/src/commands/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/create-pyth-package/src/templates/cli/src/create-command.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/create-pyth-package/src/templates/cli/src/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)