datagrok-tools 4.12.25 → 4.12.27

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.
@@ -253,11 +253,11 @@ function checkFuncSignatures(packagePath, files) {
253
253
  tags = _ref5.tags;
254
254
  var value = true;
255
255
  var message = '';
256
- if (tags == null || tags.filter(function (t) {
257
- return t.startsWith('fileViewer');
258
- }).length < 2) {
256
+
257
+ // TODO: GROK-15398: Fix file viewer check in grok check
258
+ if (tags == null || tags.length !== 1 || tags[0] !== 'fileViewer') {
259
259
  value = false;
260
- message += 'File viewers must have at least two special tags: "fileViewer" and "fileViewer-<extension>"\n';
260
+ message += 'File viewers must have only one tag: "fileViewer"\n';
261
261
  }
262
262
  if (inputs.length !== 1 || inputs[0].type !== 'file') {
263
263
  value = false;
@@ -140,31 +140,38 @@ function test(args) {
140
140
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
141
141
  return testUtils.runWithTimeout(timeout, /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
142
142
  var _process$env$TARGET_P;
143
- var consoleLog, targetPackage, r;
143
+ var consoleLogOutputDir, addLogsToFile, targetPackage, r;
144
144
  return _regenerator["default"].wrap(function _callee2$(_context2) {
145
145
  while (1) switch (_context2.prev = _context2.next) {
146
146
  case 0:
147
- consoleLog = '';
147
+ addLogsToFile = function _addLogsToFile(msg) {
148
+ _fs["default"].appendFileSync(consoleLogOutputDir, "".concat(msg));
149
+ };
150
+ consoleLogOutputDir = './test-console-output.log';
151
+ _context2.next = 4;
152
+ return page.exposeFunction("addLogsToFile", addLogsToFile);
153
+ case 4:
148
154
  if (!options.record) {
149
- _context2.next = 7;
155
+ _context2.next = 11;
150
156
  break;
151
157
  }
152
- _context2.next = 4;
158
+ _fs["default"].writeFileSync(consoleLogOutputDir, "");
159
+ _context2.next = 8;
153
160
  return recorder.start('./test-record.mp4');
154
- case 4:
161
+ case 8:
155
162
  page.on('console', function (msg) {
156
- return consoleLog += "CONSOLE LOG ENTRY: ".concat(msg.text(), "\n");
163
+ addLogsToFile("CONSOLE LOG ENTRY: ".concat(msg.text(), "\n"));
157
164
  });
158
165
  page.on('pageerror', function (error) {
159
- consoleLog += "CONSOLE LOG ERROR: ".concat(error.message, "\n");
166
+ addLogsToFile("CONSOLE LOG ERROR: ".concat(error.message, "\n"));
160
167
  });
161
168
  page.on('response', function (response) {
162
- consoleLog += "CONSOLE LOG REQUEST: ".concat(response.status(), ", ").concat(response.url(), "\n");
169
+ addLogsToFile("CONSOLE LOG REQUEST: ".concat(response.status(), ", ").concat(response.url(), "\n"));
163
170
  });
164
- case 7:
171
+ case 11:
165
172
  targetPackage = (_process$env$TARGET_P = process.env.TARGET_PACKAGE) !== null && _process$env$TARGET_P !== void 0 ? _process$env$TARGET_P : '#{PACKAGE_NAMESPACE}';
166
173
  console.log("Testing ".concat(targetPackage, " package...\n"));
167
- _context2.next = 11;
174
+ _context2.next = 15;
168
175
  return page.evaluate(function (targetPackage, options, testContext) {
169
176
  if (options.benchmark) window.DG.Test.isInBenchmark = true;
170
177
  return new Promise(function (resolve, reject) {
@@ -191,7 +198,7 @@ function test(args) {
191
198
  };
192
199
  if (df == null) {
193
200
  failed = true;
194
- failReport = "Fail reason: No package tests found".concat(options.path ? " for path \"".concat(options.path, "\"") : '');
201
+ failReport = "Fail reason: No package tests found".concat(options.path ? ' for path "' + options.path + '"' : '');
195
202
  resolve({
196
203
  failReport: failReport,
197
204
  skipReport: skipReport,
@@ -234,34 +241,33 @@ function test(args) {
234
241
  countReport: countReport
235
242
  });
236
243
  })["catch"](function (e) {
237
- var stack = window.DG.Logger.translateStackTrace(e.stack);
238
- resolve({
239
- failReport: "".concat(e.message, "\n").concat(stack),
240
- skipReport: '',
241
- passReport: '',
242
- failed: true,
243
- csv: '',
244
- countReport: {
245
- skip: 0,
246
- pass: 0
247
- }
244
+ var stack = window.DG.Logger.translateStackTrace(e.stack).then(function () {
245
+ resolve({
246
+ failReport: "".concat(e.message, "\n").concat(stack),
247
+ skipReport: '',
248
+ passReport: '',
249
+ failed: true,
250
+ csv: '',
251
+ countReport: {
252
+ skip: 0,
253
+ pass: 0
254
+ }
255
+ });
248
256
  });
249
257
  });
250
258
  });
251
259
  }, targetPackage, options, new testUtils.TestContext(options.catchUnhandled, options.report));
252
- case 11:
260
+ case 15:
253
261
  r = _context2.sent;
254
262
  if (!options.record) {
255
- _context2.next = 16;
263
+ _context2.next = 19;
256
264
  break;
257
265
  }
258
- _context2.next = 15;
266
+ _context2.next = 19;
259
267
  return recorder.stop();
260
- case 15:
261
- _fs["default"].writeFileSync('./test-console-output.log', consoleLog);
262
- case 16:
268
+ case 19:
263
269
  return _context2.abrupt("return", r);
264
- case 17:
270
+ case 20:
265
271
  case "end":
266
272
  return _context2.stop();
267
273
  }
@@ -3,6 +3,9 @@ const FuncGeneratorPlugin = require('datagrok-tools/plugins/func-gen-plugin');
3
3
  const packageName = path.parse(require('./package.json').name).name.toLowerCase().replace(/-/g, '');
4
4
 
5
5
  module.exports = {
6
+ cache: {
7
+ type: 'filesystem',
8
+ },
6
9
  mode: 'development',
7
10
  entry: {
8
11
  test: {filename: 'package-test.js', library: {type: 'var', name: `${packageName}_test`}, import: './src/package-test.ts'},
@@ -13,7 +16,7 @@ module.exports = {
13
16
  },
14
17
  module: {
15
18
  rules: [
16
- {test: /\.tsx?$/, loader: 'ts-loader'},
19
+ {test: /\.tsx?$/, loader: 'ts-loader', options: {allowTsInNodeModules: true}},
17
20
  ],
18
21
  },
19
22
  plugins: [
@@ -65,7 +65,7 @@
65
65
  "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
66
66
 
67
67
  /* Advanced Options */
68
- "skipLibCheck": false, /* Skip type checking of declaration files. */
68
+ "skipLibCheck": true, /* Skip type checking of declaration files. */
69
69
  "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
70
70
  }
71
71
  }
@@ -2,7 +2,10 @@ const path = require('path');
2
2
  const packageName = path.parse(require('./package.json').name).name.toLowerCase().replace(/-/g, '');
3
3
 
4
4
  module.exports = {
5
- mode: 'development',
5
+ cache: {
6
+ type: 'filesystem',
7
+ },
8
+ mode: 'production',
6
9
  entry: {
7
10
  package: './src/package.js',
8
11
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "4.12.25",
3
+ "version": "4.12.27",
4
4
  "description": "Utility to upload and publish packages to Datagrok",
5
5
  "homepage": "https://github.com/datagrok-ai/public/tree/master/tools#readme",
6
6
  "dependencies": {