datagrok-tools 6.7.0 → 6.7.1

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.
@@ -30,11 +30,21 @@ while (_path.default.dirname(dirStep) !== dirStep) {
30
30
  }
31
31
  dirStep = _path.default.dirname(dirStep);
32
32
  }
33
+ function isPnpmWorkspace(dir) {
34
+ for (let d = _path.default.resolve(dir);; d = _path.default.dirname(d)) {
35
+ if (_fs.default.existsSync(_path.default.join(d, 'pnpm-workspace.yaml'))) return true;
36
+ if (_path.default.dirname(d) === d) return false;
37
+ }
38
+ }
33
39
  let verbose = false;
34
40
  let pathMode = false;
35
41
  let devMode = false;
36
42
  let unlink = false;
37
43
  async function link(args) {
44
+ if (isPnpmWorkspace(curDir)) {
45
+ console.log('This checkout is a pnpm workspace: in-repo dependencies are linked by `pnpm install` ' + '(workspace:^), and `grok link` is not needed. Run `pnpm install` at the repository root.');
46
+ return true;
47
+ }
38
48
  verbose = args.verbose ?? false;
39
49
  devMode = args.dev ?? false;
40
50
  pathMode = args.path ?? false;
@@ -526,7 +526,10 @@ async function processPackage(debug, rebuild, host, devKey, packageName, dropDb,
526
526
  includeEmpty: false,
527
527
  follow: true
528
528
  });
