@weapp-vite/tailwindcss 0.2.0 → 1.0.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
@@ -10,4 +10,4 @@ Tailwind 扫描、候选删除、CSS 生成与类名转换仍由上游 core 实
10
10
 
11
11
  首期以微信双宿主运行时为验收目标;支付宝与抖音提供编译/适配契约验证,不宣称其运行时 HMR 已完成验收。
12
12
 
13
- Node.js 版本要求随编译内核:`^22.18.0 || >=24.11.0`。
13
+ Node.js 版本要求随编译内核:`^22.18.0 || ^24.11.0 || >=26.0.0`,不支持 Node 20、23、25 或低于最低补丁版本的环境。
package/dist/index.mjs CHANGED
@@ -1,7 +1,6 @@
1
1
  import { CompilerHmrResyncError, normalizeHmrSourceMap } from "@weapp-vite/hmr";
2
2
  import { createHash } from "node:crypto";
3
3
  import { readFileSync, statSync } from "node:fs";
4
- import { createTailwindV4CompiledSourceEntries, createTailwindV4SourceEntryMatcher, resolveProjectSourceFiles } from "@weapp-tailwindcss/engine";
5
4
  import path from "pathe";
6
5
  //#region src/controller.ts
7
6
  /** 编译器按宿主生命周期惰性创建;不创建 Vite、DevEngine、watcher 或输出写入者。 */
@@ -97,6 +96,8 @@ async function prepareTailwindRoots(compiler, request, roots, options) {
97
96
  sources: new Map(request.sources)
98
97
  };
99
98
  const entries = /* @__PURE__ */ new Map();
99
+ if (!capturedRoots.size) return entries;
100
+ const { createTailwindV4CompiledSourceEntries, createTailwindV4SourceEntryMatcher } = await import("@weapp-tailwindcss/engine");
100
101
  for (const [index, root] of capturedRoots) {
101
102
  const base = root.request.sourceOptions?.projectRoot ?? root.request.source?.base ?? options.cwd;
102
103
  const matches = createTailwindV4SourceEntryMatcher(createTailwindV4CompiledSourceEntries(root.result.root, [...root.result.sources], base));
@@ -171,8 +172,11 @@ async function prepareTailwindRoots(compiler, request, roots, options) {
171
172
  //#endregion
172
173
  //#region src/sources.ts
173
174
  /** 返回上游实际扫描边界中的文件,宿主将它们登记到现有 watcher。 */
174
- function listTailwindSourceFiles(result, cwd) {
175
- const sources = createTailwindV4CompiledSourceEntries(result.root, [...result.sources], cwd);
175
+ async function listTailwindSourceFiles(result, cwd) {
176
+ const root = result.root;
177
+ const scannedSources = [...result.sources];
178
+ const { createTailwindV4CompiledSourceEntries, createTailwindV4SourceEntryMatcher, resolveProjectSourceFiles } = await import("@weapp-tailwindcss/engine");
179
+ const sources = createTailwindV4CompiledSourceEntries(root, scannedSources, cwd);
176
180
  return resolveProjectSourceFiles({
177
181
  cwd,
178
182
  sources,
package/package.json CHANGED
@@ -1,14 +1,24 @@
1
1
  {
2
2
  "name": "@weapp-vite/tailwindcss",
3
3
  "type": "module",
4
- "version": "0.2.0",
4
+ "version": "1.0.0",
5
5
  "description": "基于 weapp-tailwindcss/core 的宿主无关编译控制器",
6
6
  "license": "MIT",
7
+ "homepage": "https://github.com/weapp-vite/weapp-vite#readme",
7
8
  "repository": {
8
9
  "type": "git",
9
10
  "url": "git+https://github.com/weapp-vite/weapp-vite.git",
10
11
  "directory": "packages/tailwindcss"
11
12
  },
13
+ "bugs": {
14
+ "url": "https://github.com/weapp-vite/weapp-vite/issues"
15
+ },
16
+ "keywords": [
17
+ "weapp-vite",
18
+ "weapp",
19
+ "mini-program",
20
+ "tailwindcss"
21
+ ],
12
22
  "sideEffects": false,
13
23
  "exports": {
14
24
  ".": {
@@ -24,13 +34,13 @@
24
34
  "dist"
25
35
  ],
26
36
  "engines": {
27
- "node": "^22.18.0 || >=24.11.0"
37
+ "node": "^22.18.0 || ^24.11.0 || >=26.0.0"
28
38
  },
29
39
  "dependencies": {
30
- "@weapp-tailwindcss/engine": "0.1.3",
31
- "@weapp-vite/hmr": "0.2.0",
40
+ "@weapp-tailwindcss/engine": "0.1.5",
41
+ "@weapp-vite/hmr": "0.2.1",
32
42
  "pathe": "^2.0.3",
33
- "weapp-tailwindcss": "^5.5.11"
43
+ "weapp-tailwindcss": "^5.6.0"
34
44
  },
35
45
  "publishConfig": {
36
46
  "access": "public",
@@ -40,7 +50,8 @@
40
50
  "build": "tsdown",
41
51
  "typecheck": "tsc --noEmit -p tsconfig.json",
42
52
  "test": "vitest run -c vitest.config.ts",
43
- "test:types": "tsd --files \"test-d/**/*.test-d.ts\"",
53
+ "test:types": "pnpm run test:types:check",
54
+ "test:types:check": "tsd --files \"test-d/**/*.test-d.ts\"",
44
55
  "lint": "eslint ."
45
56
  }
46
57
  }