Skip to content

Commit

Permalink
chore: update to latest Core (#8)
Browse files Browse the repository at this point in the history
* chore: update to latest Core

* chore: Updated package licence checker to legally

* chore: fixed typyings and package versions
  • Loading branch information
chrisryanouellette authored Apr 21, 2020
1 parent 8285632 commit 6f9f8c2
Show file tree
Hide file tree
Showing 13 changed files with 1,302 additions and 1,714 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"unit": "jest",
"test": "yarn lint && yarn unit",
"validate:dependencies": "yarn audit && yarn license-validate",
"license-validate": "node-license-validator -p -d --allow-licenses MIT BSD BSD-3-Clause ISC Apache Unlicense"
"license-validate": "legally --filter MIT --filter BSD --filter ISC --filter Apache --filter Unlicense"
},
"devDependencies": {
"@types/jasmine": "^3.3.15",
Expand All @@ -30,8 +30,8 @@
"jest": "24.0.0",
"jest-haste-map": "^24.5.0",
"jest-resolve": "^24.5.0",
"legally": "^3.5.2",
"moment": "^2.22.2",
"node-license-validator": "^1.3.0",
"object-path": "^0.11.4",
"ts-jest": "^24.0.0",
"ts-loader": "^5.3.3",
Expand All @@ -44,7 +44,7 @@
"webpack-cli": "^3.1.2"
},
"dependencies": {
"timeline-state-resolver-types": "^3.2.0",
"tv-automation-sofie-blueprints-integration": "^0.24.1"
"timeline-state-resolver-types": "^3.18.0",
"tv-automation-sofie-blueprints-integration": "^1.10.0"
}
}
2 changes: 1 addition & 1 deletion src/blueprint0/__tests__/layers-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function checkAllLayers (context: ShowStyleContext, pieces: IBlueprintPie

const config = parseConfig(context)

const allSourceLayers = _.values(SourceLayer)
const allSourceLayers = _.values(SourceLayer) as string[]
const allOutputLayers = _.map(OutputlayerDefaults, m => m._id)

const allMappings = {
Expand Down
3 changes: 2 additions & 1 deletion src/blueprint0/__tests__/migrations-defaults.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as _ from 'underscore'
import MappingsDefaults from '../migrations/mappings-defaults'
import { RealLLayers, SourceLayer } from '../../types/layers'
import SourcelayerDefaults from '../migrations/sourcelayer-defaults'
import { ISourceLayer } from 'tv-automation-sofie-blueprints-integration'

describe('Migration Defaults', () => {
test('MappingsDefaults', () => {
Expand All @@ -18,7 +19,7 @@ describe('Migration Defaults', () => {
})

test('SourcelayerDefaults', () => {
const defaultsIds = _.map(SourcelayerDefaults, (v) => v._id).sort()
const defaultsIds = _.map(SourcelayerDefaults, (v: ISourceLayer) => v._id).sort()
const layerIds = _.values(SourceLayer).sort()

expect(defaultsIds).toEqual(layerIds)
Expand Down
5 changes: 3 additions & 2 deletions src/blueprint0/helpers/pieces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ export function CreatePieceGenericAdLib (piece: Piece): IBlueprintAdLibPiece {
* @param {Piece} piece Piece properties.
*/
export function CreatePieceGenericEnable (piece: Piece): IBlueprintPiece {
let enable: PieceEnable = {}
enable.start = piece.objectTime || 0
let enable: PieceEnable = {
start: piece.objectTime || 0
}

let p = literal<IBlueprintPiece>({
_id: '',
Expand Down
8 changes: 3 additions & 5 deletions src/blueprint0/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ShowStyleBlueprintManifest, BlueprintManifestType } from 'tv-automation-sofie-blueprints-integration'
import { StudioConfigManifest, ShowStyleConfigManifest } from './config-manifests'
import { studioMigrations, showStyleMigrations } from './migrations'
import { ShowStyleConfigManifest } from './config-manifests'
import { showStyleMigrations } from './migrations'

import { getRundown, getShowStyleVariantId } from './getRundown'
import { getSegment } from './getSegment'
Expand All @@ -17,17 +17,15 @@ const manifest: ShowStyleBlueprintManifest = {
integrationVersion: VERSION_INTEGRATION,
TSRVersion: VERSION_TSR,

minimumCoreVersion: '1.0.0',
minimumCoreVersion: '^1.0.0',

getShowStyleVariantId: getShowStyleVariantId,
getRundown: getRundown,
getSegment: getSegment,

onAsRunEvent: onAsRunEvent,

studioConfigManifest: StudioConfigManifest,
showStyleConfigManifest: ShowStyleConfigManifest,
studioMigrations: studioMigrations,
showStyleMigrations: showStyleMigrations
}

Expand Down
19 changes: 13 additions & 6 deletions src/blueprint0/migrations/devices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ import {
MigrationContextStudio, MigrationStepInputFilteredResult, MigrationStepStudio, MigrationStepInput
} from 'tv-automation-sofie-blueprints-integration'
import {
DeviceType as PlayoutDeviceType,
DeviceOptions as PlayoutDeviceOptions
DeviceType as PlayoutDeviceType, CasparCGOptions
// DeviceOptions as PlayoutDeviceOptions
} from 'timeline-state-resolver-types'
import { literal } from '../../common/util'

declare const VERSION: string // Injected by webpack

interface PlayoutDeviceOptions {
type: number
options: {
[index: string]: any
}
}
interface DeviceEntry {
id: string
firstVersion: string
Expand All @@ -27,12 +33,13 @@ function validateDevice (spec: DeviceEntry): MigrationStepStudio {
version: VERSION,
canBeRunAutomatically: false,
validate: (context: MigrationContextStudio) => {
const dev = context.getDevice(spec.id)
const dev = context.getDevice(spec.id) // Device Default Value ( PlayoutDeviceOptions ) is a device's context
if (!dev) return false
if (dev.type !== spec.type) return `Type is not "${PlayoutDeviceType[spec.type]}"`

if (spec.validate) {
return spec.validate(dev)
return spec.validate(dev) // We check our Device from Context.
// Confirms properties needed to connect to device
}

return false
Expand Down Expand Up @@ -122,7 +129,7 @@ const devices: DeviceEntry[] = [
defaultValue: (_input: MigrationStepInputFilteredResult, context: MigrationContextStudio) => {
const mainDev = context.getDevice('caspar01')
if (mainDev && mainDev.options) {
const mainOpts = mainDev.options as any
const mainOpts = mainDev.options as CasparCGOptions
if (mainOpts.launcherHost) {
return {
type: PlayoutDeviceType.HTTPWATCHER,
Expand Down Expand Up @@ -157,7 +164,7 @@ const devices: DeviceEntry[] = [
defaultValue: (_input: MigrationStepInputFilteredResult, context: MigrationContextStudio) => {
const mainDev = context.getDevice('caspar01')
if (mainDev && mainDev.options) {
const mainOpts = mainDev.options as any
const mainOpts = mainDev.options as CasparCGOptions
if (mainOpts.launcherHost) {
return {
type: PlayoutDeviceType.HTTPWATCHER,
Expand Down
2 changes: 1 addition & 1 deletion src/blueprint0/migrations/mappings-defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default literal<BlueprintMappings>({
'atem_supersource_override': literal<MappingAtem & BlueprintMapping>({
device: PlayoutDeviceType.ATEM,
deviceId: 'atem0',
lookahead: LookaheadMode.RETAIN,
lookahead: LookaheadMode.WHEN_CLEAR,
mappingType: MappingAtemType.SuperSourceBox,
index: 0 // 0 = SS
}),
Expand Down
24 changes: 3 additions & 21 deletions src/blueprint0/migrations/sourcelayer-defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,27 @@ export default literal<ISourceLayer[]>([
abbreviation: 'VT',
type: SourceLayerType.VT,
activateKeyboardHotkeys: 'f7,f8',
onPGMClean: true,
onPresenterScreen: true,
unlimited: false,
exclusiveGroup: 'fullscreen_pgm'
},
{
_id: SourceLayer.PgmGraphicsSuper,
_rank: 1000,
name: 'Super',
type: SourceLayerType.GRAPHICS,
onPGMClean: false,
activateKeyboardHotkeys: 'q,w,e,r,t,y',
clearKeyboardHotkey: 'u,alt+j,alt+u',
allowDisable: true,
unlimited: false
allowDisable: true
},
{
_id: SourceLayer.PgmSplit,
_rank: 11000,
name: 'Split',
abbreviation: 'DVE',
type: SourceLayerType.SPLITS,
onPGMClean: true,
isSticky: true,
activateStickyKeyboardHotkey: 'f6',
onPresenterScreen: true,
unlimited: false,
exclusiveGroup: 'fullscreen_pgm'
},
{
Expand All @@ -45,67 +39,55 @@ export default literal<ISourceLayer[]>([
name: 'DIR',
abbreviation: 'DIR',
type: SourceLayerType.REMOTE,
onPGMClean: true,
activateKeyboardHotkeys: '1,2,3,4,5,6',
isRemoteInput: true,
assignHotkeysToGlobalAdlibs: true,
isSticky: true,
activateStickyKeyboardHotkey: 'f5',
onPresenterScreen: true,
unlimited: false,
exclusiveGroup: 'fullscreen_pgm'
},
{
_id: SourceLayer.PgmScript,
_rank: 14000,
name: 'Manus',
type: SourceLayerType.SCRIPT,
onPGMClean: true,
unlimited: false
type: SourceLayerType.SCRIPT
},
{
_id: SourceLayer.PgmCam,
_rank: 13000,
name: 'Cam',
abbreviation: 'C ',
type: SourceLayerType.CAMERA,
onPGMClean: true,
activateKeyboardHotkeys: 'f1,f2,f3,f4,8,9',
assignHotkeysToGlobalAdlibs: true,
onPresenterScreen: true,
unlimited: false,
exclusiveGroup: 'fullscreen_pgm'
},
{
_id: SourceLayer.PgmTransition,
_rank: 0,
name: 'Transition',
type: SourceLayerType.TRANSITION,
onPGMClean: true,
activateKeyboardHotkeys: '',
assignHotkeysToGlobalAdlibs: false,
unlimited: false
assignHotkeysToGlobalAdlibs: false
},
{
_id: SourceLayer.PgmHyperdeck,
_rank: 0,
name: 'Hyperdeck',
type: SourceLayerType.UNKNOWN,
onPGMClean: true,
activateKeyboardHotkeys: '',
assignHotkeysToGlobalAdlibs: false,
unlimited: false,
isHidden: true
},
{
_id: SourceLayer.PgmAudioBed,
_rank: 0,
name: 'Bed',
type: SourceLayerType.AUDIO,
onPGMClean: true,
activateKeyboardHotkeys: '',
assignHotkeysToGlobalAdlibs: false,
unlimited: false,
isHidden: true
}
])
5 changes: 2 additions & 3 deletions src/common/util.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import {
IBlueprintPiece, IBlueprintAdLibPiece
IBlueprintPiece, IBlueprintAdLibPiece, PieceEnable
} from 'tv-automation-sofie-blueprints-integration'
import { SourceLayer } from '../types/layers'
import { TimelineEnable } from 'timeline-state-resolver-types/dist/superfly-timeline'

export function literal<T> (o: T) { return o }

export function createVirtualPiece (layer: SourceLayer, enable: number | TimelineEnable, mainPiece?: IBlueprintPiece): IBlueprintPiece {
export function createVirtualPiece (layer: SourceLayer, enable: number | PieceEnable, mainPiece?: IBlueprintPiece): IBlueprintPiece {
return {
_id: '', name: '',
externalId: (mainPiece ? mainPiece.externalId : '-'),
Expand Down
12 changes: 7 additions & 5 deletions src/studio0/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { StudioBlueprintManifest, BlueprintManifestType } from 'tv-automation-so
import * as _ from 'underscore'
import { getBaseline } from './getBaseline'
import { getShowStyleId } from './getShowStyleId'
import { StudioConfigManifest } from '../blueprint0/config-manifests'
import { studioMigrations } from '../blueprint0/migrations'

declare const VERSION: string // Injected by webpack
declare const VERSION_TSR: string // Injected by webpack
Expand All @@ -14,13 +16,13 @@ const manifest: StudioBlueprintManifest = {
integrationVersion: VERSION_INTEGRATION,
TSRVersion: VERSION_TSR,

minimumCoreVersion: '1.0.0',

studioConfigManifest: [], // TODO - some config should be moved here
studioMigrations: [], // TODO - device migrations should be moved to be done here
minimumCoreVersion: '^1.0.0',

getBaseline: getBaseline,
getShowStyleId: getShowStyleId
getShowStyleId: getShowStyleId,

studioConfigManifest: StudioConfigManifest,
studioMigrations: studioMigrations
}

export default manifest
2 changes: 1 addition & 1 deletion src/system/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const manifest: SystemBlueprintManifest = {
integrationVersion: VERSION_INTEGRATION,
TSRVersion: VERSION_TSR,

minimumCoreVersion: '1.0.0'
minimumCoreVersion: '^1.0.0'

}

Expand Down
2 changes: 1 addition & 1 deletion src/types/layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type LLayer = VirtualAbstractLLayer | AtemLLayer | CasparLLayer

/** Get all the Real LLayers (map to devices). Note: Does not include some which are dynamically generated */
export function RealLLayers () {
return _.values(AtemLLayer)
return _.values<string>(AtemLLayer)
.concat(_.values(CasparLLayer))
.concat(_.values(LawoLLayer))
}
Expand Down
Loading

0 comments on commit 6f9f8c2

Please sign in to comment.