powerbi-visuals-tools 5.2.0-beta.2 → 5.2.1

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 CHANGED
@@ -2,9 +2,16 @@
2
2
 
3
3
  This page contains information about changes to the PowerBI Visual Tools (pbiviz).
4
4
 
5
+ ## 5.2.1
6
+ * Fixed errors output when packaging the visual
7
+ * Fixed `RHTML` template render error
8
+
5
9
  ## 5.2.0
6
10
  * Integrated PAC validation
7
11
 
12
+ ## 5.1.1
13
+ * Updated crypto import to fix error in old Node versions
14
+
8
15
  ## 5.1.0
9
16
  * New flag `--skip-api` to skip verifying api version. It might produce different errors in visual, so use it only in some specific cases (ex. installing something during the build process brakes packages managed by monorepo managers).
10
17
  * New flag `--all-locales` to disable optimization using localization loader. It's recommended not to use this flag because all locales take a huge amount of package size. If you need just a few of them follow [this guide](https://learn.microsoft.com/en-us/power-bi/developer/visuals/localization?tabs=English#step-5---add-a-resources-file-for-each-language). In this case, only declared in stringResources locales will be added to your visual package.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Microsoft Corporation.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE
package/README.md CHANGED
@@ -41,15 +41,14 @@ pbiviz
41
41
  ```
42
42
 
43
43
  ## How to build a visual?
44
- Refer to our [documentation repository](https://github.com/Microsoft/PowerBI-visuals)
44
+ Refer to our [documentation repository](https://learn.microsoft.com/en-us/power-bi/developer/visuals/develop-circle-card)
45
45
 
46
46
  ## Usage
47
47
 
48
48
  You can learn more about using these tools in the following guides
49
49
 
50
- * [Installation Guide](https://docs.microsoft.com/en-us/power-bi/developer/visuals/custom-visual-develop-tutorial#setting-up-the-developer-environment)
51
- * [Usage Guide](https://docs.microsoft.com/en-us/power-bi/developer/visuals/custom-visual-develop-tutorial#creating-a-custom-visual)
52
- * [Debugging Guide](https://microsoft.github.io/PowerBI-visuals/docs/how-to-guide/how-to-debug)
50
+ * [Usage Guide](https://learn.microsoft.com/en-us/power-bi/developer/visuals/develop-circle-card#create-a-development-project)
51
+ * [Debugging Guide](https://learn.microsoft.com/en-us/power-bi/developer/visuals/visuals-how-to-debug)
53
52
 
54
53
  ## PowerBI Visuals Tools Changes
55
54
 
package/bin/pbiviz.js CHANGED
@@ -89,6 +89,7 @@ pbiviz
89
89
  .option('--no-stats', "Doesn't generate statistics files")
90
90
  .option('--skip-api', "Skips powerbi-visuals-api verifying")
91
91
  .option('-l, --all-locales', "Keeps all locale files in the package. By default only used inside stringResources folder locales are included.")
92
+ .option('-v, --verbose', "Enables verbose logging")
92
93
  .addOption(new Option('-c, --compression <compressionLevel>', "Enables compression of visual package")
93
94
  .choices(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'])
94
95
  .default('6')
@@ -1,28 +1,28 @@
1
1
  -----BEGIN PRIVATE KEY-----
2
- MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgE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YDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAetcv
13
+ u9yB2CRVi12FKnegu6QGk+6p9ywu4nMQqEznYHzc7h8AknihmNNl2wOLNCffXvFg
14
+ PhasNt/KCeyOWmpzlExzlX0w7MoNWqGBZdAhvm26yXmyOaZ2rUc9FuOLWJy9vVT8
15
+ CKBdKXGrMbGEta5qpjmnzJ84jWCWX1ChRXPyXtnh2lBJ3xvYZ26MEln6skPC6Iuk
16
+ DBKF3MJ0RNoU3KaBaVDVh6d6QUkSqQm+t5GAeqEHx8elyzLtypUuodYnG4p4poZ3
17
+ UUlf1XA6m8NsLNl2/1XYxwH6/cOZ8/zPcaFAREChc7lEqC/QOAz+nOH4aS2dJS+l
18
+ Q93CnBuVNOscbCHHrg==
19
19
  -----END CERTIFICATE-----
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-case-declarations */
1
2
  /*
2
3
  * Power BI Visual CLI
3
4
  *
@@ -28,7 +29,7 @@ import { exec as nodeExec } from 'child_process';
28
29
  import fs from 'fs-extra';
29
30
  import os from 'os';
30
31
  import path from 'path';
31
- import crypto, { webcrypto } from "crypto";
32
+ import crypto from "crypto";
32
33
  import { getRootPath, readJsonFromRoot } from './utils.js';
33
34
  import ConsoleWriter from './ConsoleWriter.js';
34
35
  const certSafePeriod = 1000 * 60 * 60 * 24; // 24 hours
@@ -114,11 +115,8 @@ export async function createCertFile(config, open) {
114
115
  }
115
116
  break;
116
117
  case "win32":
117
- // eslint-disable-next-line no-case-declarations
118
- let passphrase = "";
119
118
  // for windows 7 and others
120
119
  // 6.1 - Windows 7
121
- // eslint-disable-next-line no-case-declarations
122
120
  const osVersion = os.release().split(".");
123
121
  if ((Number(osVersion[0]) === 6 && Number(osVersion[1]) === 1) || Number(osVersion[0]) < 6) {
124
122
  await removeCertFiles(certPath, keyPath, pfxPath);
@@ -140,7 +138,14 @@ export async function createCertFile(config, open) {
140
138
  }
141
139
  break;
142
140
  }
143
- passphrase = (crypto.getRandomValues || webcrypto.getRandomValues)(new Uint32Array(1))[0].toString().substring(2);
141
+ let randomValues;
142
+ if (crypto.getRandomValues !== undefined) {
143
+ randomValues = crypto.getRandomValues(new Uint32Array(1));
144
+ }
145
+ else {
146
+ randomValues = crypto.webcrypto.getRandomValues(new Uint32Array(1));
147
+ }
148
+ const passphrase = randomValues[0].toString().substring(2);
144
149
  config.server.passphrase = passphrase;
145
150
  fs.writeFileSync(path.join(rootPath, confPath), JSON.stringify(config));
146
151
  // for windows 8 / 8.1 / server 2012 R2 /
@@ -40,9 +40,9 @@ export default class CommandManager {
40
40
  };
41
41
  new VisualManager(rootPath)
42
42
  .prepareVisual()
43
- .validateVisual()
43
+ .validateVisual(options.verbose)
44
44
  .initializeWebpack(webpackOptions)
45
- .then(visualManager => visualManager.generatePackage());
45
+ .then(visualManager => visualManager.generatePackage(options.verbose));
46
46
  }
47
47
  static new({ force, template }, name, rootPath) {
48
48
  const generateOptions = {
@@ -78,12 +78,12 @@ export default class VisualManager {
78
78
  this.compiler = webpack(this.webpackConfig);
79
79
  return this;
80
80
  }
81
- generatePackage() {
81
+ generatePackage(verbose = false) {
82
82
  const callback = (err, stats) => {
83
+ this.parseCompilationResults(err, stats);
83
84
  this.createPackageInstance();
84
85
  const logs = this.validatePackage();
85
- this.outputResults(logs);
86
- this.parseCompilationResults(err, stats);
86
+ this.outputResults(logs, verbose);
87
87
  };
88
88
  this.compiler.run(callback);
89
89
  }
@@ -114,10 +114,10 @@ export default class VisualManager {
114
114
  process.exit(1);
115
115
  }
116
116
  }
117
- validateVisual() {
117
+ validateVisual(verbose = false) {
118
118
  this.featureManager = new FeatureManager();
119
119
  const { status, logs } = this.featureManager.validate(Stage.PreBuild, this.visual);
120
- this.outputResults(logs);
120
+ this.outputResults(logs, verbose);
121
121
  if (status === Status.Error) {
122
122
  process.exit(1);
123
123
  }
@@ -128,17 +128,21 @@ export default class VisualManager {
128
128
  const { logs } = featureManager.validate(Stage.PostBuild, this.package);
129
129
  return logs;
130
130
  }
131
- outputResults({ errors, deprecation, warnings, info }) {
132
- const featuresTotalLog = {
133
- errors: `Visual doesn't support some features required for all custom visuals:`,
131
+ outputResults({ errors, deprecation, warnings, info }, verbose) {
132
+ const headerMessage = {
133
+ error: `Visual doesn't support some features required for all custom visuals:`,
134
134
  deprecation: `Some features are going to be required soon, please update the visual:`,
135
- warn: `Visual doesn't support some features recommended for all custom visuals:`,
136
- info: `Visual can be improved by adding some features:`
135
+ warning: `Visual doesn't support some features recommended for all custom visuals:`,
136
+ verboseInfo: `Visual can be improved by adding some features:`,
137
+ shortInfo: `Visual can be improved by adding ${info.length} more optional features.`
137
138
  };
138
- this.outputLogsWithHeadMessage(featuresTotalLog.errors, errors, Severity.Error);
139
- this.outputLogsWithHeadMessage(featuresTotalLog.deprecation, deprecation, Severity.Deprecation);
140
- this.outputLogsWithHeadMessage(featuresTotalLog.warn, warnings, Severity.Warning);
141
- this.outputLogsWithHeadMessage(featuresTotalLog.info, info, Severity.Info);
139
+ this.outputLogsWithHeadMessage(headerMessage.error, errors, Severity.Error);
140
+ this.outputLogsWithHeadMessage(headerMessage.deprecation, deprecation, Severity.Deprecation);
141
+ this.outputLogsWithHeadMessage(headerMessage.warning, warnings, Severity.Warning);
142
+ const verboseSuggestion = 'Run `pbiviz package` with --verbose flag to see more details.';
143
+ const headerInfoMessage = headerMessage[verbose ? "verboseInfo" : "shortInfo"];
144
+ const infoLogs = (!info.length || verbose) ? info : [verboseSuggestion];
145
+ this.outputLogsWithHeadMessage(headerInfoMessage, infoLogs, Severity.Info);
142
146
  }
