@yamada-ui/cli 1.1.1-dev-20240825095648 → 1.1.1-dev-20240825101928

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.
@@ -826,8 +826,8 @@ var generateThemeTypings = async ({
826
826
  p.note(outPath, "Output path");
827
827
  const end = process.hrtime.bigint();
828
828
  const duration = (Number(end - start) / 1e9).toFixed(2);
829
- p.outro(source_default.green(`Done in ${duration}s
830
- `));
829
+ p.outro(`${source_default.green(`Done`)} in ${source_default.dim(`${duration}s`)}
830
+ `);
831
831
  } catch (e) {
832
832
  s.stop(`An error occurred`, 500);
833
833
  p.cancel(source_default.red(e instanceof Error ? e.message : "Message is missing"));
@@ -1031,7 +1031,7 @@ var replaceIndex = (content) => {
1031
1031
  var generateTheme = async (outPath, fileMap, isReactReplace, isForceReplace) => {
1032
1032
  if (!await isWriteable(import_path4.default.dirname(outPath))) {
1033
1033
  throw new Error(
1034
- "The provided path is not writable, please check folder permissions and try again.\nIt is likely you do not have write permissions for this folder."
1034
+ "The provided path is not writable, please check folder permissions and try again. It is likely you do not have write permissions for this folder."
1035
1035
  );
1036
1036
  }
1037
1037
  await (0, import_promises2.mkdir)(outPath, { recursive: true });
@@ -1077,8 +1077,8 @@ var actionTheme = async (_outPath, { branch = DEFAULT_BRANCH_NAME, cwd, replace
1077
1077
  s.stop(`Wrote the theme`);
1078
1078
  const end = process.hrtime.bigint();
1079
1079
  const duration = (Number(end - start) / 1e9).toFixed(2);
1080
- p2.outro(source_default.green(`Done in ${duration}s
1081
- `));
1080
+ p2.outro(`${source_default.green(`Done`)} in ${source_default.dim(`${duration}s`)}
1081
+ `);
1082
1082
  } catch (e) {
1083
1083
  s.stop(`An error occurred`, 500);
1084
1084
  p2.cancel(source_default.red(e instanceof Error ? e.message : "Message is missing"));
@@ -733,7 +733,7 @@ var replaceIndex = (content) => {
733
733
  var generateTheme = async (outPath, fileMap, isReactReplace, isForceReplace) => {
734
734
  if (!await isWriteable(import_path2.default.dirname(outPath))) {
735
735
  throw new Error(
736
- "The provided path is not writable, please check folder permissions and try again.\nIt is likely you do not have write permissions for this folder."
736
+ "The provided path is not writable, please check folder permissions and try again. It is likely you do not have write permissions for this folder."
737
737
  );
738
738
  }
739
739
  await (0, import_promises.mkdir)(outPath, { recursive: true });
@@ -779,8 +779,8 @@ var actionTheme = async (_outPath, { branch = DEFAULT_BRANCH_NAME, cwd, replace
779
779
  s.stop(`Wrote the theme`);
780
780
  const end = process.hrtime.bigint();
781
781
  const duration = (Number(end - start) / 1e9).toFixed(2);
782
- p.outro(source_default.green(`Done in ${duration}s
783
- `));
782
+ p.outro(`${source_default.green(`Done`)} in ${source_default.dim(`${duration}s`)}
783
+ `);
784
784
  } catch (e) {
785
785
  s.stop(`An error occurred`, 500);
786
786
  p.cancel(source_default.red(e instanceof Error ? e.message : "Message is missing"));
@@ -822,8 +822,8 @@ var generateThemeTypings = async ({
822
822
  p.note(outPath, "Output path");
823
823
  const end = process.hrtime.bigint();
824
824
  const duration = (Number(end - start) / 1e9).toFixed(2);
825
- p.outro(source_default.green(`Done in ${duration}s
826
- `));
825
+ p.outro(`${source_default.green(`Done`)} in ${source_default.dim(`${duration}s`)}
826
+ `);
827
827
  } catch (e) {
828
828
  s.stop(`An error occurred`, 500);
829
829
  p.cancel(source_default.red(e instanceof Error ? e.message : "Message is missing"));
package/dist/index.js CHANGED
@@ -3378,7 +3378,7 @@ var require_rc = __commonJS({
3378
3378
  "use strict";
3379
3379
  init_cjs_shims();
3380
3380
  var cc = require_utils();
3381
- var join2 = require("path").join;
3381
+ var join = require("path").join;
3382
3382
  var deepExtend = require_deep_extend();
3383
3383
  var etc = "/etc";
3384
3384
  var win = process.platform === "win32";
@@ -3403,15 +3403,15 @@ var require_rc = __commonJS({
3403
3403
  }
3404
3404
  if (!win)
3405
3405
  [
3406
- join2(etc, name, "config"),
3407
- join2(etc, name + "rc")
3406
+ join(etc, name, "config"),
3407
+ join(etc, name + "rc")
3408
3408
  ].forEach(addConfigFile);
3409
3409
  if (home)
3410
3410
  [
3411
- join2(home, ".config", name, "config"),
3412
- join2(home, ".config", name),
3413
- join2(home, "." + name, "config"),
3414
- join2(home, "." + name + "rc")
3411
+ join(home, ".config", name, "config"),
3412
+ join(home, ".config", name),
3413
+ join(home, "." + name, "config"),
3414
+ join(home, "." + name + "rc")
3415
3415
  ].forEach(addConfigFile);
3416
3416
  addConfigFile(cc.find("." + name + "rc"));
3417
3417
  if (env4.config) addConfigFile(env4.config);
@@ -5912,18 +5912,7 @@ __export(src_exports, {
5912
5912
  });
5913
5913
  module.exports = __toCommonJS(src_exports);
5914
5914
  init_cjs_shims();
5915
- var path13 = __toESM(require("path"));
5916
- var import_commander = require("commander");
5917
-
5918
- // src/command/index.ts
5919
- init_cjs_shims();
5920
-
5921
- // src/command/tokens/index.ts
5922
- init_cjs_shims();
5923
- var import_promises = require("fs/promises");
5924
- var import_path4 = __toESM(require("path"));
5925
- var p = __toESM(require("@clack/prompts"));
5926
- var import_bundle_n_require = require("bundle-n-require");
5915
+ var import_path6 = __toESM(require("path"));
5927
5916
 
5928
5917
  // ../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js
5929
5918
  init_cjs_shims();
@@ -6420,7 +6409,81 @@ var chalk = createChalk();
6420
6409
  var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
6421
6410
  var source_default = chalk;
6422
6411
 
6412
+ // src/index.ts
6413
+ var import_commander = require("commander");
6414
+
6415
+ // package.json
6416
+ var package_default = {
6417
+ name: "@yamada-ui/cli",
6418
+ version: "1.1.0",
6419
+ description: "Generate theme tokens for autocomplete",
6420
+ keywords: [
6421
+ "theme",
6422
+ "theming",
6423
+ "typings",
6424
+ "generator",
6425
+ "yamada ui",
6426
+ "yamada",
6427
+ "ui mode",
6428
+ "ui"
6429
+ ],
6430
+ author: "Hirotomo Yamada <hirotomo.yamada@avap.co.jp>",
6431
+ license: "MIT",
6432
+ main: "dist/index.js",
6433
+ files: [
6434
+ "dist",
6435
+ "bin"
6436
+ ],
6437
+ sideEffects: false,
6438
+ publishConfig: {
6439
+ access: "public"
6440
+ },
6441
+ homepage: "https://yamada-ui.com",
6442
+ repository: {
6443
+ type: "git",
6444
+ url: "https://github.com/yamada-ui/yamada-ui",
6445
+ directory: "packages/cli"
6446
+ },
6447
+ bugs: {
6448
+ url: "https://github.com/yamada-ui/yamada-ui/issues"
6449
+ },
6450
+ bin: {
6451
+ "yamada-cli": "bin/index.js"
6452
+ },
6453
+ scripts: {
6454
+ clean: "rimraf dist .turbo",
6455
+ build: "tsup src --format cjs --clean --shims",
6456
+ dev: "pnpm build --watch",
6457
+ typecheck: " tsc --noEmit"
6458
+ },
6459
+ dependencies: {
6460
+ "@clack/prompts": "^0.7.0",
6461
+ "bundle-n-require": "^1.1.1",
6462
+ chokidar: "^3.6.0",
6463
+ "cli-check-node": "^1.3.4",
6464
+ "cli-handle-unhandled": "^1.1.1",
6465
+ commander: "^12.1.0",
6466
+ glob: "^11.0.0",
6467
+ prettier: "^3.3.3",
6468
+ tar: "^7.4.3",
6469
+ typescript: "^5.5.4"
6470
+ },
6471
+ devDependencies: {
6472
+ "update-notifier": "^7.2.0",
6473
+ chalk: "^5.3.0",
6474
+ "@types/update-notifier": "6.0.8"
6475
+ }
6476
+ };
6477
+
6478
+ // src/command/index.ts
6479
+ init_cjs_shims();
6480
+
6423
6481
  // src/command/tokens/index.ts
6482
+ init_cjs_shims();
6483
+ var import_promises = require("fs/promises");
6484
+ var import_path4 = __toESM(require("path"));
6485
+ var p = __toESM(require("@clack/prompts"));
6486
+ var import_bundle_n_require = require("bundle-n-require");
6424
6487
  var import_chokidar = __toESM(require("chokidar"));
6425
6488
 
6426
6489
  // src/command/tokens/create-theme-typings.ts
@@ -6436,7 +6499,6 @@ var isArray = (value) => Array.isArray(value);
6436
6499
  init_cjs_shims();
6437
6500
  var import_cli_check_node = __toESM(require("cli-check-node"));
6438
6501
  var import_cli_handle_unhandled = __toESM(require("cli-handle-unhandled"));
6439
- var import_cli_welcome = __toESM(require("cli-welcome"));
6440
6502
 
6441
6503
  // ../../node_modules/.pnpm/update-notifier@7.2.0/node_modules/update-notifier/index.js
6442
6504
  init_cjs_shims();
@@ -8986,85 +9048,16 @@ function updateNotifier(options) {
8986
9048
  return updateNotifier2;
8987
9049
  }
8988
9050
 
8989
- // package.json
8990
- var package_default = {
8991
- name: "@yamada-ui/cli",
8992
- version: "1.1.0",
8993
- description: "Generate theme tokens for autocomplete",
8994
- keywords: [
8995
- "theme",
8996
- "theming",
8997
- "typings",
8998
- "generator",
8999
- "yamada ui",
9000
- "yamada",
9001
- "ui mode",
9002
- "ui"
9003
- ],
9004
- author: "Hirotomo Yamada <hirotomo.yamada@avap.co.jp>",
9005
- license: "MIT",
9006
- main: "dist/index.js",
9007
- files: [
9008
- "dist",
9009
- "bin"
9010
- ],
9011
- sideEffects: false,
9012
- publishConfig: {
9013
- access: "public"
9014
- },
9015
- homepage: "https://yamada-ui.com",
9016
- repository: {
9017
- type: "git",
9018
- url: "https://github.com/yamada-ui/yamada-ui",
9019
- directory: "packages/cli"
9020
- },
9021
- bugs: {
9022
- url: "https://github.com/yamada-ui/yamada-ui/issues"
9023
- },
9024
- bin: {
9025
- "yamada-cli": "bin/index.js"
9026
- },
9027
- scripts: {
9028
- clean: "rimraf dist .turbo",
9029
- build: "tsup src --format cjs --clean --shims",
9030
- dev: "pnpm build --watch",
9031
- typecheck: " tsc --noEmit"
9032
- },
9033
- dependencies: {
9034
- "@clack/prompts": "^0.7.0",
9035
- "bundle-n-require": "^1.1.1",
9036
- chokidar: "^3.6.0",
9037
- "cli-check-node": "^1.3.4",
9038
- "cli-handle-unhandled": "^1.1.1",
9039
- "cli-welcome": "^2.2.3",
9040
- commander: "^12.1.0",
9041
- glob: "^11.0.0",
9042
- prettier: "^3.3.3",
9043
- tar: "^7.4.3",
9044
- typescript: "^5.5.4"
9045
- },
9046
- devDependencies: {
9047
- "@types/cli-welcome": "^2.2.2",
9048
- "@types/update-notifier": "6.0.8",
9049
- chalk: "^5.3.0",
9050
- "update-notifier": "^7.2.0"
9051
- }
9052
- };
9053
-
9054
9051
  // src/utils/cli.ts
9055
9052
  var initCLI = async () => {
9056
9053
  (0, import_cli_check_node.default)("12");
9057
9054
  await (0, import_cli_handle_unhandled.default)();
9058
- (0, import_cli_welcome.default)({
9059
- title: "Yamada UI CLI",
9060
- tagLine: `by Yamada UI
9061
- ${package_default.description}`,
9062
- bgColor: `#3cc360`,
9063
- color: `#FFFFFF`,
9064
- bold: true,
9065
- clear: false,
9066
- version: package_default.version
9067
- });
9055
+ console.log(
9056
+ `
9057
+ ${source_default.bold.green("Yamada UI CLI")} v${package_default.version} ${source_default.dim("by Yamada UI")}`
9058
+ );
9059
+ console.log(`${source_default.dim(package_default.description)}
9060
+ `);
9068
9061
  updateNotifier({
9069
9062
  pkg: package_default,
9070
9063
  shouldNotifyInNpmScript: true,
@@ -9337,8 +9330,8 @@ var generateThemeTypings = async ({
9337
9330
  p.note(outPath, "Output path");
9338
9331
  const end = process.hrtime.bigint();
9339
9332
  const duration = (Number(end - start) / 1e9).toFixed(2);
9340
- p.outro(source_default.green(`Done in ${duration}s
9341
- `));
9333
+ p.outro(`${source_default.green(`Done`)} in ${source_default.dim(`${duration}s`)}
9334
+ `);
9342
9335
  } catch (e) {
9343
9336
  s.stop(`An error occurred`, 500);
9344
9337
  p.cancel(source_default.red(e instanceof Error ? e.message : "Message is missing"));
@@ -9542,7 +9535,7 @@ var replaceIndex = (content) => {
9542
9535
  var generateTheme = async (outPath, fileMap, isReactReplace, isForceReplace) => {
9543
9536
  if (!await isWriteable(import_path5.default.dirname(outPath))) {
9544
9537
  throw new Error(
9545
- "The provided path is not writable, please check folder permissions and try again.\nIt is likely you do not have write permissions for this folder."
9538
+ "The provided path is not writable, please check folder permissions and try again. It is likely you do not have write permissions for this folder."
9546
9539
  );
9547
9540
  }
9548
9541
  await (0, import_promises2.mkdir)(outPath, { recursive: true });
@@ -9588,8 +9581,8 @@ var actionTheme = async (_outPath, { branch = DEFAULT_BRANCH_NAME, cwd, replace
9588
9581
  s.stop(`Wrote the theme`);
9589
9582
  const end = process.hrtime.bigint();
9590
9583
  const duration = (Number(end - start) / 1e9).toFixed(2);
9591
- p2.outro(source_default.green(`Done in ${duration}s
9592
- `));
9584
+ p2.outro(`${source_default.green(`Done`)} in ${source_default.dim(`${duration}s`)}
9585
+ `);
9593
9586
  } catch (e) {
9594
9587
  s.stop(`An error occurred`, 500);
9595
9588
  p2.cancel(source_default.red(e instanceof Error ? e.message : "Message is missing"));
@@ -9599,18 +9592,10 @@ var actionTheme = async (_outPath, { branch = DEFAULT_BRANCH_NAME, cwd, replace
9599
9592
  // src/index.ts
9600
9593
  var run = async () => {
9601
9594
  await initCLI();
9602
- import_commander.program.command("tokens <path>").option("-o, --out <path>", `Output file to ${path13.join(...themePath)}`).option("-w, --watch [path]", "Watch directory for changes and rebuild").action(actionTokens);
9603
- import_commander.program.command("theme <path>").option("-b, --branch <branch>", "Branch to download").option("--cwd <path>", "Current working directory").option("-r, --replace", "Force replace the theme").action(actionTheme);
9604
- import_commander.program.on("-h, --help", () => {
9605
- console.info(`
9606
- Example call:
9607
- `);
9608
- console.info(`$ yamada-cli tokens theme.ts
9609
- `);
9610
- console.info(`$ yamada-cli theme ./theme
9611
- `);
9612
- });
9613
- import_commander.program.parse();
9595
+ const program = new import_commander.Command(package_default.name).name("yamada-cli").description(package_default.description).version(package_default.version).usage(`${source_default.green("<command>")} [options]`);
9596
+ program.command("tokens <path>").option("-o, --out <path>", `Output file to ${import_path6.default.join(...themePath)}`).option("-w, --watch [path]", "Watch directory for changes and rebuild").action(actionTokens);
9597
+ program.command("theme <path>").option("-b, --branch <branch>", "Branch to download").option("--cwd <path>", "Current working directory").option("-r, --replace", "Force replace the theme").action(actionTheme);
9598
+ program.parse();
9614
9599
  };
9615
9600
  // Annotate the CommonJS export names for ESM import in node:
9616
9601
  0 && (module.exports = {