@playwright/mcp 0.0.16 → 0.0.18
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/lib/config.js +13 -8
- package/lib/program.js +1 -0
- package/package.json +1 -1
package/lib/config.js
CHANGED
|
@@ -135,23 +135,28 @@ async function outputFile(config, name) {
|
|
|
135
135
|
const fileName = (0, utils_1.sanitizeForFilePath)(name);
|
|
136
136
|
return path_1.default.join(result, fileName);
|
|
137
137
|
}
|
|
138
|
+
function pickDefined(obj) {
|
|
139
|
+
return Object.fromEntries(Object.entries(obj ?? {}).filter(([_, v]) => v !== undefined));
|
|
140
|
+
}
|
|
138
141
|
function mergeConfig(base, overrides) {
|
|
139
142
|
const browser = {
|
|
140
|
-
...base.browser,
|
|
141
|
-
...overrides.browser,
|
|
143
|
+
...pickDefined(base.browser),
|
|
144
|
+
...pickDefined(overrides.browser),
|
|
142
145
|
launchOptions: {
|
|
143
|
-
...base.browser?.launchOptions,
|
|
144
|
-
...overrides.browser?.launchOptions,
|
|
146
|
+
...pickDefined(base.browser?.launchOptions),
|
|
147
|
+
...pickDefined(overrides.browser?.launchOptions),
|
|
145
148
|
...{ assistantMode: true },
|
|
146
149
|
},
|
|
147
150
|
contextOptions: {
|
|
148
|
-
...base.browser?.contextOptions,
|
|
149
|
-
...overrides.browser?.contextOptions,
|
|
151
|
+
...pickDefined(base.browser?.contextOptions),
|
|
152
|
+
...pickDefined(overrides.browser?.contextOptions),
|
|
150
153
|
},
|
|
151
154
|
};
|
|
155
|
+
if (browser.browserName !== 'chromium')
|
|
156
|
+
delete browser.launchOptions.channel;
|
|
152
157
|
return {
|
|
153
|
-
...base,
|
|
154
|
-
...overrides,
|
|
158
|
+
...pickDefined(base),
|
|
159
|
+
...pickDefined(overrides),
|
|
155
160
|
browser,
|
|
156
161
|
};
|
|
157
162
|
}
|
package/lib/program.js
CHANGED
|
@@ -37,6 +37,7 @@ commander_1.program
|
|
|
37
37
|
.option('--config <path>', 'Path to the configuration file.')
|
|
38
38
|
.action(async (options) => {
|
|
39
39
|
const config = await (0, config_1.resolveConfig)(options);
|
|
40
|
+
console.error(config);
|
|
40
41
|
const serverList = new server_1.ServerList(() => (0, index_1.createServer)(config));
|
|
41
42
|
setupExitWatchdog(serverList);
|
|
42
43
|
if (options.port)
|