mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
Merge pull request #1870 from outslept/feat/migrating-to-tinyexec
Deps: Replaced `execa` with `tinyexec` & removed unused devDeps
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@fumadocs/cli": patch
|
||||
---
|
||||
|
||||
Replace `execa` with `tinyexec` & removed unused devDeps
|
||||
@@ -35,18 +35,16 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@clack/prompts": "^0.10.1",
|
||||
"commander": "^13.1.0",
|
||||
"execa": "^9.5.3",
|
||||
"commander": "^14.0.0",
|
||||
"package-manager-detector": "^1.3.0",
|
||||
"picocolors": "^1.1.1",
|
||||
"tinyexec": "^1.0.1",
|
||||
"ts-morph": "^25.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/cross-spawn": "^6.0.6",
|
||||
"@types/node": "22.15.18",
|
||||
"@types/react": "^19.1.4",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"fast-glob": "^3.3.3",
|
||||
"tsconfig": "workspace:*",
|
||||
"tsx": "^4.19.4"
|
||||
},
|
||||
|
||||
@@ -3,7 +3,7 @@ import fs from 'node:fs/promises';
|
||||
import { log, confirm, isCancel, outro, spinner, intro } from '@clack/prompts';
|
||||
import { type Project } from 'ts-morph';
|
||||
import picocolors from 'picocolors';
|
||||
import { execa } from 'execa';
|
||||
import { x } from 'tinyexec';
|
||||
import { createEmptyProject } from '@/utils/typescript';
|
||||
import { getPackageManager } from '@/utils/get-package-manager';
|
||||
import { type Config, defaultConfig } from '@/config';
|
||||
@@ -77,9 +77,8 @@ export async function add(
|
||||
if (value) {
|
||||
const spin = spinner();
|
||||
spin.start('Installing dependencies...');
|
||||
if (deps.length > 0) await execa(manager, ['install', ...deps]);
|
||||
if (devDeps.length > 0)
|
||||
await execa(manager, ['install', ...devDeps, '-D']);
|
||||
if (deps.length > 0) await x(manager, ['install', ...deps]);
|
||||
if (devDeps.length > 0) await x(manager, ['install', ...devDeps, '-D']);
|
||||
|
||||
spin.stop('Dependencies installed.');
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
note,
|
||||
} from '@clack/prompts';
|
||||
import picocolors from 'picocolors';
|
||||
import { execa } from 'execa';
|
||||
import { x } from 'tinyexec';
|
||||
import { getPackageManager } from '@/utils/get-package-manager';
|
||||
import { exists } from '@/utils/fs';
|
||||
import { isSrc } from '@/utils/is-src';
|
||||
@@ -130,7 +130,7 @@ export async function init(plugin: Plugin, config: Config = {}): Promise<void> {
|
||||
if (value) {
|
||||
const spin = spinner();
|
||||
spin.start('Installing dependencies');
|
||||
await execa(manager, ['install', ...plugin.dependencies]);
|
||||
await x(manager, ['install', ...plugin.dependencies]);
|
||||
spin.stop('Successfully installed.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { execa } from 'execa';
|
||||
import { x } from 'tinyexec';
|
||||
import type { JsonTreeNode } from '@/commands/file-tree';
|
||||
|
||||
export async function runTree(args: string): Promise<JsonTreeNode[]> {
|
||||
const out = await execa('tree', [args, '--gitignore', '--prune', '-J']);
|
||||
const out = await x('tree', [args, '--gitignore', '--prune', '-J']);
|
||||
|
||||
try {
|
||||
return JSON.parse(out.stdout) as JsonTreeNode[];
|
||||
|
||||
Generated
+566
-1041
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user