Skip to content

Instantly share code, notes, and snippets.

@sixman9
Created March 10, 2022 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sixman9/0f84bd3898088aec3327708e1f8616fc to your computer and use it in GitHub Desktop.
Save sixman9/0f84bd3898088aec3327708e1f8616fc to your computer and use it in GitHub Desktop.
Script to create a JSON Schema from a TypeScript interface (Editly.Config)
#!/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