Skip to content

Add Expo v53 schema and test#4883

Merged
hyperupcall merged 1 commit intoSchemaStore:masterfrom
GreenDjango:expo-53
Aug 1, 2025
Merged

Add Expo v53 schema and test#4883
hyperupcall merged 1 commit intoSchemaStore:masterfrom
GreenDjango:expo-53

Conversation

@GreenDjango
Copy link
Contributor

Hello,

This adds the Expo SDK 53 app manifest schema, along with a generic test schema inspired by the Bluesky app.json as a real-world use case.

For reference, the following script was used to transform the Expo partial JSON schema into a complete JSON schema:

script.js
import fs from "node:fs/promises"

function cleanProperties(obj) {
 if ("meta" in obj) delete obj["meta"]
 if ("example" in obj) delete obj["example"]
 if ("exampleString" in obj) delete obj["exampleString"]
 if ("tsType" in obj) delete obj["tsType"]
 if ("fallback" in obj) {
   obj["default"] = obj["fallback"]
   delete obj["fallback"]
 }
 if (
   typeof obj["description"] === "string" &&
   obj["description"].startsWith("@deprecated ")
 ) {
   obj["deprecated"] = true
 }
 if (Array.isArray(obj["type"]) && obj["type"].length > 1) {
   obj["anyOf"] = obj["type"].map((v) => ({ type: v }))
   delete obj["type"]
 }

 for (const key in obj) {
   if (obj[key] && typeof obj[key] === "object") cleanProperties(obj[key])
 }
}

async function main() {
 const version = parseInt(process.argv[2], 10)
 const source = await fetch(
   `https://raw.githubusercontent.com/expo/expo/refs/heads/main/docs/public/static/schemas/v${version}.0.0/app-config-schema.json`
 )
 const data = await source.json()
 // Global converstion
 cleanProperties(data)

 // Version specific converstion
 if (version === 53) {
   data.plugins.items.anyOf[1] = {
     type: "array",
     items: [{ type: "string" }],
     minItems: 1,
     maxItems: 1,
   }
   data.plugins.items.anyOf[2] = {
     type: "array",
     items: [{ type: "string" }, { type: "object" }],
     minItems: 2,
     maxItems: 2,
   }
   delete data.experiments.properties.buildCacheProvider.additionalProperties
   data.android.properties.package.pattern =
     data.android.properties.package.pattern.replaceAll("\\_", "_")
 }

 await fs.writeFile(
   `expo-${version}.0.0.json`,
   `{
 "$id": "https://json.schemastore.org/expo-${version}.0.0.json",
 "$schema": "http://json-schema.org/draft-07/schema#",
 "title": "JSON schema for Expo SDK ${version} app manifest",
 "type": "object",
 "additionalProperties": true,
 "properties": {
   "expo": {
     "description": "Expo SDK ${version} app manifest",
     "type": "object",
     "required": ["name", "slug"],
     "additionalProperties": false,
     "properties": ${JSON.stringify(data, undefined, 2).replaceAll("\n", "\n      ")}
   }
 }
}`,
   { encoding: "utf-8" }
 )
}

await main()

Have a great day!

@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2025

Thanks for the PR!

This section of the codebase is owned by @madskristensen and @hyperupcall - if they write a comment saying "LGTM" then it will be merged.

@hyperupcall
Copy link
Member

Thanks!

@hyperupcall hyperupcall merged commit d992d54 into SchemaStore:master Aug 1, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants