@yamada-ui/cli 2.1.12 → 2.1.13-dev-20260830142435
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 +7 -10
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6043,24 +6043,21 @@ function transformContent(targetSection, content, { getSection }, generatedNames
|
|
|
6043
6043
|
if (module) {
|
|
6044
6044
|
const [section] = value.split("/").slice(-2);
|
|
6045
6045
|
if (!generated || !section) return;
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
replaceValue = `from "${path.join("..", "..", relativePath, name)}"`;
|
|
6051
|
-
}
|
|
6046
|
+
const { path: sectionPath } = getSection(section) ?? {};
|
|
6047
|
+
if (!sectionPath) return;
|
|
6048
|
+
const relativePath = path.posix.relative(path.posix.join(getSection(targetSection)?.path ?? targetSection, "dummy"), path.posix.join(sectionPath, name));
|
|
6049
|
+
replaceValue = `from "${relativePath.startsWith(".") ? relativePath : `./${relativePath}`}"`;
|
|
6052
6050
|
} else {
|
|
6053
6051
|
const depth = (value.match(/\.\.\//g) || []).length;
|
|
6054
6052
|
if (!depth) return;
|
|
6055
|
-
if (depth === 1) if (generated) replaceValue = `from "${path.join("..", name)}"`;
|
|
6053
|
+
if (depth === 1) if (generated) replaceValue = `from "${path.posix.join("..", name)}"`;
|
|
6056
6054
|
else replaceValue = `from "${PACKAGE_NAME}/${targetSection}/${name}"`;
|
|
6057
6055
|
else {
|
|
6058
6056
|
const { path: sectionPath, section } = getSection(value.replace(/(\.\.\/|\.\/)/g, "").split("/").slice(0, -1).join("/")) ?? {};
|
|
6059
6057
|
if (!section || !sectionPath) return;
|
|
6060
6058
|
if (generated) {
|
|
6061
|
-
const
|
|
6062
|
-
|
|
6063
|
-
replaceValue = `from "${"../".repeat(neededDepth)}${omittedTargetPath}/${name}"`;
|
|
6059
|
+
const relativePath = path.posix.relative(path.posix.join(getSection(targetSection)?.path ?? targetSection, "dummy"), path.posix.join(sectionPath, name));
|
|
6060
|
+
replaceValue = `from "${relativePath.startsWith(".") ? relativePath : `./${relativePath}`}"`;
|
|
6064
6061
|
} else replaceValue = `from "${PACKAGE_NAME}/${section}/${name}"`;
|
|
6065
6062
|
}
|
|
6066
6063
|
}
|