datagrok-tools 6.7.3 → 6.7.5
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +8 -0
- package/bin/commands/create.js +11 -11
- package/bin/commands/help.js +2 -2
- package/bin/commands/link.js +17 -28
- package/bin/commands/publish.js +20 -20
- package/bin/commands/run.js +6 -4
- package/bin/utils/test-utils.js +2 -4
- package/bin/utils/utils.js +2 -1
- package/package.json +1 -1
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Datagrok-tools changelog
|
|
2
2
|
|
|
3
|
+
## 6.7.5 (2026-09-17)
|
|
4
|
+
|
|
5
|
+
* `grok create` works outside the pnpm workspace and new packages use `@datagrok/build-config` 1.x
|
|
6
|
+
|
|
7
|
+
## 6.7.4 (2026-09-17)
|
|
8
|
+
|
|
9
|
+
* `grok create`, `grok publish`, `grok test` and `grok run` work inside the pnpm workspace
|
|
10
|
+
|
|
3
11
|
## 6.7.3 (2026-09-17)
|
|
4
12
|
|
|
5
13
|
* The function-metadata plugin emits decorator roles in camel case again (`fileHandler`, `app`, `viewer`, ...); since 6.7.1 it capitalised them, which broke JS code comparing `options.role` with `DG.FUNC_TYPES`.
|
package/bin/commands/create.js
CHANGED
|
@@ -21,17 +21,16 @@ const curFolder = _path.default.basename(curDir);
|
|
|
21
21
|
const grokDir = _path.default.join(_os.default.homedir(), '.grok');
|
|
22
22
|
const confPath = _path.default.join(grokDir, 'config.yaml');
|
|
23
23
|
const templateDir = _path.default.join(_path.default.dirname(_path.default.dirname(__dirname)), 'package-template');
|
|
24
|
-
function isPnpmWorkspace(dir) {
|
|
25
|
-
for (let d = _path.default.resolve(dir);; d = _path.default.dirname(d)) {
|
|
26
|
-
if (_fs.default.existsSync(_path.default.join(d, 'pnpm-workspace.yaml'))) return true;
|
|
27
|
-
if (_path.default.dirname(d) === d) return false;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
24
|
const confTemplateDir = _path.default.join(_path.default.dirname(_path.default.dirname(__dirname)), 'config-template.yaml');
|
|
31
25
|
const confTemplate = _jsYaml.default.load(_fs.default.readFileSync(confTemplateDir, {
|
|
32
26
|
encoding: 'utf-8'
|
|
33
27
|
}));
|
|
34
28
|
const dependencies = [];
|
|
29
|
+
function apiVersion() {
|
|
30
|
+
let dir = _path.default.dirname(require.resolve('datagrok-api/dg'));
|
|
31
|
+
while (!_fs.default.existsSync(_path.default.join(dir, 'package.json'))) dir = _path.default.dirname(dir);
|
|
32
|
+
return JSON.parse(_fs.default.readFileSync(_path.default.join(dir, 'package.json'), 'utf8')).version;
|
|
33
|
+
}
|
|
35
34
|
function createDirectoryContents(name, friendlyName, config, templateDir, packageDir, ide = '', ts = true, eslint = false, test = false) {
|
|
36
35
|
const filesToCreate = _fs.default.readdirSync(templateDir);
|
|
37
36
|
filesToCreate.forEach(file => {
|
|
@@ -62,9 +61,9 @@ function createDirectoryContents(name, friendlyName, config, templateDir, packag
|
|
|
62
61
|
_package.devDependencies = _package.devDependencies ?? {};
|
|
63
62
|
// Outside the public/ pnpm workspace the template's workspace:/catalog: specifiers mean
|
|
64
63
|
// nothing to npm: pin published ranges and bring the toolchain in as a devDependency.
|
|
65
|
-
if (!isPnpmWorkspace(packageDir)) {
|
|
64
|
+
if (!utils.isPnpmWorkspace(packageDir)) {
|
|
66
65
|
const published = {
|
|
67
|
-
'datagrok-api': `^${
|
|
66
|
+
'datagrok-api': `^${apiVersion()}`,
|
|
68
67
|
'@datagrok-libraries/test': '^1.4.0',
|
|
69
68
|
'rxjs': '^6.5.5',
|
|
70
69
|
'cash-dom': '^8.1.5',
|
|
@@ -78,7 +77,7 @@ function createDirectoryContents(name, friendlyName, config, templateDir, packag
|
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
79
|
Object.assign(_package.devDependencies, {
|
|
81
|
-
'@datagrok/build-config': '^
|
|
80
|
+
'@datagrok/build-config': '^1.0.0',
|
|
82
81
|
'eslint': '^8.57.1',
|
|
83
82
|
'@typescript-eslint/parser': '^8.39.0',
|
|
84
83
|
'@typescript-eslint/eslint-plugin': '^8.39.0',
|
|
@@ -216,8 +215,9 @@ function create(args) {
|
|
|
216
215
|
color.success('Successfully created package ' + name);
|
|
217
216
|
console.log(_entHelpers.help.package(ts));
|
|
218
217
|
console.log(`\nThe package has the following dependencies:\n${dependencies.join(' ')}\n`);
|
|
219
|
-
|
|
220
|
-
|
|
218
|
+
const install = utils.isPnpmWorkspace(packageDir) ? 'pnpm install' : 'npm install';
|
|
219
|
+
console.log(`Running \`${install}\` to get the required dependencies...\n`);
|
|
220
|
+
(0, _child_process.exec)(install, {
|
|
221
221
|
cwd: packageDir
|
|
222
222
|
}, (err, stdout, stderr) => {
|
|
223
223
|
if (err) throw err;else console.log(stderr, stdout);
|
package/bin/commands/help.js
CHANGED
|
@@ -210,7 +210,7 @@ Options:
|
|
|
210
210
|
|
|
211
211
|
--all Publish all available packages (run in packages directory)
|
|
212
212
|
--refresh Publish all available already loaded packages (run in packages directory)
|
|
213
|
-
--link Link the package to local packages
|
|
213
|
+
--link Link the package to local packages (no effect in a pnpm workspace checkout)
|
|
214
214
|
--build Builds the package (the default; kept for compatibility)
|
|
215
215
|
--skip-build Upload the existing dist/ without rebuilding
|
|
216
216
|
--release Publish package as release version
|
|
@@ -255,7 +255,7 @@ Options:
|
|
|
255
255
|
--skip-playwright Skip the Playwright pass; only run Puppeteer/DG.Test
|
|
256
256
|
--skip-node Skip the Node (browserless) pass; run all tests in the browser
|
|
257
257
|
--node-only Run only tests annotated {node: true} headless under Node, no browser
|
|
258
|
-
--link Link the package to local utils
|
|
258
|
+
--link Link the package to local utils (no effect in a pnpm workspace checkout)
|
|
259
259
|
--record Records the test execution process in mp4 format
|
|
260
260
|
--platform Runs only platform tests (applicable for ApiTests package only)
|
|
261
261
|
--core Runs package & auto tests & core tests (core tests run only from DevTools package)
|
package/bin/commands/link.js
CHANGED
|
@@ -30,18 +30,12 @@ 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
|
-
}
|
|
39
33
|
let verbose = false;
|
|
40
34
|
let pathMode = false;
|
|
41
35
|
let devMode = false;
|
|
42
36
|
let unlink = false;
|
|
43
37
|
async function link(args) {
|
|
44
|
-
if (isPnpmWorkspace(curDir)) {
|
|
38
|
+
if ((0, _utils.isPnpmWorkspace)(curDir)) {
|
|
45
39
|
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
40
|
return true;
|
|
47
41
|
}
|
|
@@ -49,7 +43,7 @@ async function link(args) {
|
|
|
49
43
|
devMode = args.dev ?? false;
|
|
50
44
|
pathMode = args.path ?? false;
|
|
51
45
|
unlink = args.unlink ?? false;
|
|
52
|
-
|
|
46
|
+
const collectedPackages = collectAvaliablePackages(args['repo-only']);
|
|
53
47
|
packagesInRepo = collectedPackages.packagesInRepo;
|
|
54
48
|
packagesOutOfRepo = collectedPackages.packagesOutOfRepo;
|
|
55
49
|
localPackageDependencies = [];
|
|
@@ -83,16 +77,13 @@ function collectPackagesData(packagePath = curDir) {
|
|
|
83
77
|
}
|
|
84
78
|
function collectPacakgeDataFromJsonObject(object) {
|
|
85
79
|
let result = [];
|
|
86
|
-
for (
|
|
80
|
+
for (const dependencyName of Object.keys(object ?? {})) {
|
|
87
81
|
if (packagesInRepo[dependencyName]) result = result.concat(parsePackageDependencies(dependencyName, _path.default.dirname(packagesInRepo[dependencyName].path)));else if (packagesOutOfRepo[dependencyName]) result = result.concat(parsePackageDependencies(dependencyName, _path.default.dirname(packagesOutOfRepo[dependencyName].path)));
|
|
88
82
|
}
|
|
89
83
|
return result;
|
|
90
84
|
}
|
|
91
|
-
function toCamelCase(input) {
|
|
92
|
-
return input.split('-').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join('');
|
|
93
|
-
}
|
|
94
85
|
function parsePackageDependencies(dependencyName, pathToLink) {
|
|
95
|
-
|
|
86
|
+
const result = [];
|
|
96
87
|
if (!packagesToLink.has(dependencyName)) {
|
|
97
88
|
packagesToLink.add(dependencyName);
|
|
98
89
|
localPackageDependencies.push(new PackageData(pathToLink));
|
|
@@ -101,8 +92,8 @@ function parsePackageDependencies(dependencyName, pathToLink) {
|
|
|
101
92
|
return result;
|
|
102
93
|
}
|
|
103
94
|
function collectAvaliablePackages(noOutLink = false) {
|
|
104
|
-
|
|
105
|
-
|
|
95
|
+
const repositoryPackages = collectAvaliablePackagesPathesFromDir(repositoryDir);
|
|
96
|
+
const commonPakcages = collectAvaliablePackagesPathesFromDir(containerDir, repositoryDir);
|
|
106
97
|
const packagesInRepoBaseInfo = parsePackages(repositoryPackages);
|
|
107
98
|
const packagesOutOfRepoBaseInfo = noOutLink ? [] : parsePackages(commonPakcages);
|
|
108
99
|
const packagesInRepo = Object.fromEntries(packagesInRepoBaseInfo.map(({
|
|
@@ -127,8 +118,8 @@ function collectAvaliablePackagesPathesFromDir(dir, dirToExclude = '') {
|
|
|
127
118
|
return res;
|
|
128
119
|
}
|
|
129
120
|
function parsePackages(packagPathes) {
|
|
130
|
-
|
|
131
|
-
|
|
121
|
+
const res = packagPathes.map(e => {
|
|
122
|
+
const packageData = {};
|
|
132
123
|
if (_fs.default.existsSync(e)) {
|
|
133
124
|
packageData.path = e;
|
|
134
125
|
const packageJson = JSON.parse(_fs.default.readFileSync(e, 'utf8'));
|
|
@@ -142,7 +133,7 @@ function parsePackages(packagPathes) {
|
|
|
142
133
|
async function unlinkPackages() {
|
|
143
134
|
const packages = [...localPackageDependencies];
|
|
144
135
|
if (currentPackage) packages.push(currentPackage);
|
|
145
|
-
for (
|
|
136
|
+
for (const packageData of packages) {
|
|
146
137
|
if (excludedPackages.includes(packageData.name)) continue;
|
|
147
138
|
if (verbose) console.log(`Package ${packageData.name} is unlinking`);
|
|
148
139
|
const packageJsonPath = _path.default.join(packageData.packagePath, 'package.json');
|
|
@@ -154,29 +145,27 @@ async function unlinkPackages() {
|
|
|
154
145
|
}
|
|
155
146
|
}
|
|
156
147
|
function updateDependenciesToVersion(packageData, dependecyNode) {
|
|
157
|
-
for (
|
|
148
|
+
for (const dependency of packageData.dependencies) {
|
|
158
149
|
if (excludedPackages.includes(dependency)) continue;
|
|
159
150
|
if (dependecyNode[dependency] && !versionDependencyRegex.test(dependecyNode[dependency])) {
|
|
160
151
|
const packageToLink = (localPackageDependencies.filter(e => e.name === dependency) ?? [])[0];
|
|
161
|
-
if (packageToLink) {
|
|
162
|
-
dependecyNode[dependency] = `^${packagesInRepo[dependency]?.version ?? packagesOutOfRepo[dependency]?.version}`;
|
|
163
|
-
}
|
|
152
|
+
if (packageToLink) dependecyNode[dependency] = `^${packagesInRepo[dependency]?.version ?? packagesOutOfRepo[dependency]?.version}`;
|
|
164
153
|
}
|
|
165
154
|
}
|
|
166
155
|
return dependecyNode;
|
|
167
156
|
}
|
|
168
157
|
async function linkPackages() {
|
|
169
158
|
let anyChanges = true;
|
|
170
|
-
for (
|
|
159
|
+
for (const element of excludedPackages) packagesToLink.delete(element);
|
|
171
160
|
if (verbose) {
|
|
172
161
|
console.log('Packages to link:');
|
|
173
162
|
console.log(localPackageDependencies);
|
|
174
163
|
}
|
|
175
164
|
while (anyChanges && packagesToLink.size > 0) {
|
|
176
165
|
anyChanges = false;
|
|
177
|
-
|
|
166
|
+
const mapElements = localPackageDependencies.filter(x => x.dependencies.every(i => !packagesToLink.has(i)) && packagesToLink.has(x.name) && !excludedPackages.includes(x.name));
|
|
178
167
|
if (mapElements.length === 0) break;
|
|
179
|
-
for (
|
|
168
|
+
for (const element of mapElements) {
|
|
180
169
|
if (verbose) console.log(`Package ${element.name} is linking`);
|
|
181
170
|
if (pathMode) await linkPathMode(element);
|
|
182
171
|
await (0, _utils.runScript)(`npm install`, element.packagePath);
|
|
@@ -187,7 +176,7 @@ async function linkPackages() {
|
|
|
187
176
|
}
|
|
188
177
|
if (anyChanges === false) throw new Error(`There is loop with next packages: ${JSON.stringify(Array.from(packagesToLink)).toString()}`);
|
|
189
178
|
}
|
|
190
|
-
|
|
179
|
+
const names = localPackageDependencies.map(x => x.name);
|
|
191
180
|
if (currentPackage && pathMode) await linkPathMode(currentPackage);
|
|
192
181
|
await (0, _utils.runScript)(`npm install`, curDir);
|
|
193
182
|
if (pathMode === false) await (0, _utils.runScript)(`npm link ${names.join(' ')}`, curDir);
|
|
@@ -208,7 +197,7 @@ async function linkPathMode(packageData) {
|
|
|
208
197
|
function updateDependenciesToLocal(packageData, dependecyNode) {
|
|
209
198
|
const backRouteForCont = `../`.repeat(packageData.packagePath.replace(containerDir, '').split(_path.default.sep).length - 1);
|
|
210
199
|
const backRouteForRepo = `../`.repeat(packageData.packagePath.replace(repositoryDir, '').split(_path.default.sep).length - 1);
|
|
211
|
-
for (
|
|
200
|
+
for (const dependency of packageData.dependencies) {
|
|
212
201
|
if (excludedPackages.includes(dependency)) continue;
|
|
213
202
|
if (dependecyNode[dependency]) {
|
|
214
203
|
const packageToLink = (localPackageDependencies.filter(e => e.name === dependency) ?? [])[0];
|
|
@@ -222,7 +211,7 @@ function updateDependenciesToLocal(packageData, dependecyNode) {
|
|
|
222
211
|
class PackageData {
|
|
223
212
|
dependencies = [];
|
|
224
213
|
constructor(packagePath) {
|
|
225
|
-
|
|
214
|
+
const packageJsonData = collectPackagesData(packagePath);
|
|
226
215
|
this.name = packageJsonData.name;
|
|
227
216
|
this.packagePath = packagePath;
|
|
228
217
|
this.dependencies = packageJsonData.dependencies;
|
package/bin/commands/publish.js
CHANGED
|
@@ -374,7 +374,9 @@ async function processDockerImages(packageName, version, registry, devKey, host,
|
|
|
374
374
|
result = pushImage(img.imageName, registryTag, registry);
|
|
375
375
|
if (!result) {
|
|
376
376
|
const fallback = await fallbackImage(img, host, devKey, registry, version, contentHash);
|
|
377
|
-
if (fallback.serverError) color.error(`Cannot resolve fallback: ${fallback.serverError}`);else if (fallback.image)
|
|
377
|
+
if (fallback.serverError) color.error(`Cannot resolve fallback: ${fallback.serverError}`);else if (fallback.image) {
|
|
378
|
+
color.warn(`Falling back to ${fallback.image}` + `${fallback.hashMatch === false ? ' (hash mismatch — container will run older code)' : ''}`);
|
|
379
|
+
} else color.error(`No published image available for ${img.imageName}. No container will be available.`);
|
|
378
380
|
result = fallback;
|
|
379
381
|
}
|
|
380
382
|
} else {
|
|
@@ -700,28 +702,24 @@ async function publish(args) {
|
|
|
700
702
|
}
|
|
701
703
|
color.log('Loading packages:');
|
|
702
704
|
await (0, _testUtils.loadPackages)(curDir, packagesToLoad.join(' '), host, false, false, args.link, args.release);
|
|
703
|
-
} else
|
|
704
|
-
if (args.link) {
|
|
705
|
-
color.log('Linking');
|
|
706
|
-
await utils.runScript(`npm install`, curDir);
|
|
707
|
-
await utils.runScript(`grok link`, curDir);
|
|
708
|
-
await utils.runScript(`npm run build`, curDir);
|
|
709
|
-
}
|
|
710
|
-
return await publishPackage(args);
|
|
711
|
-
}
|
|
705
|
+
} else return await publishPackage(args);
|
|
712
706
|
return true;
|
|
713
707
|
}
|
|
708
|
+
|
|
709
|
+
// --link means nothing inside the pnpm workspace: the root install already linked every in-repo dependency
|
|
710
|
+
async function buildPackage(args) {
|
|
711
|
+
const workspace = utils.isPnpmWorkspace(curDir);
|
|
712
|
+
const link = args.link && !workspace;
|
|
713
|
+
if (!link && (args['skip-build'] || args.rebuild || !_fs.default.existsSync(_path.default.join(curDir, 'src')))) return;
|
|
714
|
+
color.log(link ? 'Linking and building' : 'Building');
|
|
715
|
+
if (link || !workspace && !_fs.default.existsSync(_path.default.join(curDir, 'node_modules'))) await utils.runScript('npm install', curDir);
|
|
716
|
+
if (link) await utils.runScript(`${utils.grokCommand} link`, curDir);
|
|
717
|
+
await utils.runScript(workspace ? 'pnpm run build' : 'npm run build', curDir);
|
|
718
|
+
}
|
|
714
719
|
async function publishPackage(args) {
|
|
715
720
|
const nArgs = args['_'].length;
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
// workspace the install already happened at the root; standalone packages install first.
|
|
719
|
-
if (!args.link && !args['skip-build'] && !args.rebuild && _fs.default.existsSync(_path.default.join(curDir, 'src'))) {
|
|
720
|
-
color.log('Building');
|
|
721
|
-
const workspace = utils.isPnpmWorkspace(curDir);
|
|
722
|
-
if (!workspace && !_fs.default.existsSync(_path.default.join(curDir, 'node_modules'))) await utils.runScript('npm install', curDir, false);
|
|
723
|
-
await utils.runScript(workspace ? 'pnpm run build' : 'npm run build', curDir, false);
|
|
724
|
-
}
|
|
721
|
+
await buildPackage(args);
|
|
722
|
+
if (args['skip-build'] && !args.rebuild && _fs.default.existsSync(_path.default.join(curDir, 'src')) && !_fs.default.existsSync(_path.default.join(curDir, 'dist', 'package.js'))) return color.error('dist/package.js not found: build the package first, or run without --skip-build');
|
|
725
723
|
if (args.debug && args.release) {
|
|
726
724
|
color.error('Incompatible options: --debug and --release');
|
|
727
725
|
return false;
|
|
@@ -755,7 +753,9 @@ async function publishPackage(args) {
|
|
|
755
753
|
|
|
756
754
|
// Update the developer key
|
|
757
755
|
if (args.key) key = args.key;
|
|
758
|
-
if (!key && !keypair.keypairFor(url))
|
|
756
|
+
if (!key && !keypair.keypairFor(url)) {
|
|
757
|
+
return color.warn(`No credentials for ${url}. Run \`grok login ${host}\`, ` + 'or pass a developer key with `--key` (deprecated).');
|
|
758
|
+
}
|
|
759
759
|
|
|
760
760
|
// Get the package name
|
|
761
761
|
if (!_fs.default.existsSync(packDir)) return color.error('`package.json` doesn\'t exist');
|
package/bin/commands/run.js
CHANGED
|
@@ -39,7 +39,8 @@ function openBrowser(url) {
|
|
|
39
39
|
}
|
|
40
40
|
const MISSING_MODULE_PATTERNS = ['cannot find module', 'module not found', 'can\'t resolve'];
|
|
41
41
|
async function buildPackage(dir) {
|
|
42
|
-
const
|
|
42
|
+
const workspace = utils.isPnpmWorkspace(dir);
|
|
43
|
+
const buildCmd = workspace ? 'pnpm run build' : 'npm run build -- --env incremental';
|
|
43
44
|
const packageJson = JSON.parse(_fs.default.readFileSync(_path.default.join(dir, 'package.json'), 'utf-8'));
|
|
44
45
|
const name = packageJson.friendlyName || packageJson.name;
|
|
45
46
|
console.log(`Building ${name}...`);
|
|
@@ -50,9 +51,10 @@ async function buildPackage(dir) {
|
|
|
50
51
|
} catch (error) {
|
|
51
52
|
const msg = (error?.message ?? '').toLowerCase();
|
|
52
53
|
if (MISSING_MODULE_PATTERNS.some(p => msg.includes(p))) {
|
|
53
|
-
|
|
54
|
+
const install = workspace ? 'pnpm install --frozen-lockfile' : 'npm install';
|
|
55
|
+
color.warn(`Missing modules detected, running ${install}...`);
|
|
54
56
|
try {
|
|
55
|
-
await utils.runScript(
|
|
57
|
+
await utils.runScript(install, dir, color.isVerbose());
|
|
56
58
|
await utils.runScript(buildCmd, dir, color.isVerbose());
|
|
57
59
|
color.success(`Successfully built ${name}`);
|
|
58
60
|
return true;
|
|
@@ -70,7 +72,7 @@ async function buildPackage(dir) {
|
|
|
70
72
|
async function run(args) {
|
|
71
73
|
color.setVerbose(args.verbose || false);
|
|
72
74
|
|
|
73
|
-
// Step 1: Build (skip
|
|
75
|
+
// Step 1: Build (skip the install to preserve npm link; retry with an install only if needed)
|
|
74
76
|
const built = await buildPackage(process.cwd());
|
|
75
77
|
if (!built) return false;
|
|
76
78
|
|
package/bin/utils/test-utils.js
CHANGED
|
@@ -251,10 +251,8 @@ async function loadPackage(packageDir, dirName, hostString, skipPublish, skipBui
|
|
|
251
251
|
if (skipPublish != true) {
|
|
252
252
|
process.stdout.write(`Building and publishing ${dirName}...`);
|
|
253
253
|
try {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
if (skipBuild != true) await utils.runScript(`npm run build`, packageDir);
|
|
257
|
-
await utils.runScript(`grok publish ${hostString}${release ? ' --release' : ''}`, packageDir);
|
|
254
|
+
const flags = `${release ? ' --release' : ''}${linkPackage ? ' --link' : ''}${skipBuild ? ' --skip-build' : ''}`;
|
|
255
|
+
await utils.runScript(`${utils.grokCommand} publish ${hostString}${flags}`, packageDir);
|
|
258
256
|
} catch (e) {
|
|
259
257
|
process.stdout.write(' FAILED\n');
|
|
260
258
|
throw e;
|
package/bin/utils/utils.js
CHANGED
|
@@ -19,7 +19,7 @@ exports.getScriptDescription = getScriptDescription;
|
|
|
19
19
|
exports.getScriptInputs = getScriptInputs;
|
|
20
20
|
exports.getScriptName = getScriptName;
|
|
21
21
|
exports.getScriptOutputType = getScriptOutputType;
|
|
22
|
-
exports.headerTags = void 0;
|
|
22
|
+
exports.headerTags = exports.grokCommand = void 0;
|
|
23
23
|
exports.isConnectivityError = isConnectivityError;
|
|
24
24
|
exports.isEmpty = isEmpty;
|
|
25
25
|
exports.isPackageDir = isPackageDir;
|
|
@@ -310,6 +310,7 @@ function isPnpmWorkspace(dir) {
|
|
|
310
310
|
if (_path.default.dirname(d) === d) return false;
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
|
+
const grokCommand = exports.grokCommand = `"${process.execPath}" "${_path.default.join(__dirname, '..', 'grok.js')}"`;
|
|
313
314
|
async function runScript(script, path, verbose = false) {
|
|
314
315
|
try {
|
|
315
316
|
const {
|
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.
|
|
7
|
+
"version": "6.7.5",
|
|
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": {
|