@janux/tailwind 0.2.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/README.md ADDED
@@ -0,0 +1,14 @@
1
+ # @janux/tailwind
2
+
3
+ Zero-config Tailwind CSS v4 for [Janux](https://github.com/aralroca/Janux):
4
+
5
+ ```bash
6
+ bun add @janux/tailwind
7
+ ```
8
+
9
+ ```css
10
+ /* src/styles.css */
11
+ @import "tailwindcss";
12
+ ```
13
+
14
+ Done — the Janux CLI detects the package and wires the official `@tailwindcss/vite` plugin into `janux dev` and `janux build`. Docs: the [Tailwind recipe](https://github.com/aralroca/Janux/blob/main/apps/docs/content/recipes/tailwind.md).
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@janux/tailwind",
3
+ "version": "0.2.1",
4
+ "description": "Zero-config Tailwind CSS v4 integration for Janux. Install it and it's on.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/aralroca/Janux.git"
8
+ },
9
+ "license": "MIT",
10
+ "author": {
11
+ "name": "Aral Roca Gomez",
12
+ "email": "contact@aralroca.com"
13
+ },
14
+ "homepage": "https://github.com/aralroca/Janux#readme",
15
+ "bugs": "https://github.com/aralroca/Janux/issues",
16
+ "keywords": [
17
+ "janux",
18
+ "tailwindcss",
19
+ "tailwind",
20
+ "vite",
21
+ "integration"
22
+ ],
23
+ "type": "module",
24
+ "main": "./src/index.ts",
25
+ "exports": {
26
+ ".": {
27
+ "style": "./tailwind.css",
28
+ "default": "./src/index.ts"
29
+ }
30
+ },
31
+ "files": [
32
+ "src",
33
+ "tailwind.css"
34
+ ],
35
+ "publishConfig": {
36
+ "access": "public"
37
+ },
38
+ "dependencies": {
39
+ "tailwindcss": "^4.0.0",
40
+ "@tailwindcss/postcss": "^4.0.0"
41
+ },
42
+ "style": "./tailwind.css"
43
+ }
@@ -0,0 +1,21 @@
1
+ import { describe, expect, it } from 'bun:test';
2
+ import { readFileSync } from 'node:fs';
3
+ import { join } from 'node:path';
4
+ import janusTailwind from './index';
5
+
6
+ describe('@janux/tailwind', () => {
7
+ it('returns the official tailwind postcss plugin', () => {
8
+ const plugin: any = janusTailwind();
9
+
10
+ expect(String(plugin.postcssPlugin ?? plugin.name ?? '')).toContain('tailwind');
11
+ });
12
+
13
+ it('ships a style entry that resolves tailwindcss from inside the package', () => {
14
+ const pkg = JSON.parse(readFileSync(join(import.meta.dirname, '../package.json'), 'utf-8'));
15
+ const css = readFileSync(join(import.meta.dirname, '../tailwind.css'), 'utf-8');
16
+
17
+ expect(pkg.style).toBe('./tailwind.css');
18
+ expect(pkg.exports['.'].style).toBe('./tailwind.css');
19
+ expect(css).toContain('@import "tailwindcss"');
20
+ });
21
+ });
package/src/index.ts ADDED
@@ -0,0 +1,19 @@
1
+ import tailwindcss from '@tailwindcss/postcss';
2
+
3
+ /**
4
+ * Tailwind CSS v4 for Janux, zero config:
5
+ *
6
+ * bun add @janux/tailwind
7
+ * // src/styles.css
8
+ * @import "@janux/tailwind";
9
+ *
10
+ * The Janux CLI auto-detects this package and wires the official
11
+ * @tailwindcss/postcss plugin into dev and build. The postcss pipeline
12
+ * processes every CSS request — including the directly-linked
13
+ * src/styles.css convention — so it works for 0-JS static apps too.
14
+ * There is no vite.config in a Janux app: installing the package IS
15
+ * the configuration.
16
+ */
17
+ export default function janusTailwind() {
18
+ return tailwindcss();
19
+ }
package/tailwind.css ADDED
@@ -0,0 +1 @@
1
+ @import "tailwindcss";