@juristr/nx-tailwind-sync 0.0.1 → 0.0.3
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/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Nx Tailwind Sync
|
|
2
2
|
|
|
3
|
-
Nx sync generator that auto-manages `@source` directives in CSS files for Tailwind v4 monorepos.
|
|
3
|
+
Nx [sync generator](https://nx.dev/docs/concepts/sync-generators) that auto-manages `@source` directives in CSS files for Tailwind v4 monorepos.
|
|
4
4
|
|
|
5
5
|
## Problem
|
|
6
6
|
|
|
@@ -48,7 +48,7 @@ Register the sync generator on tasks that need it (e.g., `build`, `dev`):
|
|
|
48
48
|
"nx": {
|
|
49
49
|
"targets": {
|
|
50
50
|
"build": {
|
|
51
|
-
"syncGenerators": ["@
|
|
51
|
+
"syncGenerators": ["@juristr/nx-tailwind-sync:update-tailwind-globs"]
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -70,5 +70,5 @@ pnpm nx sync
|
|
|
70
70
|
## Building
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
|
-
nx build tailwind-sync
|
|
73
|
+
nx build @juristr/nx-tailwind-sync
|
|
74
74
|
```
|
|
@@ -23,7 +23,7 @@ function findTailwindCssFile(tree, projectRoot, additionalPaths = []) {
|
|
|
23
23
|
for (const relPath of searchPaths) {
|
|
24
24
|
const fullPath = (0, path_1.join)(projectRoot, relPath);
|
|
25
25
|
const content = tree.read(fullPath)?.toString();
|
|
26
|
-
if (content?.match(/@import\s+['"]tailwindcss['"]/)) {
|
|
26
|
+
if (content?.match(/@import\s+['"]tailwindcss[^'"]*['"]/)) {
|
|
27
27
|
return fullPath;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -143,7 +143,7 @@ function updateSourceDirectives(tree, projectName, cssFilePath, projectGraph) {
|
|
|
143
143
|
// Remove any existing bare @source directives (migration from old format)
|
|
144
144
|
const cleanedContent = currentContent.replace(/\n@source\s+["'][^"']*packages\/[^"']+["'];/g, '');
|
|
145
145
|
// Try to find @import 'tailwindcss' first
|
|
146
|
-
const tailwindImportRegex = /@import\s+['"]tailwindcss['"];/;
|
|
146
|
+
const tailwindImportRegex = /@import\s+['"]tailwindcss[^'"]*['"];/;
|
|
147
147
|
const tailwindImportMatch = cleanedContent.match(tailwindImportRegex);
|
|
148
148
|
// If not found, look for any @import statement
|
|
149
149
|
const anyImportRegex = /@import\s+['"][^'"]+['"];/;
|
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juristr/nx-tailwind-sync",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"repository": "https://github.com/juristr/nx-tailwind-sync",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Juri Strumpflohner - @juristr",
|
|
4
7
|
"main": "./dist/index.js",
|
|
5
8
|
"module": "./dist/index.js",
|
|
6
9
|
"types": "./dist/index.d.ts",
|
|
@@ -14,6 +17,16 @@
|
|
|
14
17
|
},
|
|
15
18
|
"nx": {
|
|
16
19
|
"targets": {
|
|
20
|
+
"e2e": {
|
|
21
|
+
"executor": "nx:run-commands",
|
|
22
|
+
"dependsOn": [
|
|
23
|
+
"build"
|
|
24
|
+
],
|
|
25
|
+
"options": {
|
|
26
|
+
"command": "vitest run",
|
|
27
|
+
"cwd": "packages/tailwind-sync-plugin"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
17
30
|
"build": {
|
|
18
31
|
"executor": "@nx/js:tsc",
|
|
19
32
|
"outputs": [
|
|
@@ -54,4 +67,4 @@
|
|
|
54
67
|
"publishConfig": {
|
|
55
68
|
"access": "public"
|
|
56
69
|
}
|
|
57
|
-
}
|
|
70
|
+
}
|