Created
March 10, 2022 04:17
-
-
Save sixman9/0f84bd3898088aec3327708e1f8616fc to your computer and use it in GitHub Desktop.
Script to create a JSON Schema from a TypeScript interface (Editly.Config)
This file contains hidden or 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
#!/bin/sh | |
# Assuming you have NodeJS tools installed... | |
tsprojname=new-ts-app | |
# Create a well-configured TypeScript project in direct './"$tsprojname"' | |
npx tsdx create --template basic "$tsprojname" | |
pushd ./"$tsprojname" | |
# Editly offer both programatic and JSON config-based video editing, we're interested in a JSON schema defining the JSON config | |
yarn add editly | |
# Let's generate a JSON schema from a scoped TypeScript interface, first we'll need 'typescript-json-schema' | |
yarn add -D typescript-json-schema | |
npx typescript-json-schema 'node_modules/editly/index.d.ts' Editly.RenderSingleFrameConfig #See also Editly.Config |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment