-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…#390) * chore(nitro-config): adds a json schema for the nitro config file * chore: adds usage of nitro.schema.json * chore: adds usage of nitro.schema.json * fix: Format, move schema to docs, remote --------- Co-authored-by: Marc Rousavy <[email protected]>
- Loading branch information
1 parent
4ffa3ae
commit f7802e2
Showing
4 changed files
with
120 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "Nitro Modules Configuration", | ||
"type": "object", | ||
"required": [ | ||
"cxxNamespace", | ||
"ios", | ||
"android", | ||
"autolinking" | ||
], | ||
"properties": { | ||
"cxxNamespace": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"minItems": 1, | ||
"description": "Represents the C++ namespace of the module that will be generated. This can have multiple sub-namespaces, and is always relative to `margelo::nitro`." | ||
}, | ||
"ios": { | ||
"type": "object", | ||
"required": [ | ||
"iosModuleName" | ||
], | ||
"properties": { | ||
"iosModuleName": { | ||
"type": "string", | ||
"minLength": 1, | ||
"description": "Represents the iOS module name of the module that will be generated This will be used to generate Swift bridges, as those are always namespaced within the clang module. If you are using CocoaPods, this should be the Pod name defined in the `.podspec`." | ||
} | ||
}, | ||
"description": "Required: iOS configuration" | ||
}, | ||
"android": { | ||
"type": "object", | ||
"required": [ | ||
"androidNamespace", | ||
"androidCxxLibName" | ||
], | ||
"properties": { | ||
"androidNamespace": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"minItems": 1, | ||
"description": "Represents the Android namespace ('package') of the module that will be generated. This can have multiple sub-namespaces, and is always relative to `com.margelo.nitro`." | ||
}, | ||
"androidCxxLibName": { | ||
"type": "string", | ||
"minLength": 1, | ||
"description": "Represents the name of the Android C++ library (aka name in CMakeLists.txt `add_library(..)`). This will be loaded via `System.loadLibrary(...)`." | ||
} | ||
}, | ||
"description": "Required: Android configuration" | ||
}, | ||
"autolinking": { | ||
"type": "object", | ||
"description": "Configures the code that gets generated for autolinking (registering) Hybrid Object constructors.", | ||
"patternProperties": { | ||
"^.*$": { | ||
"type": "object", | ||
"oneOf": [ | ||
{ | ||
"properties": { | ||
"cpp": { | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": [ | ||
"cpp" | ||
] | ||
}, | ||
{ | ||
"properties": { | ||
"swift": { | ||
"type": "string" | ||
}, | ||
"kotlin": { | ||
"type": "string" | ||
} | ||
}, | ||
"minProperties": 1, | ||
"additionalProperties": false | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"ignorePaths": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"description": "A list of paths relative to the project directory that should be ignored by nitrogen. Nitrogen will not look for `.nitro.ts` files in these directories." | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
{ | ||
"cxxNamespace": ["<<cxxNamespace>>"], | ||
"$schema": "https://nitro.margelo.com/nitro.schema.json", | ||
"cxxNamespace": [ | ||
"<<cxxNamespace>>" | ||
], | ||
"ios": { | ||
"iosModuleName": "<<iosModuleName>>" | ||
}, | ||
"android": { | ||
"androidNamespace": ["<<androidNamespace>>"], | ||
"androidNamespace": [ | ||
"<<androidNamespace>>" | ||
], | ||
"androidCxxLibName": "<<androidCxxLibName>>" | ||
}, | ||
"autolinking": {}, | ||
"ignorePaths": ["node_modules"] | ||
"ignorePaths": [ | ||
"node_modules" | ||
] | ||
} |