@weapp-tailwindcss/lynx 0.5.0 → 0.5.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.
@@ -0,0 +1,25 @@
1
+ interface DecodeResult {
2
+ status: number;
3
+ result: string;
4
+ }
5
+ interface DecoderModule {
6
+ HEAPU8: Uint8Array;
7
+ _malloc: (size: number) => number;
8
+ _free: (pointer: number) => void;
9
+ _decode: (pointer: number, size: number) => DecodeResult;
10
+ }
11
+ type DecoderFactory = () => Promise<DecoderModule>;
12
+ export interface DecodedLynxBundle {
13
+ 'engine-version': string;
14
+ 'page-config': string;
15
+ 'css': {
16
+ text: string;
17
+ };
18
+ }
19
+ /** 身份覆盖构建来源、补丁、工具链和产物;修改其中任一项都会使历史报告过期。 */
20
+ export declare function lynxDecoderIdentity(directory?: string): string;
21
+ /** 仅加载固定来源的便携 WASM;缺失、篡改或解码失败均不得回退 serializer 或系统原生库。 */
22
+ export declare function loadVerifiedDecoderFactory(directory?: string): Promise<DecoderFactory>;
23
+ /** 每次解码使用独立实例,输入只接受实际 bundle 字节,保留 decoder 的原始 CSS 展示文本。 */
24
+ export declare function decodeLynxBundle(source: Uint8Array, directory?: string): Promise<DecodedLynxBundle>;
25
+ export {};
@@ -0,0 +1,92 @@
1
+ import { RsbuildPlugin } from "@lynx-js/rspeedy";
2
+ import { WeappTailwindcssGeneratorOptions } from "weapp-tailwindcss/generator";
3
+ import { PatchRspackConfigOptions } from "weapp-tailwindcss/rspack";
4
+ import { UserDefinedOptions } from "weapp-tailwindcss/types";
5
+ type LynxDiagnosticCategory = 'preflight' | 'tailwind-default' | 'business' | 'unknown';
6
+ type LynxDiagnosticStatus = 'encoder-rejected' | 'bundled' | 'unknown';
7
+ interface LynxDiagnosticIgnore {
8
+ selector?: string | undefined;
9
+ property?: string | undefined;
10
+ reason?: string | undefined;
11
+ }
12
+ interface LynxCssDiagnostic {
13
+ origin: 'encoder-log' | 'bundle-comparison';
14
+ raw?: unknown;
15
+ ignored?: {
16
+ reason: string;
17
+ rule: LynxDiagnosticIgnore;
18
+ } | undefined;
19
+ status: LynxDiagnosticStatus;
20
+ category: LynxDiagnosticCategory;
21
+ message: string;
22
+ selector?: string | undefined;
23
+ utility?: string | undefined;
24
+ property?: string | undefined;
25
+ value?: string | undefined;
26
+ reason?: string | undefined;
27
+ suggestion?: string | undefined;
28
+ source?: {
29
+ module?: string | undefined;
30
+ file?: string | undefined;
31
+ line?: number | undefined;
32
+ column?: number | undefined;
33
+ generated?: {
34
+ line?: number | undefined;
35
+ column?: number | undefined;
36
+ } | undefined;
37
+ } | undefined;
38
+ }
39
+ interface LynxDiagnosticsReport {
40
+ schemaVersion: 1;
41
+ counts: {
42
+ generated: number;
43
+ encoderRejected: number;
44
+ unknown: number;
45
+ };
46
+ evidence?: LynxEncodingEvidence | undefined;
47
+ diagnostics: LynxCssDiagnostic[];
48
+ versionEvidence: {
49
+ encoder: string;
50
+ engine: string;
51
+ };
52
+ versions: {
53
+ encoder: string;
54
+ engine: string;
55
+ targetSdk?: string | undefined;
56
+ } | undefined;
57
+ }
58
+ interface LynxDiagnosticsOptions {
59
+ /** 是否把确证的业务样式编码删除提升为构建错误。 */
60
+ strict?: boolean | undefined;
61
+ /** 忽略匹配到的业务失败;诊断和忽略条件仍保留供报告消费方审计。 */
62
+ ignore?: LynxDiagnosticIgnore[] | undefined;
63
+ /** 构建完成一个模板时接收结构化报告。 */
64
+ onReport?: ((report: LynxDiagnosticsReport) => void) | undefined;
65
+ }
66
+ interface LynxEncodingEvidence {
67
+ inputCssSha256?: string | undefined;
68
+ outputName?: string | undefined;
69
+ bundleSha256?: string | undefined;
70
+ decoderIdentity?: string | undefined;
71
+ decodedCssSha256?: string | undefined;
72
+ cssText?: string | undefined;
73
+ error?: string | undefined;
74
+ }
75
+ declare const PLUGIN_NAME = "weapp-tailwindcss:lynx";
76
+ interface LynxGeneratorOptions extends Omit<WeappTailwindcssGeneratorOptions, 'target'> {}
77
+ /** ReactLynx Rspeedy 适配配置。 */
78
+ export interface LynxTailwindcssOptions extends Omit<UserDefinedOptions, 'platform' | 'generator'> {
79
+ /** 透传给 Rspack CSS 规则补丁的配置。 */
80
+ rspack?: PatchRspackConfigOptions | undefined;
81
+ /** Tailwind CSS v4 生成配置,目标固定为 Lynx 可消费的 web CSS。 */
82
+ generator?: LynxGeneratorOptions | false | undefined;
83
+ /** Lynx encoder CSS 诊断;默认只报告,不改变构建成功与否。 */
84
+ diagnostics?: LynxDiagnosticsOptions | undefined;
85
+ }
86
+ /**
87
+ * 为 ReactLynx + Rspeedy 注册 Tailwind CSS v4 构建链路。
88
+ *
89
+ * Lynx 原生支持 CSS class selector,因此不会改写 JSX `className` 或创建运行时样式表。
90
+ */
91
+ export declare function pluginLynxTailwindcss(options?: LynxTailwindcssOptions): RsbuildPlugin;
92
+ export { type LynxCssDiagnostic, type LynxDiagnosticCategory, type LynxDiagnosticIgnore, type LynxDiagnosticStatus, type LynxDiagnosticsOptions, type LynxDiagnosticsReport, type LynxEncodingEvidence, PLUGIN_NAME };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weapp-tailwindcss/lynx",
3
3
  "type": "module",
