@nebula.js/cli-create 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 CHANGED
@@ -1,4 +1,5 @@
1
- const create = require('./lib/create');
1
+ /* eslint-disable import/extensions */
2
+ import create from './lib/create.js';
2
3
 
3
4
  const mashup = {
4
5
  command: 'mashup <name>',
@@ -14,7 +15,7 @@ const mashup = {
14
15
  },
15
16
  };
16
17
 
17
- module.exports = {
18
+ export default {
18
19
  command: 'create <name>',
19
20
  desc: 'Create a visualization',
20
21
  builder(yargs) {
package/lib/create.js CHANGED
@@ -1,14 +1,19 @@
1
1
  /* eslint-disable no-console */
2
- const path = require('path');
3
- const fs = require('fs');
4
- const { execSync } = require('child_process');
5
- const chalk = require('chalk');
6
- const fse = require('fs-extra');
7
- const ejs = require('ejs');
8
- const inquirer = require('inquirer');
9
-
2
+ import path from 'path';
3
+ import fs from 'fs';
4
+ import { execSync } from 'child_process';
5
+ import { createRequire } from 'module';
6
+ import { fileURLToPath } from 'url';
7
+ import chalk from 'chalk';
8
+ import fse from 'fs-extra';
9
+ import ejs from 'ejs';
10
+ import { select } from '@inquirer/prompts';
11
+
12
+ const require = createRequire(import.meta.url);
10
13
  const pkg = require('../package.json');
11
14
 
15
+ const moduleDir = path.dirname(fileURLToPath(import.meta.url));
16
+
12
17
  const hasYarn = () => {
13
18
  try {
14
19
  execSync('yarnpkg --version', { stdio: 'ignore' });
@@ -63,7 +68,7 @@ const create = async (argv) => {
63
68
  const packageName = name.split('/').slice(-1)[0];
64
69
 
65
70
  const cwd = process.cwd();
66
- const templatesRoot = path.resolve(__dirname, '..', 'templates');
71
+ const templatesRoot = path.resolve(moduleDir, '..', 'templates');
67
72
  const destination = path.resolve(cwd, projectFolder);
68
73
 
69
74
  let options = {
@@ -81,18 +86,19 @@ const create = async (argv) => {
81
86
  }
82
87
 
83
88
  const prompt = async () => {
84
- const answers = await inquirer.prompt([
85
- {
86
- type: 'list',
87
- name: 'picasso',
89
+ if (!isMashup && !argv.picasso) {
90
+ const picasso = await select({
88
91
  message: 'Pick a picasso template',
89
92
  default: 'none',
90
- choices: ['none', 'minimal', 'barchart'],
91
- when: !isMashup && !argv.picasso,
92
- },
93
- ]);
93
+ choices: [
94
+ { name: 'none', value: 'none' },
95
+ { name: 'minimal', value: 'minimal' },
96
+ { name: 'barchart', value: 'barchart' },
97
+ ],
98
+ });
94
99
 
95
- options = { ...options, ...answers };
100
+ options = { ...options, picasso };
101
+ }
96
102
  };
97
103
 
98
104
  const write = async () => {
@@ -190,4 +196,4 @@ const create = async (argv) => {
190
196
  await end();
191
197
  };
192
198
 
193
- module.exports = create;
199
+ export default create;
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@nebula.js/cli-create",
3
- "version": "6.7.0",
3
+ "version": "7.0.0",
4
4
  "description": "",
5
+ "type": "module",
5
6
  "license": "MIT",
6
7
  "author": "QlikTech International AB",
7
8
  "keywords": [],
@@ -22,10 +23,10 @@
22
23
  "generate": "yo ./generator/index.js"
23
24
  },
24
25
  "dependencies": {
26
+ "@inquirer/prompts": "8.3.2",
25
27
  "chalk": "4.1.2",
26
- "ejs": "5.0.1",
27
- "fs-extra": "11.3.4",
28
- "inquirer": "8.2.7"
28
+ "ejs": "5.0.2",
29
+ "fs-extra": "11.3.4"
29
30
  },
30
- "gitHead": "d87ebb13ec942bfc42cbb691d9a22b62f19d4365"
31
+ "gitHead": "93100660bf15d108c07c96c46e93858c449c483c"
31
32
  }
@@ -12,9 +12,9 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@nebula.js/stardust": "<%= nebulaVersion %>",
15
- "@nebula.js/sn-bar-chart": "^1.x",
16
- "@qlik/api": "^1.37.0",
17
- "enigma.js": "^2.6.3",
18
- "parcel": "2.13.3"
15
+ "@nebula.js/sn-bar-chart": "^2.2.0",
16
+ "@qlik/api": "2.7.0",
17
+ "enigma.js": "^2.14.0",
18
+ "parcel": "2.16.4"
19
19
  }
20
20
  }
@@ -1,3 +1,4 @@
1
1
  dist
2
2
  coverage
3
3
  node_modules
4
+ .github
@@ -10,7 +10,7 @@
10
10
  "keywords": ["qlik", "nebula", "stardust"],
11
11
  "files": ["dist"],
12
12
  "engines": {
13
- "node": ">=18.10.0"
13
+ "node": ">=24.0.0"
14
14
  },
15
15
  "main": "dist/<%= name %>.js",
16
16
  "module": "dist/<%= name %>.esm.js",
@@ -27,14 +27,13 @@
27
27
  "@nebula.js/cli-build": "<%= nebulaVersion %>",
28
28
  "@nebula.js/cli-serve": "<%= nebulaVersion %>",
29
29
  "@nebula.js/cli-sense": "<%= nebulaVersion %>",
30
- "@playwright/test": "^1.28.1",
31
- "@qlik/sdk": "^0.28.0",
32
- "eslint": "7.27.0",
33
- "eslint-config-airbnb-base": "14.2.1",
34
- "eslint-plugin-import": "2.23.4",
35
- "eslint-plugin-mocha": "9.0.0"
30
+ "@playwright/test": "^1.59.1",
31
+ "eslint": "8.57.1",
32
+ "eslint-config-airbnb-base": "15.0.0",
33
+ "eslint-plugin-import": "2.32.0",
34
+ "eslint-plugin-mocha": "11.2.0"
36
35
  },
37
36
  "peerDependencies": {
38
- "@nebula.js/stardust": ">=5.0.0"
37
+ "@nebula.js/stardust": ">=7.0.0"
39
38
  }
40
39
  }
@@ -10,7 +10,7 @@
10
10
  "keywords": ["qlik", "nebula", "stardust"],
11
11
  "files": ["dist"],
12
12
  "engines": {
13
- "node": ">=18.10.0"
13
+ "node": ">=24.0.0"
14
14
  },
15
15
  "main": "dist/<%= name %>.js",
16
16
  "module": "dist/<%= name %>.esm.js",
@@ -32,11 +32,10 @@
32
32
  "eslint-config-airbnb-base": "14.2.1",
33
33
  "eslint-plugin-import": "2.23.4",
34
34
  "eslint-plugin-mocha": "9.0.0",
35
- "@qlik/sdk": "^0.28.0",
36
35
  "picasso.js": "2.1.1",
37
36
  "picasso-plugin-q": "2.1.1"
38
37
  },
39
38
  "peerDependencies": {
40
- "@nebula.js/stardust": ">=5.0.0"
39
+ "@nebula.js/stardust": ">=7.0.0"
41
40
  }
42
41
  }