@nebula.js/cli-build 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 +4 -4
- package/lib/build.js +10 -10
- package/lib/config.js +13 -9
- package/lib/init-config.js +5 -2
- package/lib/resolveNative.js +3 -3
- package/lib/systemjs.js +1 -1
- package/lib/watch.js +12 -9
- package/package.json +9 -8
package/command.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable import/extensions */
|
|
2
|
+
import build from './lib/build.js';
|
|
3
|
+
import init from './lib/init-config.js';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
5
|
+
export default {
|
|
6
6
|
command: 'build',
|
|
7
7
|
desc: 'Build visualization',
|
|
8
8
|
builder(yargs) {
|
package/lib/build.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/* eslint-disable no-console, import/extensions */
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import extend from 'extend';
|
|
4
|
+
import yargs from 'yargs';
|
|
5
|
+
import * as rollup from 'rollup';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import initConfig from './init-config.js';
|
|
8
|
+
import config from './config.js';
|
|
9
|
+
import watch from './watch.js';
|
|
10
|
+
import systemjsBehaviours from './systemjs.js';
|
|
11
11
|
|
|
12
12
|
const umd = async (argv) => {
|
|
13
13
|
const c = config({
|
|
@@ -89,4 +89,4 @@ async function build(argv = {}) {
|
|
|
89
89
|
return undefined;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
export default build;
|
package/lib/config.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/* eslint-disable import/extensions */
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { createRequire } from 'module';
|
|
5
|
+
import { visualizer } from 'rollup-plugin-visualizer';
|
|
6
|
+
|
|
7
|
+
import resolveNative from './resolveNative.js';
|
|
8
|
+
|
|
9
|
+
const require = createRequire(import.meta.url);
|
|
3
10
|
const babel = require('@rollup/plugin-babel');
|
|
4
11
|
const postcss = require('rollup-plugin-postcss');
|
|
5
12
|
const replace = require('@rollup/plugin-replace');
|
|
@@ -8,13 +15,10 @@ const { nodeResolve } = require('@rollup/plugin-node-resolve');
|
|
|
8
15
|
const commonjs = require('@rollup/plugin-commonjs');
|
|
9
16
|
const terser = require('@rollup/plugin-terser');
|
|
10
17
|
const babelPreset = require('@babel/preset-env');
|
|
11
|
-
const { visualizer } = require('rollup-plugin-visualizer');
|
|
12
18
|
const browsersList = require('@qlik/browserslist-config');
|
|
13
19
|
const babelPresetReact = require('@babel/preset-react');
|
|
14
20
|
const babelPresetTypescript = require('@babel/preset-typescript');
|
|
15
21
|
|
|
16
|
-
const resolveNative = require('./resolveNative');
|
|
17
|
-
|
|
18
22
|
const resolveReplacementStrings = (replacementStrings) => {
|
|
19
23
|
if (typeof replacementStrings !== 'object') {
|
|
20
24
|
throw new Error('replacementStrings should be an object with key value pairs of strings!');
|
|
@@ -82,9 +86,9 @@ const config = ({
|
|
|
82
86
|
const CWD = argv.cwd || cwd;
|
|
83
87
|
const { reactNative, reactNativePath } = setupReactNative(argv);
|
|
84
88
|
let dir = CWD;
|
|
85
|
-
let pkg = require(path.resolve(CWD, 'package.json'));
|
|
86
|
-
const corePkg = core ? require(path.resolve(core, 'package.json')) : null;
|
|
87
|
-
pkg = reactNative ? require(path.resolve(reactNativePath, 'package.json')) : pkg;
|
|
89
|
+
let pkg = require(path.resolve(CWD, 'package.json'));
|
|
90
|
+
const corePkg = core ? require(path.resolve(core, 'package.json')) : null;
|
|
91
|
+
pkg = reactNative ? require(path.resolve(reactNativePath, 'package.json')) : pkg;
|
|
88
92
|
const { sourcemap, replacementStrings = {}, typescript, preferBuiltins, browser } = argv;
|
|
89
93
|
const banner = getBanner({ pkg });
|
|
90
94
|
const outputName = getOutputName({ pkg, config: argv });
|
|
@@ -238,4 +242,4 @@ const config = ({
|
|
|
238
242
|
};
|
|
239
243
|
};
|
|
240
244
|
|
|
241
|
-
|
|
245
|
+
export default config;
|
package/lib/init-config.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/* eslint global-require: 0, no-param-reassign: 0 */
|
|
2
|
-
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import { createRequire } from 'module';
|
|
4
|
+
|
|
5
|
+
const require = createRequire(import.meta.url);
|
|
3
6
|
|
|
4
7
|
const defaultFilename = 'nebula.config.js';
|
|
5
8
|
const RX = new RegExp(`${defaultFilename.replace(/\./g, '\\.')}$`);
|
|
@@ -86,7 +89,7 @@ const watchMiddleware = (argv) => {
|
|
|
86
89
|
return argv;
|
|
87
90
|
};
|
|
88
91
|
|
|
89
|
-
|
|
92
|
+
export default (yargs) => {
|
|
90
93
|
yargs.parserConfiguration({
|
|
91
94
|
'dot-notation': false, // To avoid parsing "replacementStrings" with dot-notation into objects
|
|
92
95
|
});
|
package/lib/resolveNative.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import fs from 'fs';
|
|
4
4
|
// this plugin will check if there is a corresponding .native file for the input file and output the contents of the native file
|
|
5
5
|
// This plugin should be loaded first.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
export default ({ reactNative }) => ({
|
|
8
8
|
async load(id) {
|
|
9
9
|
if (!reactNative) {
|
|
10
10
|
return null;
|
package/lib/systemjs.js
CHANGED
package/lib/watch.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/* eslint-disable no-console, import/extensions */
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import readline from 'readline';
|
|
4
|
+
import { createRequire } from 'module';
|
|
5
|
+
import chalk from 'chalk';
|
|
6
|
+
import * as rollup from 'rollup';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
import config from './config.js';
|
|
9
|
+
import systemjsBehaviours from './systemjs.js';
|
|
9
10
|
|
|
10
|
-
const
|
|
11
|
+
const require = createRequire(import.meta.url);
|
|
12
|
+
|
|
13
|
+
const getPackage = (argv, cwd = process.cwd()) => require(path.resolve(argv.cwd || cwd, 'package.json'));
|
|
11
14
|
|
|
12
15
|
const validateWatchInput = (argv) => {
|
|
13
16
|
if (argv.watch === 'systemjs') {
|
|
@@ -119,4 +122,4 @@ const watch = async (argv) => {
|
|
|
119
122
|
});
|
|
120
123
|
};
|
|
121
124
|
|
|
122
|
-
|
|
125
|
+
export default watch;
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nebula.js/cli-build",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"license": "MIT",
|
|
6
7
|
"author": "QlikTech International AB",
|
|
7
8
|
"keywords": [],
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
"dependencies": {
|
|
24
25
|
"@babel/cli": "7.28.6",
|
|
25
26
|
"@babel/core": "7.29.0",
|
|
26
|
-
"@babel/preset-env": "7.29.
|
|
27
|
+
"@babel/preset-env": "7.29.5",
|
|
27
28
|
"@babel/preset-react": "7.28.5",
|
|
28
29
|
"@babel/preset-typescript": "7.28.5",
|
|
29
30
|
"@qlik/browserslist-config": "^3.0.0",
|
|
@@ -35,16 +36,16 @@
|
|
|
35
36
|
"@rollup/plugin-terser": "1.0.0",
|
|
36
37
|
"chalk": "4.1.2",
|
|
37
38
|
"extend": "3.0.2",
|
|
38
|
-
"postcss": "^8.5.
|
|
39
|
-
"rollup": "4.60.
|
|
39
|
+
"postcss": "^8.5.14",
|
|
40
|
+
"rollup": "4.60.3",
|
|
40
41
|
"rollup-plugin-postcss": "4.0.2",
|
|
41
|
-
"rollup-plugin-visualizer": "
|
|
42
|
-
"yargs": "
|
|
42
|
+
"rollup-plugin-visualizer": "7.0.1",
|
|
43
|
+
"yargs": "18.0.0"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
46
|
"@rollup/plugin-typescript": "12.3.0",
|
|
46
47
|
"tslib": "*",
|
|
47
|
-
"typescript": ">=6.0.
|
|
48
|
+
"typescript": ">=6.0.3"
|
|
48
49
|
},
|
|
49
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "93100660bf15d108c07c96c46e93858c449c483c"
|
|
50
51
|
}
|