@nodaro/shared 3.32.0 → 3.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-VWGNPMJZ.cjs → chunk-24ZKPE33.cjs} +5 -5
- package/dist/{chunk-VWGNPMJZ.cjs.map → chunk-24ZKPE33.cjs.map} +1 -1
- package/dist/{chunk-CK3GK34R.js → chunk-2HIDE3QV.js} +9 -3
- package/dist/chunk-2HIDE3QV.js.map +1 -0
- package/dist/{chunk-WDIBOWAA.js → chunk-2HVFF5SS.js} +6 -6
- package/dist/chunk-2HVFF5SS.js.map +1 -0
- package/dist/{chunk-KHCBJ7KD.js → chunk-2QWNPYDG.js} +3 -3
- package/dist/{chunk-KHCBJ7KD.js.map → chunk-2QWNPYDG.js.map} +1 -1
- package/dist/{chunk-J6KHW2E5.cjs → chunk-3YG3MYDE.cjs} +153 -24
- package/dist/chunk-3YG3MYDE.cjs.map +1 -0
- package/dist/{chunk-ULXI7A6Q.cjs → chunk-5VNBQ4QK.cjs} +16 -16
- package/dist/{chunk-ULXI7A6Q.cjs.map → chunk-5VNBQ4QK.cjs.map} +1 -1
- package/dist/{chunk-5AUSSJIM.cjs → chunk-5ZCXWA7J.cjs} +232 -15
- package/dist/chunk-5ZCXWA7J.cjs.map +1 -0
- package/dist/{chunk-Z2OL5AJD.cjs → chunk-6F6GGX2W.cjs} +4 -3
- package/dist/chunk-6F6GGX2W.cjs.map +1 -0
- package/dist/{chunk-E2TGXG6X.cjs → chunk-72IFMNJE.cjs} +80 -52
- package/dist/chunk-72IFMNJE.cjs.map +1 -0
- package/dist/{chunk-NB72XWXQ.cjs → chunk-A5Z3IMSJ.cjs} +6 -6
- package/dist/{chunk-NB72XWXQ.cjs.map → chunk-A5Z3IMSJ.cjs.map} +1 -1
- package/dist/{chunk-NT6IJH4L.cjs → chunk-AGEZY4LL.cjs} +66 -47
- package/dist/chunk-AGEZY4LL.cjs.map +1 -0
- package/dist/{chunk-3CUFITU7.js → chunk-ANOQWAMU.js} +88 -54
- package/dist/chunk-ANOQWAMU.js.map +1 -0
- package/dist/{chunk-PRYE7AZQ.cjs → chunk-AWWOQH46.cjs} +7 -7
- package/dist/chunk-AWWOQH46.cjs.map +1 -0
- package/dist/{chunk-QELDJGDK.cjs → chunk-B7WJJHJS.cjs} +7 -4
- package/dist/chunk-B7WJJHJS.cjs.map +1 -0
- package/dist/{chunk-AVQK77G6.cjs → chunk-BBLE4UTG.cjs} +88 -54
- package/dist/chunk-BBLE4UTG.cjs.map +1 -0
- package/dist/{chunk-HGC5JNVA.cjs → chunk-BVVKMQKR.cjs} +9 -2
- package/dist/chunk-BVVKMQKR.cjs.map +1 -0
- package/dist/{chunk-YYV35XOS.js → chunk-C4R7BTBQ.js} +4 -3
- package/dist/chunk-C4R7BTBQ.js.map +1 -0
- package/dist/{chunk-AROWPFO2.js → chunk-ETXUOETU.js} +29 -36
- package/dist/chunk-ETXUOETU.js.map +1 -0
- package/dist/{chunk-S5DMKUWK.cjs → chunk-F4ZT5X2S.cjs} +11 -11
- package/dist/{chunk-S5DMKUWK.cjs.map → chunk-F4ZT5X2S.cjs.map} +1 -1
- package/dist/{chunk-YBPBK5KI.js → chunk-FKQJYMCO.js} +97 -23
- package/dist/chunk-FKQJYMCO.js.map +1 -0
- package/dist/{chunk-ZDFHA2EC.js → chunk-FVKCNAEQ.js} +51 -7
- package/dist/chunk-FVKCNAEQ.js.map +1 -0
- package/dist/{chunk-JSNV5O2F.cjs → chunk-GHBXS5RT.cjs} +4 -4
- package/dist/{chunk-JSNV5O2F.cjs.map → chunk-GHBXS5RT.cjs.map} +1 -1
- package/dist/{chunk-C57NEO3X.js → chunk-GKJRNIP4.js} +230 -16
- package/dist/chunk-GKJRNIP4.js.map +1 -0
- package/dist/{chunk-QNGNOU4Z.js → chunk-GRIMIJJ3.js} +3 -3
- package/dist/{chunk-QNGNOU4Z.js.map → chunk-GRIMIJJ3.js.map} +1 -1
- package/dist/{chunk-IEBZHTPE.js → chunk-GVHBHUFV.js} +34 -16
- package/dist/chunk-GVHBHUFV.js.map +1 -0
- package/dist/chunk-GZH2SIOF.cjs +99 -0
- package/dist/chunk-GZH2SIOF.cjs.map +1 -0
- package/dist/{chunk-YHRG7UOC.js → chunk-IJNQYMN7.js} +4 -4
- package/dist/{chunk-YHRG7UOC.js.map → chunk-IJNQYMN7.js.map} +1 -1
- package/dist/{chunk-JX5YZ4DH.cjs → chunk-IRUPCNW2.cjs} +49 -46
- package/dist/chunk-IRUPCNW2.cjs.map +1 -0
- package/dist/{chunk-JL4C5VJ7.cjs → chunk-J65CAOUV.cjs} +14 -2
- package/dist/chunk-J65CAOUV.cjs.map +1 -0
- package/dist/{chunk-ISJDAFKS.js → chunk-LJMNCSDG.js} +38 -15
- package/dist/chunk-LJMNCSDG.js.map +1 -0
- package/dist/{chunk-ZT77RY6R.js → chunk-MEN7VLQ5.js} +8 -5
- package/dist/chunk-MEN7VLQ5.js.map +1 -0
- package/dist/{chunk-VIWSWVAW.js → chunk-MUA5L25B.js} +125 -12
- package/dist/chunk-MUA5L25B.js.map +1 -0
- package/dist/{chunk-6IJOPRZP.cjs → chunk-NWXB4F6D.cjs} +21 -21
- package/dist/{chunk-6IJOPRZP.cjs.map → chunk-NWXB4F6D.cjs.map} +1 -1
- package/dist/{chunk-PQHS255G.js → chunk-OHSIVNJO.js} +3 -3
- package/dist/chunk-OHSIVNJO.js.map +1 -0
- package/dist/{chunk-LKAIXWK3.js → chunk-PVVO23LZ.js} +3 -3
- package/dist/{chunk-LKAIXWK3.js.map → chunk-PVVO23LZ.js.map} +1 -1
- package/dist/{chunk-XAMC4S53.js → chunk-Q4ZXDDWA.js} +3 -3
- package/dist/{chunk-XAMC4S53.js.map → chunk-Q4ZXDDWA.js.map} +1 -1
- package/dist/{chunk-EK362Q45.cjs → chunk-QIIG2QDP.cjs} +8 -8
- package/dist/{chunk-EK362Q45.cjs.map → chunk-QIIG2QDP.cjs.map} +1 -1
- package/dist/{chunk-Q4CDQ2KO.js → chunk-QXW6O56Z.js} +6 -6
- package/dist/chunk-QXW6O56Z.js.map +1 -0
- package/dist/{chunk-5PC6JBGJ.cjs → chunk-R2VF5NQG.cjs} +3 -3
- package/dist/chunk-R2VF5NQG.cjs.map +1 -0
- package/dist/{chunk-6DKDOWBL.js → chunk-RRI5YBUK.js} +6 -3
- package/dist/{chunk-QELDJGDK.cjs.map → chunk-RRI5YBUK.js.map} +1 -1
- package/dist/{chunk-RJL7RCEM.cjs → chunk-RUKFN3LJ.cjs} +6 -6
- package/dist/chunk-RUKFN3LJ.cjs.map +1 -0
- package/dist/chunk-TCBHVIMD.js +89 -0
- package/dist/chunk-TCBHVIMD.js.map +1 -0
- package/dist/{chunk-SES6GDBQ.cjs → chunk-UJJUX6NW.cjs} +59 -8
- package/dist/chunk-UJJUX6NW.cjs.map +1 -0
- package/dist/{chunk-ZRL2UFTH.cjs → chunk-V3N56Z2S.cjs} +101 -22
- package/dist/chunk-V3N56Z2S.cjs.map +1 -0
- package/dist/{chunk-Z4AZW6FY.js → chunk-W36WCZS2.js} +6 -6
- package/dist/{chunk-Z4AZW6FY.js.map → chunk-W36WCZS2.js.map} +1 -1
- package/dist/{chunk-M36G6SRP.js → chunk-WXNQMJ67.js} +14 -3
- package/dist/chunk-WXNQMJ67.js.map +1 -0
- package/dist/{chunk-O7PUQLJ3.cjs → chunk-XE5PE54B.cjs} +33 -40
- package/dist/chunk-XE5PE54B.cjs.map +1 -0
- package/dist/{chunk-LPW3XNC2.js → chunk-XJOBMAWW.js} +3 -3
- package/dist/{chunk-LPW3XNC2.js.map → chunk-XJOBMAWW.js.map} +1 -1
- package/dist/{chunk-5U7VLG43.js → chunk-XS7FI4JA.js} +3 -3
- package/dist/chunk-XS7FI4JA.js.map +1 -0
- package/dist/{chunk-O5MP52U2.cjs → chunk-YD3JA36S.cjs} +4 -4
- package/dist/{chunk-O5MP52U2.cjs.map → chunk-YD3JA36S.cjs.map} +1 -1
- package/dist/chunk-YYODFQEU.cjs +25 -0
- package/dist/chunk-YYODFQEU.cjs.map +1 -0
- package/dist/{chunk-RN3RMBJZ.js → chunk-ZXBSARZX.js} +4 -4
- package/dist/{chunk-RN3RMBJZ.js.map → chunk-ZXBSARZX.js.map} +1 -1
- package/dist/entries/apps.cjs +43 -42
- package/dist/entries/apps.d.cts +11 -2
- package/dist/entries/apps.d.ts +11 -2
- package/dist/entries/apps.js +8 -7
- package/dist/entries/catalogs.d.cts +1 -1
- package/dist/entries/catalogs.d.ts +1 -1
- package/dist/entries/credits.cjs +156 -152
- package/dist/entries/credits.d.cts +41 -10
- package/dist/entries/credits.d.ts +41 -10
- package/dist/entries/credits.js +8 -8
- package/dist/entries/edl.cjs +130 -102
- package/dist/entries/edl.d.cts +74 -3
- package/dist/entries/edl.d.ts +74 -3
- package/dist/entries/edl.js +2 -2
- package/dist/entries/entities.cjs +126 -122
- package/dist/entries/entities.d.cts +2 -2
- package/dist/entries/entities.d.ts +2 -2
- package/dist/entries/entities.js +1 -1
- package/dist/entries/i18n.cjs +11 -11
- package/dist/entries/i18n.d.cts +2 -2
- package/dist/entries/i18n.d.ts +2 -2
- package/dist/entries/i18n.js +1 -1
- package/dist/entries/llm-models.cjs +63 -43
- package/dist/entries/llm-models.d.cts +71 -4
- package/dist/entries/llm-models.d.ts +71 -4
- package/dist/entries/llm-models.js +1 -1
- package/dist/entries/media.cjs +45 -41
- package/dist/entries/media.d.cts +39 -1
- package/dist/entries/media.d.ts +39 -1
- package/dist/entries/media.js +1 -1
- package/dist/entries/model-catalog.cjs +75 -63
- package/dist/entries/model-catalog.d.cts +2 -2
- package/dist/entries/model-catalog.d.ts +2 -2
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +274 -210
- package/dist/entries/models.d.cts +3 -3
- package/dist/entries/models.d.ts +3 -3
- package/dist/entries/models.js +5 -5
- package/dist/entries/nodes.cjs +222 -201
- package/dist/entries/nodes.d.cts +48 -8
- package/dist/entries/nodes.d.ts +48 -8
- package/dist/entries/nodes.js +10 -9
- package/dist/entries/pipeline.cjs +149 -149
- package/dist/entries/pipeline.d.cts +12 -8
- package/dist/entries/pipeline.d.ts +12 -8
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/social.cjs +174 -174
- package/dist/entries/social.d.cts +13 -5
- package/dist/entries/social.d.ts +13 -5
- package/dist/entries/social.js +2 -2
- package/dist/entries/types.d.cts +1 -1
- package/dist/entries/types.d.ts +1 -1
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +115 -115
- package/dist/entries/video.d.cts +4 -3
- package/dist/entries/video.d.ts +4 -3
- package/dist/entries/video.js +4 -4
- package/dist/entries/workflow.cjs +96 -95
- package/dist/entries/workflow.d.cts +19 -20
- package/dist/entries/workflow.d.ts +19 -20
- package/dist/entries/workflow.js +2 -1
- package/dist/index.cjs +1720 -1563
- package/dist/index.d.cts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.js +26 -25
- package/dist/{model-catalog-flJYaa-g.d.ts → model-catalog-VIHGmQL2.d.cts} +113 -1
- package/dist/{model-catalog-flJYaa-g.d.cts → model-catalog-VIHGmQL2.d.ts} +113 -1
- package/dist/{presentation-utils-BIqiCzSA.d.cts → presentation-utils-A4i92SYo.d.cts} +3 -1
- package/dist/{presentation-utils-BdiObtwq.d.ts → presentation-utils-DjdPtM9k.d.ts} +3 -1
- package/dist/{scene-node-types-DjenYFLO.d.ts → scene-node-types-Cvbtf-0a.d.cts} +147 -6
- package/dist/{scene-node-types-DjenYFLO.d.cts → scene-node-types-Cvbtf-0a.d.ts} +147 -6
- package/dist/{types-DffyGSy5.d.ts → types-CU6SQnMS.d.cts} +0 -5
- package/dist/{types-DffyGSy5.d.cts → types-CU6SQnMS.d.ts} +0 -5
- package/dist/{types-BRlFPEru.d.cts → types-DzUBR7yr.d.cts} +8 -1
- package/dist/{types-BRlFPEru.d.ts → types-DzUBR7yr.d.ts} +8 -1
- package/package.json +1 -1
- package/src/__tests__/camera-switch-contract.test.ts +33 -1
- package/src/__tests__/character-mention-slug.test.ts +0 -8
- package/src/__tests__/effective-tier.test.ts +3 -14
- package/src/__tests__/fixtures/camera-switch-speaker-map-parity.json +178 -0
- package/src/__tests__/fixtures/root-exports.baseline.json +21 -0
- package/src/__tests__/fixtures/speaker-map-camera-ids.json +26 -0
- package/src/__tests__/gvp-supported-providers.test.ts +1 -0
- package/src/__tests__/i18n-locale-completeness.test.ts +38 -3
- package/src/__tests__/llm-models.test.ts +200 -20
- package/src/__tests__/model-makers.test.ts +76 -0
- package/src/__tests__/node-preset-extract.test.ts +10 -0
- package/src/__tests__/presentation-utils.test.ts +15 -0
- package/src/__tests__/preview-gate-use-case.test.ts +16 -1
- package/src/__tests__/private-host.test.ts +53 -0
- package/src/__tests__/producer-types.test.ts +19 -0
- package/src/__tests__/run-continuation.test.ts +4 -1
- package/src/__tests__/speaker-map-contract.test.ts +48 -0
- package/src/__tests__/unit-contract-compose.test.ts +129 -0
- package/src/__tests__/unit-contracts.test.ts +134 -0
- package/src/__tests__/use-case-types.test.ts +33 -0
- package/src/__tests__/video-collapse-parity.test.ts +10 -0
- package/src/__tests__/video-frame-slot.test.ts +85 -0
- package/src/__tests__/video-mode-aliases.test.ts +1 -0
- package/src/__tests__/video-reference-only.test.ts +117 -0
- package/src/__tests__/vidu-q4-catalog.test.ts +230 -0
- package/src/camera-switch-contract.ts +36 -2
- package/src/component-types.ts +9 -0
- package/src/credit-identifiers.ts +81 -23
- package/src/entity-asset-types.ts +13 -0
- package/src/entries/credits.ts +1 -0
- package/src/entries/edl.ts +2 -0
- package/src/entries/llm-models.ts +5 -0
- package/src/entries/media.ts +1 -0
- package/src/entries/model-catalog.ts +6 -0
- package/src/entries/models.ts +25 -0
- package/src/entries/nodes.ts +5 -1
- package/src/fan-out-rows.ts +36 -3
- package/src/generate-mask.ts +40 -0
- package/src/generated/unit-contracts.ts +58 -0
- package/src/i18n/types.ts +13 -2
- package/src/json-kinds.ts +24 -4
- package/src/llm-models.ts +184 -31
- package/src/meta-ads-scrape.ts +16 -8
- package/src/model-catalog.ts +285 -13
- package/src/model-constants.ts +260 -5
- package/src/node-default-mappings.ts +3 -0
- package/src/node-preset-extract.ts +8 -0
- package/src/pipeline-types.ts +3 -0
- package/src/presentation-utils.ts +19 -12
- package/src/preview-gate.ts +4 -2
- package/src/private-host.ts +89 -59
- package/src/producer-types.ts +19 -19
- package/src/run-continuation.ts +26 -4
- package/src/speaker-layouts.ts +8 -3
- package/src/speaker-map-contract.ts +77 -0
- package/src/unit-contract-compose.ts +55 -0
- package/src/use-case-types.ts +19 -0
- package/src/video-ui-defaults.ts +7 -5
- package/dist/chunk-3CUFITU7.js.map +0 -1
- package/dist/chunk-5AUSSJIM.cjs.map +0 -1
- package/dist/chunk-5PC6JBGJ.cjs.map +0 -1
- package/dist/chunk-5U7VLG43.js.map +0 -1
- package/dist/chunk-6DKDOWBL.js.map +0 -1
- package/dist/chunk-AROWPFO2.js.map +0 -1
- package/dist/chunk-AVQK77G6.cjs.map +0 -1
- package/dist/chunk-C57NEO3X.js.map +0 -1
- package/dist/chunk-CK3GK34R.js.map +0 -1
- package/dist/chunk-E2TGXG6X.cjs.map +0 -1
- package/dist/chunk-HGC5JNVA.cjs.map +0 -1
- package/dist/chunk-IEBZHTPE.js.map +0 -1
- package/dist/chunk-ISJDAFKS.js.map +0 -1
- package/dist/chunk-J6KHW2E5.cjs.map +0 -1
- package/dist/chunk-JL4C5VJ7.cjs.map +0 -1
- package/dist/chunk-JX5YZ4DH.cjs.map +0 -1
- package/dist/chunk-M36G6SRP.js.map +0 -1
- package/dist/chunk-NT6IJH4L.cjs.map +0 -1
- package/dist/chunk-O7PUQLJ3.cjs.map +0 -1
- package/dist/chunk-PQHS255G.js.map +0 -1
- package/dist/chunk-PRYE7AZQ.cjs.map +0 -1
- package/dist/chunk-Q4CDQ2KO.js.map +0 -1
- package/dist/chunk-RJL7RCEM.cjs.map +0 -1
- package/dist/chunk-SES6GDBQ.cjs.map +0 -1
- package/dist/chunk-VIWSWVAW.js.map +0 -1
- package/dist/chunk-WDIBOWAA.js.map +0 -1
- package/dist/chunk-WNG7HRVA.cjs +0 -25
- package/dist/chunk-WNG7HRVA.cjs.map +0 -1
- package/dist/chunk-YBPBK5KI.js.map +0 -1
- package/dist/chunk-YYV35XOS.js.map +0 -1
- package/dist/chunk-Z2OL5AJD.cjs.map +0 -1
- package/dist/chunk-ZDFHA2EC.js.map +0 -1
- package/dist/chunk-ZRL2UFTH.cjs.map +0 -1
- package/dist/chunk-ZT77RY6R.js.map +0 -1
- package/src/__tests__/__snapshots__/prompt-builder-segments.test.ts.snap +0 -65
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect } from "vitest"
|
|
2
2
|
import {
|
|
3
3
|
CAMERA_SWITCH_BOUNDS, CAMERA_SWITCH_DEFAULTS, CAMERA_SWITCH_NAME_MAX, cameraSwitchCameras, cameraSwitchEdlProblem,
|
|
4
|
-
cameraSwitchSettingsPayload, clampCameraSwitchSetting, cleanSpeakerNames, defaultSpeakerMap, transcriptSpeakerLabels,
|
|
4
|
+
cameraSwitchSettingsPayload, cameraSwitchSpeakerMap, clampCameraSwitchSetting, cleanSpeakerNames, defaultSpeakerMap, transcriptSpeakerLabels,
|
|
5
5
|
} from "../camera-switch-contract.js"
|
|
6
6
|
|
|
7
7
|
// camera-switch (B5, decided 2026-10-03): the shared reads every caller makes.
|
|
@@ -106,3 +106,35 @@ describe("cameraSwitchSettingsPayload — one funnel for both engines", () => {
|
|
|
106
106
|
})
|
|
107
107
|
})
|
|
108
108
|
})
|
|
109
|
+
|
|
110
|
+
describe("the wired Speaker Map (decided 2026-10-17)", () => {
|
|
111
|
+
const edl = { version: 1, clock: "master", sources: [{ id: "a", url: "u", kind: "video" }, { id: "b", url: "u", kind: "video" }, { id: "w", url: "u", kind: "video", role: "wide" }], segments: [{ id: "s", inMs: 0, outMs: 1000, video: "a" }] }
|
|
112
|
+
const transcript = { words: [{ text: "x", startMs: 0, endMs: 100, speaker: "s0" }, { text: "y", startMs: 200, endMs: 300, speaker: "s1" }, { text: "z", startMs: 400, endMs: 500, speaker: "s2" }] }
|
|
113
|
+
const wired = { version: 1, speakerMap: { s0: "b", s1: "" }, confidence: {}, notes: [] }
|
|
114
|
+
it("a wired map beats the order default; its \"\" is sent as \"\" (the wide shot); an unmapped speaker keeps the default", () => {
|
|
115
|
+
// s2 (a third voice, past the two close-ups) stays unmapped, as defaultSpeakerMap leaves a speaker past the last camera
|
|
116
|
+
expect(cameraSwitchSettingsPayload({}, edl, transcript, { speakerMap: wired }).speakerMap).toEqual({ s0: "b", s1: "" })
|
|
117
|
+
})
|
|
118
|
+
it("the ordinal override beats the wired map; an explicit label beats both", () => {
|
|
119
|
+
expect(cameraSwitchSettingsPayload({ speakerMapByOrder: { "1": "a" } }, edl, transcript, { speakerMap: wired }).speakerMap).toMatchObject({ s0: "a", s1: "" })
|
|
120
|
+
expect(cameraSwitchSettingsPayload({ speakerMap: { s0: "" }, speakerMapByOrder: { "1": "a" } }, edl, transcript, { speakerMap: wired }).speakerMap).toMatchObject({ s0: "" })
|
|
121
|
+
})
|
|
122
|
+
it("an explicit entry that is not a string is ignored: it never hides the layers below it", () => {
|
|
123
|
+
const bad = { s0: null, s1: 7 } as unknown as Record<string, string>
|
|
124
|
+
expect(cameraSwitchSettingsPayload({ speakerMap: bad }, edl, transcript, { speakerMap: wired }).speakerMap).toEqual({ s0: "b", s1: "" })
|
|
125
|
+
expect(cameraSwitchSettingsPayload({ speakerMap: bad }, edl, transcript).speakerMap).toEqual({ s0: "a", s1: "b" })
|
|
126
|
+
})
|
|
127
|
+
it("the payload sends exactly the one merge (cameraSwitchSpeakerMap) the config panel shows", () => {
|
|
128
|
+
const cases = [
|
|
129
|
+
[{}, undefined],
|
|
130
|
+
[{}, { speakerMap: wired }],
|
|
131
|
+
[{ speakerMapByOrder: { "3": "a" } }, { speakerMap: wired }],
|
|
132
|
+
[{ speakerMap: { s2: "w" }, speakerMapByOrder: { "1": "" } }, { speakerMap: JSON.stringify(wired) }],
|
|
133
|
+
] as const
|
|
134
|
+
for (const [data, w] of cases) expect(cameraSwitchSettingsPayload(data, edl, transcript, w).speakerMap).toEqual(cameraSwitchSpeakerMap(data, edl, transcript, w))
|
|
135
|
+
})
|
|
136
|
+
it("nothing wired and no ordinal: exactly today's payload", () => {
|
|
137
|
+
expect(cameraSwitchSettingsPayload({}, edl, transcript)).toEqual(cameraSwitchSettingsPayload({}, edl, transcript, {}))
|
|
138
|
+
expect(cameraSwitchSettingsPayload({}, edl, transcript).speakerMap).toEqual({ s0: "a", s1: "b" })
|
|
139
|
+
})
|
|
140
|
+
})
|
|
@@ -32,14 +32,6 @@ describe("parseCharacterMentionToken", () => {
|
|
|
32
32
|
usageMode: null,
|
|
33
33
|
})
|
|
34
34
|
})
|
|
35
|
-
it("parses @kira:1:smile with character + index + variant (no mode)", () => {
|
|
36
|
-
expect(parseCharacterMentionToken("@kira:1:smile")).toEqual({
|
|
37
|
-
characterSlug: "kira",
|
|
38
|
-
imageIndex: 1,
|
|
39
|
-
variantSlug: "smile",
|
|
40
|
-
usageMode: null,
|
|
41
|
-
})
|
|
42
|
-
})
|
|
43
35
|
it("parses multi-word character + variant slugs unambiguously", () => {
|
|
44
36
|
expect(parseCharacterMentionToken("@young-kira:2:soft-smile")).toEqual({
|
|
45
37
|
characterSlug: "young-kira",
|
|
@@ -20,6 +20,9 @@ describe("resolveStoredTier", () => {
|
|
|
20
20
|
|
|
21
21
|
describe("resolveEffectiveTier — the payg derivation matrix (design §9)", () => {
|
|
22
22
|
it("never-paid free user stays free", () => {
|
|
23
|
+
// NET lifetime 0 is also what a refunded-to-zero user and the #489
|
|
24
|
+
// pre-subscribe carryover (a topup balance with NO purchase) have, so
|
|
25
|
+
// this one case pins all three: none of them may derive payg.
|
|
23
26
|
expect(
|
|
24
27
|
resolveEffectiveTier({ tier: "free", subscription_tier: null, lifetime_topup_credits: 0 })
|
|
25
28
|
).toBe("free")
|
|
@@ -31,20 +34,6 @@ describe("resolveEffectiveTier — the payg derivation matrix (design §9)", ()
|
|
|
31
34
|
).toBe("payg")
|
|
32
35
|
})
|
|
33
36
|
|
|
34
|
-
it("refunded-to-zero user drops back to free (NET lifetime)", () => {
|
|
35
|
-
expect(
|
|
36
|
-
resolveEffectiveTier({ tier: "free", subscription_tier: null, lifetime_topup_credits: 0 })
|
|
37
|
-
).toBe("free")
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
it("#489 pre-subscribe carryover fixture: topup balance without purchase stays free", () => {
|
|
41
|
-
// Cancel-path carryover moves a pre-subscribe balance into topup_credits
|
|
42
|
-
// with NO purchase — lifetime stays 0, so the user must NOT derive payg.
|
|
43
|
-
expect(
|
|
44
|
-
resolveEffectiveTier({ tier: "free", subscription_tier: null, lifetime_topup_credits: 0 })
|
|
45
|
-
).toBe("free")
|
|
46
|
-
})
|
|
47
|
-
|
|
48
37
|
it("every stored paid tier passes through untouched, regardless of lifetime", () => {
|
|
49
38
|
for (const t of ["basic", "standard", "pro", "business"]) {
|
|
50
39
|
expect(
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "A Speaker Map wired into Camera Switch's `speakerMap` input, read by BOTH engines' resolvers off the saved upstream nodes (the `map` node stands for a saved Speaker Map: its `json` output is its generatedJson). `expectedSpeakerMap` is what the run sends; `withExplicit` adds a label the person set in the panel, which beats the wired map. `emptyWire` is the same wire from a Speaker Map that has not run: recorded as \"\" and refused before the reserve. `notAMap` wires a transcript into `speakerMap`: refused too. `unwired` drops the wire: the run sends exactly what it sent before the input existed (the order default). `withByOrder` sets the ordinal override (\"2\" = the second voice heard), which beats the wired map and loses to an explicit label. `aPicker` wires a parameter picker (Mood) into `speakerMap`: no value at all, so both engines read the input as unwired.",
|
|
3
|
+
"nodes": [
|
|
4
|
+
{
|
|
5
|
+
"id": "plan",
|
|
6
|
+
"type": "edit-plan",
|
|
7
|
+
"data": {
|
|
8
|
+
"label": "Plan",
|
|
9
|
+
"generatedJson": {
|
|
10
|
+
"version": 1,
|
|
11
|
+
"clock": "master",
|
|
12
|
+
"sources": [
|
|
13
|
+
{
|
|
14
|
+
"id": "a",
|
|
15
|
+
"url": "https://r2/a.mp4",
|
|
16
|
+
"kind": "video"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "b",
|
|
20
|
+
"url": "https://r2/b.mp4",
|
|
21
|
+
"kind": "video"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"segments": [
|
|
25
|
+
{
|
|
26
|
+
"id": "s",
|
|
27
|
+
"inMs": 0,
|
|
28
|
+
"outMs": 900,
|
|
29
|
+
"video": "a"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "tx",
|
|
37
|
+
"type": "transcribe",
|
|
38
|
+
"data": {
|
|
39
|
+
"label": "T",
|
|
40
|
+
"generatedJson": {
|
|
41
|
+
"words": [
|
|
42
|
+
{
|
|
43
|
+
"text": "x",
|
|
44
|
+
"startMs": 0,
|
|
45
|
+
"endMs": 100,
|
|
46
|
+
"speaker": "s0"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"text": "y",
|
|
50
|
+
"startMs": 200,
|
|
51
|
+
"endMs": 300,
|
|
52
|
+
"speaker": "s1"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": "map",
|
|
60
|
+
"type": "speaker-map",
|
|
61
|
+
"data": {
|
|
62
|
+
"label": "M",
|
|
63
|
+
"generatedJson": {
|
|
64
|
+
"version": 1,
|
|
65
|
+
"speakerMap": {
|
|
66
|
+
"s0": "b",
|
|
67
|
+
"s1": ""
|
|
68
|
+
},
|
|
69
|
+
"confidence": {},
|
|
70
|
+
"notes": []
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"id": "mood",
|
|
76
|
+
"type": "mood",
|
|
77
|
+
"data": {
|
|
78
|
+
"label": "Mood",
|
|
79
|
+
"mood": "melancholic"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"id": "sw",
|
|
84
|
+
"type": "camera-switch",
|
|
85
|
+
"data": {
|
|
86
|
+
"label": "S",
|
|
87
|
+
"fieldMappings": {}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"edges": [
|
|
92
|
+
{
|
|
93
|
+
"id": "e-edl",
|
|
94
|
+
"source": "plan",
|
|
95
|
+
"sourceHandle": "edl",
|
|
96
|
+
"target": "sw",
|
|
97
|
+
"targetHandle": "edl"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "e-tx",
|
|
101
|
+
"source": "tx",
|
|
102
|
+
"sourceHandle": "json",
|
|
103
|
+
"target": "sw",
|
|
104
|
+
"targetHandle": "transcript"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"id": "e-map",
|
|
108
|
+
"source": "map",
|
|
109
|
+
"sourceHandle": "json",
|
|
110
|
+
"target": "sw",
|
|
111
|
+
"targetHandle": "speakerMap"
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"expectedSpeakerMap": {
|
|
115
|
+
"s0": "b",
|
|
116
|
+
"s1": ""
|
|
117
|
+
},
|
|
118
|
+
"withExplicit": {
|
|
119
|
+
"data": {
|
|
120
|
+
"speakerMap": {
|
|
121
|
+
"s0": ""
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"expectedSpeakerMap": {
|
|
125
|
+
"s0": "",
|
|
126
|
+
"s1": ""
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"unwired": {
|
|
130
|
+
"expectedSpeakerMap": {
|
|
131
|
+
"s0": "a",
|
|
132
|
+
"s1": "b"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"emptyWire": {
|
|
136
|
+
"mapData": {
|
|
137
|
+
"label": "M"
|
|
138
|
+
},
|
|
139
|
+
"problem": "empty-speaker-map"
|
|
140
|
+
},
|
|
141
|
+
"notAMap": {
|
|
142
|
+
"edge": {
|
|
143
|
+
"id": "e-map",
|
|
144
|
+
"source": "tx",
|
|
145
|
+
"sourceHandle": "json",
|
|
146
|
+
"target": "sw",
|
|
147
|
+
"targetHandle": "speakerMap"
|
|
148
|
+
},
|
|
149
|
+
"problem": "not-a-speaker-map"
|
|
150
|
+
},
|
|
151
|
+
"withByOrder": {
|
|
152
|
+
"data": {
|
|
153
|
+
"speakerMapByOrder": {
|
|
154
|
+
"2": "a"
|
|
155
|
+
},
|
|
156
|
+
"speakerMap": {
|
|
157
|
+
"s0": "a"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"expectedSpeakerMap": {
|
|
161
|
+
"s0": "a",
|
|
162
|
+
"s1": "a"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"aPicker": {
|
|
166
|
+
"edge": {
|
|
167
|
+
"id": "e-map",
|
|
168
|
+
"source": "mood",
|
|
169
|
+
"sourceHandle": "out",
|
|
170
|
+
"target": "sw",
|
|
171
|
+
"targetHandle": "speakerMap"
|
|
172
|
+
},
|
|
173
|
+
"expectedSpeakerMap": {
|
|
174
|
+
"s0": "a",
|
|
175
|
+
"s1": "b"
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
@@ -1199,6 +1199,10 @@
|
|
|
1199
1199
|
"SPEAKER_EMPHASIS_STYLES",
|
|
1200
1200
|
"SPEAKER_LAYOUTS",
|
|
1201
1201
|
"SPEAKER_LAYOUT_IDS",
|
|
1202
|
+
"SPEAKER_MAP_DEFAULT_MARGIN_DB",
|
|
1203
|
+
"SPEAKER_MAP_MAX_SOURCES",
|
|
1204
|
+
"SPEAKER_MAP_MIN_CAMERAS",
|
|
1205
|
+
"SPEAKER_MAP_VERSION",
|
|
1202
1206
|
"SPEAKER_SWITCHES",
|
|
1203
1207
|
"SPEAKER_SWITCH_IDS",
|
|
1204
1208
|
"SPEAKER_TRACKS_MAX_BOXES_PER_SOURCE",
|
|
@@ -1410,6 +1414,8 @@
|
|
|
1410
1414
|
"SourceImageSize",
|
|
1411
1415
|
"SpeakerEmphasisStyle",
|
|
1412
1416
|
"SpeakerLayoutSheet",
|
|
1417
|
+
"SpeakerMapConfidence",
|
|
1418
|
+
"SpeakerMapResult",
|
|
1413
1419
|
"SpeakerSwitchSheet",
|
|
1414
1420
|
"SpeakerTrack",
|
|
1415
1421
|
"SpeakerTrackAttribution",
|
|
@@ -1528,6 +1534,7 @@
|
|
|
1528
1534
|
"UPSCALE_IMAGE_PROVIDERS",
|
|
1529
1535
|
"USAGE_GROUP_BYS",
|
|
1530
1536
|
"USAGE_MODES",
|
|
1537
|
+
"USE_CASE_NODE_TYPES",
|
|
1531
1538
|
"UgcCreatorCall",
|
|
1532
1539
|
"UgcCreatorCandidate",
|
|
1533
1540
|
"UgcCreatorCandidateCalls",
|
|
@@ -1556,6 +1563,7 @@
|
|
|
1556
1563
|
"UsageReportRow",
|
|
1557
1564
|
"UsageReportTotals",
|
|
1558
1565
|
"UsageVarianceRow",
|
|
1566
|
+
"UseCaseNodeType",
|
|
1559
1567
|
"VARIABLES_HANDLE_ID",
|
|
1560
1568
|
"VARIABLE_PRICING_MODELS",
|
|
1561
1569
|
"VEHICLES",
|
|
@@ -1838,6 +1846,7 @@
|
|
|
1838
1846
|
"cameraSwitchCameras",
|
|
1839
1847
|
"cameraSwitchEdlProblem",
|
|
1840
1848
|
"cameraSwitchSettingsPayload",
|
|
1849
|
+
"cameraSwitchSpeakerMap",
|
|
1841
1850
|
"canonicalExposedFieldKey",
|
|
1842
1851
|
"canonicalScene3DPlanV2Json",
|
|
1843
1852
|
"canonicalSourceHandle",
|
|
@@ -2155,6 +2164,7 @@
|
|
|
2155
2164
|
"isTemplateCategory",
|
|
2156
2165
|
"isTiltDirection",
|
|
2157
2166
|
"isUsageMode",
|
|
2167
|
+
"isUseCaseNodeType",
|
|
2158
2168
|
"isValidTimezone",
|
|
2159
2169
|
"isVeoProvider",
|
|
2160
2170
|
"isVideoAnalysisMixedTier",
|
|
@@ -2557,6 +2567,8 @@
|
|
|
2557
2567
|
"sortListItems",
|
|
2558
2568
|
"sourceRefKey",
|
|
2559
2569
|
"speakerLayoutAllows",
|
|
2570
|
+
"speakerMapByOrdinal",
|
|
2571
|
+
"speakerMapResultOf",
|
|
2560
2572
|
"speakerPresentationWarnings",
|
|
2561
2573
|
"speakerSwitchOverlaps",
|
|
2562
2574
|
"speakerTurns",
|
|
@@ -3421,6 +3433,10 @@
|
|
|
3421
3433
|
"SPEAKER_EMPHASIS_STYLES",
|
|
3422
3434
|
"SPEAKER_LAYOUTS",
|
|
3423
3435
|
"SPEAKER_LAYOUT_IDS",
|
|
3436
|
+
"SPEAKER_MAP_DEFAULT_MARGIN_DB",
|
|
3437
|
+
"SPEAKER_MAP_MAX_SOURCES",
|
|
3438
|
+
"SPEAKER_MAP_MIN_CAMERAS",
|
|
3439
|
+
"SPEAKER_MAP_VERSION",
|
|
3424
3440
|
"SPEAKER_SWITCHES",
|
|
3425
3441
|
"SPEAKER_SWITCH_IDS",
|
|
3426
3442
|
"SPEAKER_TRACKS_MAX_BOXES_PER_SOURCE",
|
|
@@ -3549,6 +3565,7 @@
|
|
|
3549
3565
|
"UPSCALE_IMAGE_PROVIDERS",
|
|
3550
3566
|
"USAGE_GROUP_BYS",
|
|
3551
3567
|
"USAGE_MODES",
|
|
3568
|
+
"USE_CASE_NODE_TYPES",
|
|
3552
3569
|
"VARIABLES_HANDLE_ID",
|
|
3553
3570
|
"VARIABLE_PRICING_MODELS",
|
|
3554
3571
|
"VEHICLES",
|
|
@@ -3732,6 +3749,7 @@
|
|
|
3732
3749
|
"cameraSwitchCameras",
|
|
3733
3750
|
"cameraSwitchEdlProblem",
|
|
3734
3751
|
"cameraSwitchSettingsPayload",
|
|
3752
|
+
"cameraSwitchSpeakerMap",
|
|
3735
3753
|
"canonicalExposedFieldKey",
|
|
3736
3754
|
"canonicalScene3DPlanV2Json",
|
|
3737
3755
|
"canonicalSourceHandle",
|
|
@@ -4049,6 +4067,7 @@
|
|
|
4049
4067
|
"isTemplateCategory",
|
|
4050
4068
|
"isTiltDirection",
|
|
4051
4069
|
"isUsageMode",
|
|
4070
|
+
"isUseCaseNodeType",
|
|
4052
4071
|
"isValidTimezone",
|
|
4053
4072
|
"isVeoProvider",
|
|
4054
4073
|
"isVideoAnalysisMixedTier",
|
|
@@ -4451,6 +4470,8 @@
|
|
|
4451
4470
|
"sortListItems",
|
|
4452
4471
|
"sourceRefKey",
|
|
4453
4472
|
"speakerLayoutAllows",
|
|
4473
|
+
"speakerMapByOrdinal",
|
|
4474
|
+
"speakerMapResultOf",
|
|
4454
4475
|
"speakerPresentationWarnings",
|
|
4455
4476
|
"speakerSwitchOverlaps",
|
|
4456
4477
|
"speakerTurns",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "The same two recordings feed Edit Plan and Speaker Map, Camera B through a Teleport pair into both. Speaker Map's camera ids (its Cameras rows, the map's values) must be the ids Edit Plan mints into the EDL Camera Switch reads, on both engines, or a wired map names cameras the edit does not have. `expectedIds` is that one id list, in wire order.",
|
|
3
|
+
"nodes": [
|
|
4
|
+
{ "id": "camA", "type": "upload-video", "data": { "label": "Camera A", "url": "https://media.test/a.mp4" } },
|
|
5
|
+
{ "id": "camB", "type": "upload-video", "data": { "label": "Camera B", "url": "https://media.test/b.mp4" } },
|
|
6
|
+
{ "id": "s", "type": "teleport-send", "data": { "label": "Send" } },
|
|
7
|
+
{ "id": "r", "type": "teleport-receive", "data": { "label": "Receive" } },
|
|
8
|
+
{ "id": "tx", "type": "transcribe", "data": { "label": "Transcribe", "generatedText": "hi yo", "generatedJson": { "words": [{ "text": "hi", "startMs": 0, "endMs": 500, "speaker": "A" }, { "text": "yo", "startMs": 600, "endMs": 900, "speaker": "B" }] } } },
|
|
9
|
+
{ "id": "plan", "type": "edit-plan", "data": { "label": "Edit Plan", "mode": "tighten" } },
|
|
10
|
+
{ "id": "map", "type": "speaker-map", "data": { "label": "Speaker Map" } },
|
|
11
|
+
{ "id": "cs", "type": "camera-switch", "data": { "label": "Camera Switch" } }
|
|
12
|
+
],
|
|
13
|
+
"edges": [
|
|
14
|
+
{ "id": "a-plan", "source": "camA", "sourceHandle": "video", "target": "plan", "targetHandle": "sources" },
|
|
15
|
+
{ "id": "a-map", "source": "camA", "sourceHandle": "video", "target": "map", "targetHandle": "sources" },
|
|
16
|
+
{ "id": "b-send", "source": "camB", "sourceHandle": "video", "target": "s", "targetHandle": "in" },
|
|
17
|
+
{ "id": "pair", "source": "s", "sourceHandle": "out", "target": "r", "targetHandle": "in", "data": { "teleporter": true } },
|
|
18
|
+
{ "id": "r-plan", "source": "r", "sourceHandle": "out", "target": "plan", "targetHandle": "sources" },
|
|
19
|
+
{ "id": "r-map", "source": "r", "sourceHandle": "out", "target": "map", "targetHandle": "sources" },
|
|
20
|
+
{ "id": "tx-plan", "source": "tx", "sourceHandle": "json", "target": "plan", "targetHandle": "transcript" },
|
|
21
|
+
{ "id": "tx-map", "source": "tx", "sourceHandle": "json", "target": "map", "targetHandle": "transcript" },
|
|
22
|
+
{ "id": "plan-cs", "source": "plan", "sourceHandle": "edl", "target": "cs", "targetHandle": "edl" },
|
|
23
|
+
{ "id": "map-cs", "source": "map", "sourceHandle": "json", "target": "cs", "targetHandle": "speakerMap" }
|
|
24
|
+
],
|
|
25
|
+
"expectedIds": ["camA", "camB"]
|
|
26
|
+
}
|
|
@@ -13,14 +13,21 @@
|
|
|
13
13
|
* locale (or just English) and the bug is invisible until reported.
|
|
14
14
|
*
|
|
15
15
|
* This walk asserts every (catalog, locale) pair exists. If a developer
|
|
16
|
-
* adds a new locale or a new catalog, they must add
|
|
17
|
-
*
|
|
16
|
+
* adds a new locale or a new catalog, they must add a sidecar for every
|
|
17
|
+
* catalog (or every locale) — this test fails until they're all present.
|
|
18
|
+
*
|
|
19
|
+
* The locales are discovered from the sidecar suffixes, so a locale removed
|
|
20
|
+
* from EVERY catalog would leave the matrix complete. EXPECTED_LOCALES pins
|
|
21
|
+
* the list by hand, so dropping a locale from the registry AND its sidecars
|
|
22
|
+
* still fails here until the list is edited too; the registry is held to it
|
|
23
|
+
* as well. REQUIRED_CATALOGS pins the catalogs that must stay in the matrix.
|
|
24
|
+
* This is the only CI check of locale completeness.
|
|
18
25
|
*/
|
|
19
26
|
|
|
20
27
|
import { readdirSync } from "node:fs"
|
|
21
28
|
import { join } from "node:path"
|
|
22
29
|
import { describe, it, expect } from "vitest"
|
|
23
|
-
import { I18N_CATALOGS } from "../i18n/types.js"
|
|
30
|
+
import { I18N_CATALOGS, NON_EN_LOCALE_IDS, type LocaleId } from "../i18n/types.js"
|
|
24
31
|
|
|
25
32
|
const I18N_DIR = join(__dirname, "..", "i18n")
|
|
26
33
|
|
|
@@ -44,6 +51,18 @@ function discoverLocales(): string[] {
|
|
|
44
51
|
|
|
45
52
|
const LOCALES = discoverLocales()
|
|
46
53
|
|
|
54
|
+
/**
|
|
55
|
+
* The supported locales besides English (inline in each catalog's source,
|
|
56
|
+
* never a sidecar). To add a locale: add it here, to LANGUAGES and LocaleId
|
|
57
|
+
* in packages/shared/src/i18n/types.ts, and a `<catalog>.<locale>.ts` sidecar
|
|
58
|
+
* for every catalog. To drop one: remove it from all three and delete its
|
|
59
|
+
* sidecars.
|
|
60
|
+
*/
|
|
61
|
+
const EXPECTED_LOCALES = ["ar", "de", "es", "fr", "he", "hi", "ja", "ko", "pt-BR", "ru", "zh-CN"] as const satisfies ReadonlyArray<Exclude<LocaleId, "en">>
|
|
62
|
+
|
|
63
|
+
/** Catalogs that must keep a sidecar for every locale (dropping one from I18N_CATALOGS would take it out of the matrix). */
|
|
64
|
+
const REQUIRED_CATALOGS = ["seasons"] as const
|
|
65
|
+
|
|
47
66
|
// Sanity: a non-trivial number of locales
|
|
48
67
|
describe("locale discovery sanity", () => {
|
|
49
68
|
it("found at least 5 locales (non-trivial coverage)", () => {
|
|
@@ -56,6 +75,22 @@ describe("locale discovery sanity", () => {
|
|
|
56
75
|
expect(LOCALES).toContain("es")
|
|
57
76
|
expect(LOCALES).toContain("ja")
|
|
58
77
|
})
|
|
78
|
+
|
|
79
|
+
it("the discovered locales are exactly EXPECTED_LOCALES (a locale gone from every catalog is caught)", () => {
|
|
80
|
+
expect(
|
|
81
|
+
LOCALES,
|
|
82
|
+
"The sidecar suffixes in packages/shared/src/i18n/ do not match EXPECTED_LOCALES. English is inline in each catalog, never a sidecar. Adding a locale: add it to EXPECTED_LOCALES, to LANGUAGES and LocaleId in packages/shared/src/i18n/types.ts, and a <catalog>.<locale>.ts sidecar for every catalog. Removing one: remove it from all three and delete all of its sidecars.",
|
|
83
|
+
).toEqual([...EXPECTED_LOCALES].sort())
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
it("the language registry's non-English locales are exactly EXPECTED_LOCALES", () => {
|
|
87
|
+
expect([...NON_EN_LOCALE_IDS].sort(), "LANGUAGES in packages/shared/src/i18n/types.ts and EXPECTED_LOCALES disagree — a locale is added or dropped in one only").toEqual([...EXPECTED_LOCALES].sort())
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
it("every REQUIRED_CATALOGS entry is still in I18N_CATALOGS (so the matrix still checks it)", () => {
|
|
91
|
+
const missing = REQUIRED_CATALOGS.filter((c) => !(I18N_CATALOGS as readonly string[]).includes(c))
|
|
92
|
+
expect(missing, `Catalogs dropped from I18N_CATALOGS (packages/shared/src/i18n/types.ts) leave the locale matrix: ${missing.join(", ")}`).toEqual([])
|
|
93
|
+
})
|
|
59
94
|
})
|
|
60
95
|
|
|
61
96
|
// Build set of actually-present sidecar files for fast lookup
|