@ttskch/prettier-plugin-tailwindcss-anywhere 0.1.1 → 0.2.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/README.md CHANGED
@@ -9,7 +9,7 @@ A Prettier plugin for sorting TailwindCSS classes **in any HTML-like language, l
9
9
 
10
10
  ## Requirements
11
11
 
12
- * Node: `>= 20.9 < 24`
12
+ * Node: `>= 20.9 < 25`
13
13
 
14
14
  ## Installation
15
15
 
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@ttskch/prettier-plugin-tailwindcss-anywhere",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "A Prettier plugin for sorting TailwindCSS classes in any HTML-like language, like Twig etc.",
5
5
  "keywords": ["prettier", "tailwindcss", "formatter", "html", "twig"],
6
6
  "type": "module",
7
7
  "engines": {
8
- "node": ">= 20.9 < 24"
8
+ "node": ">= 20.9 < 25"
9
9
  },
10
10
  "main": "./dist/index.js",
11
11
  "exports": "./dist/index.js",
@@ -19,16 +19,16 @@
19
19
  "@types/prettier": "^3.0.0",
20
20
  "@vitest/coverage-v8": "~2.1",
21
21
  "husky": "^9.1.7",
22
- "prettier": "^3.0",
23
- "prettier-plugin-tailwindcss": "^0.6",
22
+ "prettier": "^3.9.10",
23
+ "prettier-plugin-tailwindcss": "^0.8",
24
24
  "rimraf": "~6.0",
25
25
  "ts-api-utils": "~1.3",
26
26
  "typescript": "~5.5",
27
27
  "vitest": "~2.1"
28
28
  },
29
29
  "peerDependencies": {
30
- "prettier": "^3.0",
31
- "prettier-plugin-tailwindcss": "^0.6"
30
+ "prettier": "^3.6.2",
31
+ "prettier-plugin-tailwindcss": "^0.7 || ^0.8"
32
32
  },
33
33
  "scripts": {
34
34
  "prepare": "husky",
@@ -47,9 +47,11 @@
47
47
  },
48
48
  "author": "Takashi Kanemoto <ttskch@gmail.com>",
49
49
  "homepage": "https://github.com/ttskch/prettier-plugin-tailwindcss-anywhere",
50
+ "bugs": "https://github.com/ttskch/prettier-plugin-tailwindcss-anywhere/issues",
50
51
  "repository": {
51
52
  "type": "git",
52
- "url": "ssh://git@github.com/ttskch/prettier-plugin-tailwindcss-anywhere"
53
+ "url": "git+https://github.com/ttskch/prettier-plugin-tailwindcss-anywhere.git"
53
54
  },
54
- "license": "MIT"
55
+ "license": "MIT",
56
+ "packageManager": "pnpm@12.14.0"
55
57
  }
package/src/parser.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type ParserOptions, format } from "prettier";
1
+ import { type ParserOptions, type Plugin, format } from "prettier";
2
2
  import * as prettierPluginTailwindcss from "prettier-plugin-tailwindcss";
3
3
  import type { AnywhereNode } from "./types.js";
4
4
 
@@ -20,7 +20,8 @@ export const parse = async (
20
20
  const fixedValue = (
21
21
  await format(`<div class="${value}"></div>`, {
22
22
  parser: "html",
23
- plugins: [prettierPluginTailwindcss],
23
+ // v0.8+ exposes lazily-loaded parsers/printers, which prettier supports at runtime but not in its `Plugin` type
24
+ plugins: [prettierPluginTailwindcss as Plugin],
24
25
  })
25
26
  ).match(/class="([^"]*)"/)?.[1];
26
27