datagrok-tools 4.5.11 → 4.6.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.
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.check = check;
|
|
11
|
+
|
|
12
|
+
var _fs = _interopRequireDefault(require("fs"));
|
|
13
|
+
|
|
14
|
+
var _path = _interopRequireDefault(require("path"));
|
|
15
|
+
|
|
16
|
+
var _ignoreWalk = _interopRequireDefault(require("ignore-walk"));
|
|
17
|
+
|
|
18
|
+
var utils = _interopRequireWildcard(require("../utils/utils"));
|
|
19
|
+
|
|
20
|
+
var color = _interopRequireWildcard(require("../utils/color-utils"));
|
|
21
|
+
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
+
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
+
|
|
26
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
27
|
+
|
|
28
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
29
|
+
|
|
30
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
31
|
+
|
|
32
|
+
function check(args) {
|
|
33
|
+
var nOptions = Object.keys(args).length - 1;
|
|
34
|
+
if (args['_'].length !== 1 || nOptions > 0) return false;
|
|
35
|
+
var curDir = process.cwd();
|
|
36
|
+
|
|
37
|
+
if (!utils.isPackageDir(curDir)) {
|
|
38
|
+
color.error('File `package.json` not found. Run the command from the package directory');
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
var files = _ignoreWalk["default"].sync({
|
|
43
|
+
ignoreFiles: ['.npmignore', '.gitignore']
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
var jsTsFiles = files.filter(function (f) {
|
|
47
|
+
return f.endsWith('.js') || f.endsWith('.ts');
|
|
48
|
+
});
|
|
49
|
+
var packageFiles = ['src/package.ts', 'src/detectors.ts', 'src/package.js', 'src/detectors.js', 'src/package-test.ts', 'src/package-test.js', 'package.js', 'detectors.js'];
|
|
50
|
+
var funcFiles = jsTsFiles.filter(function (f) {
|
|
51
|
+
return packageFiles.includes(f);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
var webpackConfigPath = _path["default"].join(curDir, 'webpack.config.js');
|
|
55
|
+
|
|
56
|
+
var isWebpack = _fs["default"].existsSync(webpackConfigPath);
|
|
57
|
+
|
|
58
|
+
if (isWebpack) {
|
|
59
|
+
var content = _fs["default"].readFileSync(webpackConfigPath, {
|
|
60
|
+
encoding: 'utf-8'
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
var externals = extractExternals(content);
|
|
64
|
+
if (externals) checkImportStatements(jsTsFiles, externals).forEach(function (warning) {
|
|
65
|
+
return color.warn(warning);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
checkFuncSignatures(funcFiles).forEach(function (warning) {
|
|
70
|
+
return color.warn(warning);
|
|
71
|
+
});
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function extractExternals(config) {
|
|
76
|
+
var externalsRegex = /(?<=externals\s*:\s*)(\{[\S\s]*?\})/;
|
|
77
|
+
var match = config.match(externalsRegex);
|
|
78
|
+
|
|
79
|
+
if (match) {
|
|
80
|
+
// Replace single quotes and a trailing comma to make a string JSON-like
|
|
81
|
+
var externalStr = match[1].replace(/'/g, '"').replace(/(?<=[\S\s]),(?=\s*\})/, '');
|
|
82
|
+
|
|
83
|
+
try {
|
|
84
|
+
var externals = JSON.parse(externalStr);
|
|
85
|
+
return externals;
|
|
86
|
+
} catch (e) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function checkImportStatements(files, externals) {
|
|
95
|
+
var modules = [];
|
|
96
|
+
|
|
97
|
+
for (var key in externals) {
|
|
98
|
+
modules.push(key);
|
|
99
|
+
if (key.includes('/')) modules.push(key.split('/', 1)[0]);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
var importRegex = new RegExp("import\\s+.*(".concat(modules.join('|'), ").*(?=\\s+?)"), 'g');
|
|
103
|
+
var validImportRegex = new RegExp("import\\s+.*(".concat(Object.keys(externals).join('|'), ")['\"]{1}"));
|
|
104
|
+
var warnings = [];
|
|
105
|
+
|
|
106
|
+
function validateImport(file, s) {
|
|
107
|
+
var value = validImportRegex.test(s);
|
|
108
|
+
var message = value ? '' : 'Pay attention to file ' + file + ': import statement `' + s + '` differs from the path given in the webpack config as an external module. ' + 'It can increase the bundle size.';
|
|
109
|
+
return {
|
|
110
|
+
value: value,
|
|
111
|
+
message: message
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
var _iterator = _createForOfIteratorHelper(files),
|
|
116
|
+
_step;
|
|
117
|
+
|
|
118
|
+
try {
|
|
119
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
120
|
+
var file = _step.value;
|
|
121
|
+
|
|
122
|
+
var content = _fs["default"].readFileSync(_path["default"].join(process.cwd(), file), {
|
|
123
|
+
encoding: 'utf-8'
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
var matchedImports = content.match(importRegex);
|
|
127
|
+
|
|
128
|
+
if (matchedImports) {
|
|
129
|
+
var _iterator2 = _createForOfIteratorHelper(matchedImports),
|
|
130
|
+
_step2;
|
|
131
|
+
|
|
132
|
+
try {
|
|
133
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
134
|
+
var match = _step2.value;
|
|
135
|
+
var vr = validateImport(file, match);
|
|
136
|
+
if (!vr.value) warnings.push(vr.message);
|
|
137
|
+
}
|
|
138
|
+
} catch (err) {
|
|
139
|
+
_iterator2.e(err);
|
|
140
|
+
} finally {
|
|
141
|
+
_iterator2.f();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
} catch (err) {
|
|
146
|
+
_iterator.e(err);
|
|
147
|
+
} finally {
|
|
148
|
+
_iterator.f();
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return warnings;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function checkFuncSignatures(files) {
|
|
155
|
+
var warnings = [];
|
|
156
|
+
var checkFunctions = {
|
|
157
|
+
semTypeDetector: function semTypeDetector(_ref) {
|
|
158
|
+
var inputs = _ref.inputs,
|
|
159
|
+
outputs = _ref.outputs;
|
|
160
|
+
var value = true;
|
|
161
|
+
var message = '';
|
|
162
|
+
|
|
163
|
+
if (inputs.length !== 1 || inputs[0].type !== 'column') {
|
|
164
|
+
value = false;
|
|
165
|
+
message += 'Semantic type detectors must have one input of type "column"';
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (outputs.length !== 1 || outputs[0].type !== 'string') {
|
|
169
|
+
value = false;
|
|
170
|
+
message += 'Semantic type detectors must have one output of type "string"';
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return {
|
|
174
|
+
value: value,
|
|
175
|
+
message: message
|
|
176
|
+
};
|
|
177
|
+
},
|
|
178
|
+
cellRenderer: function cellRenderer(_ref2) {
|
|
179
|
+
var inputs = _ref2.inputs,
|
|
180
|
+
outputs = _ref2.outputs;
|
|
181
|
+
var value = true;
|
|
182
|
+
var message = '';
|
|
183
|
+
|
|
184
|
+
if (inputs.length !== 0) {
|
|
185
|
+
value = false;
|
|
186
|
+
message += 'Cell renderer functions should take no arguments';
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (outputs.length !== 1 || outputs[0].type !== 'grid_cell_renderer') {
|
|
190
|
+
value = false;
|
|
191
|
+
message += 'Cell renderer functions must have one output of type "grid_cell_renderer"';
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return {
|
|
195
|
+
value: value,
|
|
196
|
+
message: message
|
|
197
|
+
};
|
|
198
|
+
},
|
|
199
|
+
fileViewer: function fileViewer(_ref3) {
|
|
200
|
+
var inputs = _ref3.inputs,
|
|
201
|
+
outputs = _ref3.outputs,
|
|
202
|
+
tags = _ref3.tags;
|
|
203
|
+
var value = true;
|
|
204
|
+
var message = '';
|
|
205
|
+
|
|
206
|
+
if (tags == null || tags.filter(function (t) {
|
|
207
|
+
return t.startsWith('fileViewer');
|
|
208
|
+
}).length < 2) {
|
|
209
|
+
value = false;
|
|
210
|
+
message += 'File viewers must have at least two special tags: "fileViewer" and "fileViewer-<extension>"';
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
if (inputs.length !== 1 || inputs[0].type !== 'file') {
|
|
214
|
+
value = false;
|
|
215
|
+
message += 'File viewers must have one input of type "file"';
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (outputs.length !== 1 || outputs[0].type !== 'view') {
|
|
219
|
+
value = false;
|
|
220
|
+
message += 'File viewers must have one output of type "view"';
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
return {
|
|
224
|
+
value: value,
|
|
225
|
+
message: message
|
|
226
|
+
};
|
|
227
|
+
},
|
|
228
|
+
fileExporter: function fileExporter(_ref4) {
|
|
229
|
+
var description = _ref4.description;
|
|
230
|
+
var value = true;
|
|
231
|
+
var message = '';
|
|
232
|
+
|
|
233
|
+
if (description == null || description === '') {
|
|
234
|
+
value = false;
|
|
235
|
+
message += 'File exporters should have a description parameter';
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return {
|
|
239
|
+
value: value,
|
|
240
|
+
message: message
|
|
241
|
+
};
|
|
242
|
+
},
|
|
243
|
+
packageSettingsEditor: function packageSettingsEditor(_ref5) {
|
|
244
|
+
var outputs = _ref5.outputs;
|
|
245
|
+
var value = true;
|
|
246
|
+
var message = '';
|
|
247
|
+
|
|
248
|
+
if (outputs.length === 1 && outputs[0].type === 'widget') {
|
|
249
|
+
value = false;
|
|
250
|
+
message += 'Package settings editors must have one output of type "widget"';
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return {
|
|
254
|
+
value: value,
|
|
255
|
+
message: message
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
var functionRoles = Object.keys(checkFunctions);
|
|
260
|
+
|
|
261
|
+
var _iterator3 = _createForOfIteratorHelper(files),
|
|
262
|
+
_step3;
|
|
263
|
+
|
|
264
|
+
try {
|
|
265
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
266
|
+
var file = _step3.value;
|
|
267
|
+
|
|
268
|
+
var content = _fs["default"].readFileSync(_path["default"].join(process.cwd(), file), {
|
|
269
|
+
encoding: 'utf-8'
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
var functions = getFuncMetadata(content);
|
|
273
|
+
|
|
274
|
+
var _iterator4 = _createForOfIteratorHelper(functions),
|
|
275
|
+
_step4;
|
|
276
|
+
|
|
277
|
+
try {
|
|
278
|
+
var _loop = function _loop() {
|
|
279
|
+
var f = _step4.value;
|
|
280
|
+
var roles = functionRoles.filter(function (role) {
|
|
281
|
+
var _f$tags;
|
|
282
|
+
|
|
283
|
+
return (_f$tags = f.tags) === null || _f$tags === void 0 ? void 0 : _f$tags.includes(role);
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
if (roles.length > 1) {
|
|
287
|
+
warnings.push("File ".concat(file, ", function ").concat(f.name, ": several function roles are used (").concat(roles.join(', '), ")"));
|
|
288
|
+
} else if (roles.length === 1) {
|
|
289
|
+
var vr = checkFunctions[roles[0]](f);
|
|
290
|
+
if (!vr.value) warnings.push("File ".concat(file, ", function ").concat(f.name, ":\n").concat(vr.message));
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
295
|
+
_loop();
|
|
296
|
+
}
|
|
297
|
+
} catch (err) {
|
|
298
|
+
_iterator4.e(err);
|
|
299
|
+
} finally {
|
|
300
|
+
_iterator4.f();
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
} catch (err) {
|
|
304
|
+
_iterator3.e(err);
|
|
305
|
+
} finally {
|
|
306
|
+
_iterator3.f();
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
return warnings;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
function getFuncMetadata(script) {
|
|
313
|
+
var funcData = [];
|
|
314
|
+
var headerTags = ['name', 'description', 'help-url', 'input', 'output', 'tags', 'sample', 'language', 'returns', 'test', 'sidebar', 'condition', 'top-menu', 'environment', 'require', 'editor-for', 'schedule', 'reference', 'editor'];
|
|
315
|
+
var paramRegex = new RegExp("//\\s*(".concat(headerTags.join('|'), "|meta\\.[^:]*): *(\\S+) ?(\\S+)?"));
|
|
316
|
+
var nameRegex = /(?:|static|export\s+function|export\s+async\s+function)\s+([a-zA-Z_][a-zA-Z0-9_$]*)\s*\((.*?)\).*/;
|
|
317
|
+
var isHeader = false;
|
|
318
|
+
var data = {
|
|
319
|
+
name: '',
|
|
320
|
+
inputs: [],
|
|
321
|
+
outputs: []
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
var _iterator5 = _createForOfIteratorHelper(script.split('\n')),
|
|
325
|
+
_step5;
|
|
326
|
+
|
|
327
|
+
try {
|
|
328
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
329
|
+
var line = _step5.value;
|
|
330
|
+
if (!line) continue;
|
|
331
|
+
var match = line.match(paramRegex);
|
|
332
|
+
|
|
333
|
+
if (match) {
|
|
334
|
+
if (!isHeader) isHeader = true;
|
|
335
|
+
var param = match[1];
|
|
336
|
+
if (param === 'name') data.name = match[2];else if (param === 'description') data.description = match[2];else if (param === 'input') data.inputs.push({
|
|
337
|
+
type: match[2]
|
|
338
|
+
});else if (param === 'output') data.outputs.push({
|
|
339
|
+
type: match[2]
|
|
340
|
+
});else if (param === 'tags') data.tags = match.input && match[3] ? match.input.split(':')[1].split(',').map(function (t) {
|
|
341
|
+
return t.trim();
|
|
342
|
+
}) : [match[2]];
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
if (isHeader) {
|
|
346
|
+
var nm = line.match(nameRegex);
|
|
347
|
+
|
|
348
|
+
if (nm && !line.match(paramRegex)) {
|
|
349
|
+
data.name = data.name || nm[1];
|
|
350
|
+
funcData.push(data);
|
|
351
|
+
data = {
|
|
352
|
+
name: '',
|
|
353
|
+
inputs: [],
|
|
354
|
+
outputs: []
|
|
355
|
+
};
|
|
356
|
+
isHeader = false;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
} catch (err) {
|
|
361
|
+
_iterator5.e(err);
|
|
362
|
+
} finally {
|
|
363
|
+
_iterator5.f();
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
return funcData;
|
|
367
|
+
}
|
package/bin/commands/help.js
CHANGED
|
@@ -4,16 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.help = void 0;
|
|
7
|
-
var HELP = "\nUsage: grok <command>\n\nDatagrok's package management tool\n\nCommands:\n add Add an object template\n api Create wrapper functions\n config Create and manage config files\n create Create a package\n publish Upload a package\n\nTo get help on a particular command, use:\n grok <command> --help\n\nRead more about the package development workflow:\nhttps://datagrok.ai/help/develop/develop\n";
|
|
7
|
+
var HELP = "\nUsage: grok <command>\n\nDatagrok's package management tool\n\nCommands:\n add Add an object template\n api Create wrapper functions\n check Check package content (function signatures, etc.)\n config Create and manage config files\n create Create a package\n publish Upload a package\n\nTo get help on a particular command, use:\n grok <command> --help\n\nRead more about the package development workflow:\nhttps://datagrok.ai/help/develop/develop\n";
|
|
8
8
|
var HELP_ADD = "\nUsage: grok add <entity> <name>\n\nAdd an object template to your package:\n\ngrok add app <name>\ngrok add connection <name>\ngrok add detector <semantic-type-name>\ngrok add function [tag] <name>\ngrok add query <name>\ngrok add script [tag] <language> <name>\ngrok add view <name>\ngrok add viewer <name>\ngrok add tests\n\nPlease note that entity names may only include letters and numbers\n\nSupported languages for scripts:\njavascript, julia, node, octave, python, r\n\nAvailable tags:\npanel, init\n";
|
|
9
9
|
var HELP_API = "\nUsage: grok api\n\nCreate wrapper functions for package scripts and queries\n";
|
|
10
10
|
var HELP_CONFIG = "\nUsage: grok config\n\nCreate or update a configuration file\n\nOptions:\n[--reset] [--server] [--alias] [--key]\n\n--reset Restore the default config file template\n--server Use to add a server to the config (`grok config add --alias alias --server url --key key`)\n--alias Use in conjunction with the `server` option to set the server name\n--key Use in conjunction with the `server` option to set the developer key\n--default Use in conjunction with the `server` option to set the added server as default\n";
|
|
11
11
|
var HELP_CREATE = "\nUsage: grok create [name]\n\nCreate a package:\n\ngrok create Create a package in the current working directory\ngrok create <name> Create a package in a folder with the specified name\n\nPlease note that the package name may only include letters, numbers, underscores, or hyphens\n\nOptions:\n[--eslint] [--ide] [--js|--ts] [--jest]\n\n--eslint Add a configuration for eslint\n--ide Add an IDE-specific configuration for debugging (vscode)\n--js Create a JavaScript package\n--ts Create a TypeScript package (default)\n--jest Add a configuration for jest\n";
|
|
12
12
|
var HELP_PUBLISH = "\nUsage: grok publish [host]\n\nUpload a package\n\nOptions:\n[--build|--rebuild] [--debug|--release] [--key] [--suffix]\n\nRunning `grok publish` is the same as running `grok publish defaultHost --build --debug`\n";
|
|
13
|
+
var HELP_CHECK = "\nUsage: grok check\n\nCheck package content (function signatures, import statements of external modules, etc.)\n";
|
|
13
14
|
var HELP_MIGRATE = "\nUsage: grok migrate\n\nSwitch to `grok` tools by copying your keys to the config\nfile and converting your scripts in the `package.json` file\n";
|
|
14
15
|
var help = {
|
|
15
16
|
add: HELP_ADD,
|
|
16
17
|
api: HELP_API,
|
|
18
|
+
check: HELP_CHECK,
|
|
17
19
|
config: HELP_CONFIG,
|
|
18
20
|
create: HELP_CREATE,
|
|
19
21
|
publish: HELP_PUBLISH,
|
package/bin/commands/publish.js
CHANGED
package/bin/grok.js
CHANGED
|
@@ -5,6 +5,7 @@ const help = require('./commands/help').help;
|
|
|
5
5
|
const commands = {
|
|
6
6
|
add: require('./commands/add').add,
|
|
7
7
|
api: require('./commands/api').api,
|
|
8
|
+
check: require('./commands/check').check,
|
|
8
9
|
config: require('./commands/config').config,
|
|
9
10
|
create: require('./commands/create').create,
|
|
10
11
|
publish: require('./commands/publish').publish,
|
|
@@ -75,7 +75,7 @@ export async function getBrowserPage(puppeteer: any): Promise<{browser: any, pag
|
|
|
75
75
|
}, token);
|
|
76
76
|
await page.goto(url);
|
|
77
77
|
try {
|
|
78
|
-
await page.waitForSelector('.grok-preloader', { timeout: 1800000 });
|
|
78
|
+
// await page.waitForSelector('.grok-preloader', { timeout: 1800000 });
|
|
79
79
|
await page.waitForFunction(() => document.querySelector('.grok-preloader') == null, {timeout: 3600000});
|
|
80
80
|
} catch (error) {
|
|
81
81
|
throw error;
|
package/package.json
CHANGED