datagrok-tools 5.1.9 → 6.0.0
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/.devcontainer/Dockerfile.pkg_dev +36 -0
- package/.devcontainer/PACKAGES_DEV.md +501 -0
- package/.devcontainer/docker-compose.yaml +236 -0
- package/.devcontainer/entrypoint.sh +93 -0
- package/bin/commands/claude.js +613 -0
- package/bin/commands/help.js +40 -0
- package/bin/grok.js +19 -3
- package/bin/utils/func-generation.js +1 -1
- package/package-template/package.json +1 -0
- package/package-template/ts.webpack.config.js +1 -22
- package/package-template/webpack.config.js +1 -22
- package/package.json +1 -1
package/bin/grok.js
CHANGED
|
@@ -10,6 +10,7 @@ const commands = {
|
|
|
10
10
|
api: require('./commands/api').api,
|
|
11
11
|
build: require('./commands/build').build,
|
|
12
12
|
check: require('./commands/check').check,
|
|
13
|
+
claude: require('./commands/claude').claude,
|
|
13
14
|
config: require('./commands/config').config,
|
|
14
15
|
create: require('./commands/create').create,
|
|
15
16
|
init: require('./commands/init').init,
|
|
@@ -32,9 +33,24 @@ if (command in commands) {
|
|
|
32
33
|
} else if (argv.all && onPackageCommandNames.includes(command)) {
|
|
33
34
|
runAllCommand(process.cwd(),
|
|
34
35
|
`grok ${process.argv.slice(2).join(' ')}`.replace('--all', ''), {});
|
|
35
|
-
} else
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
} else {
|
|
37
|
+
const result = commands[command](argv);
|
|
38
|
+
if (result && typeof result.then === 'function') {
|
|
39
|
+
result.then((ok) => {
|
|
40
|
+
if (!ok) {
|
|
41
|
+
console.log(help[command]);
|
|
42
|
+
exitWithCode(1);
|
|
43
|
+
}
|
|
44
|
+
}).catch((err) => {
|
|
45
|
+
console.error(err);
|
|
46
|
+
console.log(help[command]);
|
|
47
|
+
exitWithCode(255);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
else if (!result) {
|
|
51
|
+
console.log(help[command]);
|
|
52
|
+
exitWithCode(1);
|
|
53
|
+
}
|
|
38
54
|
}
|
|
39
55
|
} catch (err) {
|
|
40
56
|
console.error(err);
|
|
@@ -1,28 +1,7 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
-
const
|
|
2
|
+
const FuncGeneratorPlugin = require('datagrok-tools/plugins/func-gen-plugin');
|
|
3
3
|
const packageName = path.parse(require('./package.json').name).name.toLowerCase().replace(/-/g, '');
|
|
4
4
|
|
|
5
|
-
function getDatagrokTools() {
|
|
6
|
-
const pluginPath = 'datagrok-tools/plugins/func-gen-plugin';
|
|
7
|
-
try {
|
|
8
|
-
return require(pluginPath);
|
|
9
|
-
} catch (e) {
|
|
10
|
-
try {
|
|
11
|
-
const globalPath = execSync('npm root -g').toString().trim();
|
|
12
|
-
return require(path.join(globalPath, pluginPath));
|
|
13
|
-
} catch (globalErr) {
|
|
14
|
-
console.error('\n' + '='.repeat(60));
|
|
15
|
-
console.error('ERROR: datagrok-tools not found!');
|
|
16
|
-
console.error('To fix this, please install the tools globally by running:');
|
|
17
|
-
console.error('\n npm install -g datagrok-tools\n');
|
|
18
|
-
console.error('='.repeat(60) + '\n');
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const FuncGeneratorPlugin = getDatagrokTools();
|
|
25
|
-
|
|
26
5
|
module.exports = {
|
|
27
6
|
cache: {
|
|
28
7
|
type: 'filesystem',
|
|
@@ -1,27 +1,6 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
-
const {execSync} = require('child_process');
|
|
3
2
|
const packageName = path.parse(require('./package.json').name).name.toLowerCase().replace(/-/g, '');
|
|
4
|
-
|
|
5
|
-
function getDatagrokTools() {
|
|
6
|
-
const pluginPath = 'datagrok-tools/plugins/func-gen-plugin';
|
|
7
|
-
try {
|
|
8
|
-
return require(pluginPath);
|
|
9
|
-
} catch (e) {
|
|
10
|
-
try {
|
|
11
|
-
const globalPath = execSync('npm root -g').toString().trim();
|
|
12
|
-
return require(path.join(globalPath, pluginPath));
|
|
13
|
-
} catch (globalErr) {
|
|
14
|
-
console.error('\n' + '='.repeat(60));
|
|
15
|
-
console.error('ERROR: datagrok-tools not found!');
|
|
16
|
-
console.error('To fix this, please install the tools globally by running:');
|
|
17
|
-
console.error('\n npm install -g datagrok-tools\n');
|
|
18
|
-
console.error('='.repeat(60) + '\n');
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const FuncGeneratorPlugin = getDatagrokTools();
|
|
3
|
+
const FuncGeneratorPlugin = require('datagrok-tools/plugins/func-gen-plugin');
|
|
25
4
|
module.exports = {
|
|
26
5
|
cache: {
|
|
27
6
|
type: 'filesystem',
|
package/package.json
CHANGED