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.
- package/.devcontainer/entrypoint.sh +0 -0
- package/.turbo/turbo-build.log +5 -0
- package/CHANGELOG.md +2 -0
- package/CLAUDE.md +5 -6
- package/LICENSE.md +16 -0
- package/README.md +5 -3
- package/bin/commands/build.js +123 -139
- package/bin/commands/check.js +3 -4
- package/bin/commands/create.js +37 -11
- package/bin/commands/help.js +59 -17
- package/bin/commands/link.js +10 -0
- package/bin/commands/publish.js +12 -13
- package/bin/commands/setup.js +139 -0
- package/bin/commands/tsc.js +26 -0
- package/bin/grok.js +34 -21
- package/bin/utils/toolchain.js +121 -0
- package/bin/utils/utils.js +9 -0
- package/package-template/.vscode/tasks.json +1 -1
- package/package-template/package.json +9 -14
- package/package-template/tsconfig.json +2 -69
- package/package.json +17 -17
- package/plugins/func-gen-plugin.js +9 -4
- package/turbo.json +9 -0
- package/package-template/.eslintrc.json +0 -38
- package/package-template/ts.webpack.config.js +0 -46
- package/package-template/webpack.config.js +0 -35
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
// Loaded on first use: the parser and generator cost ~0.3 s, and the plugin is instantiated by every
|
|
5
|
+
// bundle whether or not a file changed.
|
|
6
|
+
let _tsParser; let _generate;
|
|
7
|
+
const tsParser = {parse: (...a) => (_tsParser ??= require('@typescript-eslint/typescript-estree')).parse(...a)};
|
|
8
|
+
const generate = (...a) => (_generate ??= require('@babel/generator').default)(...a);
|
|
6
9
|
|
|
7
10
|
const {
|
|
8
11
|
reservedDecorators,
|
|
@@ -15,9 +18,11 @@ const {
|
|
|
15
18
|
inputOptionsNames,
|
|
16
19
|
} = require('../bin/utils/func-generation');
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
// Not imported from commands/migrate: that module loads ts-morph (~1.5 s) at require time.
|
|
22
|
+
const toCamelCase = (s) => s.split('-').map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join('');
|
|
19
23
|
|
|
20
|
-
|
|
24
|
+
let _api;
|
|
25
|
+
const api = (...a) => (_api ??= require('../bin/commands/api').api)(...a);
|
|
21
26
|
|
|
22
27
|
// Prebuilt CJS bundle of diff-grok's IVP parser (`getIVP` + a couple constants), tree-shaken
|
|
23
28
|
// to exclude the script-code generator. Regenerate with `npm run update:ivp-parser`.
|
package/turbo.json
ADDED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"browser": true,
|
|
4
|
-
"es2022": 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,46 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const FuncGeneratorPlugin = require('datagrok-tools/plugins/func-gen-plugin');
|
|
3
|
-
const packageName = path.parse(require('./package.json').name).name.toLowerCase().replace(/-/g, '');
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
cache: {
|
|
7
|
-
type: 'filesystem',
|
|
8
|
-
},
|
|
9
|
-
mode: 'development',
|
|
10
|
-
entry: {
|
|
11
|
-
test: {filename: 'package-test.js', library: {type: 'var', name: `${packageName}_test`}, import: './src/package-test.ts'},
|
|
12
|
-
package: './src/package.ts',
|
|
13
|
-
},
|
|
14
|
-
resolve: {
|
|
15
|
-
symlinks: false,
|
|
16
|
-
extensions: ['.wasm', '.mjs', '.ts', '.json', '.js', '.tsx'],
|
|
17
|
-
},
|
|
18
|
-
module: {
|
|
19
|
-
rules: [
|
|
20
|
-
{test: /\.tsx?$/, loader: 'ts-loader', options: {allowTsInNodeModules: true}},
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
plugins: [
|
|
24
|
-
new FuncGeneratorPlugin({outputPath: './src/package.g.ts'}),
|
|
25
|
-
],
|
|
26
|
-
devtool: 'source-map',
|
|
27
|
-
externals: {
|
|
28
|
-
'datagrok-api/dg': 'DG',
|
|
29
|
-
'datagrok-api/grok': 'grok',
|
|
30
|
-
'datagrok-api/ui': 'ui',
|
|
31
|
-
'openchemlib/full.js': 'OCL',
|
|
32
|
-
'rxjs': 'rxjs',
|
|
33
|
-
'rxjs/operators': 'rxjs.operators',
|
|
34
|
-
'cash-dom': '$',
|
|
35
|
-
'dayjs': 'dayjs',
|
|
36
|
-
'wu': 'wu',
|
|
37
|
-
'exceljs': 'ExcelJS',
|
|
38
|
-
'html2canvas': 'html2canvas',
|
|
39
|
-
},
|
|
40
|
-
output: {
|
|
41
|
-
filename: '[name].js',
|
|
42
|
-
library: packageName,
|
|
43
|
-
libraryTarget: 'var',
|
|
44
|
-
path: path.resolve(__dirname, 'dist'),
|
|
45
|
-
},
|
|
46
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const packageName = path.parse(require('./package.json').name).name.toLowerCase().replace(/-/g, '');
|
|
3
|
-
const FuncGeneratorPlugin = require('datagrok-tools/plugins/func-gen-plugin');
|
|
4
|
-
module.exports = {
|
|
5
|
-
cache: {
|
|
6
|
-
type: 'filesystem',
|
|
7
|
-
},
|
|
8
|
-
mode: 'production',
|
|
9
|
-
entry: {
|
|
10
|
-
package: './src/package.js',
|
|
11
|
-
},
|
|
12
|
-
devtool: 'source-map',
|
|
13
|
-
externals: {
|
|
14
|
-
'datagrok-api/dg': 'DG',
|
|
15
|
-
'datagrok-api/grok': 'grok',
|
|
16
|
-
'datagrok-api/ui': 'ui',
|
|
17
|
-
'openchemlib/full.js': 'OCL',
|
|
18
|
-
'rxjs': 'rxjs',
|
|
19
|
-
'rxjs/operators': 'rxjs.operators',
|
|
20
|
-
'cash-dom': '$',
|
|
21
|
-
'dayjs': 'dayjs',
|
|
22
|
-
'wu': 'wu',
|
|
23
|
-
'exceljs': 'ExcelJS',
|
|
24
|
-
'html2canvas': 'html2canvas',
|
|
25
|
-
},
|
|
26
|
-
output: {
|
|
27
|
-
filename: '[name].js',
|
|
28
|
-
library: packageName,
|
|
29
|
-
libraryTarget: 'var',
|
|
30
|
-
path: path.resolve(__dirname, 'dist'),
|
|
31
|
-
},
|
|
32
|
-
plugins: [
|
|
33
|
-
new FuncGeneratorPlugin({outputPath: './src/package.g.ts'}),
|
|
34
|
-
],
|
|
35
|
-
};
|