datagrok-tools 4.14.53 → 4.14.54

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.
@@ -110,11 +110,13 @@ Uploads a package
110
110
  Checks for errors before publishing — the package won't be published if there are any.
111
111
 
112
112
  Options:
113
- [--build|--rebuild] [--debug|--release] [-k | --key] [--suffix] [--all] [--refresh] [--link]
113
+ [--all] [--refresh] [--link] [--build] [--release] [--skip-check]
114
114
 
115
- --all Publish all available packages
116
- --refresh Publish all available already loaded packages
117
- --link Link the package to local utils
115
+ --all Publish all available packages(run in packages directory)
116
+ --refresh Publish all available already loaded packages(run in packages directory)
117
+ --link Link the package to local packages
118
+ --build Builds the package
119
+ --release Publish package as release version
118
120
  --skip-check Skip check stage
119
121
 
120
122
  Running \`grok publish\` is the same as running \`grok publish defaultHost --build --debug\`
@@ -134,7 +136,7 @@ const HELP_TEST = `
134
136
  Usage: grok test
135
137
 
136
138
  Options:
137
- [--package] [--category] [--test] [--host] [--csv] [--gui] [--skip-build] [--skip-publish] [--link] [--catchUnhandled] [--report] [--record] [--verbose] [--platform] [--benchmark] [--stress-test] --[debug]
139
+ [--package] [--category] [--test] [--host] [--csv] [--gui] [--skip-build] [--skip-publish] [--link] [--catchUnhandled] [--report] [--record] [--verbose] [--platform] [--benchmark] [--stress-test] [--debug] [--all]
138
140
 
139
141
  --package Specify a package name to run tests for
140
142
  --category Specify a category name to run tests for
@@ -154,6 +156,7 @@ Options:
154
156
  --core Runs package & auto tests & core tests (core tests run only from DevTools package)
155
157
  --benchmark Runs tests in benchmark mode
156
158
  --stress-test Runs shuffled stress-test only
159
+ --all Runs tests for all available packages(run in packages directory)
157
160
 
158
161
  Run package tests
159
162
 
@@ -204,6 +207,7 @@ Options:
204
207
  --repo-only Links packages only from the current repository
205
208
  --unlink Unlinks packages and sets last versions instead of local path in package.json dependencies
206
209
  --verbose Prints detailed information about linked packages
210
+ --all Links all available packages(run in packages directory)
207
211
  `;
208
212
 
209
213
  // const HELP_MIGRATE = `
@@ -204,8 +204,7 @@ async function processPackage(debug, rebuild, host, devKey, packageName, suffix)
204
204
  return 0;
205
205
  }
