@weapp-tailwindcss/lynx 0.4.4 → 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.
Files changed (38) hide show
  1. package/README.md +41 -3
  2. package/README.zh-CN.md +44 -6
  3. package/dist/decoder-data/AGENTS.md +31 -0
  4. package/dist/decoder-data/fixtures/selector-identifiers.json +159 -0
  5. package/dist/decoder-data/manifest.json +130 -0
  6. package/dist/decoder-data/patches/0001-decode-page-config-before-css.patch +33 -0
  7. package/dist/decoder-data/patches/0002-serialize-css-identifiers.patch +55 -0
  8. package/dist/decoder-data/rebuild/bootstrap-inputs.json +25 -0
  9. package/dist/decoder-data/rebuild/inputs.json +198 -0
  10. package/dist/decoder-data/vendor/.gitattributes +2 -0
  11. package/dist/decoder-data/vendor/README.md +11 -0
  12. package/dist/decoder-data/vendor/lepus.cjs.gz +0 -0
  13. package/dist/decoder-data/vendor/licenses/emsdk-upstream-emscripten-LICENSE.txt +102 -0
  14. package/dist/decoder-data/vendor/licenses/emsdk-upstream-emscripten-system-lib-compiler-rt-LICENSE.TXT.txt +311 -0
  15. package/dist/decoder-data/vendor/licenses/emsdk-upstream-emscripten-system-lib-libc-musl-COPYRIGHT.txt +193 -0
  16. package/dist/decoder-data/vendor/licenses/emsdk-upstream-emscripten-system-lib-libcxx-LICENSE.TXT.txt +311 -0
  17. package/dist/decoder-data/vendor/licenses/emsdk-upstream-emscripten-system-lib-libcxxabi-LICENSE.TXT.txt +311 -0
  18. package/dist/decoder-data/vendor/licenses/emsdk-upstream-emscripten-system-lib-libunwind-LICENSE.TXT.txt +311 -0
  19. package/dist/decoder-data/vendor/licenses/source-LICENSE.txt +203 -0
  20. package/dist/decoder-data/vendor/licenses/source-NOTICE.txt +4 -0
  21. package/dist/decoder-data/vendor/licenses/source-third_party-aes-LICENSE.txt +21 -0
  22. package/dist/decoder-data/vendor/licenses/source-third_party-double-conversion-LICENSE.txt +26 -0
  23. package/dist/decoder-data/vendor/licenses/source-third_party-jsoncpp-LICENSE.txt +55 -0
  24. package/dist/decoder-data/vendor/licenses/source-third_party-modp_b64-LICENSE.txt +33 -0
  25. package/dist/decoder-data/vendor/licenses/source-third_party-quickjs-LICENSE.txt +22 -0
  26. package/dist/decoder-data/vendor/licenses/source-third_party-quickjs-src-LICENSE.txt +202 -0
  27. package/dist/decoder-data/vendor/licenses/source-third_party-rapidjson-license.txt.txt +57 -0
  28. package/dist/decoder-data/vendor/reproducibility.json +63 -0
  29. package/dist/decoder.cjs +108 -0
  30. package/dist/decoder.d.cts +25 -0
  31. package/dist/decoder.d.ts +25 -0
  32. package/dist/decoder.js +101 -0
  33. package/dist/index.cjs +574 -8
  34. package/dist/index.d.cts +92 -0
  35. package/dist/index.d.ts +73 -3
  36. package/dist/index.js +572 -8
  37. package/dist/rolldown-runtime-CmQyd0Gu.cjs +27 -0
  38. package/package.json +30 -10
@@ -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/dist/index.d.ts CHANGED
@@ -2,7 +2,76 @@ import { PatchRspackConfigOptions } from "weapp-tailwindcss/rspack";
2
2
  import { RsbuildPlugin } from "@lynx-js/rspeedy";
3
3
  import { WeappTailwindcssGeneratorOptions } from "weapp-tailwindcss/generator";
4
4
  import { UserDefinedOptions } from "weapp-tailwindcss/types";
5
- //#region src/index.d.ts
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
+ }
6
75
  declare const PLUGIN_NAME = "weapp-tailwindcss:lynx";
7
76
  interface LynxGeneratorOptions extends Omit<WeappTailwindcssGeneratorOptions, 'target'> {}
8
77
  /** ReactLynx Rspeedy 适配配置。 */
@@ -11,6 +80,8 @@ export interface LynxTailwindcssOptions extends Omit<UserDefinedOptions, 'platfo
11
80
  rspack?: PatchRspackConfigOptions | undefined;
12
81
  /** Tailwind CSS v4 生成配置,目标固定为 Lynx 可消费的 web CSS。 */
13
82
  generator?: LynxGeneratorOptions | false | undefined;
83
+ /** Lynx encoder CSS 诊断;默认只报告,不改变构建成功与否。 */
84
+ diagnostics?: LynxDiagnosticsOptions | undefined;
14
85
  }
15
86
  /**
16
87
  * 为 ReactLynx + Rspeedy 注册 Tailwind CSS v4 构建链路。
@@ -18,5 +89,4 @@ export interface LynxTailwindcssOptions extends Omit<UserDefinedOptions, 'platfo
18
89
  * Lynx 原生支持 CSS class selector,因此不会改写 JSX `className` 或创建运行时样式表。
19
90
  */
20
91
  export declare function pluginLynxTailwindcss(options?: LynxTailwindcssOptions): RsbuildPlugin;
21
- //#endregion
22
- export { PLUGIN_NAME };
92
+ export { type LynxCssDiagnostic, type LynxDiagnosticCategory, type LynxDiagnosticIgnore, type LynxDiagnosticStatus, type LynxDiagnosticsOptions, type LynxDiagnosticsReport, type LynxEncodingEvidence, PLUGIN_NAME };