@weapp-tailwindcss/react-native 0.2.13 → 0.2.14
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/dist/babel.d.ts +3 -4
- package/dist/compiler.d.ts +5 -6
- package/dist/env.d.ts +2 -3
- package/dist/metro-transformer.d.ts +2 -3
- package/dist/metro.d.ts +13 -14
- package/dist/runtime.d.ts +9 -9
- package/dist/tailwind.d.ts +3 -4
- package/package.json +4 -4
package/dist/babel.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PluginObject, PluginPass } from "@babel/core";
|
|
2
2
|
import * as t from "@babel/types";
|
|
3
3
|
//#region src/babel.d.ts
|
|
4
|
-
interface WeappReactNativeBabelOptions {
|
|
4
|
+
export interface WeappReactNativeBabelOptions {
|
|
5
5
|
classNameSet?: Iterable<string> | undefined;
|
|
6
6
|
/** Metro 生成的 token -> StyleSheet ID lookup。 */
|
|
7
7
|
staticStyleMap?: Record<string, string[]> | undefined;
|
|
@@ -16,6 +16,5 @@ interface PluginState extends PluginPass {
|
|
|
16
16
|
};
|
|
17
17
|
virtualImported?: boolean;
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
//#endregion
|
|
21
|
-
export { WeappReactNativeBabelOptions, weappReactNativeBabel as default };
|
|
19
|
+
export default function weappReactNativeBabel(): PluginObject<PluginState>;
|
|
20
|
+
//#endregion
|
package/dist/compiler.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { o as NativeStyleManifest, t as CompileNativeStylesheetOptions } from "./types-BTxnqaRV.js";
|
|
2
2
|
//#region src/compiler.d.ts
|
|
3
|
-
declare function baseClassName(className: string): string | undefined;
|
|
4
|
-
declare function addNativeVariantRules(manifest: NativeStyleManifest, candidates: Iterable<string>): void;
|
|
3
|
+
export declare function baseClassName(className: string): string | undefined;
|
|
4
|
+
export declare function addNativeVariantRules(manifest: NativeStyleManifest, candidates: Iterable<string>): void;
|
|
5
5
|
/** 为 manifest 生成稳定的 StyleSheet ID 和 Babel 静态 lookup。 */
|
|
6
|
-
declare function finalizeNativeManifest(manifest: NativeStyleManifest): NativeStyleManifest;
|
|
7
|
-
declare function compileNativeStylesheet(css: string, options?: CompileNativeStylesheetOptions): NativeStyleManifest;
|
|
8
|
-
//#endregion
|
|
9
|
-
export { addNativeVariantRules, baseClassName, compileNativeStylesheet, finalizeNativeManifest };
|
|
6
|
+
export declare function finalizeNativeManifest(manifest: NativeStyleManifest): NativeStyleManifest;
|
|
7
|
+
export declare function compileNativeStylesheet(css: string, options?: CompileNativeStylesheetOptions): NativeStyleManifest;
|
|
8
|
+
//#endregion
|
package/dist/env.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/env.d.ts
|
|
2
2
|
/** 供业务组件复用的 React Native className 属性。 */
|
|
3
|
-
interface NativeClassNameProps {
|
|
3
|
+
export interface NativeClassNameProps {
|
|
4
4
|
className?: string | undefined;
|
|
5
5
|
}
|
|
6
6
|
declare module 'react-native' {
|
|
@@ -9,5 +9,4 @@ declare module 'react-native' {
|
|
|
9
9
|
interface ImageProps extends NativeClassNameProps {}
|
|
10
10
|
interface ScrollViewProps extends NativeClassNameProps {}
|
|
11
11
|
}
|
|
12
|
-
//#endregion
|
|
13
|
-
export { NativeClassNameProps };
|
|
12
|
+
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Buffer } from "node:buffer";
|
|
2
2
|
//#region src/metro-transformer.d.ts
|
|
3
|
-
declare function transform(config: Record<string, unknown>, projectRoot: string, filename: string, data: Buffer, options: Record<string, unknown>): Promise<any>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { transform };
|
|
3
|
+
export declare function transform(config: Record<string, unknown>, projectRoot: string, filename: string, data: Buffer, options: Record<string, unknown>): Promise<any>;
|
|
4
|
+
//#endregion
|
package/dist/metro.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as NativeStyleManifest } from "./types-BTxnqaRV.js";
|
|
2
2
|
//#region src/metro.d.ts
|
|
3
|
-
declare const VIRTUAL_MANIFEST_MODULE = "@weapp-tailwindcss/react-native/virtual";
|
|
4
|
-
interface MetroConfigLike {
|
|
3
|
+
export declare const VIRTUAL_MANIFEST_MODULE = "@weapp-tailwindcss/react-native/virtual";
|
|
4
|
+
export interface MetroConfigLike {
|
|
5
5
|
resolver?: {
|
|
6
6
|
extraNodeModules?: Record<string, string>;
|
|
7
7
|
sourceExts?: string[];
|
|
@@ -14,7 +14,7 @@ interface MetroConfigLike {
|
|
|
14
14
|
server?: Record<string, unknown>;
|
|
15
15
|
[key: string]: unknown;
|
|
16
16
|
}
|
|
17
|
-
interface WeappReactNativeMetroOptions {
|
|
17
|
+
export interface WeappReactNativeMetroOptions {
|
|
18
18
|
projectRoot?: string | undefined;
|
|
19
19
|
input?: string | undefined;
|
|
20
20
|
css?: string | undefined;
|
|
@@ -33,20 +33,19 @@ interface RegisteredManifest {
|
|
|
33
33
|
ready: Promise<void>;
|
|
34
34
|
refresh: () => Promise<void>;
|
|
35
35
|
}
|
|
36
|
-
interface NativeManifestPaths {
|
|
36
|
+
export interface NativeManifestPaths {
|
|
37
37
|
manifestPath: string;
|
|
38
38
|
manifestReadyPath: string;
|
|
39
39
|
}
|
|
40
40
|
/** 为 Metro worker 提供不依赖进程内 registry 的 manifest 入口。 */
|
|
41
|
-
declare function getManifestPathsForProjectRoot(projectRoot: string): NativeManifestPaths;
|
|
42
|
-
declare function getRegisteredVirtualModule(filename: string): RegisteredManifest | undefined;
|
|
43
|
-
declare function getRegisteredManifest(id: string): Promise<NativeStyleManifest | undefined>;
|
|
41
|
+
export declare function getManifestPathsForProjectRoot(projectRoot: string): NativeManifestPaths;
|
|
42
|
+
export declare function getRegisteredVirtualModule(filename: string): RegisteredManifest | undefined;
|
|
43
|
+
export declare function getRegisteredManifest(id: string): Promise<NativeStyleManifest | undefined>;
|
|
44
44
|
/** 等待并读取由 Metro 配置注册的 manifest 文件,兼容未透传自定义 Metro id 的 transformer。 */
|
|
45
|
-
declare function getRegisteredManifestByPath(filename: string): Promise<NativeStyleManifest | undefined>;
|
|
45
|
+
export declare function getRegisteredManifestByPath(filename: string): Promise<NativeStyleManifest | undefined>;
|
|
46
46
|
/** 按 Metro 传入的项目根目录读取当前注册项,兼容 transformer 未透传自定义字段的实现。 */
|
|
47
|
-
declare function getRegisteredManifestByProjectRoot(projectRoot: string): Promise<NativeStyleManifest | undefined>;
|
|
48
|
-
declare function getVirtualModuleCode(filename: string): string | undefined;
|
|
49
|
-
declare function getVirtualModuleCodeAsync(filename: string): Promise<string | undefined>;
|
|
50
|
-
declare function withWeappTailwindcss<T extends MetroConfigLike>(config: T | Promise<T> | (() => T | Promise<T>), options?: WeappReactNativeMetroOptions): T | Promise<T>;
|
|
51
|
-
//#endregion
|
|
52
|
-
export { MetroConfigLike, NativeManifestPaths, VIRTUAL_MANIFEST_MODULE, WeappReactNativeMetroOptions, getManifestPathsForProjectRoot, getRegisteredManifest, getRegisteredManifestByPath, getRegisteredManifestByProjectRoot, getRegisteredVirtualModule, getVirtualModuleCode, getVirtualModuleCodeAsync, withWeappTailwindcss };
|
|
47
|
+
export declare function getRegisteredManifestByProjectRoot(projectRoot: string): Promise<NativeStyleManifest | undefined>;
|
|
48
|
+
export declare function getVirtualModuleCode(filename: string): string | undefined;
|
|
49
|
+
export declare function getVirtualModuleCodeAsync(filename: string): Promise<string | undefined>;
|
|
50
|
+
export declare function withWeappTailwindcss<T extends MetroConfigLike>(config: T | Promise<T> | (() => T | Promise<T>), options?: WeappReactNativeMetroOptions): T | Promise<T>;
|
|
51
|
+
//#endregion
|
package/dist/runtime.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ interface StyleValue {
|
|
|
4
4
|
[key: string]: unknown;
|
|
5
5
|
}
|
|
6
6
|
type StyleSheetFactory = (value: Record<string, StyleValue>) => Record<string, unknown>;
|
|
7
|
-
declare function createNativeStyleRuntime(initialManifest?: NativeStyleManifest): NativeStyleRuntime;
|
|
8
|
-
declare function setManifest(manifest: NativeStyleManifest): void;
|
|
7
|
+
export declare function createNativeStyleRuntime(initialManifest?: NativeStyleManifest): NativeStyleRuntime;
|
|
8
|
+
export declare function setManifest(manifest: NativeStyleManifest): void;
|
|
9
9
|
/** 由 Expo virtual module 注入,避免 runtime 引入 Node-only 的 require shim。 */
|
|
10
|
-
declare function setStyleSheetFactory(factory: StyleSheetFactory): void;
|
|
11
|
-
declare function setEnvironment(environment: NativeStyleEnvironment): void;
|
|
12
|
-
declare function getManifest(): NativeStyleManifest | undefined;
|
|
13
|
-
declare function tw(value: NativeClassValue, environment?: NativeStyleEnvironment): Record<string, unknown>;
|
|
14
|
-
declare function getStaticStyle(ids: readonly string[], environment?: NativeStyleEnvironment): NativeStyleValue;
|
|
15
|
-
declare function composeStyle(tailwindStyle: NativeStyleValue, inlineStyle: unknown): NativeStyleValue[];
|
|
10
|
+
export declare function setStyleSheetFactory(factory: StyleSheetFactory): void;
|
|
11
|
+
export declare function setEnvironment(environment: NativeStyleEnvironment): void;
|
|
12
|
+
export declare function getManifest(): NativeStyleManifest | undefined;
|
|
13
|
+
export declare function tw(value: NativeClassValue, environment?: NativeStyleEnvironment): Record<string, unknown>;
|
|
14
|
+
export declare function getStaticStyle(ids: readonly string[], environment?: NativeStyleEnvironment): NativeStyleValue;
|
|
15
|
+
export declare function composeStyle(tailwindStyle: NativeStyleValue, inlineStyle: unknown): NativeStyleValue[];
|
|
16
16
|
//#endregion
|
|
17
|
-
export {
|
|
17
|
+
export type { NativeClassValue, NativePlatform, NativeStyleEnvironment, NativeStyleManifest, NativeStyleValue };
|
package/dist/tailwind.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as NativeStyleManifest } from "./types-BTxnqaRV.js";
|
|
2
2
|
import { TailwindV4SourceOptions } from "weapp-tailwindcss/generator";
|
|
3
3
|
//#region src/tailwind.d.ts
|
|
4
|
-
interface GenerateNativeStylesheetOptions extends TailwindV4SourceOptions {
|
|
4
|
+
export interface GenerateNativeStylesheetOptions extends TailwindV4SourceOptions {
|
|
5
5
|
/** Tailwind source 扫描根目录;用于 workspace 示例和 Metro 项目。 */
|
|
6
6
|
projectRoot?: string | undefined;
|
|
7
7
|
/** Tailwind CSS 入口文件;相对路径会按 projectRoot 解析。 */
|
|
@@ -12,6 +12,5 @@ interface GenerateNativeStylesheetOptions extends TailwindV4SourceOptions {
|
|
|
12
12
|
/**
|
|
13
13
|
* 使用 weapp-tailwindcss 的 Tailwind v4 generator 生成原始 CSS,再编译为 RN manifest。
|
|
14
14
|
*/
|
|
15
|
-
declare function generateNativeStylesheet(options?: GenerateNativeStylesheetOptions): Promise<NativeStyleManifest>;
|
|
16
|
-
//#endregion
|
|
17
|
-
export { GenerateNativeStylesheetOptions, generateNativeStylesheet };
|
|
15
|
+
export declare function generateNativeStylesheet(options?: GenerateNativeStylesheetOptions): Promise<NativeStyleManifest>;
|
|
16
|
+
//#endregion
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-tailwindcss/react-native",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.14",
|
|
5
5
|
"description": "Tailwind CSS compiler and Expo Metro integration for cross-platform React Native apps. 面向跨端 React Native 应用的 Tailwind CSS 编译器与 Expo Metro 集成。",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://tw.weapp.dev/docs/quick-start/react-native-expo",
|
|
@@ -92,14 +92,14 @@
|
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
94
|
"@babel/types": "^8.0.4",
|
|
95
|
-
"postcss": "^8.5.
|
|
96
|
-
"weapp-tailwindcss": "5.5.
|
|
95
|
+
"postcss": "^8.5.28",
|
|
96
|
+
"weapp-tailwindcss": "5.5.2"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
99
|
"@babel/core": "^8.0.1",
|
|
100
100
|
"@types/react": "^19.2.18",
|
|
101
101
|
"react": "^19.2.8",
|
|
102
|
-
"vitest": "~
|
|
102
|
+
"vitest": "~5.0.0"
|
|
103
103
|
},
|
|
104
104
|
"scripts": {
|
|
105
105
|
"build": "tsdown",
|