datagrok-tools 4.3.0 → 4.4.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/README.md +84 -84
- package/bin/_deprecated/migrate.js +83 -83
- package/bin/_deprecated/upload.js +161 -161
- package/bin/commands/create.js +21 -3
- package/bin/commands/help.js +1 -1
- package/bin/grok.js +26 -26
- package/config-template.yaml +11 -11
- package/entity-template/app.js +6 -6
- package/entity-template/connection.json +17 -17
- package/entity-template/function.js +9 -9
- package/entity-template/function.ts +9 -9
- package/entity-template/init.js +4 -4
- package/entity-template/panel.js +11 -11
- package/entity-template/panel.ts +11 -11
- package/entity-template/queries.sql +7 -7
- package/entity-template/sem-type-detector.js +11 -11
- package/entity-template/view-class.js +60 -60
- package/entity-template/view-class.ts +64 -64
- package/entity-template/view.js +10 -10
- package/entity-template/viewer-class.js +23 -23
- package/entity-template/viewer-class.ts +23 -23
- package/entity-template/viewer.js +8 -8
- package/package-template/.eslintrc.json +38 -38
- package/package-template/.vscode/launch.json +15 -15
- package/package-template/.vscode/tasks.json +9 -9
- package/package-template/README.md +2 -2
- package/package-template/detectors.js +9 -9
- package/package-template/gitignore +29 -29
- package/package-template/npmignore +26 -0
- package/package-template/package.json +29 -29
- package/package-template/src/package-test.js +12 -12
- package/package-template/src/package-test.ts +13 -13
- package/package-template/src/package.js +11 -11
- package/package-template/ts.webpack.config.js +36 -36
- package/package-template/tsconfig.json +71 -71
- package/package-template/webpack.config.js +27 -27
- package/package.json +51 -51
- package/script-template/javascript.js +6 -6
- package/script-template/julia.jl +8 -8
- package/script-template/node.js +8 -8
- package/script-template/octave.m +8 -8
- package/script-template/python.py +8 -8
- package/script-template/r.R +8 -8
- package/tsconfig.json +71 -71
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import * as grok from 'datagrok-api/grok';
|
|
2
|
-
import * as ui from 'datagrok-api/ui';
|
|
3
|
-
import * as DG from 'datagrok-api/dg';
|
|
4
|
-
|
|
5
|
-
// See also https://datagrok.ai/help/develop/how-to/develop-custom-viewer
|
|
6
|
-
// This viewer does the following:
|
|
7
|
-
// * listens to changes of filter and selection in the attached table,
|
|
8
|
-
// * updates the number of filtered/selected rows accordingly.
|
|
9
|
-
export class #{NAME} extends DG.JsViewer {
|
|
10
|
-
onTableAttached() {
|
|
11
|
-
this.subs.push(this.dataFrame!.selection.onChanged.subscribe((_) => this.render()));
|
|
12
|
-
this.subs.push(this.dataFrame!.filter.onChanged.subscribe((_) => this.render()));
|
|
13
|
-
|
|
14
|
-
this.render();
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
render() {
|
|
18
|
-
this.root.innerHTML =
|
|
19
|
-
`${this.dataFrame!.toString()}<br>
|
|
20
|
-
Selected: ${this.dataFrame!.selection.trueCount}<br>
|
|
21
|
-
Filtered: ${this.dataFrame!.filter.trueCount}`;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
1
|
+
import * as grok from 'datagrok-api/grok';
|
|
2
|
+
import * as ui from 'datagrok-api/ui';
|
|
3
|
+
import * as DG from 'datagrok-api/dg';
|
|
4
|
+
|
|
5
|
+
// See also https://datagrok.ai/help/develop/how-to/develop-custom-viewer
|
|
6
|
+
// This viewer does the following:
|
|
7
|
+
// * listens to changes of filter and selection in the attached table,
|
|
8
|
+
// * updates the number of filtered/selected rows accordingly.
|
|
9
|
+
export class #{NAME} extends DG.JsViewer {
|
|
10
|
+
onTableAttached() {
|
|
11
|
+
this.subs.push(this.dataFrame!.selection.onChanged.subscribe((_) => this.render()));
|
|
12
|
+
this.subs.push(this.dataFrame!.filter.onChanged.subscribe((_) => this.render()));
|
|
13
|
+
|
|
14
|
+
this.render();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
render() {
|
|
18
|
+
this.root.innerHTML =
|
|
19
|
+
`${this.dataFrame!.toString()}<br>
|
|
20
|
+
Selected: ${this.dataFrame!.selection.trueCount}<br>
|
|
21
|
+
Filtered: ${this.dataFrame!.filter.trueCount}`;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
//name: #{NAME}
|
|
3
|
-
//description: Creates #{NAME} viewer
|
|
4
|
-
//tags: viewer
|
|
5
|
-
//output: viewer result
|
|
6
|
-
export function _#{NAME}() {
|
|
7
|
-
return new #{NAME}();
|
|
8
|
-
}
|
|
1
|
+
|
|
2
|
+
//name: #{NAME}
|
|
3
|
+
//description: Creates #{NAME} viewer
|
|
4
|
+
//tags: viewer
|
|
5
|
+
//output: viewer result
|
|
6
|
+
export function _#{NAME}() {
|
|
7
|
+
return new #{NAME}();
|
|
8
|
+
}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"browser": true,
|
|
4
|
-
"es2021": true
|
|
5
|
-
},
|
|
6
|
-
"extends": [
|
|
7
|
-
"google"
|
|
8
|
-
],
|
|
9
|
-
"parserOptions": {
|
|
10
|
-
"ecmaVersion": 12,
|
|
11
|
-
"sourceType": "module"
|
|
12
|
-
},
|
|
13
|
-
"rules": {
|
|
14
|
-
"indent": [
|
|
15
|
-
"error",
|
|
16
|
-
2
|
|
17
|
-
],
|
|
18
|
-
"max-len": [
|
|
19
|
-
"error",
|
|
20
|
-
120
|
|
21
|
-
],
|
|
22
|
-
"require-jsdoc": "off",
|
|
23
|
-
"spaced-comment": "off",
|
|
24
|
-
"linebreak-style": "off",
|
|
25
|
-
"curly": [
|
|
26
|
-
"error",
|
|
27
|
-
"multi-or-nest"
|
|
28
|
-
],
|
|
29
|
-
"brace-style": [
|
|
30
|
-
"error",
|
|
31
|
-
"1tbs",
|
|
32
|
-
{
|
|
33
|
-
"allowSingleLine": true
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
"block-spacing": 2
|
|
37
|
-
}
|
|
38
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"env": {
|
|
3
|
+
"browser": true,
|
|
4
|
+
"es2021": true
|
|
5
|
+
},
|
|
6
|
+
"extends": [
|
|
7
|
+
"google"
|
|
8
|
+
],
|
|
9
|
+
"parserOptions": {
|
|
10
|
+
"ecmaVersion": 12,
|
|
11
|
+
"sourceType": "module"
|
|
12
|
+
},
|
|
13
|
+
"rules": {
|
|
14
|
+
"indent": [
|
|
15
|
+
"error",
|
|
16
|
+
2
|
|
17
|
+
],
|
|
18
|
+
"max-len": [
|
|
19
|
+
"error",
|
|
20
|
+
120
|
|
21
|
+
],
|
|
22
|
+
"require-jsdoc": "off",
|
|
23
|
+
"spaced-comment": "off",
|
|
24
|
+
"linebreak-style": "off",
|
|
25
|
+
"curly": [
|
|
26
|
+
"error",
|
|
27
|
+
"multi-or-nest"
|
|
28
|
+
],
|
|
29
|
+
"brace-style": [
|
|
30
|
+
"error",
|
|
31
|
+
"1tbs",
|
|
32
|
+
{
|
|
33
|
+
"allowSingleLine": true
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"block-spacing": 2
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Use IntelliSense to learn about possible attributes.
|
|
3
|
-
// Hover to view descriptions of existing attributes.
|
|
4
|
-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
-
"version": "0.2.0",
|
|
6
|
-
"configurations": [
|
|
7
|
-
{
|
|
8
|
-
"preLaunchTask": "rebuild",
|
|
9
|
-
"type": "pwa-chrome",
|
|
10
|
-
"request": "launch",
|
|
11
|
-
"name": "Debug #{GROK_HOST_ALIAS}",
|
|
12
|
-
"url": "#{GROK_HOST}",
|
|
13
|
-
"webRoot": "${workspaceFolder}"
|
|
14
|
-
}
|
|
15
|
-
]
|
|
1
|
+
{
|
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
|
3
|
+
// Hover to view descriptions of existing attributes.
|
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
"preLaunchTask": "rebuild",
|
|
9
|
+
"type": "pwa-chrome",
|
|
10
|
+
"request": "launch",
|
|
11
|
+
"name": "Debug #{GROK_HOST_ALIAS}",
|
|
12
|
+
"url": "#{GROK_HOST}",
|
|
13
|
+
"webRoot": "${workspaceFolder}"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
16
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "2.0.0",
|
|
3
|
-
"tasks": [
|
|
4
|
-
{
|
|
5
|
-
"type": "shell",
|
|
6
|
-
"command": "cmd.exe /c 'call webpack && call grok publish {GROK_HOST_ALIAS}'",
|
|
7
|
-
"label": "rebuild"
|
|
8
|
-
}
|
|
9
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"version": "2.0.0",
|
|
3
|
+
"tasks": [
|
|
4
|
+
{
|
|
5
|
+
"type": "shell",
|
|
6
|
+
"command": "cmd.exe /c 'call webpack && call grok publish {GROK_HOST_ALIAS}'",
|
|
7
|
+
"label": "rebuild"
|
|
8
|
+
}
|
|
9
|
+
]
|
|
10
10
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# #{PACKAGE_NAME}
|
|
2
|
-
|
|
1
|
+
# #{PACKAGE_NAME}
|
|
2
|
+
|
|
3
3
|
#{PACKAGE_NAME} is a [package](https://datagrok.ai/help/develop/develop#packages) for the [Datagrok](https://datagrok.ai) platform.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The class contains semantic type detectors.
|
|
3
|
-
* Detectors are functions tagged with `DG.FUNC_TYPES.SEM_TYPE_DETECTOR`.
|
|
4
|
-
* See also: https://datagrok.ai/help/develop/how-to/define-semantic-type-detectors
|
|
5
|
-
* The class name is comprised of <PackageName> and the `PackageDetectors` suffix.
|
|
6
|
-
* Follow this naming convention to ensure that your detectors are properly loaded.
|
|
7
|
-
*/
|
|
8
|
-
class #{PACKAGE_DETECTORS_NAME}PackageDetectors extends DG.Package {
|
|
9
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* The class contains semantic type detectors.
|
|
3
|
+
* Detectors are functions tagged with `DG.FUNC_TYPES.SEM_TYPE_DETECTOR`.
|
|
4
|
+
* See also: https://datagrok.ai/help/develop/how-to/define-semantic-type-detectors
|
|
5
|
+
* The class name is comprised of <PackageName> and the `PackageDetectors` suffix.
|
|
6
|
+
* Follow this naming convention to ensure that your detectors are properly loaded.
|
|
7
|
+
*/
|
|
8
|
+
class #{PACKAGE_DETECTORS_NAME}PackageDetectors extends DG.Package {
|
|
9
|
+
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
# Developer keys
|
|
2
|
-
upload.keys.json
|
|
3
|
-
|
|
4
|
-
# Dependency directories
|
|
5
|
-
node_modules/
|
|
6
|
-
|
|
7
|
-
# Webpack outputs
|
|
8
|
-
dist/
|
|
9
|
-
|
|
10
|
-
# IDEs
|
|
11
|
-
# VS Code (https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore)
|
|
12
|
-
.vscode/*
|
|
13
|
-
!.vscode/settings.json
|
|
14
|
-
!.vscode/tasks.json
|
|
15
|
-
!.vscode/launch.json
|
|
16
|
-
!.vscode/extensions.json
|
|
17
|
-
*.code-workspace
|
|
18
|
-
.history/
|
|
19
|
-
|
|
20
|
-
# Intellij IDEA/WebStorm (https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore)
|
|
21
|
-
.idea/inspectionProfiles/
|
|
22
|
-
.idea/**/compiler.xml
|
|
23
|
-
.idea/**/encodings.xml
|
|
24
|
-
.idea/**/workspace.xml
|
|
25
|
-
.idea/**/tasks.xml
|
|
26
|
-
.idea/**/usage.statistics.xml
|
|
27
|
-
.idea/**/dictionaries
|
|
28
|
-
.idea/**/shelf
|
|
29
|
-
.idea/codeStyles/
|
|
1
|
+
# Developer keys
|
|
2
|
+
upload.keys.json
|
|
3
|
+
|
|
4
|
+
# Dependency directories
|
|
5
|
+
node_modules/
|
|
6
|
+
|
|
7
|
+
# Webpack outputs
|
|
8
|
+
dist/
|
|
9
|
+
|
|
10
|
+
# IDEs
|
|
11
|
+
# VS Code (https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore)
|
|
12
|
+
.vscode/*
|
|
13
|
+
!.vscode/settings.json
|
|
14
|
+
!.vscode/tasks.json
|
|
15
|
+
!.vscode/launch.json
|
|
16
|
+
!.vscode/extensions.json
|
|
17
|
+
*.code-workspace
|
|
18
|
+
.history/
|
|
19
|
+
|
|
20
|
+
# Intellij IDEA/WebStorm (https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore)
|
|
21
|
+
.idea/inspectionProfiles/
|
|
22
|
+
.idea/**/compiler.xml
|
|
23
|
+
.idea/**/encodings.xml
|
|
24
|
+
.idea/**/workspace.xml
|
|
25
|
+
.idea/**/tasks.xml
|
|
26
|
+
.idea/**/usage.statistics.xml
|
|
27
|
+
.idea/**/dictionaries
|
|
28
|
+
.idea/**/shelf
|
|
29
|
+
.idea/codeStyles/
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Developer keys
|
|
2
|
+
upload.keys.json
|
|
3
|
+
|
|
4
|
+
# Dependency directories
|
|
5
|
+
node_modules/
|
|
6
|
+
|
|
7
|
+
# IDEs
|
|
8
|
+
# VS Code (https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore)
|
|
9
|
+
.vscode/*
|
|
10
|
+
!.vscode/settings.json
|
|
11
|
+
!.vscode/tasks.json
|
|
12
|
+
!.vscode/launch.json
|
|
13
|
+
!.vscode/extensions.json
|
|
14
|
+
*.code-workspace
|
|
15
|
+
.history/
|
|
16
|
+
|
|
17
|
+
# Intellij IDEA/WebStorm (https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore)
|
|
18
|
+
.idea/inspectionProfiles/
|
|
19
|
+
.idea/**/compiler.xml
|
|
20
|
+
.idea/**/encodings.xml
|
|
21
|
+
.idea/**/workspace.xml
|
|
22
|
+
.idea/**/tasks.xml
|
|
23
|
+
.idea/**/usage.statistics.xml
|
|
24
|
+
.idea/**/dictionaries
|
|
25
|
+
.idea/**/shelf
|
|
26
|
+
.idea/codeStyles/
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "#{PACKAGE_NAME_LOWERCASE}",
|
|
3
|
-
"beta": true,
|
|
4
|
-
"friendlyName": "#{PACKAGE_NAME}",
|
|
5
|
-
"version": "0.0.1",
|
|
6
|
-
"description": "",
|
|
7
|
-
"dependencies": {
|
|
8
|
-
"datagrok-api": "latest",
|
|
9
|
-
"cash-dom": "latest",
|
|
10
|
-
"dayjs": "latest"
|
|
11
|
-
},
|
|
12
|
-
"devDependencies": {
|
|
13
|
-
"webpack": "latest",
|
|
14
|
-
"webpack-cli": "latest"
|
|
15
|
-
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"link-all": "",
|
|
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": "webpack"
|
|
22
|
-
},
|
|
23
|
-
"canEdit": [
|
|
24
|
-
"Developers"
|
|
25
|
-
],
|
|
26
|
-
"canView": [
|
|
27
|
-
"All users"
|
|
28
|
-
]
|
|
29
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "#{PACKAGE_NAME_LOWERCASE}",
|
|
3
|
+
"beta": true,
|
|
4
|
+
"friendlyName": "#{PACKAGE_NAME}",
|
|
5
|
+
"version": "0.0.1",
|
|
6
|
+
"description": "",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"datagrok-api": "latest",
|
|
9
|
+
"cash-dom": "latest",
|
|
10
|
+
"dayjs": "latest"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"webpack": "latest",
|
|
14
|
+
"webpack-cli": "latest"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"link-all": "",
|
|
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": "webpack"
|
|
22
|
+
},
|
|
23
|
+
"canEdit": [
|
|
24
|
+
"Developers"
|
|
25
|
+
],
|
|
26
|
+
"canView": [
|
|
27
|
+
"All users"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as DG from "datagrok-api/dg";
|
|
2
|
-
import * as grok from "datagrok-api/grok";
|
|
3
|
-
import {runTests} from "@datagrok-libraries/utils/src/test";
|
|
4
|
-
import "./tests/chem-tests";
|
|
5
|
-
|
|
6
|
-
export let _package = new DG.Package();
|
|
7
|
-
|
|
8
|
-
//name: test
|
|
9
|
-
//output: dataframe result
|
|
10
|
-
export async function test() {
|
|
11
|
-
let data = await runTests();
|
|
12
|
-
return DG.DataFrame.fromObjects(data);
|
|
1
|
+
import * as DG from "datagrok-api/dg";
|
|
2
|
+
import * as grok from "datagrok-api/grok";
|
|
3
|
+
import {runTests} from "@datagrok-libraries/utils/src/test";
|
|
4
|
+
import "./tests/chem-tests";
|
|
5
|
+
|
|
6
|
+
export let _package = new DG.Package();
|
|
7
|
+
|
|
8
|
+
//name: test
|
|
9
|
+
//output: dataframe result
|
|
10
|
+
export async function test() {
|
|
11
|
+
let data = await runTests();
|
|
12
|
+
return DG.DataFrame.fromObjects(data);
|
|
13
13
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as DG from "datagrok-api/dg";
|
|
2
|
-
import * as grok from "datagrok-api/grok";
|
|
3
|
-
import {runTests, tests} from '@datagrok-libraries/utils/src/test';
|
|
4
|
-
import "./tests/chem-tests";
|
|
5
|
-
|
|
6
|
-
export let _package = new DG.Package();
|
|
7
|
-
export {tests}
|
|
8
|
-
|
|
9
|
-
//name: test
|
|
10
|
-
//output: dataframe result
|
|
11
|
-
export async function test(): Promise<DG.DataFrame> {
|
|
12
|
-
let data = await runTests();
|
|
13
|
-
return DG.DataFrame.fromObjects(data)!;
|
|
1
|
+
import * as DG from "datagrok-api/dg";
|
|
2
|
+
import * as grok from "datagrok-api/grok";
|
|
3
|
+
import {runTests, tests} from '@datagrok-libraries/utils/src/test';
|
|
4
|
+
import "./tests/chem-tests";
|
|
5
|
+
|
|
6
|
+
export let _package = new DG.Package();
|
|
7
|
+
export {tests}
|
|
8
|
+
|
|
9
|
+
//name: test
|
|
10
|
+
//output: dataframe result
|
|
11
|
+
export async function test(): Promise<DG.DataFrame> {
|
|
12
|
+
let data = await runTests();
|
|
13
|
+
return DG.DataFrame.fromObjects(data)!;
|
|
14
14
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/* Do not change these import lines to match external modules in webpack configuration */
|
|
2
|
-
import * as grok from 'datagrok-api/grok';
|
|
3
|
-
import * as ui from 'datagrok-api/ui';
|
|
4
|
-
import * as DG from 'datagrok-api/dg';
|
|
5
|
-
|
|
6
|
-
export const _package = new DG.Package();
|
|
7
|
-
|
|
8
|
-
//name: info
|
|
9
|
-
export function info() {
|
|
10
|
-
grok.shell.info(_package.webRoot);
|
|
11
|
-
}
|
|
1
|
+
/* Do not change these import lines to match external modules in webpack configuration */
|
|
2
|
+
import * as grok from 'datagrok-api/grok';
|
|
3
|
+
import * as ui from 'datagrok-api/ui';
|
|
4
|
+
import * as DG from 'datagrok-api/dg';
|
|
5
|
+
|
|
6
|
+
export const _package = new DG.Package();
|
|
7
|
+
|
|
8
|
+
//name: info
|
|
9
|
+
export function info() {
|
|
10
|
+
grok.shell.info(_package.webRoot);
|
|
11
|
+
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const packageName = path.parse(require('./package.json').name).name.toLowerCase().replace(/-/g, '');
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
mode: 'development',
|
|
6
|
-
entry: {
|
|
7
|
-
test: {filename: 'package-test.js', library: {type: 'var', name:`${packageName}_test`}, import: './src/package-test.ts'},
|
|
8
|
-
package: './src/package.ts'
|
|
9
|
-
},
|
|
10
|
-
resolve: {
|
|
11
|
-
extensions: ['.wasm', '.mjs', '.js', '.json', '.ts', '.tsx'],
|
|
12
|
-
},
|
|
13
|
-
module: {
|
|
14
|
-
rules: [
|
|
15
|
-
{ test: /\.tsx?$/, loader: 'ts-loader' }
|
|
16
|
-
],
|
|
17
|
-
},
|
|
18
|
-
devtool: 'inline-source-map',
|
|
19
|
-
externals: {
|
|
20
|
-
'datagrok-api/dg': 'DG',
|
|
21
|
-
'datagrok-api/grok': 'grok',
|
|
22
|
-
'datagrok-api/ui': 'ui',
|
|
23
|
-
'openchemlib/full.js': 'OCL',
|
|
24
|
-
'rxjs': 'rxjs',
|
|
25
|
-
'rxjs/operators': 'rxjs.operators',
|
|
26
|
-
'cash-dom': '$',
|
|
27
|
-
'dayjs': 'dayjs',
|
|
28
|
-
'wu': 'wu',
|
|
29
|
-
},
|
|
30
|
-
output: {
|
|
31
|
-
filename: '[name].js',
|
|
32
|
-
library: packageName,
|
|
33
|
-
libraryTarget: 'var',
|
|
34
|
-
path: path.resolve(__dirname, 'dist'),
|
|
35
|
-
},
|
|
36
|
-
};
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const packageName = path.parse(require('./package.json').name).name.toLowerCase().replace(/-/g, '');
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
mode: 'development',
|
|
6
|
+
entry: {
|
|
7
|
+
test: {filename: 'package-test.js', library: {type: 'var', name:`${packageName}_test`}, import: './src/package-test.ts'},
|
|
8
|
+
package: './src/package.ts'
|
|
9
|
+
},
|
|
10
|
+
resolve: {
|
|
11
|
+
extensions: ['.wasm', '.mjs', '.js', '.json', '.ts', '.tsx'],
|
|
12
|
+
},
|
|
13
|
+
module: {
|
|
14
|
+
rules: [
|
|
15
|
+
{ test: /\.tsx?$/, loader: 'ts-loader' }
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
devtool: 'inline-source-map',
|
|
19
|
+
externals: {
|
|
20
|
+
'datagrok-api/dg': 'DG',
|
|
21
|
+
'datagrok-api/grok': 'grok',
|
|
22
|
+
'datagrok-api/ui': 'ui',
|
|
23
|
+
'openchemlib/full.js': 'OCL',
|
|
24
|
+
'rxjs': 'rxjs',
|
|
25
|
+
'rxjs/operators': 'rxjs.operators',
|
|
26
|
+
'cash-dom': '$',
|
|
27
|
+
'dayjs': 'dayjs',
|
|
28
|
+
'wu': 'wu',
|
|
29
|
+
},
|
|
30
|
+
output: {
|
|
31
|
+
filename: '[name].js',
|
|
32
|
+
library: packageName,
|
|
33
|
+
libraryTarget: 'var',
|
|
34
|
+
path: path.resolve(__dirname, 'dist'),
|
|
35
|
+
},
|
|
36
|
+
};
|