datagrok-tools 4.14.17 → 4.14.18

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.
@@ -43,7 +43,7 @@ function generateQueryWrappers() {
43
43
  const name = utils.getScriptName(q, utils.commentMap[utils.queryExtension]);
44
44
  if (!name) continue;
45
45
  checkNameColision(name);
46
- const tb = new utils.TemplateBuilder(utils.queryWrapperTemplate).replace('FUNC_NAME', name).replace('FUNC_NAME_LOWERCASE', name).replace('PACKAGE_NAMESPACE', _package?.name ?? '');
46
+ const tb = new utils.TemplateBuilder(utils.queryWrapperTemplate).replace('FUNC_NAME', name).replace('FUNC_NAME_LOWERCASE', name).replace('PACKAGE_NAMESPACE', _package?.friendlyName ?? '');
47
47
  const description = utils.getScriptDescription(q, utils.commentMap[utils.queryExtension]);
48
48
  const inputs = utils.getScriptInputs(q, utils.commentMap[utils.queryExtension]);
49
49
  const outputType = utils.getScriptOutputType(q, utils.commentMap[utils.queryExtension]);
@@ -78,7 +78,7 @@ function generateScriptWrappers() {
78
78
  if (!name) continue;
79
79
  const description = utils.getScriptDescription(script);
80
80
  checkNameColision(name);
81
- const tb = new utils.TemplateBuilder(utils.scriptWrapperTemplate).replace('FUNC_NAME', name).replace('FUNC_NAME_LOWERCASE', name).replace('PACKAGE_NAMESPACE', _package.name);
81
+ const tb = new utils.TemplateBuilder(utils.scriptWrapperTemplate).replace('FUNC_NAME', name).replace('FUNC_NAME_LOWERCASE', name).replace('PACKAGE_NAMESPACE', _package?.friendlyName ?? '');
82
82
  const inputs = utils.getScriptInputs(script);
83
83
  const outputType = utils.getScriptOutputType(script);
84
84
  tb.replace('PARAMS_OBJECT', inputs).replace('TYPED_PARAMS', inputs).replace('FUNC_DESCRIPTION', description).replace('OUTPUT_TYPE', outputType);
@@ -111,7 +111,7 @@ function generateFunctionWrappers() {
111
111
  outputType = utils.dgToTsTypeMap[outputAnnotation[1]] ?? 'any';
112
112
  }
113
113
  checkNameColision(name);
114
- const tb = new utils.TemplateBuilder(utils.scriptWrapperTemplate).replace('FUNC_NAME', name).replace('FUNC_NAME_LOWERCASE', name).replace('PACKAGE_NAMESPACE', _package?.name ?? '').replace('PARAMS_OBJECT', annotationInputs).replace('FUNC_DESCRIPTION', description).replace('TYPED_PARAMS', annotationInputs).replace('OUTPUT_TYPE', outputType);
114
+ const tb = new utils.TemplateBuilder(utils.scriptWrapperTemplate).replace('FUNC_NAME', name).replace('FUNC_NAME_LOWERCASE', name).replace('PACKAGE_NAMESPACE', _package?.friendlyName ?? '').replace('PARAMS_OBJECT', annotationInputs).replace('FUNC_DESCRIPTION', description).replace('TYPED_PARAMS', annotationInputs).replace('OUTPUT_TYPE', outputType);
115
115
  wrappers.push(tb.build(1));
116
116
  }
117
117
  }
@@ -138,6 +138,7 @@ function api(args) {
138
138
  _package = JSON.parse(_fs.default.readFileSync(packagePath, {
139
139
  encoding: 'utf-8'
140
140
  }));
141
+ if (_package.friendlyName) _package.friendlyName = _package.friendlyName.replaceAll(' ', '');
141
142
  const nOptions = Object.keys(args).length - 1;
142
143
  if (args['_'].length !== 1 || nOptions > 0) return false;
143
144
  if (!utils.isPackageDir(process.cwd())) {
@@ -106,7 +106,8 @@ Options:
106
106
  const HELP_PUBLISH = `
107
107
  Usage: grok publish [host]
108
108
 
109
- Upload a package
109
+ Uploads a package
110
+ Checks for errors before publishing — the package won't be published if there are any.
110
111
 
111
112
  Options:
112
113
  [--build|--rebuild] [--debug|--release] [-k | --key] [--suffix] [--all] [--refresh] [--link]
@@ -114,6 +115,7 @@ Options:
114
115
  --all Publish all available packages
115
116
  --refresh Publish all available already loaded packages
116
117
  --link Link the package to local utils
118
+ --skip-check Skip check stage
117
119
 
118
120
  Running \`grok publish\` is the same as running \`grok publish defaultHost --build --debug\`
119
121
  `;
@@ -124,6 +126,7 @@ Options:
124
126
  [-r | --recursive]
125
127
 
126
128
  --recursive Check all packages in the current directory
129
+ --soft Even if an error occurs, it doesn't throw an exception
127
130
 
128
131
  Check package content (function signatures, import statements of external modules, etc.)
129
132
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "4.14.17",
3
+ "version": "4.14.18",
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": {