529
- const isWebpack = _fs.default.existsSync('webpack.config.js');
529
+
530
+ // A bundled package ships dist/package.js: built by webpack (legacy) or by `grok build`
531
+ // (rspack via @datagrok/build-config, which needs no config file at all).
532
+ const isWebpack = _fs.default.existsSync('webpack.config.js') || _fs.default.existsSync('rspack.config.js') || _fs.default.existsSync('dist/package.js') || _fs.default.existsSync(_path.default.join(curDir, 'src', 'package.ts'));
530
533
  if (!rebuild && isWebpack) {
531
534
  if (_fs.default.existsSync('dist/package.js')) {
532
535
  const distFiles = await (0, _ignoreWalk.default)({
@@ -550,12 +553,6 @@ async function processPackage(debug, rebuild, host, devKey, packageName, dropDb,
550
553
  const json = JSON.parse(_fs.default.readFileSync(packageFilePath, {
551
554
  encoding: 'utf-8'
552
555
  }));
553
- if (isWebpack) {
554
- const webpackConfigPath = _path.default.join(curDir, 'webpack.config.js');
555
- const content = _fs.default.readFileSync(webpackConfigPath, {
556
- encoding: 'utf-8'
557
- });
558
- }
559
556
  const funcFiles = jsTsFiles.filter(f => packageFiles.includes(f));
560
557
  color.log(`Checks finished in ${Date.now() - checkStart} ms`);
561
558
  const reg = new RegExp(/\${(\w*)}/g);
@@ -692,12 +689,14 @@ async function publish(args) {
692
689
  }
693
690
  async function publishPackage(args) {
694
691
  const nArgs = args['_'].length;
695
- if (!args.link) {
696
- if (args.build || args.rebuild) {
697
- color.log('Building');
698
- await utils.runScript('npm install', curDir, false);
699
- await utils.runScript('npm run build', curDir, false);
700
- }
692
+
693
+ // A bundled package is built locally before upload unless --skip-build. Inside the pnpm
694
+ // workspace the install already happened at the root; standalone packages install first.
695
+ if (!args.link && !args['skip-build'] && !args.rebuild && _fs.default.existsSync(_path.default.join(curDir, 'src'))) {
696
+ color.log('Building');
697
+ const workspace = utils.isPnpmWorkspace(curDir);
698
+ if (!workspace && !_fs.default.existsSync(_path.default.join(curDir, 'node_modules'))) await utils.runScript('npm install', curDir, false);
699
+ await utils.runScript(workspace ? 'pnpm run build' : 'npm run build', curDir, false);
701
700
  }
702
701
  if (args.debug && args.release) {
703
702
  color.error('Incompatible options: --debug and --release');
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.setup = setup;
8
+ var _fs = _interopRequireDefault(require("fs"));
9
+ var _path = _interopRequireDefault(require("path"));
10
+ var _child_process = require("child_process");
11
+ var color = _interopRequireWildcard(require("../utils/color-utils"));
12
+ var _build = require("./build");
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
14
+ /**
15
+ * `grok setup`: one command to get (or keep) a public/ checkout ready to build.
16
+ * 1. Node 20+ (22 recommended); pnpm through corepack, at the version package.json pins.
17
+ * 2. Removes per-package node_modules left by the npm era and stray package-lock.json files.
18
+ * 3. `pnpm install` at the workspace root.
19
+ * 4. Reports a global `grok` older than the workspace one (`--global` updates it).
20
+ * `--check` only reports.
21
+ */
22
+ async function setup(args) {
23
+ const root = (0, _build.findWorkspaceRoot)(process.cwd());
24
+ if (!root) {
25
+ color.error('Not inside the public/ workspace (no pnpm-workspace.yaml above the current directory).');
26
+ return false;
27
+ }
28
+ const check = !!args.check;
29
+ const rootPkg = JSON.parse(_fs.default.readFileSync(_path.default.join(root, 'package.json'), 'utf8'));
30
+ const pinnedPnpm = (rootPkg.packageManager || 'pnpm@10').split('@')[1];
31
+ let ok = true;
32
+
33
+ // 1. Node and pnpm
34
+ const nodeMajor = parseInt(process.versions.node.split('.')[0], 10);
35
+ if (nodeMajor < 20) {
36
+ color.error(`Node ${process.versions.node}: 20 or later is required (22 recommended).`);
37
+ return false;
38
+ }
39
+ color.info(`Node ${process.versions.node}`);
40
+ let pnpmVersion = run('pnpm', ['--version']);
41
+ if (pnpmVersion !== pinnedPnpm) {
42
+ color.warn(`pnpm ${pnpmVersion || 'not found'}; the workspace pins ${pinnedPnpm}.`);
43
+ if (!check) {
44
+ if (run('corepack', ['--version']) === null) color.warn('corepack not found: `npm install -g corepack`, then rerun `grok setup`.');else {
45
+ (0, _child_process.spawnSync)('corepack', ['enable'], {
46
+ stdio: 'inherit',
47
+ shell: true
48
+ });
49
+ (0, _child_process.spawnSync)('corepack', ['prepare', `pnpm@${pinnedPnpm}`, '--activate'], {
50
+ stdio: 'inherit',
51
+ shell: true
52
+ });
53
+ pnpmVersion = run('pnpm', ['--version']);
54
+ }
55
+ }
56
+ }
57
+ if (pnpmVersion === pinnedPnpm) color.info(`pnpm ${pnpmVersion}`);else ok = false;
58
+
59
+ // 2. leftovers from the npm era
60
+ const projectDirs = ['js-api', 'tools', 'build-config'].map(d => _path.default.join(root, d));
61
+ for (const group of ['packages', 'libraries']) for (const d of _fs.default.readdirSync(_path.default.join(root, group))) projectDirs.push(_path.default.join(root, group, d));
62
+ const staleModules = projectDirs.filter(d => isLegacyNodeModules(_path.default.join(d, 'node_modules')));
63
+ const staleLocks = projectDirs.map(d => _path.default.join(d, 'package-lock.json')).filter(f => _fs.default.existsSync(f));
64
+ if (staleModules.length || staleLocks.length) {
65
+ color.warn(`${staleModules.length} per-package node_modules from npm and ${staleLocks.length} package-lock.json file(s)` + (check ? ' would be removed' : ': removing'));
66
+ if (!check) {
67
+ for (const d of staleModules) _fs.default.rmSync(_path.default.join(d, 'node_modules'), {
68
+ recursive: true,
69
+ force: true
70
+ });
71
+ for (const f of staleLocks) _fs.default.rmSync(f, {
72
+ force: true
73
+ });
74
+ }
75
+ } else color.info('no npm-era leftovers');
76
+
77
+ // 3. install
78
+ if (!check && pnpmVersion === pinnedPnpm) {
79
+ color.log('pnpm install ...');
80
+ const r = (0, _child_process.spawnSync)('pnpm', ['install', '--frozen-lockfile'], {
81
+ stdio: 'inherit',
82
+ cwd: root,
83
+ shell: true
84
+ });
85
+ if (r.status !== 0) {
86
+ color.warn('frozen install failed (lockfile out of date?): retrying without --frozen-lockfile');
87
+ if ((0, _child_process.spawnSync)('pnpm', ['install'], {
88
+ stdio: 'inherit',
89
+ cwd: root,
90
+ shell: true
91
+ }).status !== 0) {
92
+ color.error('pnpm install failed');
93
+ return false;
94
+ }
95
+ }
96
+ }
97
+
98
+ // 4. the global grok
99
+ const workspaceGrok = JSON.parse(_fs.default.readFileSync(_path.default.join(root, 'tools', 'package.json'), 'utf8')).version;
100
+ // datagrok-tools before 6.6 has no --version and prints its usage instead
101
+ const raw = run('grok', ['--version']);
102
+ const globalGrok = raw === null ? null : /^\d+\.\d+\.\d+/.test(raw) ? raw : 'older than 6.6';
103
+ if (globalGrok && globalGrok !== workspaceGrok) {
104
+ color.warn(`global grok ${globalGrok}; the workspace has ${workspaceGrok}` + (args.global && !check ? ': updating' : ' (run `npm install -g datagrok-tools@' + workspaceGrok + '`, or `grok setup --global`)'));
105
+ if (args.global && !check) (0, _child_process.spawnSync)('npm', ['install', '-g', `datagrok-tools@${workspaceGrok}`], {
106
+ stdio: 'inherit',
107
+ shell: true
108
+ });
109
+ } else if (globalGrok) color.info(`grok ${globalGrok}`);
110
+ if (ok && !check) color.success('Ready: `grok build` in any package, `grok build --all` for everything.');
111
+ return ok;
112
+ }
113
+
114
+ /** npm's node_modules holds real directories; pnpm's per-package one holds only symlinks (and .bin). */
115
+ function isLegacyNodeModules(dir) {
116
+ if (!_fs.default.existsSync(dir)) return false;
117
+ for (const e of _fs.default.readdirSync(dir, {
118
+ withFileTypes: true
119
+ })) {
120
+ if (e.name === '.bin' || e.name === '.cache' || e.name.startsWith('.')) continue;
121
+ const p = _path.default.join(dir, e.name);
122
+ if (e.isSymbolicLink()) continue;
123
+ if (e.isDirectory() && e.name.startsWith('@')) {
124
+ if (_fs.default.readdirSync(p, {
125
+ withFileTypes: true
126
+ }).some(s => s.isDirectory() && !s.isSymbolicLink())) return true;
127
+ continue;
128
+ }
129
+ if (e.isDirectory()) return true;
130
+ }
131
+ return false;
132
+ }
133
+ function run(cmd, args) {
134
+ const r = (0, _child_process.spawnSync)(cmd, args, {
135
+ encoding: 'utf8',
136
+ shell: true
137
+ });
138
+ return r.status === 0 ? r.stdout.trim().split(/\r?\n/).pop() || '' : null;
139
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.tsc = tsc;
7
+ var _child_process = require("child_process");
8
+ var _toolchain = require("../utils/toolchain");
9
+ /**
10
+ * `grok tsc ...` runs the workspace TypeScript compiler (the one `@datagrok/build-config` pins) with the
11
+ * given arguments, so package scripts never depend on a locally installed `tsc`. After an emitting run
12
+ * in a library, the assets its sources import are mirrored into dist/.
13
+ */
14
+ async function tsc(args) {
15
+ const cwd = process.cwd();
16
+ const extra = process.argv.slice(process.argv.indexOf('tsc') + 1);
17
+ const emitting = !extra.includes('--noEmit');
18
+ if (emitting) (0, _toolchain.ensureLibraryExports)(cwd);
19
+ const r = (0, _child_process.spawnSync)(process.execPath, [(0, _toolchain.toolchain)(cwd).tsc, ...extra], {
20
+ stdio: 'inherit',
21
+ cwd
22
+ });
23
+ if (r.status !== 0) return false;
24
+ if (emitting) (0, _toolchain.copyLibraryAssets)(cwd);
25
+ return true;
26
+ }
package/bin/grok.js CHANGED
@@ -9,32 +9,45 @@ const argv = require('minimist')(process.argv.slice(2), {
9
9
  // test.ts / playwright-runner.ts never fired and `--no-retry` was silently ignored
10
10
  // (Playwright kept retrying failed specs). Normalize back to the flag the commands read.
11
11
  if (argv.retry === false) argv['no-retry'] = true;
12
- const help = require('./commands/help').help;
12
+ // The help texts are a large module; load them only when one is printed.
13
+ let _help;
14
+ const help = new Proxy({}, {get: (_, key) => (_help ??= require('./commands/help').help)[key]});
13
15
  const runAllCommand = require('./utils/utils').runAll;
14
16
 
17
+ // Each command module is loaded only when invoked: loading all of them (puppeteer, ts-morph,
18
+ // archiver, inquirer) used to cost ~6 s of start-up on every `grok api` / `grok check`.
19
+ const lazy = (file, name) => (args) => require(`./commands/${file}`)[name](args);
15
20
  const commands = {
16
- add: require('./commands/add').add,
17
- api: require('./commands/api').api,
18
- build: require('./commands/build').build,
19
- check: require('./commands/check').check,
20
- claude: require('./commands/claude').claude,
21
- config: require('./commands/config').config,
22
- create: require('./commands/create').create,
23
- 'docker-gen': require('./commands/docker-gen').dockerGen,
24
- init: require('./commands/init').init,
25
- link: require('./commands/link').link,
26
- login: require('./commands/login').login,
27
- publish: require('./commands/publish').publish,
28
- report: require('./commands/report').report,
29
- run: require('./commands/run').run,
30
- test: require('./commands/test').test,
31
- testall: require('./commands/test-all').testAll,
32
- stresstest: require('./commands/stress-tests').stressTests,
33
- migrate: require('./commands/migrate').migrate,
34
- server: require('./commands/server').server,
35
- s: require('./commands/server').server,
21
+ add: lazy('add', 'add'),
22
+ api: lazy('api', 'api'),
23
+ build: lazy('build', 'build'),
24
+ check: lazy('check', 'check'),
25
+ claude: lazy('claude', 'claude'),
26
+ config: lazy('config', 'config'),
27
+ create: lazy('create', 'create'),
28
+ 'docker-gen': lazy('docker-gen', 'dockerGen'),
29
+ init: lazy('init', 'init'),
30
+ link: lazy('link', 'link'),
31
+ login: lazy('login', 'login'),
32
+ publish: lazy('publish', 'publish'),
33
+ report: lazy('report', 'report'),
34
+ run: lazy('run', 'run'),
35
+ test: lazy('test', 'test'),
36
+ tsc: lazy('tsc', 'tsc'),
37
+ testall: lazy('test-all', 'testAll'),
38
+ stresstest: lazy('stress-tests', 'stressTests'),
39
+ migrate: lazy('migrate', 'migrate'),
40
+ server: lazy('server', 'server'),
41
+ s: lazy('server', 'server'),
42
+ setup: lazy('setup', 'setup'),
36
43
  };
37
44
 
45
+ // `--version` is a string option (grok publish --version 1.10), so a bare `grok --version` parses as ''.
46
+ if (argv._.length === 0 && ('version' in argv && argv.version === '' || argv.v === true)) {
47
+ console.log(require('../package.json').version);
48
+ process.exit(0);
49
+ }
50
+
38
51
  const onPackageCommandNames = ['api', 'check', 'link', 'publish', 'test'];
39
52
 
40
53
  // A machine-readable run prints its error as JSON on stderr (server.ts) and nothing else:
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.copyLibraryAssets = copyLibraryAssets;
8
+ exports.ensureLibraryExports = ensureLibraryExports;
9
+ exports.toolchain = toolchain;
10
+ var _fs = _interopRequireDefault(require("fs"));
11
+ var _path = _interopRequireDefault(require("path"));
12
+ /**
13
+ * The shared toolchain (`@datagrok/build-config`: rspack factory, TypeScript) as seen from `dir`:
14
+ * the workspace root's copy inside public/, the package's own devDependency in a standalone package.
15
+ */
16
+ function toolchain(dir) {
17
+ let pkgJson;
18
+ try {
19
+ pkgJson = require.resolve('@datagrok/build-config/package.json', {
20
+ paths: [dir]
21
+ });
22
+ } catch {
23
+ throw new Error('@datagrok/build-config is not installed: run `pnpm install` at the root of public/, ' + 'or add it as a devDependency of a standalone package');
24
+ }
25
+ const buildConfigDir = _path.default.dirname(pkgJson);
26
+ const tsPkg = require.resolve('typescript/package.json', {
27
+ paths: [buildConfigDir]
28
+ });
29
+ return {
30
+ buildConfig: require(buildConfigDir),
31
+ buildConfigDir,
32
+ tsc: _path.default.join(_path.default.dirname(tsPkg), 'bin', 'tsc')
33
+ };
34
+ }
35
+ const ASSET = /\.(css|scss|wasm|js|mjs|cjs|json|png|jpe?g|gif|svg|txt|csv|md|html|sdf|mol)$/i;
36
+
37
+ /**
38
+ * A library's dist/ must be self-contained: the css, wasm, json and plain-js files its sources
39
+ * import relative to themselves are mirrored next to the compiled output. A .js next to a .ts of
40
+ * the same name is a stale in-place compile, not an asset.
41
+ */
42
+ function copyLibraryAssets(dir) {
43
+ if (!_fs.default.existsSync(_path.default.join(dir, 'dist'))) return 0;
44
+ let n = 0;
45
+ const walk = rel => {
46
+ for (const e of _fs.default.readdirSync(_path.default.join(dir, rel), {
47
+ withFileTypes: true
48
+ })) {
49
+ if (e.name === 'node_modules' || e.name === 'dist' || e.name.startsWith('.')) continue;
50
+ const r = rel ? `${rel}/${e.name}` : e.name;
51
+ if (e.isDirectory()) walk(r);else if (rel && ASSET.test(e.name) && e.name !== 'package.json' && !isCompiledSibling(dir, r)) {
52
+ const to = _path.default.join(dir, 'dist', r);
53
+ _fs.default.mkdirSync(_path.default.dirname(to), {
54
+ recursive: true
55
+ });
56
+ const from = _path.default.join(dir, r);
57
+ if (!_fs.default.existsSync(to) || _fs.default.statSync(to).mtimeMs < _fs.default.statSync(from).mtimeMs) {
58
+ _fs.default.copyFileSync(from, to);
59
+ n++;
60
+ }
61
+ }
62
+ }
63
+ };
64
+ walk('');
65
+ if (n) console.log(`copied ${n} asset file(s) into dist/`);
66
+ return n;
67
+ }
68
+
69
+ /**
70
+ * Keeps a library's package.json `exports` in step with its source tree. A library that ships dist/
71
+ * has an `exports` map ending in the `./*` wildcard; the wildcard cannot resolve a directory import
72
+ * (`@datagrok-libraries/bio/src/trees`), so every directory with an index.ts needs an explicit entry.
73
+ * Adds the missing ones and leaves everything else (hand-written entries, the wildcards, entries for
74
+ * directories that no longer exist) untouched. Packages without the wildcard are not managed.
75
+ */
76
+ function ensureLibraryExports(dir) {
77
+ const pj = _path.default.join(dir, 'package.json');
78
+ const p = JSON.parse(_fs.default.readFileSync(pj, 'utf8'));
79
+ const ex = p.exports;
80
+ if (!ex || typeof ex !== 'object' || !ex['./*']) return false;
81
+ const indexDirs = new Set();
82
+ const walk = (d, rel) => {
83
+ for (const e of _fs.default.readdirSync(d, {
84
+ withFileTypes: true
85
+ })) {
86
+ if (e.name === 'node_modules' || e.name === 'dist' || e.name.startsWith('.')) continue;
87
+ const r = rel ? `${rel}/${e.name}` : e.name;
88
+ if (e.isDirectory()) walk(_path.default.join(d, e.name), r);else if (e.name === 'index.ts' && rel) indexDirs.add(rel);
89
+ }
90
+ };
91
+ walk(dir, '');
92
+ // Add-only: hand-written entries (aliases such as js-api's "./u2core") are never touched.
93
+ const next = {
94
+ ...ex
95
+ };
96
+ let changed = false;
97
+ for (const rel of [...indexDirs].sort()) {
98
+ const key = `./${rel}`;
99
+ if (!(key in next)) {
100
+ next[key] = {
101
+ types: `./dist/${rel}/index.d.ts`,
102
+ default: `./dist/${rel}/index.js`
103
+ };
104
+ changed = true;
105
+ }
106
+ }
107
+ if (!changed) return false;
108
+ // wildcards last: exports are matched by specificity, but keeping them last reads better
109
+ const wild = ['./*.js', './*'].filter(k => k in next);
110
+ const ordered = {};
111
+ for (const [k, v] of Object.entries(next)) if (!wild.includes(k)) ordered[k] = v;
112
+ for (const k of wild) ordered[k] = next[k];
113
+ p.exports = ordered;
114
+ _fs.default.writeFileSync(pj, JSON.stringify(p, null, 2) + '\n');
115
+ console.log(`package.json exports updated for ${_path.default.basename(dir)}`);
116
+ return true;
117
+ }
118
+ function isCompiledSibling(dir, rel) {
119
+ const m = rel.match(/^(.*)\.(js|mjs|cjs)$/);
120
+ return !!m && ['.ts', '.tsx'].some(e => _fs.default.existsSync(_path.default.join(dir, m[1] + e)));
121
+ }
@@ -23,6 +23,7 @@ exports.headerTags = void 0;
23
23
  exports.isConnectivityError = isConnectivityError;
24
24
  exports.isEmpty = isEmpty;
25
25
  exports.isPackageDir = isPackageDir;
26
+ exports.isPnpmWorkspace = isPnpmWorkspace;
26
27
  exports.isValidCron = isValidCron;
27
28
  exports.jsExtention = void 0;
28
29
  exports.kebabToCamelCase = kebabToCamelCase;
@@ -301,6 +302,14 @@ function isConnectivityError(error) {
301
302
  const msg = (error?.message ?? '').toLowerCase() + ' ' + (error?.code ?? '').toLowerCase();
302
303
  return ['econnrefused', 'enotfound', 'etimedout', 'eai_again', 'econnreset', 'fetch failed', 'network error'].some(token => msg.includes(token));
303
304
  }
305
+
306
+ /** True when `dir` is inside a pnpm workspace (a pnpm-workspace.yaml in it or above it). */
307
+ function isPnpmWorkspace(dir) {
308
+ for (let d = _path.default.resolve(dir);; d = _path.default.dirname(d)) {
309
+ if (_fs.default.existsSync(_path.default.join(d, 'pnpm-workspace.yaml'))) return true;
310
+ if (_path.default.dirname(d) === d) return false;
311
+ }
312
+ }
304
313
  async function runScript(script, path, verbose = false) {
305
314
  try {
306
315
  const {
@@ -3,7 +3,7 @@
3
3
  "tasks": [
4
4
  {
5
5
  "type": "shell",
6
- "command": "cmd.exe /c 'call webpack && call grok publish #{GROK_HOST_ALIAS}'",
6
+ "command": "cmd.exe /c 'call pnpm run build && call grok publish #{GROK_HOST_ALIAS}'",
7
7
  "label": "rebuild"
8
8
  }
9
9
  ]
@@ -4,21 +4,16 @@
4
4
  "version": "0.0.1",
5
5
  "description": "#{PACKAGE_NAME} package",
6
6
  "dependencies": {
7
- "datagrok-api": "^1.26.0",
8
- "cash-dom": "^8.1.5",
9
- "dayjs": "^1.11.13",
10
- "@datagrok-libraries/test": "^1.1.0"
11
- },
12
- "devDependencies": {
13
- "datagrok-tools": "^5.1.5",
14
- "webpack": "^5.95.0",
15
- "webpack-cli": "^5.1.4"
7
+ "datagrok-api": "workspace:^",
8
+ "cash-dom": "catalog:",
9
+ "dayjs": "catalog:",
10
+ "rxjs": "catalog:",
11
+ "@datagrok-libraries/test": "workspace:^"
16
12
  },
17
13
  "scripts": {
18
- "debug-#{PACKAGE_NAME_LOWERCASE}": "webpack && grok publish",
19
- "release-#{PACKAGE_NAME_LOWERCASE}": "webpack && grok publish --release",
20
- "build-#{PACKAGE_NAME_LOWERCASE}": "webpack",
21
- "build": "grok api && grok check --soft && webpack",
14
+ "build": "grok build",
15
+ "typecheck": "grok tsc --noEmit -p tsconfig.json",
16
+ "lint": "eslint --ext .ts,.tsx src",
22
17
  "test": "grok test"
23
18
  },
24
19
  "canEdit": [
@@ -27,4 +22,4 @@
27
22
  "canView": [
28
23
  "All users"
29
24
  ]
30
- }
25
+ }
@@ -1,71 +1,4 @@
1
1
  {
2
- "compilerOptions": {
3
- /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
-
5
- /* Basic Options */
6
- // "incremental": true, /* Enable incremental compilation */
7
- "target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
8
- "module": "es2020", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
9
- "lib": ["ES2022", "dom"], /* Specify library files to be included in the compilation. */
10
- // "allowJs": true, /* Allow javascript files to be compiled. */
11
- // "checkJs": true, /* Report errors in .js files. */
12
- // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */
13
- // "declaration": true, /* Generates corresponding '.d.ts' file. */
14
- // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
15
- "sourceMap": true, /* Generates corresponding '.map' file. */
16
- // "outFile": "./", /* Concatenate and emit output to single file. */
17
- // "outDir": "./", /* Redirect output structure to the directory. */
18
- // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
19
- // "composite": true, /* Enable project compilation */
20
- // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
21
- // "removeComments": true, /* Do not emit comments to output. */
22
- // "noEmit": true, /* Do not emit outputs. */
23
- // "importHelpers": true, /* Import emit helpers from 'tslib'. */
24
- // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
25
- // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
26
-
27
- /* Strict Type-Checking Options */
28
- "strict": true, /* Enable all strict type-checking options. */
29
- // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
30
- // "strictNullChecks": true, /* Enable strict null checks. */
31
- // "strictFunctionTypes": true, /* Enable strict checking of function types. */
32
- // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
33
- // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
34
- // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
35
- // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
36
-
37
- /* Additional Checks */
38
- // "noUnusedLocals": true, /* Report errors on unused locals. */
39
- // "noUnusedParameters": true, /* Report errors on unused parameters. */
40
- // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
41
- // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
42
- // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
43
- // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */
44
-
45
- /* Module Resolution Options */
46
- "moduleResolution": "bundler", /* Specify how TypeScript looks up a file from a given module specifier. Use 'bundler' for webpack/rollup/etc. */
47
- // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
48
- // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
49
- // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
50
- // "typeRoots": [], /* List of folders to include type definitions from. */
51
- // "types": [], /* Type declaration files to be included in compilation. */
52
- // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
53
- "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
54
- // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
55
- // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
56
-
57
- /* Source Map Options */
58
- // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
59
- // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
60
- // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
61
- // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
62
-
63
- /* Experimental Options */
64
- "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
65
- "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
66
-
67
- /* Advanced Options */
68
- "skipLibCheck": true, /* Skip type checking of declaration files. */
69
- "forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */
70
- }
2
+ "extends": "@datagrok/build-config/tsconfig.base.json",
3
+ "include": ["src"]
71
4
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/datagrok-ai/public.git"
6
6
  },
7
- "version": "6.7.0",
7
+ "version": "6.7.1",
8
8
  "description": "Utility to upload and publish packages to Datagrok",
9
9
  "homepage": "https://github.com/datagrok-ai/public/tree/master/tools#readme",
10
10
  "dependencies": {
@@ -16,7 +16,6 @@
16
16
  "adm-zip": "^0.6.0",
17
17
  "ajv": "^8.20.0",
18
18
  "archiver": "^7.0.1",
19
- "datagrok-api": "^1.27.6",
20
19
  "estraverse": "^5.3.0",
21
20
  "glob": "^13.0.6",
22
21
  "ignore-walk": "^6.0.5",
@@ -26,20 +25,9 @@
26
25
  "node-fetch": "^2.7.0",
27
26
  "papaparse": "^5.5.3",
28
27
  "puppeteer": "^24.15.0",
29
- "ts-morph": "^28.0.0"
30
- },
31
- "scripts": {
32
- "link": "npm link",
33
- "prepublishOnly": "node build.js",
34
- "babel": "node build.js",
35
- "build": "node build.js",
36
- "update:ivp-parser": "esbuild plugins/ivp-parser.entry.mjs --bundle --format=cjs --platform=node --alias:diff-grok=../libraries/compute-utils/node_modules/diff-grok --outfile=plugins/ivp-parser.bundle.cjs",
37
- "debug-source-map": "node build.js --source-maps",
38
- "test": "vitest run --project unit",
39
- "test:server": "vitest run --project unit bin/__tests__/node-dapi bin/__tests__/server bin/__tests__/migrate bin/__tests__/keypair",
40
- "test:watch": "vitest --project unit",
41
- "test:integration": "vitest run --project integration",
42
- "test:all": "vitest run"
28
+ "ts-morph": "^28.0.0",
29
+ "@babel/generator": "^7.29.0",
30
+ "datagrok-api": "^1.27.11"
43
31
  },
44
32
  "bin": {
45
33
  "datagrok-upload": "./bin/_deprecated/upload.js",
@@ -94,5 +82,17 @@
94
82
  "archiver-utils": {
95
83
  "glob": "$glob"
96
84
  }
85
+ },
86
+ "scripts": {
87
+ "link": "npm link",
88
+ "babel": "node build.js",
89
+ "build": "node build.js",
90
+ "update:ivp-parser": "esbuild plugins/ivp-parser.entry.mjs --bundle --format=cjs --platform=node --alias:diff-grok=../libraries/compute-utils/node_modules/diff-grok --outfile=plugins/ivp-parser.bundle.cjs",
91
+ "debug-source-map": "node build.js --source-maps",
92
+ "test": "vitest run --project unit",
93
+ "test:server": "vitest run --project unit bin/__tests__/node-dapi bin/__tests__/server bin/__tests__/migrate bin/__tests__/keypair",
94
+ "test:watch": "vitest --project unit",
95
+ "test:integration": "vitest run --project integration",
96
+ "test:all": "vitest run"
97
97
  }
98
- }
98
+ }