@solidnative-dev/codegen 0.0.0-stage → 0.1.0-alpha.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/LICENSE +21 -0
- package/README.md +110 -2
- package/dist/index.d.ts +89 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +920 -0
- package/dist/index.js.map +1 -0
- package/package.json +37 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Solid Native contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,111 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@solidnative-dev/codegen`
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This package projects React Native 0.87's validated Codegen schema into Solid
|
|
4
|
+
Native component and raw TurboModule bindings. React Native Codegen remains
|
|
5
|
+
responsible for the generated C++/Objective-C++/Java/Kotlin ABI; Solid Native
|
|
6
|
+
consumes the same schema without importing or executing generated React
|
|
7
|
+
wrappers.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { writeFile } from "node:fs/promises";
|
|
11
|
+
import {
|
|
12
|
+
combineReactNativeCodegenSchemas,
|
|
13
|
+
generateSolidNativeComponentModule,
|
|
14
|
+
} from "@solidnative-dev/codegen";
|
|
15
|
+
|
|
16
|
+
const schema = combineReactNativeCodegenSchemas(["./specs"], {
|
|
17
|
+
libraryName: "ApplicationSpec",
|
|
18
|
+
});
|
|
19
|
+
await writeFile(
|
|
20
|
+
"./generated/ApplicationSpec.ts",
|
|
21
|
+
generateSolidNativeComponentModule(schema),
|
|
22
|
+
);
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The generated, React-free TypeScript module exports typed Solid component
|
|
26
|
+
factories, typed native command shims, individual deeply frozen descriptors,
|
|
27
|
+
and the complete `SOLID_NATIVE_COMPONENT_DESCRIPTORS` list. The lower-level
|
|
28
|
+
`createSolidNativeComponentDescriptors` API can project an already-produced
|
|
29
|
+
schema directly. Generation is deterministic, so applications can check the
|
|
30
|
+
artifact in and fail CI when it becomes stale.
|
|
31
|
+
|
|
32
|
+
Component names, prop types, semantic direct/bubbling events, command parameter
|
|
33
|
+
order, and platform exclusions come from the upstream schema. `interfaceOnly`
|
|
34
|
+
entries are excluded by default because React Native Codegen does not generate
|
|
35
|
+
an independent Fabric descriptor for them; applications may opt in only when
|
|
36
|
+
their backend provides that component through another reviewed registration
|
|
37
|
+
path. Raw-text acceptance is likewise explicit application policy because it
|
|
38
|
+
is absent from the upstream schema.
|
|
39
|
+
|
|
40
|
+
`createSolidNativeSchemaAudit` produces a deeply frozen, path-free inventory
|
|
41
|
+
from the same validated schema. It separates directly projected component and
|
|
42
|
+
TurboModule descriptors from interface-only and platform-excluded names, and
|
|
43
|
+
retains each module descriptor's `unknownValueMembers`. This is a static ABI
|
|
44
|
+
compatibility result: it does not claim that a native package is registered,
|
|
45
|
+
initialized, semantically adapted, or proven on a device.
|
|
46
|
+
|
|
47
|
+
For TurboModules, generate a separate raw ABI module from the same schema:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import {
|
|
51
|
+
combineReactNativeCodegenSchemas,
|
|
52
|
+
generateSolidNativeTurboModuleBindings,
|
|
53
|
+
} from "@solidnative-dev/codegen";
|
|
54
|
+
|
|
55
|
+
const schema = combineReactNativeCodegenSchemas(["./specs"]);
|
|
56
|
+
await writeFile(
|
|
57
|
+
"./generated/ApplicationModules.ts",
|
|
58
|
+
generateSolidNativeTurboModuleBindings(schema),
|
|
59
|
+
);
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The module exports prefixed alias/enum types, method and event-emitter
|
|
63
|
+
interfaces, optional and enforcing resolvers that accept an injected
|
|
64
|
+
TurboModule registry, and deeply frozen runtime descriptors. Resolution checks
|
|
65
|
+
that required methods and event emitters are present and callable. Descriptor
|
|
66
|
+
`unknownValueMembers` identify members containing Codegen `mixed`, `any`, or an
|
|
67
|
+
untyped `Object`; those become `unknown`, never `any`, in TypeScript.
|
|
68
|
+
|
|
69
|
+
These are intentionally raw ABI contracts. A generated interface proves which
|
|
70
|
+
values can cross the native bridge, not that those values satisfy an
|
|
71
|
+
application-domain contract. Packages should retain an explicit adapter like
|
|
72
|
+
`@solidnative-dev/storage/async-storage-3` to validate returned objects, bound
|
|
73
|
+
inputs and lifetimes, and expose portable Solid-owned services. The generated registry
|
|
74
|
+
interface avoids a hard React Native import, while accepting React Native's
|
|
75
|
+
`TurboModuleRegistry` structurally at the application boundary.
|
|
76
|
+
|
|
77
|
+
Generated `SolidNativeEventEmitter<T>` members structurally match
|
|
78
|
+
`@solidnative-dev/core`'s `createNativeEventAccessor`. That helper requires an
|
|
79
|
+
explicit decoder, binds the subscription to a Solid Native owner, and enters
|
|
80
|
+
valid deliveries through the causal scheduler without recording their values.
|
|
81
|
+
|
|
82
|
+
For an editable starting point rather than another generated ABI file, select
|
|
83
|
+
one module with `generateSolidNativeTurboModuleAdapterScaffold`:
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
import {
|
|
87
|
+
combineReactNativeCodegenSchemas,
|
|
88
|
+
generateSolidNativeTurboModuleAdapterScaffold,
|
|
89
|
+
} from "@solidnative-dev/codegen";
|
|
90
|
+
|
|
91
|
+
const schema = combineReactNativeCodegenSchemas([
|
|
92
|
+
"./node_modules/example/specs",
|
|
93
|
+
]);
|
|
94
|
+
const source = generateSolidNativeTurboModuleAdapterScaffold(schema, {
|
|
95
|
+
moduleName: "ExampleModule",
|
|
96
|
+
bindingsImport: "../generated/ExampleBindings.js",
|
|
97
|
+
});
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The scaffold is application-owned, deterministic starting material. It exposes
|
|
101
|
+
every native method through a required policy hook, passes a bound native
|
|
102
|
+
invoker plus a frozen argument tuple to that hook, and types its result as
|
|
103
|
+
`unknown`. Application code must narrow the result by replacing the scaffold's
|
|
104
|
+
portable contract as it implements bounded input and output validation. It
|
|
105
|
+
does not generate an unsafe pass-through adapter. Required and optional
|
|
106
|
+
Codegen event emitters instead use `createNativeEventAccessor`; their policy is
|
|
107
|
+
an explicit decoder and causal event identity, and subscription cleanup belongs
|
|
108
|
+
to the current Solid owner.
|
|
109
|
+
|
|
110
|
+
`generateSolidNativeBindingsModule` emits both component and TurboModule
|
|
111
|
+
sections into one deterministic artifact when `codegenConfig.type` is `all`.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { SchemaType } from "@react-native/codegen/lib/CodegenSchema.js";
|
|
2
|
+
import type { NativeComponentDescriptor } from "@solidnative-dev/host-contract";
|
|
3
|
+
export type SolidNativeCodegenPlatform = "android" | "ios";
|
|
4
|
+
export interface SolidNativeDescriptorOptions {
|
|
5
|
+
/** Excludes components unavailable on this platform. */
|
|
6
|
+
readonly platform?: SolidNativeCodegenPlatform;
|
|
7
|
+
/**
|
|
8
|
+
* Includes Codegen interfaces that do not generate their own Fabric
|
|
9
|
+
* descriptor. Disabled by default so the result cannot overclaim a mountable
|
|
10
|
+
* New Architecture component.
|
|
11
|
+
*/
|
|
12
|
+
readonly includeInterfaceOnly?: boolean;
|
|
13
|
+
/** Component names whose native implementation accepts unwrapped text. */
|
|
14
|
+
readonly rawTextComponents?: readonly string[];
|
|
15
|
+
}
|
|
16
|
+
export interface ReactNativeSchemaSourceOptions {
|
|
17
|
+
/** Applies React Native's platform filename filtering while parsing. */
|
|
18
|
+
readonly platform?: SolidNativeCodegenPlatform;
|
|
19
|
+
/** Optional library identity retained by the upstream combined schema. */
|
|
20
|
+
readonly libraryName?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface SolidNativeModuleOptions {
|
|
23
|
+
/** Excludes TurboModules unavailable on this platform. */
|
|
24
|
+
readonly platform?: SolidNativeCodegenPlatform;
|
|
25
|
+
}
|
|
26
|
+
export interface SolidNativeAdapterScaffoldOptions extends SolidNativeModuleOptions {
|
|
27
|
+
/** Exact TurboModule name selected from the validated schema. */
|
|
28
|
+
readonly moduleName: string;
|
|
29
|
+
/** Module specifier for the generated raw binding module. */
|
|
30
|
+
readonly bindingsImport: string;
|
|
31
|
+
}
|
|
32
|
+
export interface SolidNativeBindingOptions extends SolidNativeDescriptorOptions, SolidNativeModuleOptions {
|
|
33
|
+
}
|
|
34
|
+
/** Runtime-checkable surface metadata for a raw Codegen TurboModule ABI. */
|
|
35
|
+
export interface SolidNativeModuleDescriptor {
|
|
36
|
+
readonly name: string;
|
|
37
|
+
readonly requiredMethods: readonly string[];
|
|
38
|
+
readonly optionalMethods: readonly string[];
|
|
39
|
+
readonly requiredEventEmitters: readonly string[];
|
|
40
|
+
readonly optionalEventEmitters: readonly string[];
|
|
41
|
+
/** Members whose Codegen schema contains `mixed`, `any`, or untyped Object. */
|
|
42
|
+
readonly unknownValueMembers: readonly string[];
|
|
43
|
+
}
|
|
44
|
+
/** Portable compatibility inventory for one validated Codegen schema. */
|
|
45
|
+
export interface SolidNativeSchemaAudit {
|
|
46
|
+
readonly schemaVersion: 0;
|
|
47
|
+
readonly components: readonly NativeComponentDescriptor[];
|
|
48
|
+
readonly interfaceOnlyComponents: readonly string[];
|
|
49
|
+
readonly platformExcludedComponents: readonly string[];
|
|
50
|
+
readonly modules: readonly SolidNativeModuleDescriptor[];
|
|
51
|
+
readonly platformExcludedModules: readonly string[];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Projects the component portion of a pinned React Native Codegen schema into
|
|
55
|
+
* the metadata consumed by the Solid Native renderer and native host.
|
|
56
|
+
* React Native Codegen remains responsible for native ABI generation.
|
|
57
|
+
*/
|
|
58
|
+
export declare function createSolidNativeComponentDescriptors(value: unknown, options?: SolidNativeDescriptorOptions): readonly NativeComponentDescriptor[];
|
|
59
|
+
/**
|
|
60
|
+
* Uses the application-local, pinned React Native parser to combine component
|
|
61
|
+
* specs without evaluating their React-facing wrapper exports.
|
|
62
|
+
*/
|
|
63
|
+
export declare function combineReactNativeCodegenSchemas(sourcePaths: readonly string[], options?: ReactNativeSchemaSourceOptions): SchemaType;
|
|
64
|
+
/**
|
|
65
|
+
* Projects the TurboModule portion of a Codegen schema into deeply frozen
|
|
66
|
+
* runtime surface metadata. Data validation remains the adapter's job.
|
|
67
|
+
*/
|
|
68
|
+
export declare function createSolidNativeModuleDescriptors(value: unknown, options?: SolidNativeModuleOptions): readonly SolidNativeModuleDescriptor[];
|
|
69
|
+
/**
|
|
70
|
+
* Inventories reusable surfaces and explicit exclusion reasons without
|
|
71
|
+
* evaluating a dependency's React-facing JavaScript entry point.
|
|
72
|
+
*/
|
|
73
|
+
export declare function createSolidNativeSchemaAudit(value: unknown, options?: SolidNativeBindingOptions): SolidNativeSchemaAudit;
|
|
74
|
+
/**
|
|
75
|
+
* Emits raw, React-free TurboModule ABI types plus injected-registry resolvers.
|
|
76
|
+
* Callers should adapt and validate returned data before exposing portable APIs.
|
|
77
|
+
*/
|
|
78
|
+
export declare function generateSolidNativeTurboModuleBindings(value: unknown, options?: SolidNativeModuleOptions): string;
|
|
79
|
+
/**
|
|
80
|
+
* Emits an editable, fail-safe TurboModule adapter starting point. Native
|
|
81
|
+
* methods remain behind policy hooks with `unknown` outputs, while events use
|
|
82
|
+
* Solid-owned decoded accessors. The scaffold never asserts domain semantics.
|
|
83
|
+
*/
|
|
84
|
+
export declare function generateSolidNativeTurboModuleAdapterScaffold(value: unknown, options: SolidNativeAdapterScaffoldOptions): string;
|
|
85
|
+
/** Emits a React-free TypeScript module for direct application consumption. */
|
|
86
|
+
export declare function generateSolidNativeComponentModule(value: unknown, options?: SolidNativeDescriptorOptions): string;
|
|
87
|
+
/** Emits every Solid-facing binding present in a mixed Codegen schema. */
|
|
88
|
+
export declare function generateSolidNativeBindingsModule(value: unknown, options?: SolidNativeBindingOptions): string;
|
|
89
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAaV,UAAU,EAEX,MAAM,4CAA4C,CAAC;AAEpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAGhF,MAAM,MAAM,0BAA0B,GAAG,SAAS,GAAG,KAAK,CAAC;AAE3D,MAAM,WAAW,4BAA4B;IAC3C,wDAAwD;IACxD,QAAQ,CAAC,QAAQ,CAAC,EAAE,0BAA0B,CAAC;IAC/C;;;;OAIG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IACxC,0EAA0E;IAC1E,QAAQ,CAAC,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAChD;AAED,MAAM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,MAAM,EAAE,CAAC;CACrD;AAyND;;;;GAIG;AACH,wBAAgB,qCAAqC,CACnD,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,4BAAiC,GACzC,SAAS,yBAAyB,EAAE,CAItC;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAC9C,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,OAAO,GAAE,8BAAmC,GAC3C,UAAU,CAuCZ;AA8MD;;;GAGG;AACH,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,wBAA6B,GACrC,SAAS,2BAA2B,EAAE,CAIxC;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,yBAA8B,GACtC,sBAAsB,CAmDxB;AAoRD;;;GAGG;AACH,wBAAgB,sCAAsC,CACpD,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,wBAA6B,GACrC,MAAM,CAaR;AAuHD;;;;GAIG;AACH,wBAAgB,6CAA6C,CAC3D,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,iCAAiC,GACzC,MAAM,CAuGR;AA6KD,+EAA+E;AAC/E,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,4BAAiC,GACzC,MAAM,CAuBR;AAED,0EAA0E;AAC1E,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,yBAA8B,GACtC,MAAM,CAkBR"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,920 @@
|
|
|
1
|
+
import { validate } from "@react-native/codegen/lib/SchemaValidator.js";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
const NATIVE_COMPONENT_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
4
|
+
const EVENT_PROPERTY_NAME = /^on[A-Z][A-Za-z0-9_]*$/;
|
|
5
|
+
const COMMAND_ARGUMENT_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
6
|
+
const MAX_COMPONENT_NAME_LENGTH = 128;
|
|
7
|
+
const MAX_SCHEMA_SOURCE_PATHS = 256;
|
|
8
|
+
const require = createRequire(import.meta.url);
|
|
9
|
+
const schemaCombiner = require("@react-native/codegen/lib/cli/combine/combine-js-to-schema.js");
|
|
10
|
+
function plainRecord(value, path) {
|
|
11
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
12
|
+
throw new TypeError(`${path} must be an object.`);
|
|
13
|
+
}
|
|
14
|
+
const prototype = Object.getPrototypeOf(value);
|
|
15
|
+
if (prototype !== Object.prototype && prototype !== null) {
|
|
16
|
+
throw new TypeError(`${path} must be a plain object.`);
|
|
17
|
+
}
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
function assertComponentName(name, path) {
|
|
21
|
+
if (name.length === 0 ||
|
|
22
|
+
name.length > MAX_COMPONENT_NAME_LENGTH ||
|
|
23
|
+
!NATIVE_COMPONENT_NAME.test(name)) {
|
|
24
|
+
throw new TypeError(`${path} must be a 1-128 character identifier.`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function semanticEventName(name, path) {
|
|
28
|
+
if (!EVENT_PROPERTY_NAME.test(name)) {
|
|
29
|
+
throw new TypeError(`${path} must use the React Native onEventName convention.`);
|
|
30
|
+
}
|
|
31
|
+
return `${name[2]?.toLowerCase() ?? ""}${name.slice(3)}`;
|
|
32
|
+
}
|
|
33
|
+
function nativePlatform(platform) {
|
|
34
|
+
return platform === "ios" ? "iOS" : "android";
|
|
35
|
+
}
|
|
36
|
+
function componentIsIncluded(component, options) {
|
|
37
|
+
if (component.interfaceOnly === true &&
|
|
38
|
+
options.includeInterfaceOnly !== true) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
if (options.platform === undefined)
|
|
42
|
+
return true;
|
|
43
|
+
return !component.excludedPlatforms?.includes(nativePlatform(options.platform));
|
|
44
|
+
}
|
|
45
|
+
function componentDescriptor(name, component, acceptsRawText) {
|
|
46
|
+
assertComponentName(name, `Codegen component ${JSON.stringify(name)}`);
|
|
47
|
+
const bubblingEvents = [];
|
|
48
|
+
const directEvents = [];
|
|
49
|
+
const observedEvents = new Set();
|
|
50
|
+
for (const event of component.events) {
|
|
51
|
+
const semanticName = semanticEventName(event.name, `Codegen event ${JSON.stringify(event.name)} on ${name}`);
|
|
52
|
+
if (observedEvents.has(semanticName)) {
|
|
53
|
+
throw new TypeError(`Codegen component ${name} declares duplicate event ${semanticName}.`);
|
|
54
|
+
}
|
|
55
|
+
observedEvents.add(semanticName);
|
|
56
|
+
(event.bubblingType === "bubble" ? bubblingEvents : directEvents).push(semanticName);
|
|
57
|
+
}
|
|
58
|
+
const commands = [];
|
|
59
|
+
const observedCommands = new Set();
|
|
60
|
+
for (const command of component.commands) {
|
|
61
|
+
assertComponentName(command.name, `Codegen command ${JSON.stringify(command.name)} on ${name}`);
|
|
62
|
+
if (observedCommands.has(command.name)) {
|
|
63
|
+
throw new TypeError(`Codegen component ${name} declares duplicate command ${command.name}.`);
|
|
64
|
+
}
|
|
65
|
+
observedCommands.add(command.name);
|
|
66
|
+
const arguments_ = command.typeAnnotation.params.map((parameter) => {
|
|
67
|
+
if (!COMMAND_ARGUMENT_NAME.test(parameter.name)) {
|
|
68
|
+
throw new TypeError(`Codegen command argument ${JSON.stringify(parameter.name)} on ${name}.${command.name} must be an identifier.`);
|
|
69
|
+
}
|
|
70
|
+
return parameter.name;
|
|
71
|
+
});
|
|
72
|
+
if (new Set(arguments_).size !== arguments_.length) {
|
|
73
|
+
throw new TypeError(`Codegen command ${name}.${command.name} declares duplicate argument names.`);
|
|
74
|
+
}
|
|
75
|
+
commands.push([command.name, Object.freeze(arguments_)]);
|
|
76
|
+
}
|
|
77
|
+
bubblingEvents.sort();
|
|
78
|
+
directEvents.sort();
|
|
79
|
+
commands.sort(([left], [right]) => left.localeCompare(right));
|
|
80
|
+
return Object.freeze({
|
|
81
|
+
name,
|
|
82
|
+
acceptsRawText,
|
|
83
|
+
bubblingEvents: Object.freeze(bubblingEvents),
|
|
84
|
+
directEvents: Object.freeze(directEvents),
|
|
85
|
+
commands: Object.freeze(Object.fromEntries(commands)),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function validatedSchema(value) {
|
|
89
|
+
const root = plainRecord(value, "React Native Codegen schema");
|
|
90
|
+
plainRecord(root.modules, "React Native Codegen schema.modules");
|
|
91
|
+
const schema = value;
|
|
92
|
+
validate(schema);
|
|
93
|
+
return schema;
|
|
94
|
+
}
|
|
95
|
+
function projectedComponents(value, options) {
|
|
96
|
+
const schema = validatedSchema(value);
|
|
97
|
+
const rawTextComponents = new Set(options.rawTextComponents ?? []);
|
|
98
|
+
for (const name of rawTextComponents) {
|
|
99
|
+
assertComponentName(name, "rawTextComponents entry");
|
|
100
|
+
}
|
|
101
|
+
const projected = [];
|
|
102
|
+
const emittedNames = new Set();
|
|
103
|
+
for (const moduleName of Object.keys(schema.modules).sort()) {
|
|
104
|
+
const module = schema.modules[moduleName];
|
|
105
|
+
if (module?.type !== "Component")
|
|
106
|
+
continue;
|
|
107
|
+
for (const name of Object.keys(module.components).sort()) {
|
|
108
|
+
const component = module.components[name];
|
|
109
|
+
if (component === undefined || !componentIsIncluded(component, options)) {
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
if (emittedNames.has(name)) {
|
|
113
|
+
throw new TypeError(`React Native Codegen schema declares component ${name} more than once.`);
|
|
114
|
+
}
|
|
115
|
+
emittedNames.add(name);
|
|
116
|
+
projected.push(Object.freeze({
|
|
117
|
+
component,
|
|
118
|
+
descriptor: componentDescriptor(name, component, rawTextComponents.has(name)),
|
|
119
|
+
name,
|
|
120
|
+
}));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
for (const name of rawTextComponents) {
|
|
124
|
+
if (!emittedNames.has(name)) {
|
|
125
|
+
throw new TypeError(`rawTextComponents entry ${name} does not identify an emitted component.`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return projected;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Projects the component portion of a pinned React Native Codegen schema into
|
|
132
|
+
* the metadata consumed by the Solid Native renderer and native host.
|
|
133
|
+
* React Native Codegen remains responsible for native ABI generation.
|
|
134
|
+
*/
|
|
135
|
+
export function createSolidNativeComponentDescriptors(value, options = {}) {
|
|
136
|
+
return Object.freeze(projectedComponents(value, options).map(({ descriptor }) => descriptor));
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Uses the application-local, pinned React Native parser to combine component
|
|
140
|
+
* specs without evaluating their React-facing wrapper exports.
|
|
141
|
+
*/
|
|
142
|
+
export function combineReactNativeCodegenSchemas(sourcePaths, options = {}) {
|
|
143
|
+
if (sourcePaths.length === 0 ||
|
|
144
|
+
sourcePaths.length > MAX_SCHEMA_SOURCE_PATHS) {
|
|
145
|
+
throw new TypeError(`Codegen requires 1-${MAX_SCHEMA_SOURCE_PATHS} source paths.`);
|
|
146
|
+
}
|
|
147
|
+
const normalizedPaths = sourcePaths.map((sourcePath, index) => {
|
|
148
|
+
if (typeof sourcePath !== "string" ||
|
|
149
|
+
sourcePath.length === 0 ||
|
|
150
|
+
sourcePath.includes("\0")) {
|
|
151
|
+
throw new TypeError(`Codegen source path ${index} must be a path string.`);
|
|
152
|
+
}
|
|
153
|
+
return sourcePath;
|
|
154
|
+
});
|
|
155
|
+
if (options.libraryName !== undefined &&
|
|
156
|
+
(options.libraryName.length === 0 ||
|
|
157
|
+
options.libraryName.length > MAX_COMPONENT_NAME_LENGTH ||
|
|
158
|
+
!NATIVE_COMPONENT_NAME.test(options.libraryName))) {
|
|
159
|
+
throw new TypeError("Codegen libraryName must be a 1-128 character identifier.");
|
|
160
|
+
}
|
|
161
|
+
return validatedSchema(schemaCombiner.combineSchemasInFileList(normalizedPaths, options.platform, undefined, options.libraryName));
|
|
162
|
+
}
|
|
163
|
+
function unwrapNullableNativeFunction(annotation) {
|
|
164
|
+
return annotation.type === "NullableTypeAnnotation"
|
|
165
|
+
? { annotation: annotation.typeAnnotation, nullable: true }
|
|
166
|
+
: { annotation, nullable: false };
|
|
167
|
+
}
|
|
168
|
+
function annotationContainsUnknownValue(annotation, aliases, aliasesInProgress = new Set()) {
|
|
169
|
+
switch (annotation.type) {
|
|
170
|
+
case "NullableTypeAnnotation":
|
|
171
|
+
return annotationContainsUnknownValue(annotation.typeAnnotation, aliases, aliasesInProgress);
|
|
172
|
+
case "AnyTypeAnnotation":
|
|
173
|
+
case "MixedTypeAnnotation":
|
|
174
|
+
return true;
|
|
175
|
+
case "GenericObjectTypeAnnotation":
|
|
176
|
+
return annotation.dictionaryValueType === undefined
|
|
177
|
+
? true
|
|
178
|
+
: annotationContainsUnknownValue(annotation.dictionaryValueType, aliases, aliasesInProgress);
|
|
179
|
+
case "ArrayTypeAnnotation":
|
|
180
|
+
return annotationContainsUnknownValue(annotation.elementType, aliases, aliasesInProgress);
|
|
181
|
+
case "ObjectTypeAnnotation":
|
|
182
|
+
return annotation.properties.some((property) => annotationContainsUnknownValue(property.typeAnnotation, aliases, aliasesInProgress));
|
|
183
|
+
case "FunctionTypeAnnotation":
|
|
184
|
+
return (annotation.params.some((parameter) => annotationContainsUnknownValue(parameter.typeAnnotation, aliases, aliasesInProgress)) ||
|
|
185
|
+
annotationContainsUnknownValue(annotation.returnTypeAnnotation, aliases, aliasesInProgress));
|
|
186
|
+
case "PromiseTypeAnnotation":
|
|
187
|
+
return annotationContainsUnknownValue(annotation.elementType, aliases, aliasesInProgress);
|
|
188
|
+
case "EventEmitterTypeAnnotation":
|
|
189
|
+
return annotationContainsUnknownValue(annotation.typeAnnotation, aliases, aliasesInProgress);
|
|
190
|
+
case "UnionTypeAnnotation":
|
|
191
|
+
return annotation.types.some((member) => annotationContainsUnknownValue(member, aliases, aliasesInProgress));
|
|
192
|
+
case "TypeAliasTypeAnnotation": {
|
|
193
|
+
if (aliasesInProgress.has(annotation.name))
|
|
194
|
+
return true;
|
|
195
|
+
const target = aliases[annotation.name];
|
|
196
|
+
if (target === undefined)
|
|
197
|
+
return true;
|
|
198
|
+
const nextAliases = new Set(aliasesInProgress);
|
|
199
|
+
nextAliases.add(annotation.name);
|
|
200
|
+
return annotationContainsUnknownValue(target, aliases, nextAliases);
|
|
201
|
+
}
|
|
202
|
+
default:
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
function frozenSortedNames(values) {
|
|
207
|
+
return Object.freeze([...values].sort((left, right) => left.localeCompare(right)));
|
|
208
|
+
}
|
|
209
|
+
function nativeModuleDescriptor(module) {
|
|
210
|
+
assertComponentName(module.moduleName, `Codegen TurboModule ${JSON.stringify(module.moduleName)}`);
|
|
211
|
+
const requiredMethods = [];
|
|
212
|
+
const optionalMethods = [];
|
|
213
|
+
const requiredEventEmitters = [];
|
|
214
|
+
const optionalEventEmitters = [];
|
|
215
|
+
const unknownValueMembers = [];
|
|
216
|
+
const members = new Set();
|
|
217
|
+
for (const method of module.spec.methods) {
|
|
218
|
+
assertComponentName(method.name, `Codegen method ${JSON.stringify(method.name)} on ${module.moduleName}`);
|
|
219
|
+
if (members.has(method.name)) {
|
|
220
|
+
throw new TypeError(`Codegen TurboModule ${module.moduleName} declares duplicate member ${method.name}.`);
|
|
221
|
+
}
|
|
222
|
+
members.add(method.name);
|
|
223
|
+
const projected = unwrapNullableNativeFunction(method.typeAnnotation);
|
|
224
|
+
(method.optional || projected.nullable
|
|
225
|
+
? optionalMethods
|
|
226
|
+
: requiredMethods).push(method.name);
|
|
227
|
+
if (annotationContainsUnknownValue(method.typeAnnotation, module.aliasMap)) {
|
|
228
|
+
unknownValueMembers.push(method.name);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
for (const emitter of module.spec.eventEmitters) {
|
|
232
|
+
assertComponentName(emitter.name, `Codegen event emitter ${JSON.stringify(emitter.name)} on ${module.moduleName}`);
|
|
233
|
+
if (members.has(emitter.name)) {
|
|
234
|
+
throw new TypeError(`Codegen TurboModule ${module.moduleName} declares duplicate member ${emitter.name}.`);
|
|
235
|
+
}
|
|
236
|
+
members.add(emitter.name);
|
|
237
|
+
(emitter.optional ? optionalEventEmitters : requiredEventEmitters).push(emitter.name);
|
|
238
|
+
if (annotationContainsUnknownValue(emitter.typeAnnotation, module.aliasMap)) {
|
|
239
|
+
unknownValueMembers.push(emitter.name);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return Object.freeze({
|
|
243
|
+
name: module.moduleName,
|
|
244
|
+
requiredMethods: frozenSortedNames(requiredMethods),
|
|
245
|
+
optionalMethods: frozenSortedNames(optionalMethods),
|
|
246
|
+
requiredEventEmitters: frozenSortedNames(requiredEventEmitters),
|
|
247
|
+
optionalEventEmitters: frozenSortedNames(optionalEventEmitters),
|
|
248
|
+
unknownValueMembers: frozenSortedNames(unknownValueMembers),
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
function projectedNativeModules(value, options) {
|
|
252
|
+
const schema = validatedSchema(value);
|
|
253
|
+
const projected = [];
|
|
254
|
+
const emittedNames = new Set();
|
|
255
|
+
for (const schemaName of Object.keys(schema.modules).sort()) {
|
|
256
|
+
const module = schema.modules[schemaName];
|
|
257
|
+
if (module?.type !== "NativeModule")
|
|
258
|
+
continue;
|
|
259
|
+
if (options.platform !== undefined &&
|
|
260
|
+
module.excludedPlatforms?.includes(nativePlatform(options.platform))) {
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
if (emittedNames.has(module.moduleName)) {
|
|
264
|
+
throw new TypeError(`React Native Codegen schema declares TurboModule ${module.moduleName} more than once.`);
|
|
265
|
+
}
|
|
266
|
+
emittedNames.add(module.moduleName);
|
|
267
|
+
projected.push(Object.freeze({
|
|
268
|
+
descriptor: nativeModuleDescriptor(module),
|
|
269
|
+
module,
|
|
270
|
+
name: module.moduleName,
|
|
271
|
+
}));
|
|
272
|
+
}
|
|
273
|
+
return projected;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Projects the TurboModule portion of a Codegen schema into deeply frozen
|
|
277
|
+
* runtime surface metadata. Data validation remains the adapter's job.
|
|
278
|
+
*/
|
|
279
|
+
export function createSolidNativeModuleDescriptors(value, options = {}) {
|
|
280
|
+
return Object.freeze(projectedNativeModules(value, options).map(({ descriptor }) => descriptor));
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Inventories reusable surfaces and explicit exclusion reasons without
|
|
284
|
+
* evaluating a dependency's React-facing JavaScript entry point.
|
|
285
|
+
*/
|
|
286
|
+
export function createSolidNativeSchemaAudit(value, options = {}) {
|
|
287
|
+
const schema = validatedSchema(value);
|
|
288
|
+
const interfaceOnlyComponents = [];
|
|
289
|
+
const platformExcludedComponents = [];
|
|
290
|
+
const platformExcludedModules = [];
|
|
291
|
+
const excludedPlatform = options.platform === undefined
|
|
292
|
+
? undefined
|
|
293
|
+
: nativePlatform(options.platform);
|
|
294
|
+
for (const schemaName of Object.keys(schema.modules).sort()) {
|
|
295
|
+
const module = schema.modules[schemaName];
|
|
296
|
+
if (module?.type === "Component") {
|
|
297
|
+
for (const name of Object.keys(module.components).sort()) {
|
|
298
|
+
const component = module.components[name];
|
|
299
|
+
if (component === undefined)
|
|
300
|
+
continue;
|
|
301
|
+
if (component.interfaceOnly === true) {
|
|
302
|
+
interfaceOnlyComponents.push(name);
|
|
303
|
+
}
|
|
304
|
+
if (excludedPlatform !== undefined &&
|
|
305
|
+
component.excludedPlatforms?.includes(excludedPlatform)) {
|
|
306
|
+
platformExcludedComponents.push(name);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
continue;
|
|
310
|
+
}
|
|
311
|
+
if (module?.type === "NativeModule" &&
|
|
312
|
+
excludedPlatform !== undefined &&
|
|
313
|
+
module.excludedPlatforms?.includes(excludedPlatform)) {
|
|
314
|
+
platformExcludedModules.push(module.moduleName);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
return Object.freeze({
|
|
318
|
+
schemaVersion: 0,
|
|
319
|
+
components: Object.freeze(projectedComponents(schema, options).map(({ descriptor }) => descriptor)),
|
|
320
|
+
interfaceOnlyComponents: Object.freeze(interfaceOnlyComponents),
|
|
321
|
+
platformExcludedComponents: Object.freeze(platformExcludedComponents),
|
|
322
|
+
modules: Object.freeze(projectedNativeModules(schema, options).map(({ descriptor }) => descriptor)),
|
|
323
|
+
platformExcludedModules: Object.freeze(platformExcludedModules),
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
function nativeModuleTypeName(moduleName, localName) {
|
|
327
|
+
assertComponentName(localName, `Codegen type ${JSON.stringify(localName)} on ${moduleName}`);
|
|
328
|
+
return `${moduleName}ABI${localName}`;
|
|
329
|
+
}
|
|
330
|
+
function nativeObjectType(moduleName, properties, aliases) {
|
|
331
|
+
if (properties.length === 0)
|
|
332
|
+
return "Readonly<Record<string, never>>";
|
|
333
|
+
const observed = new Set();
|
|
334
|
+
const fields = properties.map((property) => {
|
|
335
|
+
if (observed.has(property.name)) {
|
|
336
|
+
throw new TypeError(`Codegen object on ${moduleName} declares duplicate property ${property.name}.`);
|
|
337
|
+
}
|
|
338
|
+
observed.add(property.name);
|
|
339
|
+
return `readonly ${JSON.stringify(property.name)}${property.optional ? "?" : ""}: ${nativeModuleValueType(moduleName, property.typeAnnotation, aliases)};`;
|
|
340
|
+
});
|
|
341
|
+
return `Readonly<{ ${fields.join(" ")} }>`;
|
|
342
|
+
}
|
|
343
|
+
function nativeFunctionType(moduleName, annotation, aliases) {
|
|
344
|
+
const parameters = annotation.params.map((parameter, index) => `argument${index}${parameter.optional ? "?" : ""}: ${nativeModuleValueType(moduleName, parameter.typeAnnotation, aliases)}`);
|
|
345
|
+
return `(${parameters.join(", ")}) => ${nativeModuleValueType(moduleName, annotation.returnTypeAnnotation, aliases)}`;
|
|
346
|
+
}
|
|
347
|
+
function nativeModuleValueType(moduleName, annotation, aliases) {
|
|
348
|
+
switch (annotation.type) {
|
|
349
|
+
case "NullableTypeAnnotation":
|
|
350
|
+
return `(${nativeModuleValueType(moduleName, annotation.typeAnnotation, aliases)}) | null`;
|
|
351
|
+
case "AnyTypeAnnotation":
|
|
352
|
+
case "MixedTypeAnnotation":
|
|
353
|
+
return "unknown";
|
|
354
|
+
case "ArrayBufferTypeAnnotation":
|
|
355
|
+
return "ArrayBuffer";
|
|
356
|
+
case "BooleanTypeAnnotation":
|
|
357
|
+
return "boolean";
|
|
358
|
+
case "BooleanLiteralTypeAnnotation":
|
|
359
|
+
return String(annotation.value);
|
|
360
|
+
case "StringTypeAnnotation":
|
|
361
|
+
return "string";
|
|
362
|
+
case "StringLiteralTypeAnnotation":
|
|
363
|
+
return JSON.stringify(annotation.value);
|
|
364
|
+
case "NumberTypeAnnotation":
|
|
365
|
+
case "Int32TypeAnnotation":
|
|
366
|
+
case "DoubleTypeAnnotation":
|
|
367
|
+
case "FloatTypeAnnotation":
|
|
368
|
+
return "number";
|
|
369
|
+
case "NumberLiteralTypeAnnotation":
|
|
370
|
+
return String(annotation.value);
|
|
371
|
+
case "VoidTypeAnnotation":
|
|
372
|
+
return "void";
|
|
373
|
+
case "ReservedTypeAnnotation":
|
|
374
|
+
return "number";
|
|
375
|
+
case "ArrayTypeAnnotation":
|
|
376
|
+
return `ReadonlyArray<${nativeModuleValueType(moduleName, annotation.elementType, aliases)}>`;
|
|
377
|
+
case "ObjectTypeAnnotation":
|
|
378
|
+
return nativeObjectType(moduleName, annotation.properties, aliases);
|
|
379
|
+
case "GenericObjectTypeAnnotation":
|
|
380
|
+
return annotation.dictionaryValueType === undefined
|
|
381
|
+
? "Readonly<Record<string, unknown>>"
|
|
382
|
+
: `Readonly<Record<string, ${nativeModuleValueType(moduleName, annotation.dictionaryValueType, aliases)}>>`;
|
|
383
|
+
case "TypeAliasTypeAnnotation":
|
|
384
|
+
return nativeModuleTypeName(moduleName, annotation.name);
|
|
385
|
+
case "EnumDeclaration":
|
|
386
|
+
return nativeModuleTypeName(moduleName, annotation.name);
|
|
387
|
+
case "UnionTypeAnnotation":
|
|
388
|
+
return annotation.types
|
|
389
|
+
.map((member) => nativeModuleValueType(moduleName, member, aliases))
|
|
390
|
+
.join(" | ");
|
|
391
|
+
case "FunctionTypeAnnotation":
|
|
392
|
+
return nativeFunctionType(moduleName, annotation, aliases);
|
|
393
|
+
case "PromiseTypeAnnotation":
|
|
394
|
+
return `Promise<${nativeModuleValueType(moduleName, annotation.elementType, aliases)}>`;
|
|
395
|
+
case "EventEmitterTypeAnnotation":
|
|
396
|
+
return `SolidNativeEventEmitter<${nativeModuleValueType(moduleName, annotation.typeAnnotation, aliases)}>`;
|
|
397
|
+
default:
|
|
398
|
+
throw new TypeError(`Unsupported TurboModule type annotation ${JSON.stringify(annotation.type)}.`);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
function nativeModuleAliasesSource(moduleName, module) {
|
|
402
|
+
for (const name of Object.keys(module.aliasMap)) {
|
|
403
|
+
if (module.enumMap[name] !== undefined) {
|
|
404
|
+
throw new TypeError(`Codegen TurboModule ${moduleName} declares both an alias and enum named ${name}.`);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
const aliases = Object.keys(module.aliasMap)
|
|
408
|
+
.sort()
|
|
409
|
+
.map((name) => {
|
|
410
|
+
const annotation = module.aliasMap[name];
|
|
411
|
+
if (annotation === undefined) {
|
|
412
|
+
throw new TypeError(`Codegen alias ${name} on ${moduleName} is missing.`);
|
|
413
|
+
}
|
|
414
|
+
return `export type ${nativeModuleTypeName(moduleName, name)} = ${nativeModuleValueType(moduleName, annotation, module.aliasMap)};`;
|
|
415
|
+
});
|
|
416
|
+
const enums = Object.keys(module.enumMap)
|
|
417
|
+
.sort()
|
|
418
|
+
.map((name) => {
|
|
419
|
+
const declaration = module.enumMap[name];
|
|
420
|
+
if (declaration === undefined) {
|
|
421
|
+
throw new TypeError(`Codegen enum ${name} on ${moduleName} is missing.`);
|
|
422
|
+
}
|
|
423
|
+
const values = declaration.members.map(({ value }) => value.value);
|
|
424
|
+
return `export type ${nativeModuleTypeName(moduleName, name)} = ${quotedUnion(values)};`;
|
|
425
|
+
});
|
|
426
|
+
return [...aliases, ...enums];
|
|
427
|
+
}
|
|
428
|
+
function nativeModuleSource(projected) {
|
|
429
|
+
const { descriptor, module, name } = projected;
|
|
430
|
+
const members = [];
|
|
431
|
+
for (const method of module.spec.methods) {
|
|
432
|
+
const unwrapped = unwrapNullableNativeFunction(method.typeAnnotation);
|
|
433
|
+
const functionType = nativeFunctionType(name, unwrapped.annotation, module.aliasMap);
|
|
434
|
+
members.push(` readonly ${JSON.stringify(method.name)}${method.optional ? "?" : ""}: ${unwrapped.nullable ? `(${functionType}) | null` : functionType};`);
|
|
435
|
+
}
|
|
436
|
+
for (const emitter of module.spec.eventEmitters) {
|
|
437
|
+
members.push(` readonly ${JSON.stringify(emitter.name)}${emitter.optional ? "?" : ""}: SolidNativeEventEmitter<${nativeModuleValueType(name, emitter.typeAnnotation.typeAnnotation, module.aliasMap)}>;`);
|
|
438
|
+
}
|
|
439
|
+
return [
|
|
440
|
+
...nativeModuleAliasesSource(name, module),
|
|
441
|
+
...(Object.keys(module.aliasMap).length +
|
|
442
|
+
Object.keys(module.enumMap).length ===
|
|
443
|
+
0
|
|
444
|
+
? []
|
|
445
|
+
: [""]),
|
|
446
|
+
`export interface ${name}NativeModule {`,
|
|
447
|
+
...members,
|
|
448
|
+
"}",
|
|
449
|
+
"",
|
|
450
|
+
`export const ${name}NativeModuleDescriptor = freezeNativeModuleDescriptor({`,
|
|
451
|
+
` name: ${JSON.stringify(name)},`,
|
|
452
|
+
` requiredMethods: ${JSON.stringify(descriptor.requiredMethods)},`,
|
|
453
|
+
` optionalMethods: ${JSON.stringify(descriptor.optionalMethods)},`,
|
|
454
|
+
` requiredEventEmitters: ${JSON.stringify(descriptor.requiredEventEmitters)},`,
|
|
455
|
+
` optionalEventEmitters: ${JSON.stringify(descriptor.optionalEventEmitters)},`,
|
|
456
|
+
` unknownValueMembers: ${JSON.stringify(descriptor.unknownValueMembers)},`,
|
|
457
|
+
"});",
|
|
458
|
+
"",
|
|
459
|
+
`export function resolve${name}NativeModule(`,
|
|
460
|
+
" registry: SolidNativeModuleRegistry,",
|
|
461
|
+
`): ${name}NativeModule | null {`,
|
|
462
|
+
` const value = registry.get(${JSON.stringify(name)});`,
|
|
463
|
+
" return value === null || value === undefined",
|
|
464
|
+
" ? null",
|
|
465
|
+
` : (validateNativeModule(value, ${name}NativeModuleDescriptor) as unknown as ${name}NativeModule);`,
|
|
466
|
+
"}",
|
|
467
|
+
"",
|
|
468
|
+
`export function require${name}NativeModule(`,
|
|
469
|
+
" registry: SolidNativeModuleRegistry,",
|
|
470
|
+
`): ${name}NativeModule {`,
|
|
471
|
+
" return validateNativeModule(",
|
|
472
|
+
` registry.getEnforcing(${JSON.stringify(name)}),`,
|
|
473
|
+
` ${name}NativeModuleDescriptor,`,
|
|
474
|
+
` ) as unknown as ${name}NativeModule;`,
|
|
475
|
+
"}",
|
|
476
|
+
].join("\n");
|
|
477
|
+
}
|
|
478
|
+
function nativeModuleRuntimeSource() {
|
|
479
|
+
return [
|
|
480
|
+
"export interface SolidNativeEventSubscription {",
|
|
481
|
+
" remove(): void;",
|
|
482
|
+
"}",
|
|
483
|
+
"",
|
|
484
|
+
"export type SolidNativeEventEmitter<T> = (",
|
|
485
|
+
" listener: (event: T) => void,",
|
|
486
|
+
") => SolidNativeEventSubscription;",
|
|
487
|
+
"",
|
|
488
|
+
"export interface SolidNativeModuleRegistry {",
|
|
489
|
+
" get(name: string): unknown;",
|
|
490
|
+
" getEnforcing(name: string): unknown;",
|
|
491
|
+
"}",
|
|
492
|
+
"",
|
|
493
|
+
"export interface SolidNativeModuleDescriptor {",
|
|
494
|
+
" readonly name: string;",
|
|
495
|
+
" readonly requiredMethods: readonly string[];",
|
|
496
|
+
" readonly optionalMethods: readonly string[];",
|
|
497
|
+
" readonly requiredEventEmitters: readonly string[];",
|
|
498
|
+
" readonly optionalEventEmitters: readonly string[];",
|
|
499
|
+
" readonly unknownValueMembers: readonly string[];",
|
|
500
|
+
"}",
|
|
501
|
+
"",
|
|
502
|
+
"function freezeNativeModuleDescriptor(",
|
|
503
|
+
" descriptor: SolidNativeModuleDescriptor,",
|
|
504
|
+
"): SolidNativeModuleDescriptor {",
|
|
505
|
+
" Object.freeze(descriptor.requiredMethods);",
|
|
506
|
+
" Object.freeze(descriptor.optionalMethods);",
|
|
507
|
+
" Object.freeze(descriptor.requiredEventEmitters);",
|
|
508
|
+
" Object.freeze(descriptor.optionalEventEmitters);",
|
|
509
|
+
" Object.freeze(descriptor.unknownValueMembers);",
|
|
510
|
+
" return Object.freeze(descriptor);",
|
|
511
|
+
"}",
|
|
512
|
+
"",
|
|
513
|
+
"function validateNativeModule(",
|
|
514
|
+
" value: unknown,",
|
|
515
|
+
" descriptor: SolidNativeModuleDescriptor,",
|
|
516
|
+
"): Readonly<Record<string, unknown>> {",
|
|
517
|
+
' if ((typeof value !== "object" && typeof value !== "function") || value === null) {',
|
|
518
|
+
" throw new TypeError(`TurboModule ${descriptor.name} must be an object.`);",
|
|
519
|
+
" }",
|
|
520
|
+
" const module = value as Readonly<Record<string, unknown>>;",
|
|
521
|
+
" const requiredMembers = [",
|
|
522
|
+
" ...descriptor.requiredMethods,",
|
|
523
|
+
" ...descriptor.requiredEventEmitters,",
|
|
524
|
+
" ];",
|
|
525
|
+
" for (const name of requiredMembers) {",
|
|
526
|
+
' if (typeof module[name] !== "function") {',
|
|
527
|
+
" throw new TypeError(`TurboModule ${descriptor.name}.${name} must be a function.`);",
|
|
528
|
+
" }",
|
|
529
|
+
" }",
|
|
530
|
+
" const optionalMembers = [",
|
|
531
|
+
" ...descriptor.optionalMethods,",
|
|
532
|
+
" ...descriptor.optionalEventEmitters,",
|
|
533
|
+
" ];",
|
|
534
|
+
" for (const name of optionalMembers) {",
|
|
535
|
+
" const member = module[name];",
|
|
536
|
+
' if (member !== undefined && member !== null && typeof member !== "function") {',
|
|
537
|
+
" throw new TypeError(`TurboModule ${descriptor.name}.${name} must be a function when present.`);",
|
|
538
|
+
" }",
|
|
539
|
+
" }",
|
|
540
|
+
" return module;",
|
|
541
|
+
"}",
|
|
542
|
+
].join("\n");
|
|
543
|
+
}
|
|
544
|
+
function nativeModuleDescriptorListSource(descriptors) {
|
|
545
|
+
return [
|
|
546
|
+
"// prettier-ignore",
|
|
547
|
+
"export const SOLID_NATIVE_MODULE_DESCRIPTORS: readonly SolidNativeModuleDescriptor[] = Object.freeze([",
|
|
548
|
+
...descriptors.map(({ name }) => ` ${name}NativeModuleDescriptor,`),
|
|
549
|
+
"]);",
|
|
550
|
+
].join("\n");
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* Emits raw, React-free TurboModule ABI types plus injected-registry resolvers.
|
|
554
|
+
* Callers should adapt and validate returned data before exposing portable APIs.
|
|
555
|
+
*/
|
|
556
|
+
export function generateSolidNativeTurboModuleBindings(value, options = {}) {
|
|
557
|
+
const projected = projectedNativeModules(value, options);
|
|
558
|
+
return `${[
|
|
559
|
+
"// Generated by @solidnative-dev/codegen. Do not edit.",
|
|
560
|
+
"// Raw native ABI: validate values in an explicit application adapter.",
|
|
561
|
+
"",
|
|
562
|
+
nativeModuleRuntimeSource(),
|
|
563
|
+
"",
|
|
564
|
+
...projected.flatMap((module) => [nativeModuleSource(module), ""]),
|
|
565
|
+
nativeModuleDescriptorListSource(projected.map(({ descriptor }) => descriptor)),
|
|
566
|
+
].join("\n")}\n`;
|
|
567
|
+
}
|
|
568
|
+
function adapterBindingsImport(value) {
|
|
569
|
+
if (typeof value !== "string" ||
|
|
570
|
+
value.length === 0 ||
|
|
571
|
+
value.length > 512 ||
|
|
572
|
+
value.trim() !== value ||
|
|
573
|
+
/[\0\r\n]/u.test(value)) {
|
|
574
|
+
throw new TypeError("Adapter scaffold bindingsImport must be a 1-512 character module specifier without surrounding whitespace or control lines.");
|
|
575
|
+
}
|
|
576
|
+
return value;
|
|
577
|
+
}
|
|
578
|
+
function adapterMemberType(moduleName, memberName) {
|
|
579
|
+
return `${moduleName}NativeModule[${JSON.stringify(memberName)}]`;
|
|
580
|
+
}
|
|
581
|
+
function adapterPolicyMembersSource(moduleName, members) {
|
|
582
|
+
if (members.length === 0)
|
|
583
|
+
return [" readonly [name: string]: never;"];
|
|
584
|
+
return members.flatMap(({ name }) => [
|
|
585
|
+
` readonly ${JSON.stringify(name)}: (`,
|
|
586
|
+
` invoke: NativeCallable<${adapterMemberType(moduleName, name)}>,`,
|
|
587
|
+
` arguments_: Readonly<NativeArguments<${adapterMemberType(moduleName, name)}>>,`,
|
|
588
|
+
" ) => unknown;",
|
|
589
|
+
]);
|
|
590
|
+
}
|
|
591
|
+
function adapterEventPolicySource(moduleName, emitters) {
|
|
592
|
+
if (emitters.length === 0)
|
|
593
|
+
return [" readonly [name: string]: never;"];
|
|
594
|
+
return emitters.map(({ name }) => ` readonly ${JSON.stringify(name)}: NativeEventAccessorOptions<NativeEventValue<${adapterMemberType(moduleName, name)}>, unknown>;`);
|
|
595
|
+
}
|
|
596
|
+
function adapterInterfaceMembersSource(moduleName, methods, emitters) {
|
|
597
|
+
return [
|
|
598
|
+
...methods.map(({ name, optional }) => ` readonly ${JSON.stringify(name)}${optional ? "?" : ""}: (...arguments_: NativeArguments<${adapterMemberType(moduleName, name)}>) => unknown;`),
|
|
599
|
+
...emitters.map(({ name, optional }) => ` readonly ${JSON.stringify(name)}${optional ? "?" : ""}: () => unknown | undefined;`),
|
|
600
|
+
];
|
|
601
|
+
}
|
|
602
|
+
function boundAdapterMemberSource(moduleName, memberName, optional) {
|
|
603
|
+
const boundName = `nativeMember_${memberName}`;
|
|
604
|
+
if (!optional) {
|
|
605
|
+
return [
|
|
606
|
+
` const ${boundName} = native[${JSON.stringify(memberName)}].bind(native) as NativeCallable<${adapterMemberType(moduleName, memberName)}>;`,
|
|
607
|
+
];
|
|
608
|
+
}
|
|
609
|
+
const rawName = `rawNativeMember_${memberName}`;
|
|
610
|
+
return [
|
|
611
|
+
` const ${rawName} = native[${JSON.stringify(memberName)}];`,
|
|
612
|
+
` const ${boundName} = typeof ${rawName} === "function"`,
|
|
613
|
+
` ? (${rawName}.bind(native) as NativeCallable<${adapterMemberType(moduleName, memberName)}>)`,
|
|
614
|
+
" : undefined;",
|
|
615
|
+
];
|
|
616
|
+
}
|
|
617
|
+
function adapterMethodImplementationSource(moduleName, name, optional) {
|
|
618
|
+
const boundName = `nativeMember_${name}`;
|
|
619
|
+
const implementation = [
|
|
620
|
+
`${JSON.stringify(name)}(...arguments_: NativeArguments<${adapterMemberType(moduleName, name)}>) {`,
|
|
621
|
+
` return policy.methods[${JSON.stringify(name)}](${boundName}, frozenArguments(arguments_));`,
|
|
622
|
+
"},",
|
|
623
|
+
];
|
|
624
|
+
return optional
|
|
625
|
+
? [
|
|
626
|
+
` ...(${boundName} === undefined`,
|
|
627
|
+
" ? {}",
|
|
628
|
+
" : {",
|
|
629
|
+
...implementation.map((line) => ` ${line}`),
|
|
630
|
+
" }),",
|
|
631
|
+
]
|
|
632
|
+
: implementation.map((line) => ` ${line}`);
|
|
633
|
+
}
|
|
634
|
+
function adapterEventImplementationSource(name, optional) {
|
|
635
|
+
const boundName = `nativeMember_${name}`;
|
|
636
|
+
const expression = `createNativeEventAccessor(${boundName}, policy.events[${JSON.stringify(name)}])`;
|
|
637
|
+
return optional
|
|
638
|
+
? [
|
|
639
|
+
` ...(${boundName} === undefined`,
|
|
640
|
+
" ? {}",
|
|
641
|
+
` : { ${JSON.stringify(name)}: ${expression} }),`,
|
|
642
|
+
]
|
|
643
|
+
: [` ${JSON.stringify(name)}: ${expression},`];
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* Emits an editable, fail-safe TurboModule adapter starting point. Native
|
|
647
|
+
* methods remain behind policy hooks with `unknown` outputs, while events use
|
|
648
|
+
* Solid-owned decoded accessors. The scaffold never asserts domain semantics.
|
|
649
|
+
*/
|
|
650
|
+
export function generateSolidNativeTurboModuleAdapterScaffold(value, options) {
|
|
651
|
+
if (typeof options !== "object" || options === null) {
|
|
652
|
+
throw new TypeError("Adapter scaffold options must be an object.");
|
|
653
|
+
}
|
|
654
|
+
assertComponentName(options.moduleName, `Adapter scaffold moduleName ${JSON.stringify(options.moduleName)}`);
|
|
655
|
+
const bindingsImport = adapterBindingsImport(options.bindingsImport);
|
|
656
|
+
const projected = projectedNativeModules(value, options).find((entry) => entry.name === options.moduleName);
|
|
657
|
+
if (projected === undefined) {
|
|
658
|
+
throw new TypeError(`Codegen TurboModule ${options.moduleName} is unavailable for the selected adapter platform.`);
|
|
659
|
+
}
|
|
660
|
+
const { module, name } = projected;
|
|
661
|
+
const methods = module.spec.methods
|
|
662
|
+
.map((method) => ({
|
|
663
|
+
name: method.name,
|
|
664
|
+
optional: method.optional ||
|
|
665
|
+
unwrapNullableNativeFunction(method.typeAnnotation).nullable,
|
|
666
|
+
}))
|
|
667
|
+
.sort((left, right) => left.name.localeCompare(right.name));
|
|
668
|
+
const emitters = module.spec.eventEmitters
|
|
669
|
+
.map((emitter) => ({ name: emitter.name, optional: emitter.optional }))
|
|
670
|
+
.sort((left, right) => left.name.localeCompare(right.name));
|
|
671
|
+
const members = [...methods, ...emitters].sort((left, right) => left.name.localeCompare(right.name));
|
|
672
|
+
if (members.some((member) => member.name === "__proto__")) {
|
|
673
|
+
throw new TypeError(`Codegen TurboModule ${name} cannot scaffold reserved member __proto__.`);
|
|
674
|
+
}
|
|
675
|
+
return `${[
|
|
676
|
+
"// Scaffolded by @solidnative-dev/codegen. This file is application-owned and safe to edit.",
|
|
677
|
+
"// Native method outputs intentionally remain unknown until policy code validates them.",
|
|
678
|
+
"",
|
|
679
|
+
...(emitters.length === 0
|
|
680
|
+
? []
|
|
681
|
+
: [
|
|
682
|
+
"import {",
|
|
683
|
+
" createNativeEventAccessor,",
|
|
684
|
+
" type NativeEventAccessorOptions,",
|
|
685
|
+
'} from "@solidnative-dev/core";',
|
|
686
|
+
]),
|
|
687
|
+
`import type { ${name}NativeModule } from ${JSON.stringify(bindingsImport)};`,
|
|
688
|
+
"",
|
|
689
|
+
"type NativeCallable<T> = T extends (...arguments_: infer TArguments) => infer TResult",
|
|
690
|
+
" ? (...arguments_: TArguments) => TResult",
|
|
691
|
+
" : never;",
|
|
692
|
+
"type NativeArguments<T> = T extends (...arguments_: infer TArguments) => unknown",
|
|
693
|
+
" ? TArguments",
|
|
694
|
+
" : never;",
|
|
695
|
+
...(emitters.length === 0
|
|
696
|
+
? []
|
|
697
|
+
: [
|
|
698
|
+
"type NativeEventValue<T> = NativeCallable<T> extends (",
|
|
699
|
+
" listener: (event: infer TEvent) => void,",
|
|
700
|
+
") => unknown",
|
|
701
|
+
" ? TEvent",
|
|
702
|
+
" : never;",
|
|
703
|
+
]),
|
|
704
|
+
"",
|
|
705
|
+
`export interface ${name}AdapterPolicy {`,
|
|
706
|
+
" readonly methods: Readonly<{",
|
|
707
|
+
...adapterPolicyMembersSource(name, methods),
|
|
708
|
+
" }>;",
|
|
709
|
+
" readonly events: Readonly<{",
|
|
710
|
+
...adapterEventPolicySource(name, emitters),
|
|
711
|
+
" }>;",
|
|
712
|
+
"}",
|
|
713
|
+
"",
|
|
714
|
+
`export interface ${name}SolidAdapter {`,
|
|
715
|
+
...adapterInterfaceMembersSource(name, methods, emitters),
|
|
716
|
+
"}",
|
|
717
|
+
"",
|
|
718
|
+
"function frozenArguments<TArguments extends readonly unknown[]>(",
|
|
719
|
+
" arguments_: TArguments,",
|
|
720
|
+
"): Readonly<TArguments> {",
|
|
721
|
+
" return Object.freeze(arguments_);",
|
|
722
|
+
"}",
|
|
723
|
+
"",
|
|
724
|
+
`export function create${name}SolidAdapter(`,
|
|
725
|
+
` native: ${name}NativeModule,`,
|
|
726
|
+
` policy: ${name}AdapterPolicy,`,
|
|
727
|
+
`): ${name}SolidAdapter {`,
|
|
728
|
+
...members.flatMap((member) => boundAdapterMemberSource(name, member.name, member.optional)),
|
|
729
|
+
" return Object.freeze({",
|
|
730
|
+
...methods.flatMap((method) => adapterMethodImplementationSource(name, method.name, method.optional)),
|
|
731
|
+
...emitters.flatMap((emitter) => adapterEventImplementationSource(emitter.name, emitter.optional)),
|
|
732
|
+
" });",
|
|
733
|
+
"}",
|
|
734
|
+
].join("\n")}\n`;
|
|
735
|
+
}
|
|
736
|
+
function quotedUnion(values) {
|
|
737
|
+
if (values.length === 0)
|
|
738
|
+
return "never";
|
|
739
|
+
return values.map((value) => JSON.stringify(value)).join(" | ");
|
|
740
|
+
}
|
|
741
|
+
function objectType(properties) {
|
|
742
|
+
if (properties.length === 0)
|
|
743
|
+
return "Readonly<Record<string, never>>";
|
|
744
|
+
const observed = new Set();
|
|
745
|
+
const fields = properties.map((property) => {
|
|
746
|
+
if (observed.has(property.name)) {
|
|
747
|
+
throw new TypeError(`Codegen object declares duplicate property ${property.name}.`);
|
|
748
|
+
}
|
|
749
|
+
observed.add(property.name);
|
|
750
|
+
return `readonly ${JSON.stringify(property.name)}${property.optional ? "?" : ""}: ${componentValueType(property.typeAnnotation)};`;
|
|
751
|
+
});
|
|
752
|
+
return `Readonly<{ ${fields.join(" ")} }>`;
|
|
753
|
+
}
|
|
754
|
+
function componentValueType(annotation) {
|
|
755
|
+
switch (annotation.type) {
|
|
756
|
+
case "BooleanTypeAnnotation":
|
|
757
|
+
return "boolean";
|
|
758
|
+
case "StringTypeAnnotation":
|
|
759
|
+
return "string";
|
|
760
|
+
case "DoubleTypeAnnotation":
|
|
761
|
+
case "FloatTypeAnnotation":
|
|
762
|
+
case "Int32TypeAnnotation":
|
|
763
|
+
return "number";
|
|
764
|
+
case "MixedTypeAnnotation":
|
|
765
|
+
return "HostValue";
|
|
766
|
+
case "StringEnumTypeAnnotation":
|
|
767
|
+
case "Int32EnumTypeAnnotation":
|
|
768
|
+
return quotedUnion(annotation.options);
|
|
769
|
+
case "UnionTypeAnnotation":
|
|
770
|
+
return quotedUnion(annotation.types.map(({ value }) => value));
|
|
771
|
+
case "ReservedPropTypeAnnotation":
|
|
772
|
+
switch (annotation.name) {
|
|
773
|
+
case "ColorPrimitive":
|
|
774
|
+
return "string";
|
|
775
|
+
case "ImageSourcePrimitive":
|
|
776
|
+
case "ImageRequestPrimitive":
|
|
777
|
+
return "ImageSource";
|
|
778
|
+
case "PointPrimitive":
|
|
779
|
+
return "Readonly<{ readonly x: number; readonly y: number }>";
|
|
780
|
+
case "EdgeInsetsPrimitive":
|
|
781
|
+
return "Readonly<{ readonly top: number; readonly left: number; readonly bottom: number; readonly right: number }>";
|
|
782
|
+
case "DimensionPrimitive":
|
|
783
|
+
return "number | string";
|
|
784
|
+
}
|
|
785
|
+
case "ReservedTypeAnnotation":
|
|
786
|
+
return "number";
|
|
787
|
+
case "ObjectTypeAnnotation":
|
|
788
|
+
return objectType(annotation.properties);
|
|
789
|
+
case "ArrayTypeAnnotation":
|
|
790
|
+
return `ReadonlyArray<${componentValueType(annotation.elementType)}>`;
|
|
791
|
+
default:
|
|
792
|
+
throw new TypeError(`Unsupported component type annotation ${JSON.stringify(annotation.type)}.`);
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
function componentPropsSource(name, component) {
|
|
796
|
+
const fields = [];
|
|
797
|
+
const observed = new Set();
|
|
798
|
+
for (const property of component.props) {
|
|
799
|
+
if (observed.has(property.name)) {
|
|
800
|
+
throw new TypeError(`Codegen component ${name} declares duplicate prop ${property.name}.`);
|
|
801
|
+
}
|
|
802
|
+
observed.add(property.name);
|
|
803
|
+
fields.push(` readonly ${JSON.stringify(property.name)}${property.optional ? "?" : ""}: ${componentValueType(property.typeAnnotation)};`);
|
|
804
|
+
}
|
|
805
|
+
for (const event of component.events) {
|
|
806
|
+
if (observed.has(event.name)) {
|
|
807
|
+
throw new TypeError(`Codegen component ${name} declares both a prop and event named ${event.name}.`);
|
|
808
|
+
}
|
|
809
|
+
observed.add(event.name);
|
|
810
|
+
fields.push(` readonly ${JSON.stringify(event.name)}${event.optional ? "?" : ""}: (event: NativeSyntheticEvent) => unknown;`);
|
|
811
|
+
}
|
|
812
|
+
return [
|
|
813
|
+
`export interface ${name}NativeProps extends NativeElementProps {`,
|
|
814
|
+
...fields,
|
|
815
|
+
"}",
|
|
816
|
+
"",
|
|
817
|
+
`export const ${name}NativeComponent =`,
|
|
818
|
+
` createNativeComponent<${name}NativeProps>(${JSON.stringify(name)});`,
|
|
819
|
+
].join("\n");
|
|
820
|
+
}
|
|
821
|
+
function componentCommandsSource(name, component) {
|
|
822
|
+
if (component.commands.length === 0)
|
|
823
|
+
return undefined;
|
|
824
|
+
const methods = component.commands.map((command) => {
|
|
825
|
+
const parameters = command.typeAnnotation.params.map((parameter, index) => ` argument${index}: ${componentValueType(parameter.typeAnnotation)},`);
|
|
826
|
+
const arguments_ = command.typeAnnotation.params.map((_parameter, index) => `argument${index}`);
|
|
827
|
+
return [
|
|
828
|
+
` ${JSON.stringify(command.name)}(`,
|
|
829
|
+
" node: NativeNode,",
|
|
830
|
+
...parameters,
|
|
831
|
+
" ): Promise<void> {",
|
|
832
|
+
` return node.dispatchCommand(${[
|
|
833
|
+
JSON.stringify(command.name),
|
|
834
|
+
...arguments_,
|
|
835
|
+
].join(", ")});`,
|
|
836
|
+
" },",
|
|
837
|
+
].join("\n");
|
|
838
|
+
});
|
|
839
|
+
return [
|
|
840
|
+
`export const ${name}NativeCommands = Object.freeze({`,
|
|
841
|
+
...methods,
|
|
842
|
+
"});",
|
|
843
|
+
].join("\n");
|
|
844
|
+
}
|
|
845
|
+
function descriptorDataSource(descriptors) {
|
|
846
|
+
const declarations = descriptors.map((descriptor) => [
|
|
847
|
+
"// prettier-ignore",
|
|
848
|
+
`export const ${descriptor.name}NativeDescriptor: NativeComponentDescriptor = freezeDescriptor({`,
|
|
849
|
+
` name: ${JSON.stringify(descriptor.name)},`,
|
|
850
|
+
` acceptsRawText: ${String(descriptor.acceptsRawText)},`,
|
|
851
|
+
` bubblingEvents: ${JSON.stringify(descriptor.bubblingEvents)},`,
|
|
852
|
+
` directEvents: ${JSON.stringify(descriptor.directEvents)},`,
|
|
853
|
+
` commands: ${JSON.stringify(descriptor.commands)},`,
|
|
854
|
+
"});",
|
|
855
|
+
].join("\n"));
|
|
856
|
+
return [
|
|
857
|
+
"function freezeDescriptor(",
|
|
858
|
+
" descriptor: NativeComponentDescriptor,",
|
|
859
|
+
"): NativeComponentDescriptor {",
|
|
860
|
+
" Object.freeze(descriptor.bubblingEvents);",
|
|
861
|
+
" Object.freeze(descriptor.directEvents);",
|
|
862
|
+
" for (const parameters of Object.values(descriptor.commands)) {",
|
|
863
|
+
" Object.freeze(parameters);",
|
|
864
|
+
" }",
|
|
865
|
+
" Object.freeze(descriptor.commands);",
|
|
866
|
+
" return Object.freeze(descriptor);",
|
|
867
|
+
"}",
|
|
868
|
+
"",
|
|
869
|
+
...declarations.flatMap((declaration) => [declaration, ""]),
|
|
870
|
+
"// prettier-ignore",
|
|
871
|
+
"export const SOLID_NATIVE_COMPONENT_DESCRIPTORS: readonly NativeComponentDescriptor[] = Object.freeze([",
|
|
872
|
+
...descriptors.map(({ name }) => ` ${name}NativeDescriptor,`),
|
|
873
|
+
"]);",
|
|
874
|
+
].join("\n");
|
|
875
|
+
}
|
|
876
|
+
/** Emits a React-free TypeScript module for direct application consumption. */
|
|
877
|
+
export function generateSolidNativeComponentModule(value, options = {}) {
|
|
878
|
+
const projected = projectedComponents(value, options);
|
|
879
|
+
const sections = projected.flatMap(({ component, name }) => {
|
|
880
|
+
const commands = componentCommandsSource(name, component);
|
|
881
|
+
return [
|
|
882
|
+
componentPropsSource(name, component),
|
|
883
|
+
...(commands === undefined ? [] : [commands]),
|
|
884
|
+
];
|
|
885
|
+
});
|
|
886
|
+
return `${[
|
|
887
|
+
"// Generated by @solidnative-dev/codegen. Do not edit.",
|
|
888
|
+
"import {",
|
|
889
|
+
" createNativeComponent,",
|
|
890
|
+
" type ImageSource,",
|
|
891
|
+
" type NativeElementProps,",
|
|
892
|
+
" type NativeNode,",
|
|
893
|
+
" type NativeSyntheticEvent,",
|
|
894
|
+
'} from "@solidnative-dev/core";',
|
|
895
|
+
'import type { HostValue, NativeComponentDescriptor } from "@solidnative-dev/host-contract";',
|
|
896
|
+
"",
|
|
897
|
+
...sections.flatMap((section) => [section, ""]),
|
|
898
|
+
descriptorDataSource(projected.map(({ descriptor }) => descriptor)),
|
|
899
|
+
].join("\n")}\n`;
|
|
900
|
+
}
|
|
901
|
+
/** Emits every Solid-facing binding present in a mixed Codegen schema. */
|
|
902
|
+
export function generateSolidNativeBindingsModule(value, options = {}) {
|
|
903
|
+
const hasComponents = createSolidNativeComponentDescriptors(value, options).length > 0;
|
|
904
|
+
const hasModules = createSolidNativeModuleDescriptors(value, options).length > 0;
|
|
905
|
+
if (!hasComponents && !hasModules) {
|
|
906
|
+
return "// Generated by @solidnative-dev/codegen. Do not edit.\nexport {};\n";
|
|
907
|
+
}
|
|
908
|
+
if (!hasComponents) {
|
|
909
|
+
return generateSolidNativeTurboModuleBindings(value, options);
|
|
910
|
+
}
|
|
911
|
+
const componentSource = generateSolidNativeComponentModule(value, options);
|
|
912
|
+
if (!hasModules)
|
|
913
|
+
return componentSource;
|
|
914
|
+
const moduleLines = generateSolidNativeTurboModuleBindings(value, options)
|
|
915
|
+
.trimEnd()
|
|
916
|
+
.split("\n");
|
|
917
|
+
moduleLines.shift();
|
|
918
|
+
return `${componentSource.trimEnd()}\n\n${moduleLines.join("\n")}\n`;
|
|
919
|
+
}
|
|
920
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,QAAQ,EAAE,MAAM,8CAA8C,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAuF5C,MAAM,qBAAqB,GAAG,0BAA0B,CAAC;AACzD,MAAM,mBAAmB,GAAG,wBAAwB,CAAC;AACrD,MAAM,qBAAqB,GAAG,0BAA0B,CAAC;AACzD,MAAM,yBAAyB,GAAG,GAAG,CAAC;AACtC,MAAM,uBAAuB,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ChE,IAAI,CAAC,aAAa,IAAI,CAAC,UAAU,EAAE,CAAC;QAClC,OAAO,sEAAsE,CAAC;IAChF,CAAC;IACD,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,sCAAsC,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;IACD,MAAM,eAAe,GAAG,kCAAkC,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC3E,IAAI,CAAC,UAAU;QAAE,OAAO,eAAe,CAAC;IACxC,MAAM,WAAW,GAAG,sCAAsC,CAAC,KAAK,EAAE,OAAO,CAAC;SACvE,OAAO,EAAE;SACT,KAAK,CAAC,IAAI,CAAC,CAAC;IACf,WAAW,CAAC,KAAK,EAAE,CAAC;IACpB,OAAO,GAAG,eAAe,CAAC,OAAO,EAAE,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACvE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidnative-dev/codegen",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "React-free Solid component and TurboModule bindings from React Native Codegen schemas.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://solidnative.dev",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/solid-native/solid-native.git",
|
|
11
|
+
"directory": "packages/codegen"
|
|
12
|
+
},
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": "^22.13.0 || ^24.3.0 || >=26.0.0"
|
|
18
|
+
},
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"default": "./dist/index.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@react-native/codegen": "0.88.1",
|
|
30
|
+
"@solidnative-dev/host-contract": "0.1.0-alpha.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/node": "^26.2.0"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsc -p tsconfig.json",
|
|
37
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
38
|
+
"test": "pnpm build && node --test test/*.test.mjs"
|
|
39
|
+
}
|
|
6
40
|
}
|