@yamada-ui/cli 2.0.0-dev-20251007133236 → 2.0.0-dev-20251008050759
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.js +49 -93
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -447,9 +447,9 @@ var require_graceful_fs$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pn
|
|
|
447
447
|
previousSymbol$1 = "___graceful-fs.previous";
|
|
448
448
|
}
|
|
449
449
|
function noop$1() {}
|
|
450
|
-
function publishQueue$1(context, queue
|
|
450
|
+
function publishQueue$1(context, queue) {
|
|
451
451
|
Object.defineProperty(context, gracefulQueue$1, { get: function() {
|
|
452
|
-
return queue
|
|
452
|
+
return queue;
|
|
453
453
|
} });
|
|
454
454
|
}
|
|
455
455
|
var debug$1 = noop$1;
|
|
@@ -460,8 +460,7 @@ var require_graceful_fs$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pn
|
|
|
460
460
|
console.error(m);
|
|
461
461
|
};
|
|
462
462
|
if (!fs$8[gracefulQueue$1]) {
|
|
463
|
-
|
|
464
|
-
publishQueue$1(fs$8, queue$1);
|
|
463
|
+
publishQueue$1(fs$8, global[gracefulQueue$1] || []);
|
|
465
464
|
fs$8.close = (function(fs$close) {
|
|
466
465
|
function close(fd, cb) {
|
|
467
466
|
return fs$close.call(fs$8, fd, function(err) {
|
|
@@ -776,8 +775,7 @@ var require_graceful_fs$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pn
|
|
|
776
775
|
} else {
|
|
777
776
|
var sinceAttempt = Date.now() - lastTime;
|
|
778
777
|
var sinceStart = Math.max(lastTime - startTime, 1);
|
|
779
|
-
|
|
780
|
-
if (sinceAttempt >= desiredDelay) {
|
|
778
|
+
if (sinceAttempt >= Math.min(sinceStart * 1.2, 100)) {
|
|
781
779
|
debug$1("RETRY", fn.name, args);
|
|
782
780
|
fn.apply(null, args.concat([startTime]));
|
|
783
781
|
} else fs$8[gracefulQueue$1].push(elem);
|
|
@@ -1064,8 +1062,7 @@ const Temp = {
|
|
|
1064
1062
|
store: {},
|
|
1065
1063
|
create: (filePath) => {
|
|
1066
1064
|
const randomness = `000000${Math.floor(Math.random() * 16777215).toString(16)}`.slice(-6);
|
|
1067
|
-
|
|
1068
|
-
return `${filePath}${suffix}`;
|
|
1065
|
+
return `${filePath}${`.tmp-${Date.now().toString().slice(-10)}${randomness}`}`;
|
|
1069
1066
|
},
|
|
1070
1067
|
get: (filePath, creator, purge = true) => {
|
|
1071
1068
|
const tempPath = Temp.truncate(creator(filePath));
|
|
@@ -1634,11 +1631,10 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
1634
1631
|
return min;
|
|
1635
1632
|
}
|
|
1636
1633
|
function createSupportsColor(stream, options = {}) {
|
|
1637
|
-
|
|
1634
|
+
return translateLevel(_supportsColor(stream, {
|
|
1638
1635
|
streamIsTTY: stream && stream.isTTY,
|
|
1639
1636
|
...options
|
|
1640
|
-
});
|
|
1641
|
-
return translateLevel(level);
|
|
1637
|
+
}));
|
|
1642
1638
|
}
|
|
1643
1639
|
const supportsColor = {
|
|
1644
1640
|
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
@@ -1806,9 +1802,7 @@ var HTTPError = class extends Error {
|
|
|
1806
1802
|
request;
|
|
1807
1803
|
options;
|
|
1808
1804
|
constructor(response, request, options) {
|
|
1809
|
-
const
|
|
1810
|
-
const title = response.statusText ?? "";
|
|
1811
|
-
const status = `${code} ${title}`.trim();
|
|
1805
|
+
const status = `${response.status || response.status === 0 ? response.status : ""} ${response.statusText ?? ""}`.trim();
|
|
1812
1806
|
const reason = status ? `status code ${status}` : "an unknown error";
|
|
1813
1807
|
super(`Request failed with ${reason}: ${request.method} ${request.url}`);
|
|
1814
1808
|
this.name = "HTTPError";
|
|
@@ -3246,9 +3240,9 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
3246
3240
|
previousSymbol = "___graceful-fs.previous";
|
|
3247
3241
|
}
|
|
3248
3242
|
function noop() {}
|
|
3249
|
-
function publishQueue(context, queue
|
|
3243
|
+
function publishQueue(context, queue) {
|
|
3250
3244
|
Object.defineProperty(context, gracefulQueue, { get: function() {
|
|
3251
|
-
return queue
|
|
3245
|
+
return queue;
|
|
3252
3246
|
} });
|
|
3253
3247
|
}
|
|
3254
3248
|
var debug = noop;
|
|
@@ -3259,8 +3253,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
3259
3253
|
console.error(m);
|
|
3260
3254
|
};
|
|
3261
3255
|
if (!fs$5[gracefulQueue]) {
|
|
3262
|
-
|
|
3263
|
-
publishQueue(fs$5, queue);
|
|
3256
|
+
publishQueue(fs$5, global[gracefulQueue] || []);
|
|
3264
3257
|
fs$5.close = (function(fs$close) {
|
|
3265
3258
|
function close(fd, cb) {
|
|
3266
3259
|
return fs$close.call(fs$5, fd, function(err) {
|
|
@@ -3575,8 +3568,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
3575
3568
|
} else {
|
|
3576
3569
|
var sinceAttempt = Date.now() - lastTime;
|
|
3577
3570
|
var sinceStart = Math.max(lastTime - startTime, 1);
|
|
3578
|
-
|
|
3579
|
-
if (sinceAttempt >= desiredDelay) {
|
|
3571
|
+
if (sinceAttempt >= Math.min(sinceStart * 1.2, 100)) {
|
|
3580
3572
|
debug("RETRY", fn.name, args);
|
|
3581
3573
|
fn.apply(null, args.concat([startTime]));
|
|
3582
3574
|
} else fs$5[gracefulQueue].push(elem);
|
|
@@ -4629,8 +4621,7 @@ var require_registry_auth_token = /* @__PURE__ */ __commonJS({ "../../node_modul
|
|
|
4629
4621
|
let pathname;
|
|
4630
4622
|
while (pathname !== "/" && parsed.pathname !== pathname) {
|
|
4631
4623
|
pathname = parsed.pathname || "/";
|
|
4632
|
-
const
|
|
4633
|
-
const authInfo = getAuthInfoForUrl(regUrl, options.npmrc);
|
|
4624
|
+
const authInfo = getAuthInfoForUrl("//" + parsed.host + pathname.replace(/\/$/, ""), options.npmrc);
|
|
4634
4625
|
if (authInfo) return authInfo;
|
|
4635
4626
|
if (!options.recursive) return /\/$/.test(checkUrl) ? void 0 : getRegistryAuthInfo(new URL("./", parsed), options);
|
|
4636
4627
|
parsed.pathname = urlResolve(normalizePath(pathname), "..") || "/";
|
|
@@ -4649,9 +4640,7 @@ var require_registry_auth_token = /* @__PURE__ */ __commonJS({ "../../node_modul
|
|
|
4649
4640
|
function getAuthInfoForUrl(regUrl, npmrc) {
|
|
4650
4641
|
const bearerAuth = getBearerToken(npmrc.get(regUrl + tokenKey) || npmrc.get(regUrl + "/:_authToken"));
|
|
4651
4642
|
if (bearerAuth) return bearerAuth;
|
|
4652
|
-
const
|
|
4653
|
-
const password = npmrc.get(regUrl + passwordKey) || npmrc.get(regUrl + "/:_password");
|
|
4654
|
-
const basicAuth = getTokenForUsernameAndPassword(username, password);
|
|
4643
|
+
const basicAuth = getTokenForUsernameAndPassword(npmrc.get(regUrl + userKey) || npmrc.get(regUrl + "/:username"), npmrc.get(regUrl + passwordKey) || npmrc.get(regUrl + "/:_password"));
|
|
4655
4644
|
if (basicAuth) return basicAuth;
|
|
4656
4645
|
const basicAuthWithToken = getLegacyAuthToken(npmrc.get(regUrl + legacyTokenKey) || npmrc.get(regUrl + "/:_auth"));
|
|
4657
4646
|
if (basicAuthWithToken) return basicAuthWithToken;
|
|
@@ -5420,9 +5409,8 @@ async function formatText(content, { configPath, enabled = true,...options } = {
|
|
|
5420
5409
|
if (!enabled) return content;
|
|
5421
5410
|
try {
|
|
5422
5411
|
configPath ??= await resolveConfigFile();
|
|
5423
|
-
const config$1 = configPath ? await resolveConfig(configPath) : {};
|
|
5424
5412
|
return format$1(content, {
|
|
5425
|
-
...
|
|
5413
|
+
...configPath ? await resolveConfig(configPath) : {},
|
|
5426
5414
|
parser: "typescript",
|
|
5427
5415
|
...options
|
|
5428
5416
|
});
|
|
@@ -5494,14 +5482,10 @@ async function getFiles(pattern) {
|
|
|
5494
5482
|
await Promise.all(dirents$1.map(async (dirent$1) => {
|
|
5495
5483
|
if (dirent$1.isDirectory()) return;
|
|
5496
5484
|
if (dirent$1.name === REGISTRY_FILE_NAME) return;
|
|
5497
|
-
const
|
|
5498
|
-
const data = await readFile(targetPath, "utf-8");
|
|
5485
|
+
const data = await readFile(path$1.join(dirent$1.parentPath, dirent$1.name), "utf-8");
|
|
5499
5486
|
files$1[`${name$1}/${dirent$1.name}`] = data;
|
|
5500
5487
|
}));
|
|
5501
|
-
} else if (name$1 !== REGISTRY_FILE_NAME)
|
|
5502
|
-
const targetPath = path$1.join(dirent.parentPath, dirent.name);
|
|
5503
|
-
files$1[name$1] = await readFile(targetPath, "utf-8");
|
|
5504
|
-
}
|
|
5488
|
+
} else if (name$1 !== REGISTRY_FILE_NAME) files$1[name$1] = await readFile(path$1.join(dirent.parentPath, dirent.name), "utf-8");
|
|
5505
5489
|
}));
|
|
5506
5490
|
return {
|
|
5507
5491
|
dirPath,
|
|
@@ -5592,16 +5576,14 @@ function packageExecuteCommands(packageManager) {
|
|
|
5592
5576
|
}
|
|
5593
5577
|
async function installDependencies(dependencies$1, { cwd: cwd$3, dev, exact = true } = {}) {
|
|
5594
5578
|
const packageManager = getPackageManager();
|
|
5595
|
-
if (dependencies$1?.length) {
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
});
|
|
5604
|
-
} else await execa(packageManager, ["install"], {
|
|
5579
|
+
if (dependencies$1?.length) await execa(packageManager, [...packageAddArgs(packageManager, {
|
|
5580
|
+
dev,
|
|
5581
|
+
exact
|
|
5582
|
+
}), ...dependencies$1], {
|
|
5583
|
+
cwd: cwd$3,
|
|
5584
|
+
stdout: "ignore"
|
|
5585
|
+
});
|
|
5586
|
+
else await execa(packageManager, ["install"], {
|
|
5605
5587
|
cwd: cwd$3,
|
|
5606
5588
|
stdout: "ignore"
|
|
5607
5589
|
});
|
|
@@ -5625,10 +5607,7 @@ async function addWorkspace(cwd$3, workspacePath, config$1) {
|
|
|
5625
5607
|
json$1.packages.push(workspacePath);
|
|
5626
5608
|
await writeFileSafe(targetPath, YAML.stringify(json$1), merge(config$1, { format: { parser: "yaml" } }));
|
|
5627
5609
|
}
|
|
5628
|
-
} else {
|
|
5629
|
-
const content = YAML.stringify({ packages: [workspacePath] });
|
|
5630
|
-
await writeFileSafe(targetPath, content, merge(config$1, { format: { parser: "yaml" } }));
|
|
5631
|
-
}
|
|
5610
|
+
} else await writeFileSafe(targetPath, YAML.stringify({ packages: [workspacePath] }), merge(config$1, { format: { parser: "yaml" } }));
|
|
5632
5611
|
break;
|
|
5633
5612
|
}
|
|
5634
5613
|
default: {
|
|
@@ -5636,9 +5615,7 @@ async function addWorkspace(cwd$3, workspacePath, config$1) {
|
|
|
5636
5615
|
packageJson$2.workspaces ??= [];
|
|
5637
5616
|
if (!packageJson$2.workspaces.includes(workspacePath)) {
|
|
5638
5617
|
packageJson$2.workspaces.push(workspacePath);
|
|
5639
|
-
|
|
5640
|
-
const content = JSON.stringify(packageJson$2);
|
|
5641
|
-
await writeFileSafe(targetPath, content, merge(config$1, { format: { parser: "json" } }));
|
|
5618
|
+
await writeFileSafe(path$1.resolve(cwd$3, "package.json"), JSON.stringify(packageJson$2), merge(config$1, { format: { parser: "json" } }));
|
|
5642
5619
|
}
|
|
5643
5620
|
break;
|
|
5644
5621
|
}
|
|
@@ -5674,12 +5651,10 @@ function transformTsToJs(content) {
|
|
|
5674
5651
|
//#region src/utils/config.ts
|
|
5675
5652
|
function getPaths(rootPath, jsx) {
|
|
5676
5653
|
const srcPath = existsSync(path$1.resolve(rootPath, "src")) ? path$1.resolve(rootPath, "src") : rootPath;
|
|
5677
|
-
const indexPath = path$1.resolve(srcPath, transformExtension("index.ts", jsx));
|
|
5678
|
-
const registryPath = path$1.resolve(srcPath, REGISTRY_FILE_NAME);
|
|
5679
5654
|
return {
|
|
5680
5655
|
src: srcPath,
|
|
5681
|
-
index:
|
|
5682
|
-
registry:
|
|
5656
|
+
index: path$1.resolve(srcPath, transformExtension("index.ts", jsx)),
|
|
5657
|
+
registry: path$1.resolve(srcPath, REGISTRY_FILE_NAME),
|
|
5683
5658
|
root: rootPath
|
|
5684
5659
|
};
|
|
5685
5660
|
}
|
|
@@ -5695,8 +5670,7 @@ async function getConfig(cwd$3, configPath, { format: format$2, jsx, lint } = {}
|
|
|
5695
5670
|
ui: getPaths(path$1.resolve(cwd$3, userConfig.path ?? (userConfig.monorepo ? DEFAULT_PATH.ui.monorepo : DEFAULT_PATH.ui.polyrepo)), userConfig.jsx)
|
|
5696
5671
|
};
|
|
5697
5672
|
const sectionMap = Object.fromEntries(SECTION_NAMES.map((section) => {
|
|
5698
|
-
|
|
5699
|
-
return [section, replacedSection];
|
|
5673
|
+
return [section, (userConfig[section]?.path ?? DEFAULT_PATH[section]).replace(/(\.\.\/|\.\/)/g, "").replace(/(^\/|\/$)/g, "")];
|
|
5700
5674
|
}));
|
|
5701
5675
|
if (userConfig.theme?.path) userConfig.theme.path = path$1.resolve(cwd$3, userConfig.theme.path);
|
|
5702
5676
|
function isSection(section) {
|
|
@@ -5743,8 +5717,7 @@ async function getConfig(cwd$3, configPath, { format: format$2, jsx, lint } = {}
|
|
|
5743
5717
|
paths
|
|
5744
5718
|
};
|
|
5745
5719
|
} catch {
|
|
5746
|
-
const
|
|
5747
|
-
const { args, command } = packageExecuteCommands(packageManager);
|
|
5720
|
+
const { args, command } = packageExecuteCommands(getPackageManager());
|
|
5748
5721
|
const prefix = `${command}${args.length ? ` ${args.join(" ")}` : ""}`;
|
|
5749
5722
|
throw new Error(`No ${c.yellow("config")} found. Please run ${c.cyan(`${prefix} ${package_default.name}@latest init`)}.`);
|
|
5750
5723
|
}
|
|
@@ -5780,11 +5753,10 @@ async function getModule(file$1, cwd$3) {
|
|
|
5780
5753
|
mod
|
|
5781
5754
|
};
|
|
5782
5755
|
} catch {
|
|
5783
|
-
const mod = nodeEval(code);
|
|
5784
5756
|
return {
|
|
5785
5757
|
code,
|
|
5786
5758
|
dependencies: dependencies$1,
|
|
5787
|
-
mod
|
|
5759
|
+
mod: nodeEval(code)
|
|
5788
5760
|
};
|
|
5789
5761
|
}
|
|
5790
5762
|
}
|
|
@@ -5867,9 +5839,7 @@ async function fetchLocaleRegistry(path$9) {
|
|
|
5867
5839
|
async function getGeneratedNameMap(config$1) {
|
|
5868
5840
|
const results = await Promise.all(SECTION_NAMES.map(async (section) => {
|
|
5869
5841
|
try {
|
|
5870
|
-
|
|
5871
|
-
const dirents = await readdir(sectionPath, { withFileTypes: true });
|
|
5872
|
-
return [section, dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name)];
|
|
5842
|
+
return [section, (await readdir(config$1.getSectionResolvedPath(section), { withFileTypes: true })).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name)];
|
|
5873
5843
|
} catch {
|
|
5874
5844
|
return [section, []];
|
|
5875
5845
|
}
|
|
@@ -5901,12 +5871,10 @@ function transformContent(targetSection, content, { getSection }, generatedNames
|
|
|
5901
5871
|
if (depth === 1) if (generated) replaceValue = `from "${path$1.join("..", name$1)}"`;
|
|
5902
5872
|
else replaceValue = `from "@yamada-ui/react/${targetSection}/${name$1}"`;
|
|
5903
5873
|
else {
|
|
5904
|
-
const
|
|
5905
|
-
const { path: sectionPath, section } = getSection(query) ?? {};
|
|
5874
|
+
const { path: sectionPath, section } = getSection(value.replace(/(\.\.\/|\.\/)/g, "").split("/").slice(0, -1).join("/")) ?? {};
|
|
5906
5875
|
if (!section || !sectionPath) return;
|
|
5907
5876
|
if (generated) {
|
|
5908
|
-
const
|
|
5909
|
-
const neededDepth = depth + targetDepth;
|
|
5877
|
+
const neededDepth = depth + (sectionPath.match(/\.\.\//g) || []).length;
|
|
5910
5878
|
const omittedTargetPath = sectionPath.replace(/(\.\.\/|\.\/)/g, "");
|
|
5911
5879
|
replaceValue = `from "${"../".repeat(neededDepth)}${omittedTargetPath}/${name$1}"`;
|
|
5912
5880
|
} else replaceValue = `from "@yamada-ui/react/${section}/${name$1}"`;
|
|
@@ -5949,8 +5917,7 @@ function transformIndex(generatedNames, content, { getSection }) {
|
|
|
5949
5917
|
if (!path$9) return;
|
|
5950
5918
|
replaceValue = `from "${path$9}/${name$1}"`;
|
|
5951
5919
|
} else {
|
|
5952
|
-
const
|
|
5953
|
-
const { section } = getSection(query) ?? {};
|
|
5920
|
+
const { section } = getSection(value.replace(/(\.\.\/|\.\/)/g, "").split("/").slice(0, -1).join("/")) ?? {};
|
|
5954
5921
|
if (!section) return;
|
|
5955
5922
|
replaceValue = `from "@yamada-ui/react/${section}/${name$1}"`;
|
|
5956
5923
|
}
|
|
@@ -6097,8 +6064,7 @@ const add = new Command("add").description("add a component to your project").ar
|
|
|
6097
6064
|
tasks.add({
|
|
6098
6065
|
task: async (_, task) => {
|
|
6099
6066
|
const sectionPath = config$1.getSectionResolvedPath(section);
|
|
6100
|
-
const
|
|
6101
|
-
const dirents = await readdir(dirPath, { withFileTypes: true });
|
|
6067
|
+
const dirents = await readdir(path$1.join(sectionPath, name$1), { withFileTypes: true });
|
|
6102
6068
|
await Promise.all(dirents.map(async (dirent) => {
|
|
6103
6069
|
if (dirent.isDirectory()) {
|
|
6104
6070
|
const dirents$1 = await readdir(path$1.join(dirent.parentPath, name$1), { withFileTypes: true });
|
|
@@ -6147,8 +6113,7 @@ const add = new Command("add").description("add a component to your project").ar
|
|
|
6147
6113
|
if (dependencies$1.length) {
|
|
6148
6114
|
const targetPath = config$1.monorepo ? config$1.paths.ui.root : cwd$3;
|
|
6149
6115
|
spinner.start(`Checking ${c.cyan("package.json")} dependencies`);
|
|
6150
|
-
const
|
|
6151
|
-
const notInstalledDependencies = getNotInstalledDependencies(packageJson$2, dependencies$1);
|
|
6116
|
+
const notInstalledDependencies = getNotInstalledDependencies(await getPackageJson(targetPath), dependencies$1);
|
|
6152
6117
|
spinner.succeed(`Checked ${c.cyan("package.json")} dependencies`);
|
|
6153
6118
|
if (!install && notInstalledDependencies.length) {
|
|
6154
6119
|
const colorizedNames = notInstalledDependencies.map((value) => c.yellow(isObject(value) ? value.current ? `${value.name}@${value.current}->${c.red(value.wanted)}` : value.name : value));
|
|
@@ -6565,8 +6530,7 @@ const diff = new Command("diff").description("check for updates against the regi
|
|
|
6565
6530
|
const spinner = ora();
|
|
6566
6531
|
try {
|
|
6567
6532
|
const { end } = timer();
|
|
6568
|
-
const
|
|
6569
|
-
const { args, command } = packageExecuteCommands(packageManager);
|
|
6533
|
+
const { args, command } = packageExecuteCommands(getPackageManager());
|
|
6570
6534
|
const prefix = `${command}${args.length ? ` ${args.join(" ")}` : ""}`;
|
|
6571
6535
|
const getCommand = (command$1) => c.cyan(`${prefix} ${package_default.name}@latest ${command$1}`);
|
|
6572
6536
|
spinner.start("Validating directory");
|
|
@@ -6767,14 +6731,13 @@ const init = new Command("init").description("initialize your project and instal
|
|
|
6767
6731
|
const targetPath = path$1.resolve(outdirPath, "package.json");
|
|
6768
6732
|
const defaultExports = DEFAULT_PACKAGE_JSON_EXPORTS.ui[jsx ? "jsx" : "tsx"];
|
|
6769
6733
|
const exports$2 = src ? defaultExports : Object.fromEntries(Object.entries(defaultExports).map(([key, value]) => [key, value.replace(/src\//, "")]));
|
|
6770
|
-
|
|
6734
|
+
await writeFileSafe(targetPath, JSON.stringify({
|
|
6771
6735
|
name: packageName,
|
|
6772
6736
|
...DEFAULT_PACKAGE_JSON,
|
|
6773
6737
|
dependencies: Object.fromEntries(REQUIRED_DEPENDENCIES.ui.map((dependency) => splitVersion(dependency))),
|
|
6774
6738
|
devDependencies: Object.fromEntries(REQUIRED_DEV_DEPENDENCIES.ui.map((dependency) => splitVersion(dependency))),
|
|
6775
6739
|
exports: exports$2
|
|
6776
|
-
});
|
|
6777
|
-
await writeFileSafe(targetPath, content, merge(config$1, { format: { parser: "json" } }));
|
|
6740
|
+
}), merge(config$1, { format: { parser: "json" } }));
|
|
6778
6741
|
task.title = `Generated ${c.cyan("package.json")}`;
|
|
6779
6742
|
},
|
|
6780
6743
|
title: `Generating ${c.cyan("package.json")}`
|
|
@@ -6792,10 +6755,8 @@ const init = new Command("init").description("initialize your project and instal
|
|
|
6792
6755
|
},
|
|
6793
6756
|
{
|
|
6794
6757
|
task: async (_, task) => {
|
|
6795
|
-
if (outdir.includes("/")) {
|
|
6796
|
-
|
|
6797
|
-
await addWorkspace(cwd$3, path$9, config$1);
|
|
6798
|
-
} else await addWorkspace(cwd$3, outdir, config$1);
|
|
6758
|
+
if (outdir.includes("/")) await addWorkspace(cwd$3, `${outdir.replace(/^\.\//, "").split("/")[0]}/**`, config$1);
|
|
6759
|
+
else await addWorkspace(cwd$3, outdir, config$1);
|
|
6799
6760
|
task.title = "Added workspace";
|
|
6800
6761
|
},
|
|
6801
6762
|
title: "Adding workspace"
|
|
@@ -6806,8 +6767,7 @@ const init = new Command("init").description("initialize your project and instal
|
|
|
6806
6767
|
const targetPath = path$1.resolve(outdirPath, "tsconfig.json");
|
|
6807
6768
|
const tsconfig = { ...TSCONFIG_JSON };
|
|
6808
6769
|
if (!src) tsconfig.include = tsconfig.include.map((value) => value.replace(/src\//, ""));
|
|
6809
|
-
|
|
6810
|
-
await writeFileSafe(targetPath, content, merge(config$1, { format: { parser: "json" } }));
|
|
6770
|
+
await writeFileSafe(targetPath, JSON.stringify(tsconfig), merge(config$1, { format: { parser: "json" } }));
|
|
6811
6771
|
task.title = `Generated ${c.cyan("tsconfig.json")}`;
|
|
6812
6772
|
},
|
|
6813
6773
|
title: `Generating ${c.cyan("tsconfig.json")}`
|
|
@@ -6984,14 +6944,13 @@ const theme = new Command("theme").description("generate theme to your project")
|
|
|
6984
6944
|
const targetPath = path$1.resolve(outdirPath, "package.json");
|
|
6985
6945
|
const defaultExports = DEFAULT_PACKAGE_JSON_EXPORTS.theme[config$1.jsx ? "jsx" : "tsx"];
|
|
6986
6946
|
const exports$2 = monorepoConfig.src ? defaultExports : Object.fromEntries(Object.entries(defaultExports).map(([key, value]) => [key, value.replace(/src\//, "")]));
|
|
6987
|
-
|
|
6947
|
+
await writeFileSafe(targetPath, JSON.stringify({
|
|
6988
6948
|
name: monorepoConfig.packageName,
|
|
6989
6949
|
...DEFAULT_PACKAGE_JSON,
|
|
6990
6950
|
dependencies: Object.fromEntries(REQUIRED_DEPENDENCIES.theme.map((dependency) => splitVersion(dependency))),
|
|
6991
6951
|
devDependencies: Object.fromEntries(REQUIRED_DEV_DEPENDENCIES.theme.map((dependency) => splitVersion(dependency))),
|
|
6992
6952
|
exports: exports$2
|
|
6993
|
-
});
|
|
6994
|
-
await writeFileSafe(targetPath, content, merge(config$1, { format: { parser: "json" } }));
|
|
6953
|
+
}), merge(config$1, { format: { parser: "json" } }));
|
|
6995
6954
|
task.title = `Generated ${c.cyan("package.json")}`;
|
|
6996
6955
|
},
|
|
6997
6956
|
title: `Generating ${c.cyan("package.json")}`
|
|
@@ -7001,8 +6960,7 @@ const theme = new Command("theme").description("generate theme to your project")
|
|
|
7001
6960
|
const targetPath = path$1.resolve(outdirPath, "tsconfig.json");
|
|
7002
6961
|
const tsconfig = { ...TSCONFIG_JSON };
|
|
7003
6962
|
if (!monorepoConfig.src) tsconfig.include = tsconfig.include.map((value) => value.replace(/src\//, ""));
|
|
7004
|
-
|
|
7005
|
-
await writeFileSafe(targetPath, content, merge(config$1, { format: { parser: "json" } }));
|
|
6963
|
+
await writeFileSafe(targetPath, JSON.stringify(tsconfig), merge(config$1, { format: { parser: "json" } }));
|
|
7006
6964
|
task.title = `Generated ${c.cyan("tsconfig.json")}`;
|
|
7007
6965
|
},
|
|
7008
6966
|
title: `Generating ${c.cyan("tsconfig.json")}`
|
|
@@ -7171,8 +7129,7 @@ function generateThemeTokens(theme$1, { internal = false, theme: { responsive =
|
|
|
7171
7129
|
shouldProcess: (obj) => shouldProcess(obj) && additionalShouldProcess(obj)
|
|
7172
7130
|
}).flatMap(flatMap);
|
|
7173
7131
|
if (isObject(theme$1.semanticTokens)) {
|
|
7174
|
-
const
|
|
7175
|
-
const semanticKeys = extractPaths(target$1, {
|
|
7132
|
+
const semanticKeys = extractPaths(getObject(theme$1.semanticTokens, key), {
|
|
7176
7133
|
maxDepth,
|
|
7177
7134
|
replaceKey,
|
|
7178
7135
|
shouldProcess: (obj) => shouldProcess(obj) && additionalShouldProcess(obj)
|
|
@@ -7286,8 +7243,7 @@ const update = new Command("update").description("update components in your proj
|
|
|
7286
7243
|
const spinner = ora();
|
|
7287
7244
|
try {
|
|
7288
7245
|
const { end } = timer();
|
|
7289
|
-
const
|
|
7290
|
-
const { args, command } = packageExecuteCommands(packageManager);
|
|
7246
|
+
const { args, command } = packageExecuteCommands(getPackageManager());
|
|
7291
7247
|
const prefix = `${command}${args.length ? ` ${args.join(" ")}` : ""}`;
|
|
7292
7248
|
const getCommand = (command$1) => c.cyan(`${prefix} ${package_default.name}@latest ${command$1}`);
|
|
7293
7249
|
spinner.start("Validating directory");
|