@yamada-ui/cli 0.0.0-dev-20230608024220
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/LICENSE +21 -0
- package/README.md +42 -0
- package/bin/index.js +7 -0
- package/bin/tsconfig.json +14 -0
- package/dist/command/tokens/config.js +44 -0
- package/dist/command/tokens/create-theme-typings.js +213 -0
- package/dist/command/tokens/index.js +6833 -0
- package/dist/command/tokens/resolve-output-path.js +82 -0
- package/dist/index.js +24023 -0
- package/dist/utils/assertion.js +56 -0
- package/dist/utils/cli.js +17917 -0
- package/dist/utils/index.js +17969 -0
- package/dist/utils/prettier.js +41 -0
- package/package.json +59 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/command/tokens/resolve-output-path.ts
|
|
31
|
+
var resolve_output_path_exports = {};
|
|
32
|
+
__export(resolve_output_path_exports, {
|
|
33
|
+
resolveOutputPath: () => resolveOutputPath,
|
|
34
|
+
themePath: () => themePath
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(resolve_output_path_exports);
|
|
37
|
+
var import_fs = __toESM(require("fs"));
|
|
38
|
+
var import_path = __toESM(require("path"));
|
|
39
|
+
var import_util = require("util");
|
|
40
|
+
var exists = (0, import_util.promisify)(import_fs.default.exists);
|
|
41
|
+
var themePath = [
|
|
42
|
+
"node_modules",
|
|
43
|
+
"@yamada-ui",
|
|
44
|
+
"core",
|
|
45
|
+
"dist",
|
|
46
|
+
"generated-theme.types.d.ts"
|
|
47
|
+
];
|
|
48
|
+
var resolveThemePath = async () => {
|
|
49
|
+
const basePath = import_path.default.join("..", "..", "..");
|
|
50
|
+
const rootPath = process.cwd();
|
|
51
|
+
const paths = [
|
|
52
|
+
import_path.default.resolve(basePath, "..", ...themePath),
|
|
53
|
+
import_path.default.resolve(basePath, "..", "..", ...themePath),
|
|
54
|
+
import_path.default.resolve(rootPath, ...themePath),
|
|
55
|
+
import_path.default.resolve(rootPath, "..", ...themePath),
|
|
56
|
+
import_path.default.resolve(rootPath, "..", "..", ...themePath)
|
|
57
|
+
];
|
|
58
|
+
const triedPaths = await Promise.all(
|
|
59
|
+
paths.map(async (possiblePath) => {
|
|
60
|
+
const isExist = await exists(possiblePath);
|
|
61
|
+
if (isExist)
|
|
62
|
+
return possiblePath;
|
|
63
|
+
return "";
|
|
64
|
+
})
|
|
65
|
+
);
|
|
66
|
+
return triedPaths.find(Boolean);
|
|
67
|
+
};
|
|
68
|
+
var resolveOutputPath = async (outPath) => {
|
|
69
|
+
if (outPath)
|
|
70
|
+
return import_path.default.resolve(process.cwd(), outPath);
|
|
71
|
+
const themePath2 = await resolveThemePath();
|
|
72
|
+
if (!themePath2)
|
|
73
|
+
throw new Error(
|
|
74
|
+
"Could not find @yamada-ui/core in node_modules. Please provide `--out` parameter."
|
|
75
|
+
);
|
|
76
|
+
return themePath2;
|
|
77
|
+
};
|
|
78
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
79
|
+
0 && (module.exports = {
|
|
80
|
+
resolveOutputPath,
|
|
81
|
+
themePath
|
|
82
|
+
});
|