@yamada-ui/cli 2.1.0 → 2.1.1-dev-20260311092521
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +15 -19
- package/package.json +4 -2
package/dist/index.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import path from "node:path";
|
|
|
10
10
|
import { format, promisify } from "node:util";
|
|
11
11
|
import os from "node:os";
|
|
12
12
|
import fs, { existsSync, realpathSync, statSync } from "fs";
|
|
13
|
+
import { promisify as promisify$1 } from "util";
|
|
13
14
|
import os$1, { tmpdir } from "os";
|
|
14
15
|
import path$1 from "path";
|
|
15
16
|
import fs$1 from "node:fs";
|
|
@@ -23,9 +24,9 @@ import { mkdir, mkdtemp, readFile, readdir, writeFile } from "fs/promises";
|
|
|
23
24
|
import { Listr } from "listr2";
|
|
24
25
|
import ora from "ora";
|
|
25
26
|
import prompts from "prompts";
|
|
26
|
-
import { ExecaError, execa } from "execa";
|
|
27
27
|
import "validate-npm-package-name";
|
|
28
28
|
import YAML from "yamljs";
|
|
29
|
+
import { execFile } from "child_process";
|
|
29
30
|
import { glob } from "glob";
|
|
30
31
|
import { ESLint } from "eslint";
|
|
31
32
|
import { format as format$1, resolveConfig, resolveConfigFile } from "prettier";
|
|
@@ -5528,6 +5529,9 @@ var package_default = {
|
|
|
5528
5529
|
"clean": "rimraf node_modules dist trace coverage .turbo .eslintcache",
|
|
5529
5530
|
"dev": "tsx src/index.ts",
|
|
5530
5531
|
"build": "tsdown",
|
|
5532
|
+
"test": "vitest",
|
|
5533
|
+
"test:dev": "vitest --watch --ui",
|
|
5534
|
+
"test:coverage": "vitest run --coverage",
|
|
5531
5535
|
"typecheck": " tsc --noEmit",
|
|
5532
5536
|
"typetrace": "tsc --noEmit --generateTrace ./trace --incremental false",
|
|
5533
5537
|
"typeanalyze": "npx analyze-trace ./trace --expandTypes=false",
|
|
@@ -5544,7 +5548,6 @@ var package_default = {
|
|
|
5544
5548
|
"diff": "^8.0.3",
|
|
5545
5549
|
"esbuild": "^0.27.3",
|
|
5546
5550
|
"eslint": "^9.39.3",
|
|
5547
|
-
"execa": "9.6.1",
|
|
5548
5551
|
"glob": "^13.0.6",
|
|
5549
5552
|
"https-proxy-agent": "^7.0.6",
|
|
5550
5553
|
"listr2": "^10.2.1",
|
|
@@ -5732,6 +5735,7 @@ async function formatFiles(patterns, { enabled = true, ...options } = {}) {
|
|
|
5732
5735
|
//#endregion
|
|
5733
5736
|
//#region src/utils/fs.ts
|
|
5734
5737
|
const cwd = process.env.INIT_CWD ?? process.cwd();
|
|
5738
|
+
const execFileAsync$1 = promisify$1(execFile);
|
|
5735
5739
|
async function isWriteable(directory) {
|
|
5736
5740
|
try {
|
|
5737
5741
|
await fs.promises.access(directory, ("constants" in fs ? fs.constants : fs).W_OK);
|
|
@@ -5884,24 +5888,15 @@ function packageExecuteCommands(packageManager) {
|
|
|
5884
5888
|
}
|
|
5885
5889
|
async function installDependencies(dependencies$1, { cwd: cwd$1, dev, exact = true } = {}) {
|
|
5886
5890
|
const packageManager = getPackageManager();
|
|
5887
|
-
if (dependencies$1?.length) await
|
|
5891
|
+
if (dependencies$1?.length) await execFileAsync$1(packageManager, [...packageAddArgs(packageManager, {
|
|
5888
5892
|
dev,
|
|
5889
5893
|
exact
|
|
5890
|
-
}), ...dependencies$1], {
|
|
5891
|
-
|
|
5892
|
-
stdout: "ignore"
|
|
5893
|
-
});
|
|
5894
|
-
else await execa(packageManager, ["install"], {
|
|
5895
|
-
cwd: cwd$1,
|
|
5896
|
-
stdout: "ignore"
|
|
5897
|
-
});
|
|
5894
|
+
}), ...dependencies$1], { cwd: cwd$1 });
|
|
5895
|
+
else await execFileAsync$1(packageManager, ["install"], { cwd: cwd$1 });
|
|
5898
5896
|
}
|
|
5899
5897
|
async function uninstallDependencies(dependencies$1, { cwd: cwd$1 } = {}) {
|
|
5900
5898
|
const packageManager = getPackageManager();
|
|
5901
|
-
if (dependencies$1.length) await
|
|
5902
|
-
cwd: cwd$1,
|
|
5903
|
-
stdout: "ignore"
|
|
5904
|
-
});
|
|
5899
|
+
if (dependencies$1.length) await execFileAsync$1(packageManager, [packageManager === "npm" ? "uninstall" : "remove", ...dependencies$1], { cwd: cwd$1 });
|
|
5905
5900
|
}
|
|
5906
5901
|
async function addWorkspace(cwd$1, workspacePath, config$1) {
|
|
5907
5902
|
switch (getPackageManager()) {
|
|
@@ -6634,7 +6629,7 @@ async function mergeContent(remotePath, localPath, currentPath, fallback) {
|
|
|
6634
6629
|
let content = "";
|
|
6635
6630
|
let conflict = false;
|
|
6636
6631
|
try {
|
|
6637
|
-
const { stdout } = await
|
|
6632
|
+
const { stdout } = await execFileAsync$1("diff3", [
|
|
6638
6633
|
"-m",
|
|
6639
6634
|
remotePath,
|
|
6640
6635
|
localPath,
|
|
@@ -6642,7 +6637,7 @@ async function mergeContent(remotePath, localPath, currentPath, fallback) {
|
|
|
6642
6637
|
]);
|
|
6643
6638
|
content = stdout;
|
|
6644
6639
|
} catch (e) {
|
|
6645
|
-
if (e
|
|
6640
|
+
if (e?.stdout) {
|
|
6646
6641
|
conflict = true;
|
|
6647
6642
|
content = e.stdout;
|
|
6648
6643
|
} else content = fallback;
|
|
@@ -6729,9 +6724,10 @@ async function updateFiles(changeMap, { add: add$1, remove, update: update$1 },
|
|
|
6729
6724
|
|
|
6730
6725
|
//#endregion
|
|
6731
6726
|
//#region src/commands/update/validate-diff-3.ts
|
|
6727
|
+
const execFileAsync = promisify$1(execFile);
|
|
6732
6728
|
async function validateDiff3() {
|
|
6733
6729
|
try {
|
|
6734
|
-
await
|
|
6730
|
+
await execFileAsync("diff3", ["--version"]);
|
|
6735
6731
|
return true;
|
|
6736
6732
|
} catch {
|
|
6737
6733
|
throw new Error(`${c.yellow("diff3")} is not installed. Please install it.`);
|
|
@@ -6949,7 +6945,7 @@ const diff = new Command("diff").description("check for updates against the regi
|
|
|
6949
6945
|
|
|
6950
6946
|
//#endregion
|
|
6951
6947
|
//#region src/commands/init/index.ts
|
|
6952
|
-
const init = new Command("init").description("initialize your project and install dependencies.").option("--cwd <path>", "current working directory.", cwd).option("-c, --config <path>", "path to the config file.", CONFIG_FILE_NAME).option("-o, --overwrite", "overwrite existing files.", false).option("-t, --tag <name>", "tag for the registries (e.g. dev, next).").option("-j, --jsx", "use jsx instead of tsx.", false).option("-y, --yes", "skip all confirmation prompts.", false).option("-m, --monorepo", "enable monorepo mode.").option("--no-monorepo", "disable monorepo mode.").option("-p, --package-name <name>", "package name.").option("-s, --src", "use src
|
|
6948
|
+
const init = new Command("init").description("initialize your project and install dependencies.").option("--cwd <path>", "current working directory.", cwd).option("-c, --config <path>", "path to the config file.", CONFIG_FILE_NAME).option("-o, --overwrite", "overwrite existing files.", false).option("-t, --tag <name>", "tag for the registries (e.g. dev, next).").option("-j, --jsx", "use jsx instead of tsx.", false).option("-y, --yes", "skip all confirmation prompts.", false).option("-m, --monorepo", "enable monorepo mode.").option("--no-monorepo", "disable monorepo mode.").option("-p, --package-name <name>", "package name.").option("-s, --src", "use `src/` directory when choice is monorepo.").option("-i, --install", "install dependencies when choice is monorepo.").option("--no-install", "do not install dependencies when choice is monorepo.").option("-f, --format", "use Prettier.").option("--no-format", "do not use Prettier.").option("-l, --lint", "use ESLint.").option("--no-lint", "do not use ESLint.").option("--outdir <path>", "output directory path.").action(async function({ src, config: configPath, cwd: cwd$1, format: format$2, install, jsx, lint, monorepo, outdir = "", overwrite, packageName = "", tag, yes }) {
|
|
6953
6949
|
const spinner = ora();
|
|
6954
6950
|
try {
|
|
6955
6951
|
const { end } = timer();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamada-ui/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.1-dev-20260311092521",
|
|
5
5
|
"description": "The official CLI for Yamada UI projects",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"theme",
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
"diff": "^8.0.3",
|
|
40
40
|
"esbuild": "^0.27.3",
|
|
41
41
|
"eslint": "^9.39.3",
|
|
42
|
-
"execa": "9.6.1",
|
|
43
42
|
"glob": "^13.0.6",
|
|
44
43
|
"https-proxy-agent": "^7.0.6",
|
|
45
44
|
"listr2": "^10.2.1",
|
|
@@ -75,6 +74,9 @@
|
|
|
75
74
|
"clean": "rimraf node_modules dist trace coverage .turbo .eslintcache",
|
|
76
75
|
"dev": "tsx src/index.ts",
|
|
77
76
|
"build": "tsdown",
|
|
77
|
+
"test": "vitest",
|
|
78
|
+
"test:dev": "vitest --watch --ui",
|
|
79
|
+
"test:coverage": "vitest run --coverage",
|
|
78
80
|
"typecheck": " tsc --noEmit",
|
|
79
81
|
"typetrace": "tsc --noEmit --generateTrace ./trace --incremental false",
|
|
80
82
|
"typeanalyze": "npx analyze-trace ./trace --expandTypes=false",
|