datagrok-tools 4.14.9 → 4.14.10
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/CHANGELOG.md +7 -0
- package/bin/commands/check.js +11 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/bin/commands/check.js
CHANGED
|
@@ -64,7 +64,9 @@ function runChecks(packagePath, soft = false) {
|
|
|
64
64
|
errors.push(...checkSourceMap(packagePath));
|
|
65
65
|
errors.push(...checkNpmIgnore(packagePath));
|
|
66
66
|
warnings.push(...checkScriptNames(packagePath));
|
|
67
|
-
|
|
67
|
+
const [signatureWarnings, signatureErrors] = checkFuncSignatures(packagePath, jsTsFiles);
|
|
68
|
+
warnings.push(...signatureWarnings);
|
|
69
|
+
errors.push(...signatureErrors);
|
|
68
70
|
errors.push(...checkPackageFile(packagePath, json, {
|
|
69
71
|
isWebpack,
|
|
70
72
|
externals,
|
|
@@ -145,6 +147,7 @@ function checkImportStatements(packagePath, files, externals) {
|
|
|
145
147
|
}
|
|
146
148
|
function checkFuncSignatures(packagePath, files) {
|
|
147
149
|
const warnings = [];
|
|
150
|
+
const errors = [];
|
|
148
151
|
const checkFunctions = {
|
|
149
152
|
app: ({
|
|
150
153
|
name
|
|
@@ -317,19 +320,19 @@ function checkFuncSignatures(packagePath, files) {
|
|
|
317
320
|
}
|
|
318
321
|
}
|
|
319
322
|
let wrongInputNames = f.inputs.filter(e => forbiddenNames.includes(e?.name ?? ''));
|
|
320
|
-
if (f.name) {
|
|
323
|
+
if (f.name && f.name !== 'postprocess') {
|
|
321
324
|
if (namesInFiles.has(f.name)) namesInFiles.get(f.name)?.push(file);else namesInFiles.set(f.name, [file]);
|
|
322
325
|
}
|
|
323
|
-
if (wrongInputNames.length > 0)
|
|
324
|
-
if (f.isInvalidateOnWithoutCache)
|
|
325
|
-
if (f.cache) if (!utils.cacheValues.includes(f.cache))
|
|
326
|
-
if (f.invalidateOn) if (!utils.isValidCron(f.invalidateOn))
|
|
326
|
+
if (wrongInputNames.length > 0) errors.push(`File ${file}, function ${f.name}: Wrong input names: (${wrongInputNames.map(e => e.name).join(', ')})`);
|
|
327
|
+
if (f.isInvalidateOnWithoutCache) errors.push(`File ${file}, function ${f.name}: Can't use invalidateOn without cache, please follow this example: 'meta.cache.invalidateOn'`);
|
|
328
|
+
if (f.cache) if (!utils.cacheValues.includes(f.cache)) errors.push(`File ${file}, function ${f.name}: unsupposed variable for cache : ${f.cache}`);
|
|
329
|
+
if (f.invalidateOn) if (!utils.isValidCron(f.invalidateOn)) errors.push(`File ${file}, function ${f.name}: unsupposed variable for invalidateOn : ${f.invalidateOn}`);
|
|
327
330
|
}
|
|
328
331
|
}
|
|
329
332
|
for (const [name, files] of namesInFiles) {
|
|
330
|
-
if (files.length > 1)
|
|
333
|
+
if (files.length > 1) errors.push(`Duplicate names ('${name}'): \n ${files.join('\n ')}`);
|
|
331
334
|
}
|
|
332
|
-
return warnings;
|
|
335
|
+
return [warnings, errors];
|
|
333
336
|
}
|
|
334
337
|
const sharedLibExternals = {
|
|
335
338
|
'common/html2canvas.min.js': {
|
package/package.json
CHANGED