143
147
  displayInfo() {
144
148
  if (this.pbivizConfig) {
@@ -239,6 +243,9 @@ export default class VisualManager {
239
243
  if (!err && !stats?.compilation.errors.length) {
240
244
  ConsoleWriter.done('Build completed successfully');
241
245
  }
246
+ else {
247
+ process.exit(1);
248
+ }
242
249
  }
243
250
  outputLogsWithHeadMessage(headMessage, logs, severity) {
244
251
  if (!logs.length) {
@@ -2,7 +2,7 @@ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
2
  export default class ESLint {
3
3
  static featureName = "ESLint";
4
4
  static documentationLink = "https://github.com/microsoft/eslint-plugin-powerbi-visuals";
5
- static severity = Severity.Error;
5
+ static severity = Severity.Warning;
6
6
  static stage = Stage.PreBuild;
7
7
  static visualFeatureType = VisualFeatureType.All;
8
8
  static errorMessage = `${this.featureName} - ${this.documentationLink}`;
@@ -4,7 +4,7 @@ export default class TotalSubTotal {
4
4
  static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/total-subtotal-api";
5
5
  static severity = Severity.Warning;
6
6
  static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.Matrix | VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
7
+ static visualFeatureType = VisualFeatureType.Matrix;
8
8
  static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
9
  static isSupported(packageInstance) {
10
10
  return packageInstance.isCapabilityEnabled({ subtotals: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powerbi-visuals-tools",
3
- "version": "5.2.0-beta.2",
3
+ "version": "5.2.1",
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,8 +29,8 @@
29
29
  },
30
30
  "homepage": "https://github.com/Microsoft/PowerBI-visuals-tools#readme",
31
31
  "dependencies": {
32
- "@typescript-eslint/parser": "^5.62.0",
33
- "assert": "^2.0.0",
32
+ "@typescript-eslint/parser": "^6.7.5",
33
+ "assert": "^2.1.0",
34
34
  "async": "^3.2.4",
35
35
  "browserify-zlib": "^0.2.0",
36
36
  "buffer": "^6.0.3",
@@ -68,19 +68,19 @@
68
68
  "string_decoder": "^1.3.0",
69
69
  "terser-webpack-plugin": "^5.3.9",
70
70
  "timers-browserify": "^2.0.12",
71
- "ts-loader": "^9.4.4",
71
+ "ts-loader": "^9.5.0",
72
72
  "tty-browserify": "^0.0.1",
73
73
  "typescript": "^4.9.5",
74
- "url": "^0.11.1",
74
+ "url": "^0.11.3",
75
75
  "util": "^0.12.5",
76
76
  "vm-browserify": "^1.1.2",
77
77
  "webpack": "^5.88.2",
78
- "webpack-bundle-analyzer": "4.9.0",
78
+ "webpack-bundle-analyzer": "4.9.1",
79
79
  "webpack-dev-server": "^4.15.1"
80
80
  },
81
81
  "devDependencies": {
82
- "@typescript-eslint/eslint-plugin": "^5.62.0",
83
- "eslint": "^8.47.0",
82
+ "@typescript-eslint/eslint-plugin": "^6.7.5",
83
+ "eslint": "^8.51.0",
84
84
  "eslint-plugin-powerbi-visuals": "^0.8.1",
85
85
  "jasmine": "5.1.0",
86
86
  "jasmine-spec-reporter": "7.0.0",
@@ -17,7 +17,7 @@
17
17
  "@types/d3": "7.4.0",
18
18
  "d3": "7.8.5",
19
19
  "powerbi-visuals-api": "5.4.0",
20
- "powerbi-visuals-utils-formattingmodel": "5.0.0"
20
+ "powerbi-visuals-utils-formattingmodel": "6.0.0"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@typescript-eslint/eslint-plugin": "^5.59.11",
@@ -28,7 +28,7 @@
28
28
 
29
29
  import { formattingSettings } from "powerbi-visuals-utils-formattingmodel";
30
30
 
31
- import FormattingSettingsCard = formattingSettings.Card;
31
+ import FormattingSettingsCard = formattingSettings.SimpleCard;
32
32
  import FormattingSettingsSlice = formattingSettings.Slice;
33
33
  import FormattingSettingsModel = formattingSettings.Model;
34
34
 
@@ -59,7 +59,7 @@ export class Visual implements IVisual {
59
59
  }
60
60
 
61
61
  public update(options: VisualUpdateOptions) {
62
- this.formattingSettings = this.formattingSettingsService.populateFormattingSettingsModel(VisualFormattingSettingsModel, options.dataViews);
62
+ this.formattingSettings = this.formattingSettingsService.populateFormattingSettingsModel(VisualFormattingSettingsModel, options.dataViews[0]);
63
63
 
64
64
  console.log('Visual update', options);
65
65
  if (this.textNode) {
@@ -59,5 +59,10 @@
59
59
  }
60
60
  },
61
61
  "suppressDefaultTitle": true,
62
- "privileges": []
62
+ "privileges": [
63
+ {
64
+ "name": "WebAccess",
65
+ "parameters": ["https://cdn.plot.ly/"]
66
+ }
67
+ ]
63
68
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "visual",
3
3
  "dependencies": {
4
- "powerbi-visuals-utils-formattingmodel": "5.0.0"
4
+ "powerbi-visuals-utils-formattingmodel": "6.0.0"
5
5
  },
6
6
  "devDependencies": {
7
7
  "powerbi-visuals-api": "5.4.0",
@@ -28,7 +28,7 @@
28
28
 
29
29
  import { formattingSettings } from "powerbi-visuals-utils-formattingmodel";
30
30
 
31
- import FormattingSettingsCard = formattingSettings.Card;
31
+ import FormattingSettingsCard = formattingSettings.SimpleCard;
32
32
  import FormattingSettingsSlice = formattingSettings.Slice;
33
33
  import FormattingSettingsModel = formattingSettings.Model;
34
34
 
@@ -111,7 +111,7 @@ export class Visual implements IVisual {
111
111
  }
112
112
 
113
113
  const dataView: DataView = options.dataViews[0];
114
- this.formattingSettings = this.formattingSettingsService.populateFormattingSettingsModel(VisualFormattingSettingsModel, options.dataViews);
114
+ this.formattingSettings = this.formattingSettingsService.populateFormattingSettingsModel(VisualFormattingSettingsModel, options.dataViews[0]);
115
115
 
116
116
  let payloadBase64: string = null;
117
117
  if (dataView.scriptResult && dataView.scriptResult.payloadBase64) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "visual",
3
3
  "dependencies": {
4
- "powerbi-visuals-utils-formattingmodel": "5.0.0"
4
+ "powerbi-visuals-utils-formattingmodel": "6.0.0"
5
5
  },
6
6
  "devDependencies": {
7
7
  "powerbi-visuals-api": "5.4.0",
@@ -28,7 +28,7 @@
28
28
 
29
29
  import { formattingSettings } from "powerbi-visuals-utils-formattingmodel";
30
30
 
31
- import FormattingSettingsCard = formattingSettings.Card;
31
+ import FormattingSettingsCard = formattingSettings.SimpleCard;
32
32
  import FormattingSettingsSlice = formattingSettings.Slice;
33
33
  import FormattingSettingsModel = formattingSettings.Model;
34
34
 
@@ -63,7 +63,7 @@ export class Visual implements IVisual {
63
63
  }
64
64
 
65
65
  const dataView: DataView = options.dataViews[0];
66
- this.formattingSettings = this.formattingSettingsService.populateFormattingSettingsModel(VisualFormattingSettingsModel, options.dataViews);
66
+ this.formattingSettings = this.formattingSettingsService.populateFormattingSettingsModel(VisualFormattingSettingsModel, options.dataViews[0]);
67
67
 
68
68
  let imageUrl: string = null;
69
69
  if (dataView.scriptResult && dataView.scriptResult.payloadBase64) {
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "d3": "7.8.5",
11
- "powerbi-visuals-utils-formattingmodel": "5.0.0"
11
+ "powerbi-visuals-utils-formattingmodel": "6.0.0"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@types/d3": "7.4.0",
@@ -28,7 +28,7 @@
28
28
 
29
29
  import { formattingSettings } from "powerbi-visuals-utils-formattingmodel";
30
30
 
31
- import FormattingSettingsCard = formattingSettings.Card;
31
+ import FormattingSettingsCard = formattingSettings.SimpleCard;
32
32
  import FormattingSettingsSlice = formattingSettings.Slice;
33
33
  import FormattingSettingsModel = formattingSettings.Model;
34
34
 
@@ -59,7 +59,7 @@ export class Visual implements IVisual {
59
59
  }
60
60
 
61
61
  public update(options: VisualUpdateOptions) {
62
- this.formattingSettings = this.formattingSettingsService.populateFormattingSettingsModel(VisualFormattingSettingsModel, options.dataViews);
62
+ this.formattingSettings = this.formattingSettingsService.populateFormattingSettingsModel(VisualFormattingSettingsModel, options.dataViews[0]);
63
63
  console.log("Visual update", options);
64
64
  if (this.textNode) {
65
65
  this.textNode.textContent = (this.updateCount++).toString();
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "d3": "7.8.5",
11
- "powerbi-visuals-utils-formattingmodel": "5.0.0"
11
+ "powerbi-visuals-utils-formattingmodel": "6.0.0"
12
12
  },
13
13
  "devDependencies": {
14
14
  "powerbi-visuals-api": "5.4.0",