@yamada-ui/cli 0.3.2 → 0.4.0

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.
@@ -37,6 +37,7 @@ var config = [
37
37
  { key: "sizes", maxScanDepth: 2 },
38
38
  { key: "spaces", flatMap: (value) => [value, `-${value}`] },
39
39
  { key: "zIndices" },
40
+ { key: "animations", omitScanKeys: ["keyframes"] },
40
41
  { key: "gradients" }
41
42
  ];
42
43
  // Annotate the CommonJS export names for ESM import in node:
@@ -20,9 +20,9 @@ var __copyProps = (to, from, except, desc) => {
20
20
  };
21
21
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
22
 
23
- // ../../node_modules/.pnpm/tsup@7.2.0_@swc+core@1.3.74_ts-node@10.9.1_typescript@5.1.6/node_modules/tsup/assets/cjs_shims.js
23
+ // ../../node_modules/.pnpm/tsup@7.2.0_@swc+core@1.3.83_ts-node@10.9.1_typescript@5.2.2/node_modules/tsup/assets/cjs_shims.js
24
24
  var init_cjs_shims = __esm({
25
- "../../node_modules/.pnpm/tsup@7.2.0_@swc+core@1.3.74_ts-node@10.9.1_typescript@5.1.6/node_modules/tsup/assets/cjs_shims.js"() {
25
+ "../../node_modules/.pnpm/tsup@7.2.0_@swc+core@1.3.83_ts-node@10.9.1_typescript@5.2.2/node_modules/tsup/assets/cjs_shims.js"() {
26
26
  "use strict";
27
27
  }
28
28
  });
@@ -78,6 +78,7 @@ var config = [
78
78
  { key: "sizes", maxScanDepth: 2 },
79
79
  { key: "spaces", flatMap: (value) => [value, `-${value}`] },
80
80
  { key: "zIndices" },
81
+ { key: "animations", omitScanKeys: ["keyframes"] },
81
82
  { key: "gradients" }
82
83
  ];
83
84
 
@@ -112,9 +113,7 @@ var printComponent = (components) => `components: { ${Object.entries(components)
112
113
  var print = (unions) => Object.entries(unions).sort(([a], [b]) => a.localeCompare(b)).map(
113
114
  ([key, union]) => `${key}: ${union.map((value) => `"${value}"`).concat(["(string & {})"]).join(" | ")};`
114
115
  ).join("\n");
115
- var extractComponents = ({
116
- components = {}
117
- }) => Object.entries(components).reduce(
116
+ var extractComponents = ({ components = {} }) => Object.entries(components).reduce(
118
117
  (obj, [key, { sizes, variants }]) => {
119
118
  if (sizes || variants) {
120
119
  obj[key] = {
@@ -167,12 +166,12 @@ var extractColorSchemes = (theme) => {
167
166
  return array;
168
167
  }, []);
169
168
  };
170
- var extractPaths = (target, maxDepth = 3) => {
171
- if (!isObject(target) && !Array.isArray(target) || !maxDepth)
169
+ var extractPaths = (target, maxDepth = 3, omitKeys = []) => {
170
+ if (!isObject(target) && !isArray(target) || !maxDepth)
172
171
  return [];
173
172
  return Object.entries(target).reduce((array, [key, value]) => {
174
- if (isObject(value)) {
175
- extractPaths(value, maxDepth - 1).forEach(
173
+ if (isObject(value) && !Object.keys(value).some((key2) => omitKeys.includes(key2))) {
174
+ extractPaths(value, maxDepth - 1, omitKeys).forEach(
176
175
  (nestedKey) => array.push(`${key}.${nestedKey}`)
177
176
  );
178
177
  } else {
@@ -190,11 +189,17 @@ var extractKeys = (theme, key) => {
190
189
  };
191
190
  var createThemeTypings = async (theme) => {
192
191
  const unions = config.reduce(
193
- (obj, { key, maxScanDepth, filter = () => true, flatMap = (value) => value }) => {
192
+ (obj, {
193
+ key,
194
+ maxScanDepth,
195
+ omitScanKeys,
196
+ filter = () => true,
197
+ flatMap = (value) => value
198
+ }) => {
194
199
  const target = theme[key];
195
200
  obj[key] = [];
196
201
  if (isObject(target) || isArray(target)) {
197
- obj[key] = extractPaths(target, maxScanDepth).filter(filter).flatMap(flatMap);
202
+ obj[key] = extractPaths(target, maxScanDepth, omitScanKeys).filter(filter).flatMap(flatMap);
198
203
  }
199
204
  if (isObject(theme.semantics)) {
200
205
  const semanticKeys = extractKeys(theme.semantics, key).filter(filter).flatMap(flatMap);
@@ -33,9 +33,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
33
  ));
34
34
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
35
 
36
- // ../../node_modules/.pnpm/tsup@7.2.0_@swc+core@1.3.74_ts-node@10.9.1_typescript@5.1.6/node_modules/tsup/assets/cjs_shims.js
36
+ // ../../node_modules/.pnpm/tsup@7.2.0_@swc+core@1.3.83_ts-node@10.9.1_typescript@5.2.2/node_modules/tsup/assets/cjs_shims.js
37
37
  var init_cjs_shims = __esm({
38
- "../../node_modules/.pnpm/tsup@7.2.0_@swc+core@1.3.74_ts-node@10.9.1_typescript@5.1.6/node_modules/tsup/assets/cjs_shims.js"() {
38
+ "../../node_modules/.pnpm/tsup@7.2.0_@swc+core@1.3.83_ts-node@10.9.1_typescript@5.2.2/node_modules/tsup/assets/cjs_shims.js"() {
39
39
  "use strict";
40
40
  }
41
41
  });
@@ -6462,6 +6462,7 @@ var config = [
6462
6462
  { key: "sizes", maxScanDepth: 2 },
6463
6463
  { key: "spaces", flatMap: (value) => [value, `-${value}`] },
6464
6464
  { key: "zIndices" },
6465
+ { key: "animations", omitScanKeys: ["keyframes"] },
6465
6466
  { key: "gradients" }
6466
6467
  ];
6467
6468
 
@@ -6496,9 +6497,7 @@ var printComponent = (components) => `components: { ${Object.entries(components)
6496
6497
  var print = (unions) => Object.entries(unions).sort(([a], [b]) => a.localeCompare(b)).map(
6497
6498
  ([key, union]) => `${key}: ${union.map((value) => `"${value}"`).concat(["(string & {})"]).join(" | ")};`
6498
6499
  ).join("\n");
6499
- var extractComponents = ({
6500
- components = {}
6501
- }) => Object.entries(components).reduce(
6500
+ var extractComponents = ({ components = {} }) => Object.entries(components).reduce(
6502
6501
  (obj, [key, { sizes, variants }]) => {
6503
6502
  if (sizes || variants) {
6504
6503
  obj[key] = {
@@ -6551,12 +6550,12 @@ var extractColorSchemes = (theme) => {
6551
6550
  return array;
6552
6551
  }, []);
6553
6552
  };
6554
- var extractPaths = (target, maxDepth = 3) => {
6555
- if (!isObject(target) && !Array.isArray(target) || !maxDepth)
6553
+ var extractPaths = (target, maxDepth = 3, omitKeys = []) => {
6554
+ if (!isObject(target) && !isArray(target) || !maxDepth)
6556
6555
  return [];
6557
6556
  return Object.entries(target).reduce((array, [key, value]) => {
6558
- if (isObject(value)) {
6559
- extractPaths(value, maxDepth - 1).forEach(
6557
+ if (isObject(value) && !Object.keys(value).some((key2) => omitKeys.includes(key2))) {
6558
+ extractPaths(value, maxDepth - 1, omitKeys).forEach(
6560
6559
  (nestedKey) => array.push(`${key}.${nestedKey}`)
6561
6560
  );
6562
6561
  } else {
@@ -6574,11 +6573,17 @@ var extractKeys = (theme, key) => {
6574
6573
  };
6575
6574
  var createThemeTypings = async (theme) => {
6576
6575
  const unions = config.reduce(
6577
- (obj, { key, maxScanDepth, filter = () => true, flatMap = (value) => value }) => {
6576
+ (obj, {
6577
+ key,
6578
+ maxScanDepth,
6579
+ omitScanKeys,
6580
+ filter = () => true,
6581
+ flatMap = (value) => value
6582
+ }) => {
6578
6583
  const target = theme[key];
6579
6584
  obj[key] = [];
6580
6585
  if (isObject(target) || isArray(target)) {
6581
- obj[key] = extractPaths(target, maxScanDepth).filter(filter).flatMap(flatMap);
6586
+ obj[key] = extractPaths(target, maxScanDepth, omitScanKeys).filter(filter).flatMap(flatMap);
6582
6587
  }
6583
6588
  if (isObject(theme.semantics)) {
6584
6589
  const semanticKeys = extractKeys(theme.semantics, key).filter(filter).flatMap(flatMap);
package/dist/index.js CHANGED
@@ -33,10 +33,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
33
  ));
34
34
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
35
 
36
- // ../../node_modules/.pnpm/tsup@7.2.0_@swc+core@1.3.74_ts-node@10.9.1_typescript@5.1.6/node_modules/tsup/assets/cjs_shims.js
36
+ // ../../node_modules/.pnpm/tsup@7.2.0_@swc+core@1.3.83_ts-node@10.9.1_typescript@5.2.2/node_modules/tsup/assets/cjs_shims.js
37
37
  var getImportMetaUrl, importMetaUrl;
38
38
  var init_cjs_shims = __esm({
39
- "../../node_modules/.pnpm/tsup@7.2.0_@swc+core@1.3.74_ts-node@10.9.1_typescript@5.1.6/node_modules/tsup/assets/cjs_shims.js"() {
39
+ "../../node_modules/.pnpm/tsup@7.2.0_@swc+core@1.3.83_ts-node@10.9.1_typescript@5.2.2/node_modules/tsup/assets/cjs_shims.js"() {
40
40
  "use strict";
41
41
  getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
42
42
  importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
@@ -18735,7 +18735,7 @@ var import_cli_welcome = __toESM(require("cli-welcome"));
18735
18735
  // package.json
18736
18736
  var package_default = {
18737
18737
  name: "@yamada-ui/cli",
18738
- version: "0.3.2",
18738
+ version: "0.4.0",
18739
18739
  description: "Generate theme tokens for autocomplete",
18740
18740
  keywords: [
18741
18741
  "theme",
@@ -25913,6 +25913,7 @@ var config = [
25913
25913
  { key: "sizes", maxScanDepth: 2 },
25914
25914
  { key: "spaces", flatMap: (value) => [value, `-${value}`] },
25915
25915
  { key: "zIndices" },
25916
+ { key: "animations", omitScanKeys: ["keyframes"] },
25916
25917
  { key: "gradients" }
25917
25918
  ];
25918
25919
 
@@ -25947,9 +25948,7 @@ var printComponent = (components) => `components: { ${Object.entries(components)
25947
25948
  var print = (unions) => Object.entries(unions).sort(([a], [b]) => a.localeCompare(b)).map(
25948
25949
  ([key, union]) => `${key}: ${union.map((value) => `"${value}"`).concat(["(string & {})"]).join(" | ")};`
25949
25950
  ).join("\n");
25950
- var extractComponents = ({
25951
- components = {}
25952
- }) => Object.entries(components).reduce(
25951
+ var extractComponents = ({ components = {} }) => Object.entries(components).reduce(
25953
25952
  (obj, [key, { sizes, variants }]) => {
25954
25953
  if (sizes || variants) {
25955
25954
  obj[key] = {
@@ -26002,12 +26001,12 @@ var extractColorSchemes = (theme) => {
26002
26001
  return array;
26003
26002
  }, []);
26004
26003
  };
26005
- var extractPaths = (target, maxDepth = 3) => {
26006
- if (!isObject(target) && !Array.isArray(target) || !maxDepth)
26004
+ var extractPaths = (target, maxDepth = 3, omitKeys = []) => {
26005
+ if (!isObject(target) && !isArray(target) || !maxDepth)
26007
26006
  return [];
26008
26007
  return Object.entries(target).reduce((array, [key, value]) => {
26009
- if (isObject(value)) {
26010
- extractPaths(value, maxDepth - 1).forEach(
26008
+ if (isObject(value) && !Object.keys(value).some((key2) => omitKeys.includes(key2))) {
26009
+ extractPaths(value, maxDepth - 1, omitKeys).forEach(
26011
26010
  (nestedKey) => array.push(`${key}.${nestedKey}`)
26012
26011
  );
26013
26012
  } else {
@@ -26025,11 +26024,17 @@ var extractKeys = (theme, key) => {
26025
26024
  };
26026
26025
  var createThemeTypings = async (theme) => {
26027
26026
  const unions = config.reduce(
26028
- (obj, { key, maxScanDepth, filter = () => true, flatMap = (value) => value }) => {
26027
+ (obj, {
26028
+ key,
26029
+ maxScanDepth,
26030
+ omitScanKeys,
26031
+ filter = () => true,
26032
+ flatMap = (value) => value
26033
+ }) => {
26029
26034
  const target = theme[key];
26030
26035
  obj[key] = [];
26031
26036
  if (isObject(target) || isArray(target)) {
26032
- obj[key] = extractPaths(target, maxScanDepth).filter(filter).flatMap(flatMap);
26037
+ obj[key] = extractPaths(target, maxScanDepth, omitScanKeys).filter(filter).flatMap(flatMap);
26033
26038
  }
26034
26039
  if (isObject(theme.semantics)) {
26035
26040
  const semanticKeys = extractKeys(theme.semantics, key).filter(filter).flatMap(flatMap);
@@ -39,9 +39,7 @@ var isUndefined = (value) => typeof value === "undefined" && value === void 0;
39
39
  var isNull = (value) => value === null;
40
40
  var isObject = (obj) => obj !== null && (typeof obj === "object" || typeof obj === "function") && !Array.isArray(obj);
41
41
  var isArray = (value) => Array.isArray(value);
42
- function isFunction(value) {
43
- return typeof value === "function";
44
- }
42
+ var isFunction = (value) => typeof value === "function";
45
43
  // Annotate the CommonJS export names for ESM import in node:
46
44
  0 && (module.exports = {
47
45
  isArray,
package/dist/utils/cli.js CHANGED
@@ -33,10 +33,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
33
  ));
34
34
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
35
 
36
- // ../../node_modules/.pnpm/tsup@7.2.0_@swc+core@1.3.74_ts-node@10.9.1_typescript@5.1.6/node_modules/tsup/assets/cjs_shims.js
36
+ // ../../node_modules/.pnpm/tsup@7.2.0_@swc+core@1.3.83_ts-node@10.9.1_typescript@5.2.2/node_modules/tsup/assets/cjs_shims.js
37
37
  var getImportMetaUrl, importMetaUrl;
38
38
  var init_cjs_shims = __esm({
39
- "../../node_modules/.pnpm/tsup@7.2.0_@swc+core@1.3.74_ts-node@10.9.1_typescript@5.1.6/node_modules/tsup/assets/cjs_shims.js"() {
39
+ "../../node_modules/.pnpm/tsup@7.2.0_@swc+core@1.3.83_ts-node@10.9.1_typescript@5.2.2/node_modules/tsup/assets/cjs_shims.js"() {
40
40
  "use strict";
41
41
  getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
42
42
  importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
@@ -12631,7 +12631,7 @@ var import_cli_welcome = __toESM(require("cli-welcome"));
12631
12631
  // package.json
12632
12632
  var package_default = {
12633
12633
  name: "@yamada-ui/cli",
12634
- version: "0.3.2",
12634
+ version: "0.4.0",
12635
12635
  description: "Generate theme tokens for autocomplete",
12636
12636
  keywords: [
12637
12637
  "theme",
@@ -33,10 +33,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
33
  ));
34
34
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
35
 
36
- // ../../node_modules/.pnpm/tsup@7.2.0_@swc+core@1.3.74_ts-node@10.9.1_typescript@5.1.6/node_modules/tsup/assets/cjs_shims.js
36
+ // ../../node_modules/.pnpm/tsup@7.2.0_@swc+core@1.3.83_ts-node@10.9.1_typescript@5.2.2/node_modules/tsup/assets/cjs_shims.js
37
37
  var getImportMetaUrl, importMetaUrl;
38
38
  var init_cjs_shims = __esm({
39
- "../../node_modules/.pnpm/tsup@7.2.0_@swc+core@1.3.74_ts-node@10.9.1_typescript@5.1.6/node_modules/tsup/assets/cjs_shims.js"() {
39
+ "../../node_modules/.pnpm/tsup@7.2.0_@swc+core@1.3.83_ts-node@10.9.1_typescript@5.2.2/node_modules/tsup/assets/cjs_shims.js"() {
40
40
  "use strict";
41
41
  getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
42
42
  importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
@@ -12645,9 +12645,7 @@ var isUndefined = (value) => typeof value === "undefined" && value === void 0;
12645
12645
  var isNull = (value) => value === null;
12646
12646
  var isObject = (obj) => obj !== null && (typeof obj === "object" || typeof obj === "function") && !Array.isArray(obj);
12647
12647
  var isArray = (value) => Array.isArray(value);
12648
- function isFunction(value) {
12649
- return typeof value === "function";
12650
- }
12648
+ var isFunction = (value) => typeof value === "function";
12651
12649
 
12652
12650
  // src/utils/cli.ts
12653
12651
  init_cjs_shims();
@@ -12658,7 +12656,7 @@ var import_cli_welcome = __toESM(require("cli-welcome"));
12658
12656
  // package.json
12659
12657
  var package_default = {
12660
12658
  name: "@yamada-ui/cli",
12661
- version: "0.3.2",
12659
+ version: "0.4.0",
12662
12660
  description: "Generate theme tokens for autocomplete",
12663
12661
  keywords: [
12664
12662
  "theme",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yamada-ui/cli",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "Generate theme tokens for autocomplete",
5
5
  "keywords": [
6
6
  "theme",