saha-ui 1.13.0 ā 1.13.1
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/bin/cli.js +4 -4
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -813,19 +813,19 @@ const inject = (f, tailwindInfo) => {
|
|
|
813
813
|
// For Tailwind v4, check if @source is already present
|
|
814
814
|
const relativePathToNodeModules = getRelativePathToNodeModules(f);
|
|
815
815
|
const sahaUISourcePath = `${relativePathToNodeModules}/saha-ui/dist/**/*.js`;
|
|
816
|
-
const sourcePattern = /source\s
|
|
816
|
+
const sourcePattern = /source\s+["'][^"']*saha-ui[^"']*["']/;
|
|
817
817
|
|
|
818
818
|
if (sourcePattern.test(cur)) {
|
|
819
819
|
console.log("ā
Tailwind v4 @source already includes saha-ui");
|
|
820
820
|
out = cur.replace(/@import\s+["']tailwindcss["'];?/, (m) => `${m}\n${M}\n${cssToInject}`);
|
|
821
821
|
} else {
|
|
822
|
-
// Add @source to the @import line
|
|
822
|
+
// Add @source to the @import line (without parentheses)
|
|
823
823
|
out = cur.replace(
|
|
824
824
|
/@import\s+["']tailwindcss["'];?/,
|
|
825
|
-
`@import "tailwindcss" source
|
|
825
|
+
`@import "tailwindcss" source "${sahaUISourcePath}";`
|
|
826
826
|
);
|
|
827
827
|
out = out.replace(/@import\s+["']tailwindcss["'][^;]*;/, (m) => `${m}\n${M}\n${cssToInject}`);
|
|
828
|
-
console.log(`\nš Added @source
|
|
828
|
+
console.log(`\nš Added @source "${sahaUISourcePath}" to Tailwind v4 import`);
|
|
829
829
|
}
|
|
830
830
|
} else if (hasTailwindV3Import) {
|
|
831
831
|
const tailwindDirectives = cur.match(/@tailwind\s+(base|components|utilities);?\n*/g);
|