@agentuity/cli 1.0.51 → 1.0.52

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.
@@ -3,10 +3,12 @@
3
3
  *
4
4
  * The Tailwind v4 oxide scanner (native Rust binary) can hang or fail when
5
5
  * scanning the filesystem in containerized environments. Adding source(none)
6
- * to @import "tailwindcss" disables the oxide filesystem scanner while still
7
- * allowing @tailwindcss/vite to detect class usage through Vite's module graph.
6
+ * to @import "tailwindcss" disables the oxide filesystem scanner, and an
7
+ * explicit @source directive pointing at the project's src/ directory tells
8
+ * Tailwind exactly where to find utility classes.
8
9
  *
9
10
  * @see https://github.com/tailwindlabs/tailwindcss/discussions/19661
11
+ * @see https://tailwindcss.com/docs/detecting-classes-in-source-files
10
12
  */
11
13
  import type { Plugin } from 'vite';
12
14
  export declare function tailwindSourcePlugin(): Plugin;
@@ -1 +1 @@
1
- {"version":3,"file":"tailwind-source-plugin.d.ts","sourceRoot":"","sources":["../../../../src/cmd/build/vite/tailwind-source-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,wBAAgB,oBAAoB,IAAI,MAAM,CAwC7C"}
1
+ {"version":3,"file":"tailwind-source-plugin.d.ts","sourceRoot":"","sources":["../../../../src/cmd/build/vite/tailwind-source-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,wBAAgB,oBAAoB,IAAI,MAAM,CAwD7C"}
@@ -3,15 +3,22 @@
3
3
  *
4
4
  * The Tailwind v4 oxide scanner (native Rust binary) can hang or fail when
5
5
  * scanning the filesystem in containerized environments. Adding source(none)
6
- * to @import "tailwindcss" disables the oxide filesystem scanner while still
7
- * allowing @tailwindcss/vite to detect class usage through Vite's module graph.
6
+ * to @import "tailwindcss" disables the oxide filesystem scanner, and an
7
+ * explicit @source directive pointing at the project's src/ directory tells
8
+ * Tailwind exactly where to find utility classes.
8
9
  *
9
10
  * @see https://github.com/tailwindlabs/tailwindcss/discussions/19661
11
+ * @see https://tailwindcss.com/docs/detecting-classes-in-source-files
10
12
  */
13
+ import { dirname, join, relative, sep } from 'node:path';
11
14
  export function tailwindSourcePlugin() {
15
+ let root;
12
16
  return {
13
17
  name: 'agentuity:tailwind-source',
14
18
  enforce: 'pre',
19
+ configResolved(config) {
20
+ root = config.root;
21
+ },
15
22
  transform(code, id) {
16
23
  // Only transform CSS files
17
24
  if (!id.endsWith('.css')) {
@@ -21,15 +28,25 @@ export function tailwindSourcePlugin() {
21
28
  if (!/@import\s+["']tailwindcss["']/.test(code)) {
22
29
  return null;
23
30
  }
31
+ // Compute relative path from CSS file to project's src/ directory
32
+ const cssDir = dirname(id);
33
+ const srcDir = join(root, 'src');
34
+ let relPath = relative(cssDir, srcDir).split(sep).join('/');
35
+ if (relPath === '') {
36
+ relPath = '.';
37
+ }
38
+ else if (!relPath.startsWith('.')) {
39
+ relPath = './' + relPath;
40
+ }
24
41
  // Transform @import "tailwindcss" → @import "tailwindcss" source(none)
25
- // Handles both quote styles and preserves any other directives on the same statement
26
- // Does NOT transform if source() is already specified
42
+ // and add explicit @source so Tailwind knows where to scan for classes.
43
+ // Does NOT transform if source() is already specified.
27
44
  const transformed = code.replace(/@import\s+(["'])tailwindcss\1([^;]*);/g, (match, quote, rest) => {
28
45
  // If source() is already present, don't modify
29
46
  if (/source\s*\(/.test(rest)) {
30
47
  return match;
31
48
  }
32
- return `@import ${quote}tailwindcss${quote}${rest} source(none);`;
49
+ return `@import ${quote}tailwindcss${quote}${rest} source(none);\n@source "${relPath}";`;
33
50
  });
34
51
  if (transformed !== code) {
35
52
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"tailwind-source-plugin.js","sourceRoot":"","sources":["../../../../src/cmd/build/vite/tailwind-source-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,MAAM,UAAU,oBAAoB;IACnC,OAAO;QACN,IAAI,EAAE,2BAA2B;QACjC,OAAO,EAAE,KAAK;QAEd,SAAS,CAAC,IAAI,EAAE,EAAE;YACjB,2BAA2B;YAC3B,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC1B,OAAO,IAAI,CAAC;YACb,CAAC;YAED,4EAA4E;YAC5E,IAAI,CAAC,+BAA+B,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjD,OAAO,IAAI,CAAC;YACb,CAAC;YAED,uEAAuE;YACvE,qFAAqF;YACrF,sDAAsD;YACtD,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAC/B,wCAAwC,EACxC,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;gBACtB,+CAA+C;gBAC/C,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC9B,OAAO,KAAK,CAAC;gBACd,CAAC;gBACD,OAAO,WAAW,KAAK,cAAc,KAAK,GAAG,IAAI,gBAAgB,CAAC;YACnE,CAAC,CACD,CAAC;YAEF,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;gBAC1B,OAAO;oBACN,IAAI,EAAE,WAAW;oBACjB,GAAG,EAAE,IAAI;iBACT,CAAC;YACH,CAAC;YAED,OAAO,IAAI,CAAC;QACb,CAAC;KACD,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"tailwind-source-plugin.js","sourceRoot":"","sources":["../../../../src/cmd/build/vite/tailwind-source-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAGzD,MAAM,UAAU,oBAAoB;IACnC,IAAI,IAAY,CAAC;IAEjB,OAAO;QACN,IAAI,EAAE,2BAA2B;QACjC,OAAO,EAAE,KAAK;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AC;gBAC1B,OAAO;oBACN,IAAI,EAAE,WAAW;oBACjB,GAAG,EAAE,IAAI;iBACT,CAAC;YACH,CAAC;YAED,OAAO,IAAI,CAAC;QACb,CAAC;KACD,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentuity/cli",
3
- "version": "1.0.51",
3
+ "version": "1.0.52",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Agentuity employees and contributors",
6
6
  "type": "module",
@@ -41,9 +41,9 @@
41
41
  "prepublishOnly": "bun run clean && bun run build"
42
42
  },
43
43
  "dependencies": {
44
- "@agentuity/auth": "1.0.51",
45
- "@agentuity/core": "1.0.51",
46
- "@agentuity/server": "1.0.51",
44
+ "@agentuity/auth": "1.0.52",
45
+ "@agentuity/core": "1.0.52",
46
+ "@agentuity/server": "1.0.52",
47
47
  "@datasert/cronjs-parser": "^1.4.0",
48
48
  "@vitejs/plugin-react": "^5.1.2",
49
49
  "acorn-loose": "^8.5.2",
@@ -59,10 +59,10 @@
59
59
  "typescript": "^5.9.0",
60
60
  "vite": "^7.2.7",
61
61
  "zod": "^4.3.5",
62
- "@agentuity/frontend": "1.0.51"
62
+ "@agentuity/frontend": "1.0.52"
63
63
  },
64
64
  "devDependencies": {
65
- "@agentuity/test-utils": "1.0.51",
65
+ "@agentuity/test-utils": "1.0.52",
66
66
  "@types/adm-zip": "^0.5.7",
67
67
  "@types/bun": "latest",
68
68
  "@types/tar-fs": "^2.0.4",
@@ -3,19 +3,28 @@
3
3
  *
4
4
  * The Tailwind v4 oxide scanner (native Rust binary) can hang or fail when
5
5
  * scanning the filesystem in containerized environments. Adding source(none)
6
- * to @import "tailwindcss" disables the oxide filesystem scanner while still
7
- * allowing @tailwindcss/vite to detect class usage through Vite's module graph.
6
+ * to @import "tailwindcss" disables the oxide filesystem scanner, and an
7
+ * explicit @source directive pointing at the project's src/ directory tells
8
+ * Tailwind exactly where to find utility classes.
8
9
  *
9
10
  * @see https://github.com/tailwindlabs/tailwindcss/discussions/19661
11
+ * @see https://tailwindcss.com/docs/detecting-classes-in-source-files
10
12
  */
11
13
 
14
+ import { dirname, join, relative, sep } from 'node:path';
12
15
  import type { Plugin } from 'vite';
13
16
 
14
17
  export function tailwindSourcePlugin(): Plugin {
18
+ let root: string;
19
+
15
20
  return {
16
21
  name: 'agentuity:tailwind-source',
17
22
  enforce: 'pre',
18
23
 
24
+ configResolved(config) {
25
+ root = config.root;
26
+ },
27
+
19
28
  transform(code, id) {
20
29
  // Only transform CSS files
21
30
  if (!id.endsWith('.css')) {
@@ -27,9 +36,19 @@ export function tailwindSourcePlugin(): Plugin {
27
36
  return null;
28
37
  }
29
38
 
39
+ // Compute relative path from CSS file to project's src/ directory
40
+ const cssDir = dirname(id);
41
+ const srcDir = join(root, 'src');
42
+ let relPath = relative(cssDir, srcDir).split(sep).join('/');
43
+ if (relPath === '') {
44
+ relPath = '.';
45
+ } else if (!relPath.startsWith('.')) {
46
+ relPath = './' + relPath;
47
+ }
48
+
30
49
  // Transform @import "tailwindcss" → @import "tailwindcss" source(none)
31
- // Handles both quote styles and preserves any other directives on the same statement
32
- // Does NOT transform if source() is already specified
50
+ // and add explicit @source so Tailwind knows where to scan for classes.
51
+ // Does NOT transform if source() is already specified.
33
52
  const transformed = code.replace(
34
53
  /@import\s+(["'])tailwindcss\1([^;]*);/g,
35
54
  (match, quote, rest) => {
@@ -37,7 +56,7 @@ export function tailwindSourcePlugin(): Plugin {
37
56
  if (/source\s*\(/.test(rest)) {
38
57
  return match;
39
58
  }
40
- return `@import ${quote}tailwindcss${quote}${rest} source(none);`;
59
+ return `@import ${quote}tailwindcss${quote}${rest} source(none);\n@source "${relPath}";`;
41
60
  }
42
61
  );
43
62