
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
sofie-blueprint-tools
Advanced tools
When making blueprints for Sofie, they need to be packaged and uploaded in a certain way. This includes steps such as transforming the json-schema used for the configuration, and extracting strings to be translated.
When making blueprints for Sofie, they need to be packaged and uploaded in a certain way.
This includes steps such as transforming the json-schema used for the configuration, and extracting strings to be translated.
This library is a collection of tooling needed by all blueprints to prepare them into the format that Sofie expects.
You can see a reference blueprint implementation which utilises this tooling at https://github.com/SuperFlyTV/sofie-demo-blueprints
If wanting to make your own blueprints, we recommend starting from that repository instead of building from scratch.
All of these scripts need to know the names and paths of the blueprints in your project. This is done with the blueprint-map.mjs
file provided to each command.
A simple example of this file is:
// This is each blueprint that you have
export const BlueprintEntrypoints = {
demoshowstyle: './src/main/showstyle/index.ts',
demostudio: './src/main/studio/index.ts',
system: './src/system/index.ts',
}
// You can optionally define bundles, so that you can easily produce a smaller bundle containing a subset of the blueprints in the project
export const BlueprintBundles = {
show: ['demoshowstyle', 'demostudio', 'system'],
}
This is the core build script. It will consume your typescript source code, and prepare a self contained js file for each blueprint. Optionally, it can auto-upload the built code to your sofie installation (very useful for development)
Tool to build blueprints into a Sofie compatible bundle
Usage
$ blueprint-build <config-file> <dist-dir>
Options
--server Server to upload to
--development Development mode
--watch, -w Watch for changes and rebuild
--bundle Bundle to build, or "all" for all bundles (default: "all")
Examples
$ blueprint-build ./blueprint-map.mjs ./dist
$ blueprint-build ./blueprint-map.mjs ./dist --watch --development
$ blueprint-build ./blueprint-map.mjs ./dist --bundle=core
This is a helper build script to combine the built blueprints into a single json bundle. This allows them to be uploaded to sofie with a single POST to http://localhost:3000/api/private/blueprints/restore
.
Tool to bundle built blueprints into a json bundle for easier bulk uploading
Usage
$ blueprint-bundle <config-file> <dist-dir>
Options
--bundle Bundle name to process, or "all" for all bundles (default: "all")
Examples
$ blueprint-bundle ./blueprint-map.mjs ./dist/
$ blueprint-bundle ./blueprint-map.mjs ./dist/ -b core
Sofie expects your available blueprint configuration fields to be defined with JSON schema. This tool will convert the same schema into typescript interfaces and enums which you can use in your code.
Tool to generate typescript types from blueprint config schemas
Usage
$ blueprint-schema-types <search-path> <output-path>
Examples
$ blueprint-schema-types ./src/$schemas/generated ./src/generated/types
If you need to provide translations for various text from your blueprints into multiple languages, you can utilise this to generate po
files for the strings that need translating.
Tool to extract translations from the TypeScript sourcecode, and associated json schemas
Usage
$ blueprint-extract-versions <config-file>
Examples
$ blueprint-extract-versions ./blueprint-map.mjs
Any contributions to this are welcome. We hope that the tools here can be utilised for all Sofie blueprints no matter how complex. There are likely bits of configuration that have not been exposed, and are happy to expose more as needed.
FAQs
When making blueprints for Sofie, they need to be packaged and uploaded in a certain way. This includes steps such as transforming the json-schema used for the configuration, and extracting strings to be translated.
The npm package sofie-blueprint-tools receives a total of 13 weekly downloads. As such, sofie-blueprint-tools popularity was classified as not popular.
We found that sofie-blueprint-tools demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.