@react-native/compatibility-check 0.0.0 → 0.0.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.
- package/README.md +245 -1
- package/dist/ComparisonResult.d.ts +135 -0
- package/dist/ComparisonResult.js +88 -0
- package/dist/ComparisonResult.js.flow +188 -0
- package/dist/DiffResults.d.ts +137 -0
- package/dist/DiffResults.js +52 -0
- package/dist/DiffResults.js.flow +160 -0
- package/dist/ErrorFormatting.d.ts +31 -0
- package/dist/ErrorFormatting.js +272 -0
- package/dist/ErrorFormatting.js.flow +34 -0
- package/dist/SortTypeAnnotations.d.ts +18 -0
- package/dist/SortTypeAnnotations.js +300 -0
- package/dist/SortTypeAnnotations.js.flow +20 -0
- package/dist/TypeDiffing.d.ts +86 -0
- package/dist/TypeDiffing.js +1253 -0
- package/dist/TypeDiffing.js.flow +99 -0
- package/dist/VersionDiffing.d.ts +59 -0
- package/dist/VersionDiffing.js +1235 -0
- package/dist/VersionDiffing.js.flow +71 -0
- package/dist/convertPropToBasicTypes.d.ts +20 -0
- package/dist/convertPropToBasicTypes.js +86 -0
- package/dist/convertPropToBasicTypes.js.flow +20 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +12 -0
- package/dist/index.js.flow +12 -0
- package/package.json +31 -3
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type {
|
|
12
|
+
ComparisonResult,
|
|
13
|
+
MembersComparisonResult,
|
|
14
|
+
} from "./ComparisonResult";
|
|
15
|
+
import type {
|
|
16
|
+
CompleteTypeAnnotation,
|
|
17
|
+
NamedShape,
|
|
18
|
+
NativeModuleAliasMap,
|
|
19
|
+
NativeModuleEnumDeclaration,
|
|
20
|
+
NativeModuleEnumDeclarationWithMembers,
|
|
21
|
+
NativeModuleEnumMap,
|
|
22
|
+
NativeModuleEnumMember,
|
|
23
|
+
NativeModuleFunctionTypeAnnotation,
|
|
24
|
+
NativeModuleGenericObjectTypeAnnotation,
|
|
25
|
+
NativeModulePromiseTypeAnnotation,
|
|
26
|
+
NativeModuleUnionTypeAnnotation,
|
|
27
|
+
NumberLiteralTypeAnnotation,
|
|
28
|
+
StringLiteralTypeAnnotation,
|
|
29
|
+
StringLiteralUnionTypeAnnotation,
|
|
30
|
+
} from "@react-native/codegen/src/CodegenSchema";
|
|
31
|
+
|
|
32
|
+
declare export function compareTypes(
|
|
33
|
+
newerType: CompleteTypeAnnotation,
|
|
34
|
+
olderType: ?CompleteTypeAnnotation,
|
|
35
|
+
newerTypesReg: ?NativeModuleAliasMap,
|
|
36
|
+
olderTypesReg: ?NativeModuleAliasMap,
|
|
37
|
+
newerEnumMap: ?NativeModuleEnumMap,
|
|
38
|
+
olderEnumMap: ?NativeModuleEnumMap
|
|
39
|
+
): ComparisonResult;
|
|
40
|
+
|
|
41
|
+
declare export function compareTypeAnnotation(
|
|
42
|
+
originalNewerAnnotation: CompleteTypeAnnotation,
|
|
43
|
+
originalOlderAnnotation: CompleteTypeAnnotation
|
|
44
|
+
): ComparisonResult;
|
|
45
|
+
|
|
46
|
+
declare export function compareObjectTypes<T: CompleteTypeAnnotation>(
|
|
47
|
+
newerPropertyTypes: $ReadOnlyArray<NamedShape<T>>,
|
|
48
|
+
olderPropertyTypes: $ReadOnlyArray<NamedShape<T>>
|
|
49
|
+
): ComparisonResult;
|
|
50
|
+
|
|
51
|
+
declare export function compareEnumDeclarations(
|
|
52
|
+
newerDeclaration: NativeModuleEnumDeclaration,
|
|
53
|
+
olderDeclaration: NativeModuleEnumDeclaration
|
|
54
|
+
): ComparisonResult;
|
|
55
|
+
|
|
56
|
+
declare export function compareEnumDeclarationMemberArrays(
|
|
57
|
+
newer: Array<NativeModuleEnumMember>,
|
|
58
|
+
older: Array<NativeModuleEnumMember>
|
|
59
|
+
): MembersComparisonResult;
|
|
60
|
+
|
|
61
|
+
declare export function compareEnumDeclarationWithMembers(
|
|
62
|
+
newerDeclaration: NativeModuleEnumDeclarationWithMembers,
|
|
63
|
+
olderDeclaration: NativeModuleEnumDeclarationWithMembers
|
|
64
|
+
): ComparisonResult;
|
|
65
|
+
|
|
66
|
+
declare export function compareUnionTypes(
|
|
67
|
+
newerType: NativeModuleUnionTypeAnnotation,
|
|
68
|
+
olderType: NativeModuleUnionTypeAnnotation
|
|
69
|
+
): ComparisonResult;
|
|
70
|
+
|
|
71
|
+
declare export function comparePromiseTypes(
|
|
72
|
+
newerType: NativeModulePromiseTypeAnnotation,
|
|
73
|
+
olderType: NativeModulePromiseTypeAnnotation
|
|
74
|
+
): ComparisonResult;
|
|
75
|
+
|
|
76
|
+
declare export function compareGenericObjectTypes(
|
|
77
|
+
newerType: NativeModuleGenericObjectTypeAnnotation,
|
|
78
|
+
olderType: NativeModuleGenericObjectTypeAnnotation
|
|
79
|
+
): ComparisonResult;
|
|
80
|
+
|
|
81
|
+
declare export function compareNumberLiteralTypes(
|
|
82
|
+
newerType: NumberLiteralTypeAnnotation,
|
|
83
|
+
olderType: NumberLiteralTypeAnnotation
|
|
84
|
+
): ComparisonResult;
|
|
85
|
+
|
|
86
|
+
declare export function compareStringLiteralTypes(
|
|
87
|
+
newerType: StringLiteralTypeAnnotation,
|
|
88
|
+
olderType: StringLiteralTypeAnnotation
|
|
89
|
+
): ComparisonResult;
|
|
90
|
+
|
|
91
|
+
declare export function compareStringLiteralUnionTypes(
|
|
92
|
+
newerType: StringLiteralUnionTypeAnnotation,
|
|
93
|
+
olderType: StringLiteralUnionTypeAnnotation
|
|
94
|
+
): ComparisonResult;
|
|
95
|
+
|
|
96
|
+
declare export function compareFunctionTypes(
|
|
97
|
+
newerType: NativeModuleFunctionTypeAnnotation,
|
|
98
|
+
olderType: NativeModuleFunctionTypeAnnotation
|
|
99
|
+
): ComparisonResult;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { ComparisonResult } from "./ComparisonResult";
|
|
12
|
+
import type {
|
|
13
|
+
DiffSet,
|
|
14
|
+
DiffSummary,
|
|
15
|
+
ErrorStore,
|
|
16
|
+
ObjectTypeChangeStore,
|
|
17
|
+
SchemaDiff,
|
|
18
|
+
} from "./DiffResults";
|
|
19
|
+
import type {
|
|
20
|
+
CompleteTypeAnnotation,
|
|
21
|
+
SchemaType,
|
|
22
|
+
} from "@react-native/codegen/src/CodegenSchema";
|
|
23
|
+
type BoundaryDirection = "toNative" | "fromNative" | "both";
|
|
24
|
+
export declare const removedPropertiesMessage: "Object removed required properties expected by native";
|
|
25
|
+
export declare const addedPropertiesMessage: "Object added required properties, which native will not provide";
|
|
26
|
+
export declare const stricterPropertiesMessage: "Property made strict, but native may not provide it";
|
|
27
|
+
export declare const tooOptionalPropertiesMessage: "Property made optional, but native requires it";
|
|
28
|
+
export declare const removedUnionMessage: "Union removed items, but native may still provide them";
|
|
29
|
+
export declare const addedUnionMessage: "Union added items, but native will not expect/support them";
|
|
30
|
+
export declare const removedEnumMessage: "Enum removed items, but native may still provide them";
|
|
31
|
+
export declare const addedEnumMessage: "Enum added items, but native will not expect/support them";
|
|
32
|
+
export declare const removedIntersectionMessage: "Intersection removed items, but native may still require properties contained in them";
|
|
33
|
+
export declare const addedIntersectionMessage: "Intersection added items, but native may not provide all required attributes";
|
|
34
|
+
export declare const toNativeVoidChangeMessage: "Native may not be able to safely handle presence of type";
|
|
35
|
+
export declare const typeNullableChangeMessage: "Type made nullable, but native requires it";
|
|
36
|
+
export declare const fromNativeVoidChangeMessage: "Type set to void but native may still provide a value";
|
|
37
|
+
export declare const typeNonNullableChangeMessage: "Type made non-nullable, but native might provide null still";
|
|
38
|
+
export declare function assessComparisonResult(
|
|
39
|
+
newTypes: Set<{ typeName: string; typeInformation: CompleteTypeAnnotation }>,
|
|
40
|
+
deprecatedTypes: Set<{
|
|
41
|
+
typeName: string;
|
|
42
|
+
typeInformation: CompleteTypeAnnotation;
|
|
43
|
+
}>,
|
|
44
|
+
incompatibleChanges: Set<ErrorStore>,
|
|
45
|
+
objectTypeChanges: Set<ObjectTypeChangeStore>
|
|
46
|
+
): (
|
|
47
|
+
typeName: string,
|
|
48
|
+
newType: CompleteTypeAnnotation,
|
|
49
|
+
oldType: null | undefined | CompleteTypeAnnotation,
|
|
50
|
+
difference: ComparisonResult,
|
|
51
|
+
oldDirection: BoundaryDirection
|
|
52
|
+
) => void;
|
|
53
|
+
export declare function hasUpdatesTypes(diff: DiffSet): boolean;
|
|
54
|
+
export declare function hasCodegenUpdatesTypes(diff: DiffSet): boolean;
|
|
55
|
+
export declare function buildSchemaDiff(
|
|
56
|
+
newerSchemaSet: SchemaType,
|
|
57
|
+
olderSchemaSet: SchemaType
|
|
58
|
+
): Set<SchemaDiff>;
|
|
59
|
+
export declare function summarizeDiffSet(diffs: Set<SchemaDiff>): DiffSummary;
|