206
206
  async function publish(args) {
207
- console.log('publish');
208
- if (args['skip-check'] && !args['all']) (0, _check.check)({
207
+ if (!args['skip-check'] && !args['all'] && !args['refresh']) (0, _check.check)({
209
208
  _: ['check']
210
209
  });
211
210
  config = _jsYaml.default.load(_fs.default.readFileSync(confPath, {
@@ -236,6 +235,7 @@ async function publish(args) {
236
235
  await (0, _testUtils.loadPackages)(curDir, packagesToLoad.join(' '), host, false, false, args.link, args.release);
237
236
  } else {
238
237
  if (args.link) {
238
+ console.log('Linking');
239
239
  await utils.runScript(`npm install`, curDir);
240
240
  await utils.runScript(`grok link`, curDir);
241
241
  await utils.runScript(`npm run build`, curDir);
@@ -245,15 +245,18 @@ async function publish(args) {
245
245
  }
246
246
  async function publishPackage(args) {
247
247
  const nArgs = args['_'].length;
248
- if (args.build || args.rebuild) {
249
- utils.runScript('npm install', curDir, false);
250
- utils.runScript('npm run build', curDir, false);
248
+ if (!args.link) {
249
+ if (args.build || args.rebuild) {
250
+ console.log('Building');
251
+ utils.runScript('npm install', curDir, false);
252
+ utils.runScript('npm run build', curDir, false);
253
+ }
251
254
  }
252
255
  if (args.debug && args.release) {
253
256
  color.error('Incompatible options: --debug and --release');
254
257
  return false;
255
258
  }
256
-
259
+ console.log('Publishing');
257
260
  // Create `config.yaml` if it doesn't exist yet
258
261
  if (!_fs.default.existsSync(grokDir)) _fs.default.mkdirSync(grokDir);
259
262
  if (!_fs.default.existsSync(confPath)) _fs.default.writeFileSync(confPath, _jsYaml.default.dump(confTemplate));
@@ -143,7 +143,7 @@ function getFuncAnnotation(data, comment = '//', sep = '\n') {
143
143
  isArray = true;
144
144
  }
145
145
  const annotationType = typesToAnnotation[type ?? ''];
146
- if (input?.options?.type) type = input?.options?.type;else if (annotationType) {
146
+ if (input?.options?.type || input?.options?.options?.type) type = input?.options?.type ?? input?.options?.options?.type;else if (annotationType) {
147
147
  if (isArray) type = `list<${annotationType}>`;else type = annotationType;
148
148
  } else type = 'dynamic';
149
149
  const options = input?.options?.options ? buildStringOfOptions(input.options ?? {}) : '';
@@ -184,13 +184,15 @@ function getFuncAnnotation(data, comment = '//', sep = '\n') {
184
184
  return s;
185
185
  }
186
186
  const inputOptionsNames = exports.inputOptionsNames = ['semType', 'category', 'optional', 'editor', 'nullable', 'separators', 'choices', 'format', 'min', 'max', 'caption', 'description', 'initialValue', 'viewer', 'units', 'type', 'optionsType', 'step', 'meta.url', 'metaUrl'];
187
+ const nonquotedValues = ['true', 'false'];
187
188
  function buildStringOfOptions(input) {
188
189
  const optionsInString = [];
189
190
  const opt = input.options ?? {};
190
191
  let defaultValue = '';
192
+ if (opt['initialValue'] && /[A-Za-z]/.test(opt['initialValue']) && !opt['initialValue'].includes('\'') && !opt['initialValue'].includes('"') && !nonquotedValues.includes(opt['initialValue'])) opt['initialValue'] = `'${opt['initialValue']}'`;
191
193
  if (opt['initialValue']) defaultValue = `= ${opt['initialValue']}`;
192
194
  for (const [key, value] of Object.entries(opt)) {
193
- if (key === 'initialValue') continue;
195
+ if (key === 'initialValue' || key === 'name' || key === 'type' && !input?.options?.key) continue;
194
196
  let val = value;
195
197
  let option = key;
196
198
  option = decoratorOptionToAnnotation.get(option) ?? option;
@@ -198,7 +200,7 @@ function buildStringOfOptions(input) {
198
200
  optionsInString.push(`${option}: ${val}`);
199
201
  }
200
202
  const optString = optionsInString.length > 0 ? `{ ${optionsInString.join('; ')} }` : '';
201
- return `${defaultValue} ${optString}`;
203
+ return defaultValue ? `${defaultValue} ${optString}` : `${optString}`;
202
204
  }
203
205
  const reservedDecorators = exports.reservedDecorators = {
204
206
  viewer: {
@@ -296,7 +296,6 @@ async function runAll(packagesDir, command, options, packagesToLoad = ['all']) {
296
296
  console.log(`${packagePath}: ${commandToRun} - Finished`);
297
297
  } catch (e) {
298
298
  console.log(`${packagePath}: ${commandToRun} - Error`);
299
- break;
300
299
  }
301
300
  }
302
301
  }
@@ -7,10 +7,10 @@
7
7
  "datagrok-api": "^1.26.0",
8
8
  "cash-dom": "^8.1.5",
9
9
  "dayjs": "^1.11.13",
10
- "@datagrok-libraries/utils": "^4.6.0"
10
+ "@datagrok-libraries/utils": "^4.6.5"
11
11
  },
12
12
  "devDependencies": {
13
- "datagrok-tools": "^4.14.48",
13
+ "datagrok-tools": "^4.14.53",
14
14
  "webpack": "^5.95.0",
15
15
  "webpack-cli": "^5.1.4"
16
16
  },
@@ -2,6 +2,7 @@
2
2
  import * as grok from 'datagrok-api/grok';
3
3
  import * as ui from 'datagrok-api/ui';
4
4
  import * as DG from 'datagrok-api/dg';
5
+ export * from './package.g';
5
6
 
6
7
  export const _package = new DG.Package();
7
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "4.14.53",
3
+ "version": "4.14.54",
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": {