Skip to content

Commit

Permalink
refactor(cli): use citty rewrite cli
Browse files Browse the repository at this point in the history
- Use `citty` rewrite cli
- Refactor all commands to citty
- Defaults to start a dev server

Resolved: farm-fe#1123
  • Loading branch information
fu050409 committed Jul 3, 2024
1 parent 8106989 commit f2ac316
Show file tree
Hide file tree
Showing 7 changed files with 350 additions and 200 deletions.
11 changes: 6 additions & 5 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"canonicalize",
"changset",
"chpos",
"citty",
"clippy",
"clsx",
"codeframe",
Expand Down Expand Up @@ -64,6 +65,7 @@
"fnames",
"Fock",
"funs",
"globset",
"gnueabihf",
"guolao",
"hashbrown",
Expand Down Expand Up @@ -124,6 +126,7 @@
"pnpm",
"preact",
"prefixer",
"primevue",
"proto",
"protobuf",
"protoc",
Expand All @@ -142,6 +145,7 @@
"Rustup",
"sabi",
"safelisted",
"shulan",
"shulandmimi",
"sirv",
"srcset",
Expand Down Expand Up @@ -175,13 +179,10 @@
"walkdir",
"wasi",
"wasix",
"wasmer",
"wechat",
"xlink",
"Yuxi",
"wasmer",
"primevue",
"shulan",
"globset"
"Yuxi"
],
"ignorePaths": [
"pnpm-lock.yaml",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"node": ">= 16"
},
"dependencies": {
"cac": "^6.7.14",
"cross-spawn": "^7.0.3",
"citty": "^0.1.6",
"inquirer": "^9.1.4",
"walkdir": "^0.4.1"
},
Expand Down
7 changes: 5 additions & 2 deletions packages/cli/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { FarmCLIOptions, UserConfig } from '@farmfe/core';
import { FarmCLIBuildOptions, GlobalFarmCLIOptions } from './types.js';
import {
GlobalFarmCLIOptions,
NormalizedFarmCLIBuildOptions
} from './types.js';

export function getOptionFromBuildOption(
options: FarmCLIBuildOptions & GlobalFarmCLIOptions
options: NormalizedFarmCLIBuildOptions & GlobalFarmCLIOptions
): FarmCLIOptions & UserConfig {
const {
input,
Expand Down
Loading

0 comments on commit f2ac316

Please sign in to comment.