@kimesh/tailwindcss 0.2.20 → 0.2.21-nightly.20260127100702
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.d.ts +0 -3
- package/dist/index.js +24 -10
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -96,19 +96,31 @@ function hasReferenceDirective(content) {
|
|
|
96
96
|
//#endregion
|
|
97
97
|
//#region src/module.ts
|
|
98
98
|
/**
|
|
99
|
-
*
|
|
99
|
+
* Build source entries from Kimesh layers
|
|
100
100
|
*/
|
|
101
|
-
function
|
|
101
|
+
function buildLayerSources(kimesh) {
|
|
102
|
+
return kimesh.layers.map((layer) => {
|
|
103
|
+
const srcPath = layer.path.endsWith("/src") || layer.path.endsWith("\\src") ? layer.path : `${layer.path}/src`;
|
|
104
|
+
return {
|
|
105
|
+
path: srcPath,
|
|
106
|
+
comment: `layer: ${layer.name}`
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Generate CSS content with @source directives
|
|
112
|
+
*/
|
|
113
|
+
function generateSourcesCSS(kimesh, sources, additionalSources) {
|
|
102
114
|
const lines = ["/* Auto-generated by @kimesh/tailwindcss */", ""];
|
|
103
|
-
for (const
|
|
104
|
-
const
|
|
105
|
-
const sourcePath = relative(kimesh.buildDir, srcDir);
|
|
115
|
+
for (const source of sources) {
|
|
116
|
+
const sourcePath = relative(kimesh.buildDir, source.path);
|
|
106
117
|
const normalizedPath = sourcePath.replace(/\\/g, "/");
|
|
107
|
-
|
|
118
|
+
const comment = source.comment ? ` /* ${source.comment} */` : "";
|
|
119
|
+
lines.push(`@source "${normalizedPath}";${comment}`);
|
|
108
120
|
}
|
|
109
121
|
if (additionalSources.length > 0) {
|
|
110
122
|
lines.push("");
|
|
111
|
-
lines.push("/* Additional sources */");
|
|
123
|
+
lines.push("/* Additional sources (config) */");
|
|
112
124
|
for (const source of additionalSources) {
|
|
113
125
|
const normalizedPath = source.replace(/\\/g, "/");
|
|
114
126
|
lines.push(`@source "${normalizedPath}";`);
|
|
@@ -119,8 +131,8 @@ function generateSourcesCSS(kimesh, additionalSources) {
|
|
|
119
131
|
/**
|
|
120
132
|
* Generate the main CSS content
|
|
121
133
|
*/
|
|
122
|
-
function generateMainCSS(kimesh, additionalSources) {
|
|
123
|
-
const sourcesCSS = generateSourcesCSS(kimesh, additionalSources);
|
|
134
|
+
function generateMainCSS(kimesh, sources, additionalSources) {
|
|
135
|
+
const sourcesCSS = generateSourcesCSS(kimesh, sources, additionalSources);
|
|
124
136
|
return [
|
|
125
137
|
`/* Generated by @kimesh/tailwindcss - DO NOT EDIT */`,
|
|
126
138
|
``,
|
|
@@ -165,10 +177,12 @@ var module_default = defineKimeshModule({
|
|
|
165
177
|
async setup(options, kimesh) {
|
|
166
178
|
const { additionalSources = [], cssFileName = "tailwind.css", autoReference = true, alias = "#kimesh/tailwind", mainCss = "src/app.css", referenceAlias = "#tailwind" } = options;
|
|
167
179
|
const cssFilePath = join(kimesh.buildDir, cssFileName);
|
|
180
|
+
const sources = buildLayerSources(kimesh);
|
|
181
|
+
await kimesh.callHook("tailwindcss:sources:extend", sources, kimesh);
|
|
168
182
|
addTemplate({
|
|
169
183
|
filename: cssFileName,
|
|
170
184
|
write: true,
|
|
171
|
-
getContents: ({ kimesh:
|
|
185
|
+
getContents: ({ kimesh: km }) => generateMainCSS(km, sources, additionalSources)
|
|
172
186
|
});
|
|
173
187
|
addAlias(alias, cssFilePath);
|
|
174
188
|
const mainCssPath = join(kimesh.root, mainCss);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kimesh/tailwindcss",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.21-nightly.20260127100702",
|
|
4
4
|
"description": "TailwindCSS module for Kimesh framework",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"magic-string": "^0.30.17"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@kimesh/kit": "
|
|
34
|
+
"@kimesh/kit": "workspace:*",
|
|
35
35
|
"tsdown": "^0.11.6",
|
|
36
36
|
"typescript": "^5.8.3",
|
|
37
37
|
"vite": "^8.0.0-beta.8"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@kimesh/kit": "
|
|
40
|
+
"@kimesh/kit": "workspace:*",
|
|
41
41
|
"tailwindcss": "^4.0.0",
|
|
42
42
|
"vite": "^8.0.0-beta.8"
|
|
43
43
|
}
|