@micromag/cli 0.2.296 → 0.2.301
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/bin/export.js +3 -3
- package/lib/index.js +16 -17
- package/package.json +9 -9
package/bin/export.js
CHANGED
|
@@ -109,6 +109,9 @@ const captureStory = async (story, location, settings = {}) => {
|
|
|
109
109
|
width,
|
|
110
110
|
height
|
|
111
111
|
} = defaultViewport;
|
|
112
|
+
const {
|
|
113
|
+
components: screens = null
|
|
114
|
+
} = story || {};
|
|
112
115
|
const browser = await puppeteer__default['default'].launch({
|
|
113
116
|
devtools: DEBUG,
|
|
114
117
|
...(executablePath !== null ? {
|
|
@@ -122,9 +125,6 @@ const captureStory = async (story, location, settings = {}) => {
|
|
|
122
125
|
const hasPage = pages.length > 0;
|
|
123
126
|
const page = hasPage ? pages[0] : await browser.newPage();
|
|
124
127
|
await page.goto(`http://127.0.0.1:${serverPort}`);
|
|
125
|
-
const {
|
|
126
|
-
components: screens = null
|
|
127
|
-
} = story || {};
|
|
128
128
|
|
|
129
129
|
if (screens !== null) {
|
|
130
130
|
const count = screens.length;
|
package/lib/index.js
CHANGED
|
@@ -148,13 +148,13 @@ var captureStory = /*#__PURE__*/function () {
|
|
|
148
148
|
serverPort,
|
|
149
149
|
width,
|
|
150
150
|
height,
|
|
151
|
+
_ref2,
|
|
152
|
+
_ref2$components,
|
|
153
|
+
screens,
|
|
151
154
|
browser,
|
|
152
155
|
pages,
|
|
153
156
|
hasPage,
|
|
154
157
|
page,
|
|
155
|
-
_ref2,
|
|
156
|
-
_ref2$components,
|
|
157
|
-
screens,
|
|
158
158
|
count,
|
|
159
159
|
index,
|
|
160
160
|
screenNumber,
|
|
@@ -177,7 +177,8 @@ var captureStory = /*#__PURE__*/function () {
|
|
|
177
177
|
server = _context2.sent;
|
|
178
178
|
serverPort = server.address().port;
|
|
179
179
|
width = defaultViewport.width, height = defaultViewport.height;
|
|
180
|
-
|
|
180
|
+
_ref2 = story || {}, _ref2$components = _ref2.components, screens = _ref2$components === void 0 ? null : _ref2$components;
|
|
181
|
+
_context2.next = 10;
|
|
181
182
|
return puppeteer__default['default'].launch(_objectSpread__default['default'](_objectSpread__default['default']({
|
|
182
183
|
devtools: DEBUG
|
|
183
184
|
}, executablePath !== null ? {
|
|
@@ -187,39 +188,37 @@ var captureStory = /*#__PURE__*/function () {
|
|
|
187
188
|
args: ['--no-sandbox']
|
|
188
189
|
}));
|
|
189
190
|
|
|
190
|
-
case
|
|
191
|
+
case 10:
|
|
191
192
|
browser = _context2.sent;
|
|
192
|
-
_context2.next =
|
|
193
|
+
_context2.next = 13;
|
|
193
194
|
return browser.pages();
|
|
194
195
|
|
|
195
|
-
case
|
|
196
|
+
case 13:
|
|
196
197
|
pages = _context2.sent;
|
|
197
198
|
hasPage = pages.length > 0;
|
|
198
199
|
|
|
199
200
|
if (!hasPage) {
|
|
200
|
-
_context2.next =
|
|
201
|
+
_context2.next = 19;
|
|
201
202
|
break;
|
|
202
203
|
}
|
|
203
204
|
|
|
204
205
|
_context2.t0 = pages[0];
|
|
205
|
-
_context2.next =
|
|
206
|
+
_context2.next = 22;
|
|
206
207
|
break;
|
|
207
208
|
|
|
208
|
-
case
|
|
209
|
-
_context2.next =
|
|
209
|
+
case 19:
|
|
210
|
+
_context2.next = 21;
|
|
210
211
|
return browser.newPage();
|
|
211
212
|
|
|
212
|
-
case
|
|
213
|
+
case 21:
|
|
213
214
|
_context2.t0 = _context2.sent;
|
|
214
215
|
|
|
215
|
-
case
|
|
216
|
+
case 22:
|
|
216
217
|
page = _context2.t0;
|
|
217
|
-
_context2.next =
|
|
218
|
+
_context2.next = 25;
|
|
218
219
|
return page["goto"]("http://127.0.0.1:".concat(serverPort));
|
|
219
220
|
|
|
220
|
-
case
|
|
221
|
-
_ref2 = story || {}, _ref2$components = _ref2.components, screens = _ref2$components === void 0 ? null : _ref2$components;
|
|
222
|
-
|
|
221
|
+
case 25:
|
|
223
222
|
if (!(screens !== null)) {
|
|
224
223
|
_context2.next = 51;
|
|
225
224
|
break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.301",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@babel/runtime": "^7.13.10",
|
|
47
|
-
"@micromag/core": "^0.2.
|
|
48
|
-
"@micromag/elements": "^0.2.
|
|
49
|
-
"@micromag/fields": "^0.2.
|
|
50
|
-
"@micromag/screens": "^0.2.
|
|
51
|
-
"@micromag/transforms": "^0.2.
|
|
52
|
-
"@micromag/viewer": "^0.2.
|
|
53
|
-
"@micromag/viewer-build": "^0.2.
|
|
47
|
+
"@micromag/core": "^0.2.301",
|
|
48
|
+
"@micromag/elements": "^0.2.301",
|
|
49
|
+
"@micromag/fields": "^0.2.301",
|
|
50
|
+
"@micromag/screens": "^0.2.301",
|
|
51
|
+
"@micromag/transforms": "^0.2.301",
|
|
52
|
+
"@micromag/viewer": "^0.2.301",
|
|
53
|
+
"@micromag/viewer-build": "^0.2.301",
|
|
54
54
|
"change-case": "^4.1.2",
|
|
55
55
|
"classnames": "^2.2.6",
|
|
56
56
|
"commander": "^7.2.0",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "64ad343d46608aef6d024a68ff5a988174097f21"
|
|
71
71
|
}
|