diff --git a/package.json b/package.json index f7c4cfff..b8fb5eac 100644 --- a/package.json +++ b/package.json @@ -31,10 +31,7 @@ "node": ">=20" }, "packageManager": "npm@10.8.2", - "workspaces": [ - "packages/*", - "tooling/*" - ], + "workspaces": ["packages/*", "tooling/*"], "config": { "commitizen": { "path": "./node_modules/cz-conventional-changelog" diff --git a/packages/cli/src/commander/handler.ts b/packages/cli/src/commander/handler.ts index 87b8e433..30770005 100644 --- a/packages/cli/src/commander/handler.ts +++ b/packages/cli/src/commander/handler.ts @@ -1,13 +1,13 @@ const handler = ( str: string, - options: { first?: true | undefined; separator: string } + options: { first?: true | undefined; separator: string }, ) => { const limit = options.first ? 1 : undefined; const output = str .split(options.separator, limit) .reduce( (acc: Record, curr, index) => ((acc[curr] = index), acc), - {} + {}, ); console.log(output); }; diff --git a/packages/pastel-cli/package.json b/packages/pastel-cli/package.json index d60ba848..06f3ced3 100644 --- a/packages/pastel-cli/package.json +++ b/packages/pastel-cli/package.json @@ -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" } diff --git a/packages/pastel-cli/source/cli.tsx b/packages/pastel-cli/source/cli.tsx index 8d0bdddd..e73a51f1 100644 --- a/packages/pastel-cli/source/cli.tsx +++ b/packages/pastel-cli/source/cli.tsx @@ -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(); diff --git a/packages/pastel-cli/source/commands/index.tsx b/packages/pastel-cli/source/commands/index.tsx index 04eaf4a6..ace66a90 100644 --- a/packages/pastel-cli/source/commands/index.tsx +++ b/packages/pastel-cli/source/commands/index.tsx @@ -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; + options: zod.infer; }; -export default function Index({options}: Props) { - return ( - - Hello, {options.name} - - ); +export default function Index({ options }: Props) { + return ( + + Hello, {options.name} + + ); } diff --git a/packages/pastel-cli/test.tsx b/packages/pastel-cli/test.tsx index 5e69153e..5bd7c312 100644 --- a/packages/pastel-cli/test.tsx +++ b/packages/pastel-cli/test.tsx @@ -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(); +test("greet user", (t) => { + const { lastFrame } = render(); - t.is(lastFrame(), `Hello, ${chalk.green('Jane')}`); + t.is(lastFrame(), `Hello, ${chalk.green("Jane")}`); }); diff --git a/packages/pastel-cli/tsconfig.json b/packages/pastel-cli/tsconfig.json index 54fa3245..48986746 100644 --- a/packages/pastel-cli/tsconfig.json +++ b/packages/pastel-cli/tsconfig.json @@ -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"] }