screenci 0.0.71 → 0.0.73
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/README.md +13 -13
- package/dist/cli.d.ts +14 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +257 -81
- package/dist/cli.js.map +1 -1
- package/dist/docs/manifest.d.ts +3 -3
- package/dist/docs/manifest.js +1 -1
- package/dist/docs/manifest.js.map +1 -1
- package/dist/docs/video-sources/installation.screenci.js +13 -12
- package/dist/docs/video-sources/installation.screenci.js.map +1 -1
- package/dist/docs/video-sources/landing.screenci.js +16 -9
- package/dist/docs/video-sources/landing.screenci.js.map +1 -1
- package/dist/docs/video-sources/public-urls.screenci.js +16 -9
- package/dist/docs/video-sources/public-urls.screenci.js.map +1 -1
- package/dist/docs/video-sources/studio.screenci.js +42 -27
- package/dist/docs/video-sources/studio.screenci.js.map +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/src/asset.d.ts +82 -51
- package/dist/src/asset.d.ts.map +1 -1
- package/dist/src/asset.js +93 -46
- package/dist/src/asset.js.map +1 -1
- package/dist/src/audio.d.ts +6 -24
- package/dist/src/audio.d.ts.map +1 -1
- package/dist/src/audio.js +10 -35
- package/dist/src/audio.js.map +1 -1
- package/dist/src/builder.d.ts +214 -0
- package/dist/src/builder.d.ts.map +1 -0
- package/dist/src/builder.js +212 -0
- package/dist/src/builder.js.map +1 -0
- package/dist/src/config.d.ts +1 -1
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +13 -7
- package/dist/src/config.js.map +1 -1
- package/dist/src/cue.d.ts +40 -123
- package/dist/src/cue.d.ts.map +1 -1
- package/dist/src/cue.js +190 -30
- package/dist/src/cue.js.map +1 -1
- package/dist/src/defaults.d.ts +2 -2
- package/dist/src/defaults.d.ts.map +1 -1
- package/dist/src/defaults.js +2 -2
- package/dist/src/defaults.js.map +1 -1
- package/dist/src/events.d.ts +80 -15
- package/dist/src/events.d.ts.map +1 -1
- package/dist/src/events.js +72 -6
- package/dist/src/events.js.map +1 -1
- package/dist/src/init.d.ts.map +1 -1
- package/dist/src/init.js +80 -39
- package/dist/src/init.js.map +1 -1
- package/dist/src/locales.d.ts +19 -0
- package/dist/src/locales.d.ts.map +1 -0
- package/dist/src/locales.js +60 -0
- package/dist/src/locales.js.map +1 -0
- package/dist/src/localize.d.ts +135 -0
- package/dist/src/localize.d.ts.map +1 -0
- package/dist/src/localize.js +195 -0
- package/dist/src/localize.js.map +1 -0
- package/dist/src/localizeRuntime.d.ts +53 -0
- package/dist/src/localizeRuntime.d.ts.map +1 -0
- package/dist/src/localizeRuntime.js +79 -0
- package/dist/src/localizeRuntime.js.map +1 -0
- package/dist/src/mouse.d.ts.map +1 -1
- package/dist/src/mouse.js +6 -0
- package/dist/src/mouse.js.map +1 -1
- package/dist/src/recordingData.d.ts +5 -4
- package/dist/src/recordingData.d.ts.map +1 -1
- package/dist/src/runtimeContext.d.ts +22 -4
- package/dist/src/runtimeContext.d.ts.map +1 -1
- package/dist/src/runtimeContext.js +11 -0
- package/dist/src/runtimeContext.js.map +1 -1
- package/dist/src/runtimeMode.d.ts +47 -0
- package/dist/src/runtimeMode.d.ts.map +1 -1
- package/dist/src/runtimeMode.js +124 -0
- package/dist/src/runtimeMode.js.map +1 -1
- package/dist/src/screenshot.d.ts +56 -2
- package/dist/src/screenshot.d.ts.map +1 -1
- package/dist/src/screenshot.js +49 -10
- package/dist/src/screenshot.js.map +1 -1
- package/dist/src/stillCapture.d.ts +10 -4
- package/dist/src/stillCapture.d.ts.map +1 -1
- package/dist/src/stillCapture.js +11 -0
- package/dist/src/stillCapture.js.map +1 -1
- package/dist/src/studio.d.ts +55 -22
- package/dist/src/studio.d.ts.map +1 -1
- package/dist/src/studio.js +38 -12
- package/dist/src/studio.js.map +1 -1
- package/dist/src/types.d.ts +20 -7
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/src/video.d.ts +149 -13
- package/dist/src/video.d.ts.map +1 -1
- package/dist/src/video.js +98 -25
- package/dist/src/video.js.map +1 -1
- package/dist/src/voiceConfig.d.ts +110 -0
- package/dist/src/voiceConfig.d.ts.map +1 -0
- package/dist/src/voiceConfig.js +2 -0
- package/dist/src/voiceConfig.js.map +1 -0
- package/dist/src/voices.d.ts +27 -23
- package/dist/src/voices.d.ts.map +1 -1
- package/dist/src/voices.js +7 -4
- package/dist/src/voices.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/skills/screenci/SKILL.md +51 -47
- package/skills/screenci/references/init.md +1 -1
- package/skills/screenci/references/record.md +6 -6
- package/dist/docs/video-sources/product-pitch.screenci.d.ts +0 -2
- package/dist/docs/video-sources/product-pitch.screenci.d.ts.map +0 -1
- package/dist/docs/video-sources/product-pitch.screenci.js +0 -136
- package/dist/docs/video-sources/product-pitch.screenci.js.map +0 -1
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
|
+
import { resolveLocaleForLanguage } from './locales.js';
|
|
3
|
+
import { parseRequestedLanguages } from './runtimeMode.js';
|
|
4
|
+
import { logger } from './logger.js';
|
|
5
|
+
import { normalizeLocalizeSpec, } from './localize.js';
|
|
6
|
+
import { validateStudioDeclaration } from './studio.js';
|
|
7
|
+
function variantVideoName(baseTitle, variant) {
|
|
8
|
+
return variant === null ? baseTitle : `${baseTitle} ${variant.key}`;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Expand the localize / each fan-out specs into the concrete list of Playwright
|
|
12
|
+
* tests to register. Pure and exported for testing.
|
|
13
|
+
*
|
|
14
|
+
* - With no `localize`, each variant yields a single language-agnostic test.
|
|
15
|
+
* - In `'shared'` mode, each variant yields one test that carries every language
|
|
16
|
+
* (narration is overdubbed at render); the `--languages` filter does not split
|
|
17
|
+
* a shared recording.
|
|
18
|
+
* - In `'per-language'` mode, each variant yields one test per language,
|
|
19
|
+
* intersected with the `--languages` filter when present. A variant whose
|
|
20
|
+
* languages are entirely filtered out yields nothing. The browser locale is set
|
|
21
|
+
* per language unless `browserLocale` is `false`.
|
|
22
|
+
*/
|
|
23
|
+
export function expandRegistrations(params) {
|
|
24
|
+
const { baseTitle, localize, studio, eachVariants, requestedLanguages } = params;
|
|
25
|
+
const variants = eachVariants ?? [null];
|
|
26
|
+
const registrations = [];
|
|
27
|
+
for (const variant of variants) {
|
|
28
|
+
const videoName = variantVideoName(baseTitle, variant);
|
|
29
|
+
const recordOptions = variant?.recordOptions ?? null;
|
|
30
|
+
const use = variant?.use ?? null;
|
|
31
|
+
const variantLabel = variant === null ? '' : `${variant.key} `;
|
|
32
|
+
if (localize === null) {
|
|
33
|
+
registrations.push({
|
|
34
|
+
describeTitle: variant?.key ?? baseTitle,
|
|
35
|
+
leafTitle: videoName,
|
|
36
|
+
videoName,
|
|
37
|
+
language: null,
|
|
38
|
+
locale: null,
|
|
39
|
+
recordOptions,
|
|
40
|
+
use,
|
|
41
|
+
localize: null,
|
|
42
|
+
studio,
|
|
43
|
+
});
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (localize.mode === 'shared') {
|
|
47
|
+
registrations.push({
|
|
48
|
+
describeTitle: `${variantLabel}shared`.trim(),
|
|
49
|
+
leafTitle: videoName,
|
|
50
|
+
videoName,
|
|
51
|
+
language: null,
|
|
52
|
+
locale: null,
|
|
53
|
+
recordOptions,
|
|
54
|
+
use,
|
|
55
|
+
localize,
|
|
56
|
+
studio,
|
|
57
|
+
});
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const languages = requestedLanguages === null
|
|
61
|
+
? localize.languages
|
|
62
|
+
: localize.languages.filter((lang) => requestedLanguages.includes(lang));
|
|
63
|
+
for (const lang of languages) {
|
|
64
|
+
registrations.push({
|
|
65
|
+
describeTitle: `${variantLabel}${lang}`,
|
|
66
|
+
leafTitle: `${videoName} [${lang}]`,
|
|
67
|
+
videoName,
|
|
68
|
+
language: lang,
|
|
69
|
+
locale: localize.browserLocale
|
|
70
|
+
? resolveLocaleForLanguage(lang, localize.locales)
|
|
71
|
+
: null,
|
|
72
|
+
recordOptions,
|
|
73
|
+
use,
|
|
74
|
+
localize,
|
|
75
|
+
studio,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return registrations;
|
|
80
|
+
}
|
|
81
|
+
/** Internal option keys the page/context fixtures read off a registered test. */
|
|
82
|
+
const SCREENCI_LANGUAGE_OPTION = '_screenciLanguage';
|
|
83
|
+
const SCREENCI_VIDEO_NAME_OPTION = '_screenciVideoName';
|
|
84
|
+
const SCREENCI_LOCALIZE_OPTION = '_screenciLocalize';
|
|
85
|
+
const SCREENCI_STUDIO_OPTION = '_screenciStudio';
|
|
86
|
+
const SCREENCI_SOURCE_FILE_OPTION = '_screenciSourceFile';
|
|
87
|
+
/** Absolute path of this module, used to skip our own frames when capturing. */
|
|
88
|
+
const BUILDER_MODULE_PATH = fileURLToPath(import.meta.url);
|
|
89
|
+
/** Normalize a V8 call-site filename (which may be a `file://` URL) to a path. */
|
|
90
|
+
function callSiteFile(frame) {
|
|
91
|
+
const fileName = frame.getFileName();
|
|
92
|
+
if (!fileName)
|
|
93
|
+
return null;
|
|
94
|
+
return fileName.startsWith('file://') ? fileURLToPath(fileName) : fileName;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Capture the source file of the user's `.screenci` script that called the
|
|
98
|
+
* builder. Playwright attributes `testInfo.file` to this module (the test is
|
|
99
|
+
* registered here, not in the user's file), so asset paths authored relative to
|
|
100
|
+
* the script would otherwise resolve against this package. We walk the call
|
|
101
|
+
* stack and return the first frame outside this module, which is the script.
|
|
102
|
+
* Returns `null` if no such frame is found (fixtures then fall back to
|
|
103
|
+
* `testInfo.file`).
|
|
104
|
+
*/
|
|
105
|
+
function captureSourceFile() {
|
|
106
|
+
const originalPrepare = Error.prepareStackTrace;
|
|
107
|
+
const originalLimit = Error.stackTraceLimit;
|
|
108
|
+
try {
|
|
109
|
+
Error.stackTraceLimit = 50;
|
|
110
|
+
Error.prepareStackTrace = (_error, stack) => stack;
|
|
111
|
+
const stack = new Error().stack;
|
|
112
|
+
if (!Array.isArray(stack))
|
|
113
|
+
return null;
|
|
114
|
+
for (const frame of stack) {
|
|
115
|
+
const file = callSiteFile(frame);
|
|
116
|
+
if (file !== null && file !== BUILDER_MODULE_PATH) {
|
|
117
|
+
return file;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
finally {
|
|
123
|
+
Error.prepareStackTrace = originalPrepare;
|
|
124
|
+
Error.stackTraceLimit = originalLimit;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function registerOne(test, reg, details, body, modifier, sourceFile) {
|
|
128
|
+
const useOptions = {
|
|
129
|
+
...(reg.use ?? {}),
|
|
130
|
+
...(reg.recordOptions !== null ? { recordOptions: reg.recordOptions } : {}),
|
|
131
|
+
...(reg.locale !== null ? { locale: reg.locale } : {}),
|
|
132
|
+
[SCREENCI_LANGUAGE_OPTION]: reg.language ?? undefined,
|
|
133
|
+
[SCREENCI_VIDEO_NAME_OPTION]: reg.videoName,
|
|
134
|
+
[SCREENCI_LOCALIZE_OPTION]: reg.localize ?? undefined,
|
|
135
|
+
[SCREENCI_STUDIO_OPTION]: reg.studio ?? undefined,
|
|
136
|
+
[SCREENCI_SOURCE_FILE_OPTION]: sourceFile ?? undefined,
|
|
137
|
+
};
|
|
138
|
+
const register = modifier ? test[modifier] : test;
|
|
139
|
+
test.describe(reg.describeTitle, () => {
|
|
140
|
+
test.use(useOptions);
|
|
141
|
+
if (details !== undefined) {
|
|
142
|
+
register(reg.leafTitle, details, body);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
register(reg.leafTitle, body);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
function normalizeVariants(variants) {
|
|
150
|
+
if (variants.length === 0) {
|
|
151
|
+
throw new Error('video.each() requires at least one variant, e.g. .each([{ key: "mobile" }]).');
|
|
152
|
+
}
|
|
153
|
+
const seen = new Set();
|
|
154
|
+
for (const variant of variants) {
|
|
155
|
+
if (seen.has(variant.key)) {
|
|
156
|
+
throw new Error(`Duplicate video.each() variant key "${variant.key}". Variant keys must be unique.`);
|
|
157
|
+
}
|
|
158
|
+
seen.add(variant.key);
|
|
159
|
+
}
|
|
160
|
+
return variants;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Create a fan-out builder bound to a registrar test instance. `video.localize`
|
|
164
|
+
* and `video.each` are the `localize`/`each` methods of a root builder created
|
|
165
|
+
* with this factory. `Args` is the medium's fixture arg type (video/screenshot).
|
|
166
|
+
*/
|
|
167
|
+
export function createVideoBuilder(test, state = { localize: null, studio: null, eachVariants: null }) {
|
|
168
|
+
const runTerminal = (modifier, title, detailsOrBody, maybeBody) => {
|
|
169
|
+
const hasDetails = typeof detailsOrBody !== 'function';
|
|
170
|
+
const details = hasDetails ? detailsOrBody : undefined;
|
|
171
|
+
const body = (hasDetails ? maybeBody : detailsOrBody);
|
|
172
|
+
// Captured here, at the user's call site, so the script's path survives
|
|
173
|
+
// even though Playwright records the test as declared in this module.
|
|
174
|
+
const sourceFile = captureSourceFile();
|
|
175
|
+
// Studio-managed names must be unique and disjoint from the seeded localize
|
|
176
|
+
// names. Validate once, here, where both the localize spec and the studio
|
|
177
|
+
// declaration are known (they can be chained in either order).
|
|
178
|
+
validateStudioDeclaration(state.studio, state.localize?.narration?.seededNames ?? [], state.localize?.text?.seededNames ?? []);
|
|
179
|
+
const registrations = expandRegistrations({
|
|
180
|
+
baseTitle: title,
|
|
181
|
+
localize: state.localize,
|
|
182
|
+
studio: state.studio,
|
|
183
|
+
eachVariants: state.eachVariants,
|
|
184
|
+
requestedLanguages: parseRequestedLanguages(),
|
|
185
|
+
});
|
|
186
|
+
if (registrations.length === 0) {
|
|
187
|
+
logger.warn(`[screenci] "${title}" was skipped: none of its declared languages match the --languages filter.`);
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
for (const reg of registrations) {
|
|
191
|
+
registerOne(test, reg, details, body, modifier, sourceFile);
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
const callable = ((title, detailsOrBody, maybeBody) => runTerminal(undefined, title, detailsOrBody, maybeBody));
|
|
195
|
+
for (const modifier of ['only', 'skip', 'fixme', 'fail']) {
|
|
196
|
+
callable[modifier] = ((title, detailsOrBody, maybeBody) => runTerminal(modifier, title, detailsOrBody, maybeBody));
|
|
197
|
+
}
|
|
198
|
+
callable.localize = ((spec) => createVideoBuilder(test, {
|
|
199
|
+
...state,
|
|
200
|
+
localize: normalizeLocalizeSpec(spec),
|
|
201
|
+
}));
|
|
202
|
+
callable.studio = ((declaration) => createVideoBuilder(test, {
|
|
203
|
+
...state,
|
|
204
|
+
studio: declaration,
|
|
205
|
+
}));
|
|
206
|
+
callable.each = (variants) => createVideoBuilder(test, {
|
|
207
|
+
...state,
|
|
208
|
+
eachVariants: normalizeVariants(variants),
|
|
209
|
+
});
|
|
210
|
+
return callable;
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../src/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAOxC,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EACL,qBAAqB,GAItB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,yBAAyB,EAA0B,MAAM,aAAa,CAAA;AAuC/E,SAAS,gB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,QAAQ,EAAE,EAAE,CAC3B,kBAAkB,CAAO,IAAI,EAAE;QAC7B,GAAG,KAAK;QACR,YAAY,EAAE,iBAAiB,CAAC,QAAQ,CAAC;KAC1C,CAAC,CAAA;IAEJ,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
package/dist/src/config.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ import type { ScreenCIConfig, ExtendedScreenCIConfig } from './types.js';
|
|
|
19
19
|
*
|
|
20
20
|
* export default defineConfig({
|
|
21
21
|
* projectName: 'my-project',
|
|
22
|
-
*
|
|
22
|
+
* recordingDir: './recordings',
|
|
23
23
|
* use: {
|
|
24
24
|
* baseURL: 'https://app.example.com',
|
|
25
25
|
* recordOptions: {
|
package/dist/src/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AASxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,cAAc,GAAG,sBAAsB,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AASxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,cAAc,GAAG,sBAAsB,CAuI3E"}
|
package/dist/src/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DEFAULT_RECORDING_DIR, DEFAULT_RECORD_UPLOAD_POLICY, DEFAULT_TIMEOUT, DEFAULT_ACTION_TIMEOUT, DEFAULT_NAVIGATION_TIMEOUT, } from './defaults.js';
|
|
2
2
|
/**
|
|
3
3
|
* Defines a screenci configuration file.
|
|
4
4
|
*
|
|
@@ -19,7 +19,7 @@ import { DEFAULT_VIDEO_DIR, DEFAULT_RECORD_UPLOAD_POLICY, DEFAULT_TIMEOUT, DEFAU
|
|
|
19
19
|
*
|
|
20
20
|
* export default defineConfig({
|
|
21
21
|
* projectName: 'my-project',
|
|
22
|
-
*
|
|
22
|
+
* recordingDir: './recordings',
|
|
23
23
|
* use: {
|
|
24
24
|
* baseURL: 'https://app.example.com',
|
|
25
25
|
* recordOptions: {
|
|
@@ -76,8 +76,14 @@ export function defineConfig(config) {
|
|
|
76
76
|
if (Object.prototype.hasOwnProperty.call(config, 'testDir') &&
|
|
77
77
|
config.testDir !== undefined) {
|
|
78
78
|
throw new Error('screenci does not support "testDir" option. ' +
|
|
79
|
-
'Use "
|
|
80
|
-
'Defaults to "./
|
|
79
|
+
'Use "recordingDir" instead to specify the directory containing your *.screenci.* files. ' +
|
|
80
|
+
'Defaults to "./recordings".');
|
|
81
|
+
}
|
|
82
|
+
// Runtime check for the renamed videoDir option
|
|
83
|
+
if ('videoDir' in config) {
|
|
84
|
+
throw new Error('screenci renamed "videoDir" to "recordingDir". ' +
|
|
85
|
+
'Rename the option in your config to specify the directory containing your *.screenci.* files. ' +
|
|
86
|
+
'Defaults to "./recordings".');
|
|
81
87
|
}
|
|
82
88
|
// Runtime check for testMatch
|
|
83
89
|
if ('testMatch' in config) {
|
|
@@ -90,7 +96,7 @@ export function defineConfig(config) {
|
|
|
90
96
|
'Tests must succeed immediately or fail to ensure proper video recording. ' +
|
|
91
97
|
'screenci automatically sets retries to 0.');
|
|
92
98
|
}
|
|
93
|
-
const {
|
|
99
|
+
const { recordingDir, record, test, ...rest } = config;
|
|
94
100
|
const reporter = rest.reporter !== undefined ? normalizeReporter(rest.reporter) : undefined;
|
|
95
101
|
// recording does not need tracing, also it takes resources so that is why forced off
|
|
96
102
|
const trace = isRecording ? 'off' : rest.use?.trace;
|
|
@@ -109,9 +115,9 @@ export function defineConfig(config) {
|
|
|
109
115
|
actionTimeout: rest.use?.actionTimeout ?? DEFAULT_ACTION_TIMEOUT,
|
|
110
116
|
navigationTimeout: rest.use?.navigationTimeout ?? DEFAULT_NAVIGATION_TIMEOUT,
|
|
111
117
|
};
|
|
112
|
-
// Map
|
|
118
|
+
// Map recordingDir to testDir and keep screenci-managed defaults in place.
|
|
113
119
|
return {
|
|
114
|
-
testDir:
|
|
120
|
+
testDir: recordingDir ?? DEFAULT_RECORDING_DIR,
|
|
115
121
|
testMatch: [
|
|
116
122
|
'**/*.screenci.?(c|m)[jt]s?(x)',
|
|
117
123
|
// Deprecated alias kept only for backward compatibility: legacy
|
package/dist/src/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,EACrB,4BAA4B,EAC5B,eAAe,EACf,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,eAAe,CAAA;AAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,UAAU,YAAY,CAAC,MAAsB;IACjD,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,KAAK,MAAM,CAAA;IAC7D,MAAM,iBAAiB,GAAG,CACxB,QAAiD,EACR,EAAE;QAC3C,IAAI,CAAC,WAAW;YAAE,OAAO,QAAQ,CAAA;QAEjC,0EAA0E;QAC1E,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;YACxB,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAA;QACtC,CAAC;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5B,OAAO,QAAQ,C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AAC,EAAE,CAAC;QACzC,aAAa,EAAE,IAAI,CAAC,GAAG,EAAE,aAAa,IAAI,sBAAsB;QAChE,iBAAiB,EACf,IAAI,CAAC,GAAG,EAAE,iBAAiB,IAAI,0BAA0B;KAC5D,CAAA;IAED,2EAA2E;IAC3E,OAAO;QACL,OAAO,EAAE,YAAY,IAAI,qBAAqB;QAC9C,SAAS,EAAE;YACT,+BAA+B;YAC/B,gEAAgE;YAChE,uEAAuE;YACvE,uEAAuE;YACvE,4BAA4B;SAC7B;QACD,GAAG,IAAI;QACP,MAAM,EAAE;YACN,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,4BAA4B;SACvD;QACD,IAAI,EAAE;YACJ,UAAU,EAAE,IAAI,EAAE,UAAU,IAAI,KAAK;SACtC;QACD,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/C,GAAG;QACH,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjC,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,eAAe;QACxC,OAAO,EAAE,CAAC;KACX,CAAA;AACH,CAAC"}
|
package/dist/src/cue.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import type { IEventRecorder } from './events.js';
|
|
2
|
-
import { type
|
|
1
|
+
import type { IEventRecorder, VoiceLanguageMeta } from './events.js';
|
|
2
|
+
import { type VoiceKey, type Lang, type CustomVoiceRef } from './voices.js';
|
|
3
|
+
import type { TopLevelVoiceConfig, LangNarrationOverride } from './voiceConfig.js';
|
|
4
|
+
export type { TopLevelVoiceConfig, LangNarrationOverride };
|
|
5
|
+
import type { NormalizedNarration } from './localize.js';
|
|
3
6
|
export declare const ONE_FRAME_MS: number;
|
|
4
7
|
export declare function setSleepFn(fn: (ms: number) => void): void;
|
|
5
8
|
export declare function setActiveCueRecorder(recorder: IEventRecorder | null): void;
|
|
@@ -50,107 +53,6 @@ export type CueMapValue = string | NarrationCueObject;
|
|
|
50
53
|
export type Cues<T extends Record<string, CueMapValue>> = {
|
|
51
54
|
[K in keyof T]: NarrationCue;
|
|
52
55
|
};
|
|
53
|
-
/**
|
|
54
|
-
* Top-level voice configuration shared across all languages.
|
|
55
|
-
* `seed` is not allowed here — use per-language `voice` overrides instead.
|
|
56
|
-
*
|
|
57
|
-
* Built-in model voices support expressive/consistent model controls.
|
|
58
|
-
* ElevenLabs voices support only the numeric settings documented below.
|
|
59
|
-
*/
|
|
60
|
-
type ElevenLabsVoiceSettings = {
|
|
61
|
-
/** Voice stability for ElevenLabs `eleven_multilingual_v2`. Valid range: 0 to 1. */
|
|
62
|
-
stability?: number;
|
|
63
|
-
/** Similarity enhancement for ElevenLabs `eleven_multilingual_v2`. Valid range: 0 to 1. */
|
|
64
|
-
similarityBoost?: number;
|
|
65
|
-
/** Style exaggeration for ElevenLabs `eleven_multilingual_v2`. Valid range: 0 to 1. */
|
|
66
|
-
style?: number;
|
|
67
|
-
/** Playback speed for ElevenLabs `eleven_multilingual_v2`. Valid range: 0.7 to 1.2. */
|
|
68
|
-
speed?: number;
|
|
69
|
-
/** Enables ElevenLabs speaker boost. Defaults to `true`. */
|
|
70
|
-
useSpeakerBoost?: boolean;
|
|
71
|
-
};
|
|
72
|
-
type ElevenLabsVoiceConfig = ElevenLabsVoiceSettings & {
|
|
73
|
-
name: ElevenLabsVoiceKey | CustomVoiceRef;
|
|
74
|
-
modelType?: never;
|
|
75
|
-
accent?: never;
|
|
76
|
-
pacing?: never;
|
|
77
|
-
};
|
|
78
|
-
export type TopLevelVoiceConfig = ElevenLabsVoiceConfig | {
|
|
79
|
-
name: ModelVoiceKey;
|
|
80
|
-
/** Speaking style prompt for expressive synthesis. Business tier only. Implies `expressive` model type. */
|
|
81
|
-
style: string;
|
|
82
|
-
/** Can be omitted when `style` is set — `expressive` is implied. Business tier only. */
|
|
83
|
-
modelType?: 'expressive';
|
|
84
|
-
/**
|
|
85
|
-
* Accent description for expressive synthesis.
|
|
86
|
-
* The more specific, the better — e.g. `'Southern American English'` or `'Received Pronunciation British'`.
|
|
87
|
-
* Omitted from the prompt when not set — the voice uses its natural default.
|
|
88
|
-
*/
|
|
89
|
-
accent?: string;
|
|
90
|
-
/**
|
|
91
|
-
* Pacing description for expressive synthesis.
|
|
92
|
-
* Describes the overall speed and tempo — e.g. `'Measured and deliberate'` or `'Brisk and energetic'`.
|
|
93
|
-
*/
|
|
94
|
-
pacing?: string;
|
|
95
|
-
} | {
|
|
96
|
-
name: ModelVoiceKey;
|
|
97
|
-
style?: never;
|
|
98
|
-
accent?: never;
|
|
99
|
-
/** Speaking rate for consistent synthesis. Valid range: 0.25 to 2. */
|
|
100
|
-
pacing?: number;
|
|
101
|
-
/** TTS model type — `modelTypes.expressive` or `modelTypes.consistent`. Defaults to `consistent`. */
|
|
102
|
-
modelType?: Exclude<ModelType, 'expressive'> | undefined;
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* Per-language narration override. Can override the top-level voice name and
|
|
106
|
-
* optionally set a `seed` for TTS generation.
|
|
107
|
-
*
|
|
108
|
-
* The voice name discriminates provider-specific settings: built-in model
|
|
109
|
-
* voices use expressive/consistent controls, while ElevenLabs voices use the
|
|
110
|
-
* numeric `eleven_multilingual_v2` controls.
|
|
111
|
-
*/
|
|
112
|
-
export type LangNarrationOverride = (ElevenLabsVoiceConfig & {
|
|
113
|
-
/**
|
|
114
|
-
* Integer seed included in the audio cache key and forwarded to ElevenLabs.
|
|
115
|
-
* A different seed always forces regeneration.
|
|
116
|
-
*/
|
|
117
|
-
seed?: number;
|
|
118
|
-
}) | {
|
|
119
|
-
name: ModelVoiceKey;
|
|
120
|
-
/**
|
|
121
|
-
* Integer seed included in the audio cache key. A different seed always forces
|
|
122
|
-
* regeneration. Consistent output is not guaranteed across all voice types.
|
|
123
|
-
*/
|
|
124
|
-
seed?: number;
|
|
125
|
-
/** Speaking style prompt for expressive synthesis. Business tier only. Implies `expressive` model type. */
|
|
126
|
-
style: string;
|
|
127
|
-
/** Can be omitted when `style` is set — `expressive` is implied. Business tier only. */
|
|
128
|
-
modelType?: 'expressive';
|
|
129
|
-
/**
|
|
130
|
-
* Accent description for expressive synthesis.
|
|
131
|
-
* The more specific, the better — e.g. `'Southern American English'` or `'Received Pronunciation British'`.
|
|
132
|
-
* Omitted from the prompt when not set — the voice uses its natural default.
|
|
133
|
-
*/
|
|
134
|
-
accent?: string;
|
|
135
|
-
/**
|
|
136
|
-
* Pacing description for expressive synthesis.
|
|
137
|
-
* Describes the overall speed and tempo — e.g. `'Measured and deliberate'` or `'Brisk and energetic'`.
|
|
138
|
-
*/
|
|
139
|
-
pacing?: string;
|
|
140
|
-
} | {
|
|
141
|
-
name: ModelVoiceKey;
|
|
142
|
-
/**
|
|
143
|
-
* Integer seed included in the audio cache key. A different seed always forces
|
|
144
|
-
* regeneration. Consistent output is not guaranteed across all voice types.
|
|
145
|
-
*/
|
|
146
|
-
seed?: number;
|
|
147
|
-
style?: never;
|
|
148
|
-
accent?: never;
|
|
149
|
-
/** Speaking rate for consistent synthesis. Valid range: 0.25 to 2. */
|
|
150
|
-
pacing?: number;
|
|
151
|
-
/** TTS model type — `modelTypes.expressive` or `modelTypes.consistent`. Defaults to `consistent`. */
|
|
152
|
-
modelType?: Exclude<ModelType, 'expressive'> | undefined;
|
|
153
|
-
};
|
|
154
56
|
/** Converts a union type to an intersection: `A | B` → `A & B` */
|
|
155
57
|
type UnionToIntersection<U> = (U extends unknown ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
|
|
156
58
|
/**
|
|
@@ -220,27 +122,42 @@ type NarrationInput<M extends Partial<Record<Lang, NarrationLanguageInput>>> = {
|
|
|
220
122
|
*/
|
|
221
123
|
export declare function createNarration<M extends Partial<Record<Lang, NarrationLanguageInput>>>(input: NarrationInput<M>): Cues<AllCues<M>>;
|
|
222
124
|
/**
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
*
|
|
231
|
-
* video
|
|
232
|
-
*
|
|
125
|
+
* Asserts that a narration input's language keys match a video's declared
|
|
126
|
+
* languages exactly. Used by the `narration` fixture so the languages declared
|
|
127
|
+
* via `video.languages([...])` stay the single source of truth: a missing or
|
|
128
|
+
* unexpected language fails loudly instead of silently drifting.
|
|
129
|
+
*/
|
|
130
|
+
export declare function assertNarrationLanguagesMatch(input: Record<string, unknown>, declared: readonly string[]): void;
|
|
131
|
+
/**
|
|
132
|
+
* Builds narration controllers for Studio-managed cues declared via
|
|
133
|
+
* `video.studio({ narration: [...] })`. Their text and voice are configured on
|
|
134
|
+
* the ScreenCI Studio page instead of in code. Each name becomes a cue with the
|
|
135
|
+
* same behavior as a seeded narration cue (callable, with `start()`/`end()`);
|
|
136
|
+
* languages, narration text, and voice all come from Studio.
|
|
233
137
|
*
|
|
234
|
-
*
|
|
235
|
-
|
|
236
|
-
|
|
138
|
+
* Internal: the `narration` fixture merges these with the seeded localize cues.
|
|
139
|
+
*/
|
|
140
|
+
export declare function buildStudioNarrationCues(names: readonly string[]): Record<string, NarrationCue>;
|
|
141
|
+
/**
|
|
142
|
+
* Resolve a single voice config into its recorded name and language metadata.
|
|
143
|
+
* Unlike {@link buildCuesFromInput}, the config here is already fully resolved by
|
|
144
|
+
* the localize voice cascade, so there is no top-level/override merge: every
|
|
145
|
+
* provider setting comes from this one config.
|
|
146
|
+
*/
|
|
147
|
+
export declare function resolveVoiceMeta(config: TopLevelVoiceConfig | LangNarrationOverride): {
|
|
148
|
+
name: VoiceKey | CustomVoiceRef;
|
|
149
|
+
meta: VoiceLanguageMeta;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Build the narration cue controllers for a localized recording, directly from
|
|
153
|
+
* the normalized localize spec. Per-cue voice can override the per-language
|
|
154
|
+
* (`voiceByLang`) and config/global (`defaultVoice`) voices, so the cascade is
|
|
155
|
+
* resolved per `(cue, language)` here rather than routed through
|
|
156
|
+
* {@link buildCuesFromInput} (which is per-language only).
|
|
237
157
|
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
* await narration.checkout.end()
|
|
242
|
-
* ```
|
|
158
|
+
* Seeded cues emit translations carrying the resolved voice + spoken text (the
|
|
159
|
+
* recorder filters to the active language). Studio-managed cues emit studio cue
|
|
160
|
+
* starts whose content is owned by Studio.
|
|
243
161
|
*/
|
|
244
|
-
export declare function
|
|
245
|
-
export {};
|
|
162
|
+
export declare function buildLocalizedNarrationCues(narration: NormalizedNarration, voiceByLang: Partial<Record<string, LangNarrationOverride>>, defaultVoice: TopLevelVoiceConfig | LangNarrationOverride | undefined): Record<string, NarrationCue>;
|
|
246
163
|
//# sourceMappingURL=cue.d.ts.map
|
package/dist/src/cue.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cue.d.ts","sourceRoot":"","sources":["../../src/cue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,
|
|
1
|
+
{"version":3,"file":"cue.d.ts","sourceRoot":"","sources":["../../src/cue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAKd,iBAAiB,EAClB,MAAM,aAAa,CAAA;AACpB,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,IAAI,EACT,KAAK,cAAc,EACpB,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EACV,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,CAAA;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAiBxD,eAAO,MAAM,YAAY,QAAY,CAAA;AAqBrC,wBAAgB,UAAU,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,GAA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