cocos2d-cli 2.2.0 → 2.2.1

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.
@@ -188,9 +188,13 @@ export async function takeScreenshot(userConfig = {}) {
188
188
  addLog('requestfailed', request.url(), { error: errorText });
189
189
  });
190
190
  addLog('info', 'Loading Page');
191
- const pageUrl = config.debugBounds
192
- ? `${serverUrl}/index.html?debugBounds=true`
193
- : `${serverUrl}/index.html`;
191
+ const baseUrl = `${serverUrl}/index.html`;
192
+ const searchParams = new URLSearchParams();
193
+ searchParams.set('width', config.viewport.width.toString());
194
+ if (config.debugBounds) {
195
+ searchParams.set('debugBounds', 'true');
196
+ }
197
+ const pageUrl = `${baseUrl}?${searchParams.toString()}`;
194
198
  await page.goto(pageUrl, {
195
199
  waitUntil: 'networkidle',
196
200
  timeout: config.timeout
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cocos2d-cli",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "Command-line tools for AI to read and manipulate Cocos Creator 2.4.x project scenes",
5
5
  "type": "module",
6
6
  "main": "dist/bin/cocos2d-cli.js",