Skip to content

Commit b0ac632

Browse files
committed
wip: meteor-lib esm
1 parent f80b7d5 commit b0ac632

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+284
-255
lines changed

packages/meteor-lib/.eslintrc.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"extends": "../node_modules/@sofie-automation/code-standard-preset/eslint/main"
2+
"extends": "../node_modules/@sofie-automation/code-standard-preset/eslint/main",
3+
"rules": {
4+
"node/no-missing-import": "off" // This doesn't understand ESM loading
5+
}
36
}
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@ module.exports = {
22
globals: {},
33
moduleFileExtensions: ['js', 'ts'],
44
transform: {
5-
'^.+\\.(ts|tsx)$': [
5+
'^.+\\.(ts|cts|tsx)$': [
66
'ts-jest',
77
{
8+
useESM: true,
89
tsconfig: 'tsconfig.json',
910
},
1011
],
1112
},
13+
extensionsToTreatAsEsm: ['.ts'],
14+
moduleNameMapper: {
15+
'^(\\.{1,2}/.*)\\.js$': '$1',
16+
// '^(\\.{1,2}/.*)\\.cjs$': '$1',
17+
},
1218
testMatch: ['**/__tests__/**/*.(spec|test).(ts|js)'],
1319
testPathIgnorePatterns: ['integrationTests'],
1420
testEnvironment: 'node',

packages/meteor-lib/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"description": "Temporary internal library for some types shared by meteor and webui",
66
"main": "dist/index.js",
77
"typings": "dist/index.d.ts",
8+
"type": "module",
89
"license": "MIT",
910
"repository": {
1011
"type": "git",

packages/meteor-lib/src/Settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { KeyboardLayouts } from './KeyboardLayout'
1+
import { KeyboardLayouts } from './KeyboardLayout.js'
22

33
/**
44
* This is an object specifying installation-wide, User Interface settings.

packages/meteor-lib/src/adlibs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { ITranslatableMessage } from '@sofie-automation/blueprints-integration'
2-
import { isTranslatableMessage } from '@sofie-automation/corelib/dist/TranslatableMessage'
3-
import type { ProtectedString } from '@sofie-automation/corelib/dist/protectedString'
2+
import { isTranslatableMessage } from '@sofie-automation/corelib/dist/TranslatableMessage.js'
3+
import type { ProtectedString } from '@sofie-automation/corelib/dist/protectedString.js'
44

55
function compareLabels(a: string | ITranslatableMessage, b: string | ITranslatableMessage) {
66
const actualA = isTranslatableMessage(a) ? a.key : (a as string)

packages/meteor-lib/src/api/ExternalMessageQueue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ExternalMessageQueueObjId } from '@sofie-automation/corelib/dist/dataModel/Ids'
1+
import type { ExternalMessageQueueObjId } from '@sofie-automation/corelib/dist/dataModel/Ids.js'
22

33
export interface NewExternalMessageQueueAPI {
44
remove(messageId: ExternalMessageQueueObjId): Promise<void>

packages/meteor-lib/src/api/MountedTriggers.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { ISourceLayer, ITranslatableMessage } from '@sofie-automation/blueprints-integration'
2-
import {
1+
import type { ISourceLayer, ITranslatableMessage } from '@sofie-automation/blueprints-integration'
2+
import type {
33
AdLibActionId,
44
PeripheralDeviceId,
55
PieceId,
66
RundownBaselineAdLibActionId,
77
TriggeredActionId,
8-
} from '@sofie-automation/corelib/dist/dataModel/Ids'
9-
import { ProtectedString } from '@sofie-automation/corelib/dist/protectedString'
8+
} from '@sofie-automation/corelib/dist/dataModel/Ids.js'
9+
import type { ProtectedString } from '@sofie-automation/corelib/dist/protectedString.js'
1010

1111
export type {
1212
DeviceActionId,
@@ -16,7 +16,7 @@ export type {
1616
PreviewWrappedAdLibId,
1717
PreviewWrappedAdLib,
1818
IWrappedAdLibBase,
19-
} from '@sofie-automation/shared-lib/dist/input-gateway/deviceTriggerPreviews'
19+
} from '@sofie-automation/shared-lib/dist/input-gateway/deviceTriggerPreviews.js'
2020

2121
export type MountedTrigger = (MountedGenericTrigger | MountedAdLibTrigger) & MountedHotkeyMixin
2222
export type MountedDeviceTrigger = (MountedGenericTrigger | MountedAdLibTrigger) & MountedDeviceMixin

packages/meteor-lib/src/api/blueprint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BlueprintId } from '@sofie-automation/corelib/dist/dataModel/Ids'
1+
import type { BlueprintId } from '@sofie-automation/corelib/dist/dataModel/Ids.js'
22

33
export interface NewBlueprintAPI {
44
insertBlueprint(): Promise<BlueprintId>

packages/meteor-lib/src/api/client.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import * as _ from 'underscore'
2-
import { Time } from '@sofie-automation/shared-lib/dist/lib/lib'
3-
import { UserError } from '@sofie-automation/corelib/dist/error'
4-
import { PeripheralDeviceId } from '@sofie-automation/corelib/dist/dataModel/Ids'
5-
import { TSR } from '@sofie-automation/blueprints-integration'
1+
import _ from 'underscore'
2+
import type { Time } from '@sofie-automation/shared-lib/dist/lib/lib.js'
3+
import { UserError } from '@sofie-automation/corelib/dist/error.js'
4+
import type { PeripheralDeviceId } from '@sofie-automation/corelib/dist/dataModel/Ids.js'
5+
import type { TSR } from '@sofie-automation/blueprints-integration'
66

77
export interface NewClientAPI {
88
clientLogger(type: string, ...args: string[]): Promise<void>

packages/meteor-lib/src/api/mediaManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as Shared from '@sofie-automation/shared-lib/dist/peripheralDevice/mediaManager'
1+
import * as Shared from '@sofie-automation/shared-lib/dist/peripheralDevice/mediaManager.js'
22

33
// eslint-disable-next-line @typescript-eslint/no-namespace
44
export namespace MediaManagerAPI {

0 commit comments

Comments
 (0)