@nebula.js/cli-sense 6.7.0 → 7.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/command.js +4 -3
- package/lib/api-entry.js +6 -5
- package/lib/build.js +17 -12
- package/lib/init-config.js +1 -1
- package/lib/sense.js +3 -2
- package/package.json +7 -6
package/command.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/* eslint-disable import/extensions */
|
|
2
|
+
import init from './lib/init-config.js';
|
|
3
|
+
import sense from './lib/sense.js';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
export default {
|
|
5
6
|
command: 'sense',
|
|
6
7
|
desc: 'Build a nebula visualization as a Qlik Sense extension',
|
|
7
8
|
builder(yargs) {
|
package/lib/api-entry.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/* eslint-disable import/extensions */
|
|
2
|
+
import extend from 'extend';
|
|
3
|
+
import yargs from 'yargs';
|
|
4
|
+
import initConfig from './init-config.js';
|
|
5
|
+
import sense from './sense.js';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
export default (argv) => {
|
|
7
8
|
// not runnning via command line, run the config to inject default values
|
|
8
9
|
const defaultBuildConfig = initConfig(yargs([])).argv;
|
|
9
10
|
const senseConfig = extend(true, {}, defaultBuildConfig, argv);
|
package/lib/build.js
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import { createRequire } from 'module';
|
|
5
|
+
import fs from 'fs-extra';
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
import * as rollup from 'rollup';
|
|
8
|
+
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
9
|
+
import common from '@rollup/plugin-commonjs';
|
|
10
|
+
import babel from '@rollup/plugin-babel';
|
|
11
|
+
import terser from '@rollup/plugin-terser';
|
|
12
|
+
|
|
13
|
+
const require = createRequire(import.meta.url);
|
|
14
|
+
const moduleDir = path.dirname(fileURLToPath(import.meta.url));
|
|
10
15
|
|
|
11
16
|
async function build(argv) {
|
|
12
17
|
const cwd = process.cwd();
|
|
13
18
|
|
|
14
|
-
const supernovaPkg = require(path.resolve(cwd, 'package.json'));
|
|
19
|
+
const supernovaPkg = require(path.resolve(cwd, 'package.json'));
|
|
15
20
|
|
|
16
|
-
let extName = supernovaPkg.name.split('/').reverse()[0];
|
|
21
|
+
let extName = supernovaPkg.name.split('/').reverse()[0];
|
|
17
22
|
|
|
18
23
|
const { main } = supernovaPkg;
|
|
19
24
|
|
|
@@ -32,7 +37,7 @@ async function build(argv) {
|
|
|
32
37
|
const createQextFiles = () => {
|
|
33
38
|
const qext = supernovaPkg.qext || {};
|
|
34
39
|
if (argv.meta) {
|
|
35
|
-
const meta = require(path.resolve(cwd, argv.meta));
|
|
40
|
+
const meta = require(path.resolve(cwd, argv.meta));
|
|
36
41
|
Object.assign(qext, meta);
|
|
37
42
|
}
|
|
38
43
|
const contents = {
|
|
@@ -46,7 +51,7 @@ async function build(argv) {
|
|
|
46
51
|
supernova: true,
|
|
47
52
|
};
|
|
48
53
|
|
|
49
|
-
let qextjs = fs.readFileSync(path.resolve(
|
|
54
|
+
let qextjs = fs.readFileSync(path.resolve(moduleDir, extDefinition ? '../src/ext.js' : '../src/empty-ext.js'), {
|
|
50
55
|
encoding: 'utf8',
|
|
51
56
|
});
|
|
52
57
|
qextjs = qextjs.replace('{{DIST}}', `./${main.replace(/^[./]*/, '').replace(/\.js$/, '')}`);
|
|
@@ -129,4 +134,4 @@ async function build(argv) {
|
|
|
129
134
|
createQextFiles();
|
|
130
135
|
}
|
|
131
136
|
|
|
132
|
-
|
|
137
|
+
export default build;
|
package/lib/init-config.js
CHANGED
package/lib/sense.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable import/extensions */
|
|
2
|
+
import build from './build.js';
|
|
2
3
|
|
|
3
4
|
function sense(argv) {
|
|
4
5
|
if (argv.legacy) {
|
|
@@ -7,4 +8,4 @@ function sense(argv) {
|
|
|
7
8
|
}
|
|
8
9
|
return build(argv);
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
+
export default sense;
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nebula.js/cli-sense",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Build a supernova as a Qlik Sense extension",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"license": "MIT",
|
|
6
7
|
"author": "QlikTech International AB",
|
|
7
8
|
"keywords": [
|
|
@@ -29,8 +30,8 @@
|
|
|
29
30
|
"dependencies": {
|
|
30
31
|
"@babel/cli": "7.28.6",
|
|
31
32
|
"@babel/core": "7.29.0",
|
|
32
|
-
"@babel/preset-env": "7.29.
|
|
33
|
-
"@nebula.js/stardust": "^
|
|
33
|
+
"@babel/preset-env": "7.29.5",
|
|
34
|
+
"@nebula.js/stardust": "^7.0.0",
|
|
34
35
|
"@rollup/plugin-babel": "7.0.0",
|
|
35
36
|
"@rollup/plugin-commonjs": "29.0.2",
|
|
36
37
|
"@rollup/plugin-node-resolve": "16.0.3",
|
|
@@ -39,8 +40,8 @@
|
|
|
39
40
|
"extend": "3.0.2",
|
|
40
41
|
"fs-extra": "11.3.4",
|
|
41
42
|
"node-event-emitter": "0.0.1",
|
|
42
|
-
"rollup": "4.
|
|
43
|
-
"yargs": "
|
|
43
|
+
"rollup": "4.60.3",
|
|
44
|
+
"yargs": "18.0.0"
|
|
44
45
|
},
|
|
45
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "93100660bf15d108c07c96c46e93858c449c483c"
|
|
46
47
|
}
|