@kimesh/tailwindcss 0.2.20 → 0.2.21-nightly.20260127094737

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 CHANGED
@@ -3,9 +3,6 @@ import { VitePlugin } from "@kimesh/kit";
3
3
 
4
4
  //#region src/types.d.ts
5
5
 
6
- /**
7
- * @kimesh/tailwindcss - Types
8
- */
9
6
  /**
10
7
  * Configuration options for the Kimesh TailwindCSS module
11
8
  */
package/dist/index.js CHANGED
@@ -96,19 +96,28 @@ function hasReferenceDirective(content) {
96
96
  //#endregion
97
97
  //#region src/module.ts
98
98
  /**
99
- * Generate CSS content with @source directives for all layers
99
+ * Build source entries from Kimesh layers
100
100
  */
101
- function generateSourcesCSS(kimesh, additionalSources) {
101
+ function buildLayerSources(kimesh) {
102
+ return kimesh.layers.map((layer) => ({
103
+ path: `${layer.path}/src`,
104
+ comment: `layer: ${layer.name}`
105
+ }));
106
+ }
107
+ /**
108
+ * Generate CSS content with @source directives
109
+ */
110
+ function generateSourcesCSS(kimesh, sources, additionalSources) {
102
111
  const lines = ["/* Auto-generated by @kimesh/tailwindcss */", ""];
103
- for (const layer of kimesh.layers) {
104
- const srcDir = `${layer.path}/src`;
105
- const sourcePath = relative(kimesh.buildDir, srcDir);
112
+ for (const source of sources) {
113
+ const sourcePath = relative(kimesh.buildDir, source.path);
106
114
  const normalizedPath = sourcePath.replace(/\\/g, "/");
107
- lines.push(`@source "${normalizedPath}";`);
115
+ const comment = source.comment ? ` /* ${source.comment} */` : "";
116
+ lines.push(`@source "${normalizedPath}";${comment}`);
108
117
  }
109
118
  if (additionalSources.length > 0) {
110
119
  lines.push("");
111
- lines.push("/* Additional sources */");
120
+ lines.push("/* Additional sources (config) */");
112
121
  for (const source of additionalSources) {
113
122
  const normalizedPath = source.replace(/\\/g, "/");
114
123
  lines.push(`@source "${normalizedPath}";`);
@@ -119,8 +128,8 @@ function generateSourcesCSS(kimesh, additionalSources) {
119
128
  /**
120
129
  * Generate the main CSS content
121
130
  */
122
- function generateMainCSS(kimesh, additionalSources) {
123
- const sourcesCSS = generateSourcesCSS(kimesh, additionalSources);
131
+ function generateMainCSS(kimesh, sources, additionalSources) {
132
+ const sourcesCSS = generateSourcesCSS(kimesh, sources, additionalSources);
124
133
  return [
125
134
  `/* Generated by @kimesh/tailwindcss - DO NOT EDIT */`,
126
135
  ``,
@@ -165,10 +174,12 @@ var module_default = defineKimeshModule({
165
174
  async setup(options, kimesh) {
166
175
  const { additionalSources = [], cssFileName = "tailwind.css", autoReference = true, alias = "#kimesh/tailwind", mainCss = "src/app.css", referenceAlias = "#tailwind" } = options;
167
176
  const cssFilePath = join(kimesh.buildDir, cssFileName);
177
+ const sources = buildLayerSources(kimesh);
178
+ await kimesh.callHook("tailwindcss:sources:extend", sources, kimesh);
168
179
  addTemplate({
169
180
  filename: cssFileName,
170
181
  write: true,
171
- getContents: ({ kimesh: kimesh$1 }) => generateMainCSS(kimesh$1, additionalSources)
182
+ getContents: ({ kimesh: km }) => generateMainCSS(km, sources, additionalSources)
172
183
  });
173
184
  addAlias(alias, cssFilePath);
174
185
  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.20",
3
+ "version": "0.2.21-nightly.20260127094737",
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": "0.2.20",
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": "0.2.20",
40
+ "@kimesh/kit": "workspace:*",
41
41
  "tailwindcss": "^4.0.0",
42
42
  "vite": "^8.0.0-beta.8"
43
43
  }