datagrok-tools 4.5.4 → 4.5.7
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/bin/commands/create.js
CHANGED
|
@@ -81,6 +81,7 @@ function createDirectoryContents(name, config, templateDir, packageDir) {
|
|
|
81
81
|
contents = contents.replace(/#{PACKAGE_DETECTORS_NAME}/g, utils.kebabToCamelCase(name));
|
|
82
82
|
contents = contents.replace(/#{PACKAGE_NAME_LOWERCASE}/g, name.toLowerCase());
|
|
83
83
|
contents = contents.replace(/#{PACKAGE_NAME_LOWERCASE_WORD}/g, name.replace(/-/g, '').toLowerCase());
|
|
84
|
+
contents = utils.replacers['PACKAGE_NAMESPACE'](contents, name);
|
|
84
85
|
contents = contents.replace(/#{GROK_HOST_ALIAS}/g, config["default"]);
|
|
85
86
|
contents = contents.replace(/#{GROK_HOST}/g, /localhost|127\.0\.0\.1/.test(config['servers'][config["default"]]['url']) ? 'http://localhost:63343/login.html' : new URL(config['servers'][config["default"]]['url']).origin);
|
|
86
87
|
|
package/bin/commands/help.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.help = void 0;
|
|
7
|
-
var HELP = "\nUsage: grok <command>\n\nDatagrok's package management tool\n\nCommands:\n add Add an object template\n api Create wrapper functions\n config Create and manage config files\n create Create a package\n publish Upload a package\n
|
|
7
|
+
var HELP = "\nUsage: grok <command>\n\nDatagrok's package management tool\n\nCommands:\n add Add an object template\n api Create wrapper functions\n config Create and manage config files\n create Create a package\n publish Upload a package\n\nTo get help on a particular command, use:\n grok <command> --help\n\nRead more about the package development workflow:\nhttps://datagrok.ai/help/develop/develop\n";
|
|
8
8
|
var HELP_ADD = "\nUsage: grok add <entity> <name>\n\nAdd an object template to your package:\n\ngrok add app <name>\ngrok add connection <name>\ngrok add detector <semantic-type-name>\ngrok add function [tag] <name>\ngrok add query <name>\ngrok add script [tag] <language> <name>\ngrok add view <name>\ngrok add viewer <name>\ngrok add tests\n\nPlease note that entity names may only include letters and numbers\n\nSupported languages for scripts:\njavascript, julia, node, octave, python, r\n\nAvailable tags:\npanel, init\n";
|
|
9
9
|
var HELP_API = "\nUsage: grok api\n\nCreate wrapper functions for package scripts and queries\n";
|
|
10
10
|
var HELP_CONFIG = "\nUsage: grok config\n\nCreate or update a configuration file\n\nOptions:\n[--reset] [--server] [--alias] [--key]\n\n--reset Restore the default config file template\n--server Use to add a server to the config (`grok config add --alias alias --server url --key key`)\n--alias Use in conjunction with the `server` option to set the server name\n--key Use in conjunction with the `server` option to set the developer key\n--default Use in conjunction with the `server` option to set the added server as default\n";
|
|
@@ -17,7 +17,6 @@ var help = {
|
|
|
17
17
|
config: HELP_CONFIG,
|
|
18
18
|
create: HELP_CREATE,
|
|
19
19
|
publish: HELP_PUBLISH,
|
|
20
|
-
migrate: HELP_MIGRATE,
|
|
21
20
|
help: HELP
|
|
22
21
|
};
|
|
23
22
|
exports.help = help;
|
package/bin/grok.js
CHANGED
|
@@ -20,13 +20,13 @@ afterAll(async () => {
|
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
it('TEST', async () => {
|
|
23
|
-
const
|
|
24
|
-
console.log(`Testing ${
|
|
23
|
+
const targetPackage: string = process.env.TARGET_PACKAGE ?? '#{PACKAGE_NAMESPACE}';
|
|
24
|
+
console.log(`Testing ${targetPackage} package`);
|
|
25
25
|
|
|
26
26
|
//console.log(require('root-require')('package.json').version);
|
|
27
|
-
let r = await page.evaluate((
|
|
27
|
+
let r = await page.evaluate((targetPackage): Promise<object> => {
|
|
28
28
|
return new Promise<object>((resolve, reject) => {
|
|
29
|
-
(<any>window).grok.functions.eval(
|
|
29
|
+
(<any>window).grok.functions.eval(targetPackage + ':test()').then((df: any) => {
|
|
30
30
|
let cStatus = df.columns.byName('success');
|
|
31
31
|
let cMessage = df.columns.byName('result');
|
|
32
32
|
let cCat = df.columns.byName('category');
|
|
@@ -41,7 +41,7 @@ it('TEST', async () => {
|
|
|
41
41
|
resolve({report, failed});
|
|
42
42
|
}).catch((e: any) => reject(e));
|
|
43
43
|
});
|
|
44
|
-
},
|
|
44
|
+
}, targetPackage);
|
|
45
45
|
// @ts-ignore
|
|
46
46
|
console.log(r.report);
|
|
47
47
|
// @ts-ignore
|
package/package.json
CHANGED