-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli, pastel-cli): fix formatting in cli and pastel-cli
- Loading branch information
Showing
7 changed files
with
82 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,53 @@ | ||
{ | ||
"name": "pastel-cli", | ||
"version": "0.0.0", | ||
"license": "MIT", | ||
"bin": "dist/cli.js", | ||
"type": "module", | ||
"engines": { | ||
"node": ">=16" | ||
}, | ||
"scripts": { | ||
"build": "tsc", | ||
"dev": "tsc --watch", | ||
"test": "prettier --check . && xo && ava", | ||
"cli": "tsx source/cli.tsx" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"dependencies": { | ||
"ink": "^4.1.0", | ||
"pastel": "^2.0.0", | ||
"react": "^18.2.0", | ||
"zod": "^3.21.4" | ||
}, | ||
"devDependencies": { | ||
"@sindresorhus/tsconfig": "^3.0.1", | ||
"@types/react": "^18.0.32", | ||
"@vdemedes/prettier-config": "^2.0.1", | ||
"ava": "^5.2.0", | ||
"chalk": "^5.2.0", | ||
"eslint-config-xo-react": "^0.27.0", | ||
"eslint-plugin-react": "^7.32.2", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"ink-testing-library": "^3.0.0", | ||
"prettier": "^2.8.7", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^5.0.3", | ||
"xo": "^0.54.2" | ||
}, | ||
"ava": { | ||
"extensions": { | ||
"ts": "module", | ||
"tsx": "module" | ||
}, | ||
"nodeArguments": [ | ||
"--loader=ts-node/esm" | ||
] | ||
}, | ||
"xo": { | ||
"extends": "xo-react", | ||
"prettier": true, | ||
"rules": { | ||
"react/prop-types": "off" | ||
} | ||
}, | ||
"prettier": "@vdemedes/prettier-config" | ||
"name": "pastel-cli", | ||
"version": "0.0.0", | ||
"license": "MIT", | ||
"bin": "dist/cli.js", | ||
"type": "module", | ||
"engines": { | ||
"node": ">=16" | ||
}, | ||
"scripts": { | ||
"build": "tsc", | ||
"dev": "tsc --watch", | ||
"test": "prettier --check . && xo && ava", | ||
"cli": "tsx source/cli.tsx" | ||
}, | ||
"files": ["dist"], | ||
"dependencies": { | ||
"ink": "^4.1.0", | ||
"pastel": "^2.0.0", | ||
"react": "^18.2.0", | ||
"zod": "^3.21.4" | ||
}, | ||
"devDependencies": { | ||
"@sindresorhus/tsconfig": "^3.0.1", | ||
"@types/react": "^18.0.32", | ||
"@vdemedes/prettier-config": "^2.0.1", | ||
"ava": "^5.2.0", | ||
"chalk": "^5.2.0", | ||
"eslint-config-xo-react": "^0.27.0", | ||
"eslint-plugin-react": "^7.32.2", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"ink-testing-library": "^3.0.0", | ||
"prettier": "^2.8.7", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^5.0.3", | ||
"xo": "^0.54.2" | ||
}, | ||
"ava": { | ||
"extensions": { | ||
"ts": "module", | ||
"tsx": "module" | ||
}, | ||
"nodeArguments": ["--loader=ts-node/esm"] | ||
}, | ||
"xo": { | ||
"extends": "xo-react", | ||
"prettier": true, | ||
"rules": { | ||
"react/prop-types": "off" | ||
} | ||
}, | ||
"prettier": "@vdemedes/prettier-config" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#!/usr/bin/env node | ||
import Pastel from 'pastel'; | ||
import Pastel from "pastel"; | ||
|
||
const app = new Pastel({ | ||
importMeta: import.meta, | ||
importMeta: import.meta, | ||
}); | ||
|
||
await app.run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import React from 'react'; | ||
import {Text} from 'ink'; | ||
import zod from 'zod'; | ||
import { Text } from "ink"; | ||
import React from "react"; | ||
import zod from "zod"; | ||
|
||
export const options = zod.object({ | ||
name: zod.string().default('Stranger').describe('Name'), | ||
name: zod.string().default("Stranger").describe("Name"), | ||
}); | ||
|
||
type Props = { | ||
options: zod.infer<typeof options>; | ||
options: zod.infer<typeof options>; | ||
}; | ||
|
||
export default function Index({options}: Props) { | ||
return ( | ||
<Text> | ||
Hello, <Text color="green">{options.name}</Text> | ||
</Text> | ||
); | ||
export default function Index({ options }: Props) { | ||
return ( | ||
<Text> | ||
Hello, <Text color="green">{options.name}</Text> | ||
</Text> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import React from 'react'; | ||
import chalk from 'chalk'; | ||
import test from 'ava'; | ||
import {render} from 'ink-testing-library'; | ||
import Index from './source/commands/index.js'; | ||
import test from "ava"; | ||
import chalk from "chalk"; | ||
import { render } from "ink-testing-library"; | ||
import React from "react"; | ||
import Index from "./source/commands/index.js"; | ||
|
||
test('greet user', t => { | ||
const {lastFrame} = render(<Index options={{name: 'Jane'}} />); | ||
test("greet user", (t) => { | ||
const { lastFrame } = render(<Index options={{ name: "Jane" }} />); | ||
|
||
t.is(lastFrame(), `Hello, ${chalk.green('Jane')}`); | ||
t.is(lastFrame(), `Hello, ${chalk.green("Jane")}`); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"extends": "@sindresorhus/tsconfig", | ||
"compilerOptions": { | ||
"moduleResolution": "node16", | ||
"module": "Node16", | ||
"outDir": "dist" | ||
}, | ||
"include": ["source"] | ||
"extends": "@sindresorhus/tsconfig", | ||
"compilerOptions": { | ||
"moduleResolution": "node16", | ||
"module": "Node16", | ||
"outDir": "dist" | ||
}, | ||
"include": ["source"] | ||
} |