@nebula.js/cli-sense 6.8.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 CHANGED
@@ -1,7 +1,8 @@
1
- const init = require('./lib/init-config');
2
- const sense = require('./lib/sense');
1
+ /* eslint-disable import/extensions */
2
+ import init from './lib/init-config.js';
3
+ import sense from './lib/sense.js';
3
4
 
4
- module.exports = {
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
- const extend = require('extend');
2
- const yargs = require('yargs');
3
- const initConfig = require('./init-config');
4
- const sense = require('./sense');
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
- module.exports = (argv) => {
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
- const path = require('path');
3
- const fs = require('fs-extra');
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ import { createRequire } from 'module';
5
+ import fs from 'fs-extra';
4
6
 
5
- const rollup = require('rollup');
6
- const { nodeResolve } = require('@rollup/plugin-node-resolve');
7
- const common = require('@rollup/plugin-commonjs');
8
- const babel = require('@rollup/plugin-babel');
9
- const terser = require('@rollup/plugin-terser');
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')); // eslint-disable-line
19
+ const supernovaPkg = require(path.resolve(cwd, 'package.json'));
15
20
 
16
- let extName = supernovaPkg.name.split('/').reverse()[0]; // replace(/\//, '-').replace('@', '');
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)); // eslint-disable-line
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(__dirname, extDefinition ? '../src/ext.js' : '../src/empty-ext.js'), {
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
- module.exports = build;
137
+ export default build;
@@ -29,4 +29,4 @@ const options = {
29
29
  },
30
30
  };
31
31
 
32
- module.exports = (yargs) => yargs.options(options);
32
+ export default (yargs) => yargs.options(options);
package/lib/sense.js CHANGED
@@ -1,4 +1,5 @@
1
- const build = require('./build');
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
- module.exports = sense;
11
+ export default sense;
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@nebula.js/cli-sense",
3
- "version": "6.8.0",
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.2",
33
- "@nebula.js/stardust": "^6.8.0",
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.60.0",
43
- "yargs": "17.7.2"
43
+ "rollup": "4.60.3",
44
+ "yargs": "18.0.0"
44
45
  },
45
- "gitHead": "5da9c702c8dc6c9570ea50ef458d2328385eef2b"
46
+ "gitHead": "93100660bf15d108c07c96c46e93858c449c483c"
46
47
  }