@prunellejs/tailwind 0.1.1 → 0.7.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kaynooo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/llms.txt CHANGED
@@ -12,7 +12,7 @@ Install `tailwindcss` and `bun-plugin-tailwind` in your app (`bun add -d tailwin
12
12
 
13
13
  - `css`: global stylesheet entry path relative to project root (default `'src/app.css'`).
14
14
  - `bunPlugin`: optional `BunPlugin` override (auto-resolved from `bun-plugin-tailwind` when omitted).
15
- - `prunelle check`: reports an error if `bun-plugin-tailwind` cannot be resolved and no `bunPlugin` was passed.
15
+ - `prunelle check`: reports an error if `bun-plugin-tailwind` cannot be resolved and no `bunPlugin` was passed. An installed `bun-plugin-tailwind` that throws while loading fails the build with its own error as `cause`.
16
16
 
17
17
  ## Snippets
18
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prunellejs/tailwind",
3
- "version": "0.1.1",
3
+ "version": "0.7.0",
4
4
  "description": "Tailwind CSS v4 integration plugin for Prunelle",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -21,6 +21,6 @@
21
21
  "directory": "packages/plugin-tailwind"
22
22
  },
23
23
  "peerDependencies": {
24
- "prunelle": "^0.1.1"
24
+ "prunelle": "^0.7.0"
25
25
  }
26
26
  }
package/src/index.ts CHANGED
@@ -5,9 +5,8 @@ import type { BunPlugin } from 'bun'
5
5
  import type { PrunellePlugin } from 'prunelle/config'
6
6
  import { createRequire } from 'node:module'
7
7
  import { join } from 'node:path'
8
- import { definePlugin, serviceKey } from 'prunelle/config'
8
+ import { definePlugin, UI_KUI_LAYER_SERVICE } from 'prunelle/config'
9
9
 
10
- const UI_KUI_LAYER_SERVICE = serviceKey<boolean>('prunelle.ui.kuiLayer')
11
10
  // Declares @layer kui after Tailwind's base Preflight and before utilities so utilities override @prunellejs/ui without Preflight wiping component styles.
12
11
  const KUI_LAYER_ORDER_TAG = '<style>@layer properties,theme,base,kui,components,utilities;</style>'
13
12
 
@@ -31,11 +30,19 @@ function loadDefaultTailwindPlugin(root: string): BunPlugin | undefined {
31
30
  if (plugin !== undefined && typeof plugin.setup === 'function')
32
31
  return plugin
33
32
  }
34
- catch {}
33
+ catch (err) {
34
+ if (!isMissingTailwindPlugin(err))
35
+ throw new Error(`@prunellejs/tailwind: "bun-plugin-tailwind" is installed but failed to load: ${err instanceof Error ? err.message : String(err)}. Reinstall it with \`bun add -d bun-plugin-tailwind\`, or pass tailwind({ bunPlugin }).`, { cause: err })
36
+ }
35
37
  }
36
38
  return undefined
37
39
  }
38
40
 
41
+ // Absent from this base, as opposed to installed and broken (a missing dependency of its own names another module).
42
+ function isMissingTailwindPlugin(err: unknown): boolean {
43
+ return err instanceof Error && err.message.startsWith('Cannot find module \'bun-plugin-tailwind\'')
44
+ }
45
+
39
46
  export function tailwind(options: TailwindPluginOptions = {}): PrunellePlugin {
40
47
  let warnedMissing = false
41
48