4
- "version": "0.5.0",
4
+ "version": "0.5.1",
5
5
  "description": "Tailwind CSS integration for ReactLynx and Rspeedy cross-platform builds. 面向 ReactLynx 与 Rspeedy 跨端构建的 Tailwind CSS 集成。",
6
6
  "license": "MIT",
7
7
  "homepage": "https://tw.weapp.dev/docs/quick-start/frameworks/lynx",
@@ -13,15 +13,25 @@
13
13
  "sideEffects": false,
14
14
  "exports": {
15
15
  ".": {
16
- "types": "./dist/index.d.ts",
17
- "import": "./dist/index.js",
18
- "require": "./dist/index.cjs"
16
+ "import": {
17
+ "types": "./dist/index.d.ts",
18
+ "default": "./dist/index.js"
19
+ },
20
+ "require": {
21
+ "types": "./dist/index.d.cts",
22
+ "default": "./dist/index.cjs"
23
+ }
19
24
  },
20
25
  "./package.json": "./package.json",
21
26
  "./decoder": {
22
- "types": "./dist/decoder.d.ts",
23
- "import": "./dist/decoder.js",
24
- "require": "./dist/decoder.cjs"
27
+ "import": {
28
+ "types": "./dist/decoder.d.ts",
29
+ "default": "./dist/decoder.js"
30
+ },
31
+ "require": {
32
+ "types": "./dist/decoder.d.cts",
33
+ "default": "./dist/decoder.cjs"
34
+ }
25
35
  }
26
36
  },
27
37
  "main": "./dist/index.cjs",
@@ -54,7 +64,7 @@
54
64
  },
55
65
  "dependencies": {
56
66
  "@jridgewell/trace-mapping": "^0.3.31",
57
- "weapp-tailwindcss": "5.7.0"
67
+ "weapp-tailwindcss": "5.7.1"
58
68
  },
59
69
  "devDependencies": {
60
70
  "@lynx-js/rspeedy": "^0.18.4",