powerbi-visuals-tools 5.4.1 → 5.4.3
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/Changelog.md +8 -0
- package/bin/pbiviz.js +2 -0
- package/certs/PowerBICustomVisualTest_private.key +26 -26
- package/certs/PowerBICustomVisualTest_public.crt +17 -17
- package/lib/CommandManager.js +1 -0
- package/lib/LintValidator.js +49 -33
- package/lib/VisualManager.js +11 -3
- package/lib/webpack.config.js +2 -1
- package/package.json +10 -10
package/Changelog.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
This page contains information about changes to the PowerBI Visual Tools (pbiviz).
|
|
4
4
|
|
|
5
|
+
## 5.4.3
|
|
6
|
+
* Fixed bug with missing plugins for Eslint.
|
|
7
|
+
* New flag `--use-default` for `pbiviz package` and `pbiviz lint` commands. Use this command to lint files according to recommended lint config.
|
|
8
|
+
|
|
9
|
+
## 5.4.2
|
|
10
|
+
* Added the **node: false** option to the webpack plugin to eliminate the use of the potentially dangerous **new Function()** method, which ensures compatibility with the Node.js runtime.
|
|
11
|
+
* Introduced support for *.mjs ECMAScript modules.
|
|
12
|
+
|
|
5
13
|
## 5.4.1
|
|
6
14
|
* Updated R-based visuals settings.ts file to work properly with the new API
|
|
7
15
|
|
package/bin/pbiviz.js
CHANGED
|
@@ -72,6 +72,7 @@ pbiviz
|
|
|
72
72
|
pbiviz
|
|
73
73
|
.command('lint')
|
|
74
74
|
.option('--fix', 'Enable autofixing of lint errors')
|
|
75
|
+
.option('--use-default', 'Use recommended eslintrc file')
|
|
75
76
|
.action(options => {
|
|
76
77
|
CommandManager.lint({ ...options, verbose: true }, rootPath);
|
|
77
78
|
});
|
|
@@ -100,6 +101,7 @@ pbiviz
|
|
|
100
101
|
.option('-l, --all-locales', "Keeps all locale files in the package. By default only used inside stringResources folder locales are included.")
|
|
101
102
|
.option('-v, --verbose', "Enables verbose logging")
|
|
102
103
|
.option('--fix', 'Enable autofixing of lint errors')
|
|
104
|
+
.option('--use-default', 'Use recommended eslintrc file')
|
|
103
105
|
.option('-p, --pbiviz-file <pbiviz-file>', "Path to pbiviz.json file (useful for debugging)", pbivizFile)
|
|
104
106
|
.addOption(new Option('-c, --compression <compressionLevel>', "Enables compression of visual package")
|
|
105
107
|
.choices(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'])
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
-----BEGIN PRIVATE KEY-----
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
+
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
2
|
+
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDA/HV0YoD7zmrM
|
|
3
|
+
+IwncAJLHH7ld0deBjC4tIPzv06sGwOqLgnUy5zSjHIb5k7/ojuyW1KQ1dcWU3az
|
|
4
|
+
yj6To9Sl7aieuzHbobsUM7jSKTmCk5zowjZa9JSmU3gP/Ma2/IptvtkWoa8oTCU9
|
|
5
|
+
/iisjLugVBUNyAjSObIWOqtLDlXgHjfX7U/PhrZmQaAC6Z33uHB+J+L3tQq1B7fx
|
|
6
|
+
bNDuW1qQhdTodZ7ecKeyYXZ6uGP961+WyUWFIkLJxYojXYI9QwEfOIMQN3H9LqaP
|
|
7
|
+
m7ZsYtdzUfKcWryRRHiejUALNdkDIpLYixfPsoVzBty2uVE4qFb0vuWA9pVhIdIx
|
|
8
|
+
zAmQbvxnAgMBAAECggEAPzp3wQoE+HtIwp8sTD+GgNV1Pfk2iLe+fsWl9dZYEEtJ
|
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UKtQe38WzQ7ltakIXU6HWe3nCnsmF2erhj/etf
|
|
9
|
+
lslFhSJCycWKI12CPUMBHziDEDdx/S6mj5u2bGLXc1HynFq8kUR4no1ACzXZAyKS
|
|
10
|
+
2IsXz7KFcwbctrlROKhW9L7lgPaVYSHSMcwJkG78ZwIDAQABo1MwUTAdBgNVHQ4E
|
|
11
|
+
FgQUNVa/M6yDr6zThWXt51Ag6kZlAaYwHwYDVR0jBBgwFoAUNVa/M6yDr6zThWXt
|
|
12
|
+
51Ag6kZlAaYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAGYjh
|
|
13
|
+
ykXpTW2OcRUM6xPcp9MGdr/b1V1sQQ2OI4GXBuBuqBybY1mROSvprzmEre+SslWI
|
|
14
|
+
joR/wepusgPsoWl54Gylg1eir4xWPq06U6KkNtngMpwHO1ln97Fw6eEND0bJWcn3
|
|
15
|
+
HKagaqOd96vNii4AjMeQnncNUqQGfizDjEOwDY0JY6A4DDjf+Zud6dcpkr7emZby
|
|
16
|
+
3ZQEQ5Jzt2aCqmc1Dzbw2RE/mnlcc87x0jWXyTGVC+L+e08et8WLPFcDtgVa+2L0
|
|
17
|
+
NSVE+P9vchDdX8oHcqGovC0LZibkJZ46oNtqeQQ5/LN2P3Zk6dji4BI7u//U03Gf
|
|
18
|
+
ko5df8qJp7CXHrl6+Q==
|
|
19
19
|
-----END CERTIFICATE-----
|
package/lib/CommandManager.js
CHANGED
|
@@ -49,6 +49,7 @@ export default class CommandManager {
|
|
|
49
49
|
const lintOptions = {
|
|
50
50
|
verbose: options.verbose,
|
|
51
51
|
fix: options.fix,
|
|
52
|
+
useDefault: options.useDefault
|
|
52
53
|
};
|
|
53
54
|
const visual = new VisualManager(rootPath).prepareVisual(options.pbivizFile);
|
|
54
55
|
await visual.runLintValidation(lintOptions);
|
package/lib/LintValidator.js
CHANGED
|
@@ -1,37 +1,44 @@
|
|
|
1
1
|
import { ESLint } from "eslint";
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import fs from 'fs';
|
|
2
4
|
import ConsoleWriter from "./ConsoleWriter.js";
|
|
3
5
|
import { fileExists, getRootPath } from "./utils.js";
|
|
4
6
|
export class LintValidator {
|
|
5
7
|
visualPath;
|
|
6
8
|
rootPath;
|
|
9
|
+
isVerboseMode;
|
|
10
|
+
useDefault;
|
|
11
|
+
shouldFix;
|
|
7
12
|
config;
|
|
8
|
-
defaultConfig;
|
|
9
13
|
linterInstance;
|
|
10
|
-
constructor(fix
|
|
14
|
+
constructor({ verbose, fix, useDefault }) {
|
|
11
15
|
this.visualPath = process.cwd();
|
|
12
16
|
this.rootPath = getRootPath();
|
|
13
|
-
this.
|
|
17
|
+
this.isVerboseMode = verbose;
|
|
18
|
+
this.useDefault = useDefault;
|
|
19
|
+
this.shouldFix = fix;
|
|
20
|
+
this.prepareConfig();
|
|
14
21
|
this.linterInstance = new ESLint(this.config);
|
|
15
22
|
}
|
|
16
23
|
/**
|
|
17
24
|
* Runs lint validation in the visual folder
|
|
18
25
|
*/
|
|
19
|
-
async runLintValidation(
|
|
26
|
+
async runLintValidation() {
|
|
20
27
|
ConsoleWriter.info("Running lint check...");
|
|
21
28
|
// By default it will lint all files in the src of current working directory, but some files can be excluded in .eslintignore
|
|
22
|
-
const results = await this.linterInstance.lintFiles("src
|
|
23
|
-
if (
|
|
29
|
+
const results = await this.linterInstance.lintFiles("src/");
|
|
30
|
+
if (this.shouldFix) {
|
|
24
31
|
await this.fixErrors(results);
|
|
25
32
|
}
|
|
26
|
-
await this.outputResults(results
|
|
33
|
+
await this.outputResults(results);
|
|
27
34
|
ConsoleWriter.info("Lint check completed.");
|
|
28
35
|
}
|
|
29
36
|
async fixErrors(results) {
|
|
30
37
|
ConsoleWriter.info("Lint fixing errors...");
|
|
31
38
|
await ESLint.outputFixes(results);
|
|
32
39
|
}
|
|
33
|
-
async outputResults(results
|
|
34
|
-
if (
|
|
40
|
+
async outputResults(results) {
|
|
41
|
+
if (this.isVerboseMode) {
|
|
35
42
|
const formatter = await this.linterInstance.loadFormatter("stylish");
|
|
36
43
|
const formattedResults = await formatter.format(results);
|
|
37
44
|
console.log(formattedResults);
|
|
@@ -46,33 +53,42 @@ export class LintValidator {
|
|
|
46
53
|
}
|
|
47
54
|
}
|
|
48
55
|
}
|
|
49
|
-
prepareConfig(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
es6: true,
|
|
55
|
-
es2022: true
|
|
56
|
-
},
|
|
57
|
-
plugins: [
|
|
58
|
-
"powerbi-visuals"
|
|
59
|
-
],
|
|
60
|
-
extends: [
|
|
61
|
-
"plugin:powerbi-visuals/recommended"
|
|
62
|
-
]
|
|
63
|
-
},
|
|
64
|
-
extensions: [".ts", ".tsx"],
|
|
65
|
-
resolvePluginsRelativeTo: this.rootPath,
|
|
66
|
-
useEslintrc: false,
|
|
67
|
-
fix
|
|
56
|
+
prepareConfig() {
|
|
57
|
+
const requiredConfig = {
|
|
58
|
+
extensions: [".js", ".jsx", ".ts", ".tsx"],
|
|
59
|
+
fix: this.shouldFix,
|
|
60
|
+
resolvePluginsRelativeTo: this.getPluginPath()
|
|
68
61
|
};
|
|
69
|
-
const eslintrcExtensions = ['.json', '.js', '.ts'];
|
|
70
|
-
if (eslintrcExtensions.some(el => fileExists(this.visualPath, `.eslintrc${el}`))) {
|
|
71
|
-
this.config =
|
|
62
|
+
const eslintrcExtensions = ['.json', '.js', '.cjs', '.ts', ''];
|
|
63
|
+
if (!this.useDefault && eslintrcExtensions.some(el => fileExists(this.visualPath, `.eslintrc${el}`))) {
|
|
64
|
+
this.config = requiredConfig;
|
|
72
65
|
}
|
|
73
66
|
else {
|
|
74
|
-
ConsoleWriter.warning("
|
|
75
|
-
this.config =
|
|
67
|
+
ConsoleWriter.warning("Using recommended eslint config.");
|
|
68
|
+
this.config = {
|
|
69
|
+
...requiredConfig,
|
|
70
|
+
overrideConfig: {
|
|
71
|
+
env: {
|
|
72
|
+
browser: true,
|
|
73
|
+
es6: true,
|
|
74
|
+
es2022: true
|
|
75
|
+
},
|
|
76
|
+
plugins: [
|
|
77
|
+
"powerbi-visuals"
|
|
78
|
+
],
|
|
79
|
+
extends: [
|
|
80
|
+
"plugin:powerbi-visuals/recommended"
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
useEslintrc: false,
|
|
84
|
+
};
|
|
76
85
|
}
|
|
77
86
|
}
|
|
87
|
+
getPluginPath() {
|
|
88
|
+
const pluginPaths = [
|
|
89
|
+
path.resolve(this.visualPath, "node_modules", "eslint-plugin-powerbi-visuals"),
|
|
90
|
+
path.resolve(this.rootPath, "node_modules", "eslint-plugin-powerbi-visuals")
|
|
91
|
+
];
|
|
92
|
+
return pluginPaths.find(fs.existsSync);
|
|
93
|
+
}
|
|
78
94
|
}
|
package/lib/VisualManager.js
CHANGED
|
@@ -68,9 +68,17 @@ export default class VisualManager {
|
|
|
68
68
|
}
|
|
69
69
|
return this;
|
|
70
70
|
}
|
|
71
|
-
runLintValidation(options) {
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
async runLintValidation(options) {
|
|
72
|
+
try {
|
|
73
|
+
const linter = new LintValidator(options);
|
|
74
|
+
await linter.runLintValidation();
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
ConsoleWriter.error("Can't run lint validation.");
|
|
78
|
+
if (options.verbose) {
|
|
79
|
+
ConsoleWriter.error(error.message);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
74
82
|
}
|
|
75
83
|
createVisualInstance() {
|
|
76
84
|
this.capabilities = readJsonFromVisual("capabilities.json", this.basePath);
|
package/lib/webpack.config.js
CHANGED
|
@@ -10,6 +10,7 @@ const webpackConfig = {
|
|
|
10
10
|
'visual.js': ['./src/visual.ts']
|
|
11
11
|
},
|
|
12
12
|
target: 'web',
|
|
13
|
+
node: false,
|
|
13
14
|
devtool: false,
|
|
14
15
|
mode: "production",
|
|
15
16
|
optimization: {
|
|
@@ -71,7 +72,7 @@ const webpackConfig = {
|
|
|
71
72
|
"powerbi-visuals-api": 'null'
|
|
72
73
|
},
|
|
73
74
|
resolve: {
|
|
74
|
-
extensions: ['.tsx', '.ts', '.jsx', '.js', '.css'],
|
|
75
|
+
extensions: ['.tsx', '.ts', '.jsx', '.js', '.mjs', '.css'],
|
|
75
76
|
modules: ['node_modules', path.resolve(rootPath, 'node_modules')],
|
|
76
77
|
fallback: {
|
|
77
78
|
assert: "assert",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "powerbi-visuals-tools",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.3",
|
|
4
4
|
"description": "Command line tool for creating and publishing visuals for Power BI",
|
|
5
5
|
"main": "./bin/pbiviz.js",
|
|
6
6
|
"type": "module",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/Microsoft/PowerBI-visuals-tools#readme",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@typescript-eslint/parser": "^6.
|
|
32
|
+
"@typescript-eslint/parser": "^6.21.0",
|
|
33
33
|
"assert": "^2.1.0",
|
|
34
34
|
"async": "^3.2.5",
|
|
35
35
|
"browserify-zlib": "^0.2.0",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"console-browserify": "^1.2.0",
|
|
41
41
|
"constants-browserify": "^1.0.0",
|
|
42
42
|
"crypto-browserify": "^3.12.0",
|
|
43
|
-
"css-loader": "^6.
|
|
43
|
+
"css-loader": "^6.10.0",
|
|
44
44
|
"domain-browser": "^5.7.0",
|
|
45
45
|
"events": "^3.3.0",
|
|
46
46
|
"extra-watch-webpack-plugin": "^1.0.3",
|
|
47
47
|
"fs-extra": "^11.2.0",
|
|
48
48
|
"https-browserify": "^1.0.0",
|
|
49
|
-
"inline-source-map": "^0.6.
|
|
49
|
+
"inline-source-map": "^0.6.3",
|
|
50
50
|
"json-loader": "0.5.7",
|
|
51
51
|
"jszip": "^3.10.1",
|
|
52
52
|
"less": "^4.2.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"lodash.defaults": "4.2.0",
|
|
56
56
|
"lodash.isequal": "4.5.0",
|
|
57
57
|
"lodash.ismatch": "^4.4.0",
|
|
58
|
-
"mini-css-extract-plugin": "^2.
|
|
58
|
+
"mini-css-extract-plugin": "^2.8.1",
|
|
59
59
|
"os-browserify": "^0.3.0",
|
|
60
60
|
"path-browserify": "^1.0.1",
|
|
61
61
|
"powerbi-visuals-webpack-plugin": "4.1.0",
|
|
@@ -74,17 +74,17 @@
|
|
|
74
74
|
"url": "^0.11.3",
|
|
75
75
|
"util": "^0.12.5",
|
|
76
76
|
"vm-browserify": "^1.1.2",
|
|
77
|
-
"webpack": "^5.
|
|
77
|
+
"webpack": "^5.91.0",
|
|
78
78
|
"webpack-bundle-analyzer": "4.10.1",
|
|
79
|
-
"webpack-dev-server": "^4.15.
|
|
79
|
+
"webpack-dev-server": "^4.15.2"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
83
|
-
"eslint": "^8.
|
|
82
|
+
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
83
|
+
"eslint": "^8.57.0",
|
|
84
84
|
"eslint-plugin-powerbi-visuals": "^0.8.1",
|
|
85
85
|
"jasmine": "5.1.0",
|
|
86
86
|
"jasmine-spec-reporter": "7.0.0",
|
|
87
|
-
"semver": "7.
|
|
87
|
+
"semver": "7.6.0",
|
|
88
88
|
"tree-kill": "1.2.2",
|
|
89
89
|
"webpack-cli": "^5.1.4"
|
|
90
90
|
},
|