From 437f6f7ca691a1efaff625967a3b1b250dfffd8c Mon Sep 17 00:00:00 2001 From: Aleksandr Savelev <94454577+AleksSavelev@users.noreply.github.com> Date: Wed, 18 Oct 2023 09:45:47 +0200 Subject: [PATCH] Updated `rhtml` template and fixed error output (#488) * Fixed errors output * fixed rhtml template * updated changelog * Updated links in ReadMe * Added license file --- Changelog.md | 4 ++++ LICENSE | 21 +++++++++++++++++++++ README.md | 7 +++---- package-lock.json | 4 ++-- package.json | 2 +- src/VisualManager.ts | 4 +++- templates/visuals/rhtml/capabilities.json | 7 ++++++- 7 files changed, 40 insertions(+), 9 deletions(-) create mode 100644 LICENSE diff --git a/Changelog.md b/Changelog.md index 5a5f4907..f501f50e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,10 @@ This page contains information about changes to the PowerBI Visual Tools (pbiviz). +## 5.2.1 +* Fixed errors output when packaging the visual +* Fixed `RHTML` template render error + ## 5.2.0 * Integrated PAC validation diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..79656060 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE \ No newline at end of file diff --git a/README.md b/README.md index f8420899..a667783d 100644 --- a/README.md +++ b/README.md @@ -41,15 +41,14 @@ pbiviz ``` ## How to build a visual? -Refer to our [documentation repository](https://github.com/Microsoft/PowerBI-visuals) +Refer to our [documentation repository](https://learn.microsoft.com/en-us/power-bi/developer/visuals/develop-circle-card) ## Usage You can learn more about using these tools in the following guides -* [Installation Guide](https://docs.microsoft.com/en-us/power-bi/developer/visuals/custom-visual-develop-tutorial#setting-up-the-developer-environment) -* [Usage Guide](https://docs.microsoft.com/en-us/power-bi/developer/visuals/custom-visual-develop-tutorial#creating-a-custom-visual) -* [Debugging Guide](https://microsoft.github.io/PowerBI-visuals/docs/how-to-guide/how-to-debug) +* [Usage Guide](https://learn.microsoft.com/en-us/power-bi/developer/visuals/develop-circle-card#create-a-development-project) +* [Debugging Guide](https://learn.microsoft.com/en-us/power-bi/developer/visuals/visuals-how-to-debug) ## PowerBI Visuals Tools Changes diff --git a/package-lock.json b/package-lock.json index 616a36be..3f4ae77c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "powerbi-visuals-tools", - "version": "5.2.0", + "version": "5.2.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "powerbi-visuals-tools", - "version": "5.2.0", + "version": "5.2.1", "license": "MIT", "dependencies": { "@typescript-eslint/parser": "^6.7.5", diff --git a/package.json b/package.json index 21872a5d..65100271 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "powerbi-visuals-tools", - "version": "5.2.0", + "version": "5.2.1", "description": "Command line tool for creating and publishing visuals for Power BI", "main": "./bin/pbiviz.js", "type": "module", diff --git a/src/VisualManager.ts b/src/VisualManager.ts index 2196bb17..d44efc7e 100644 --- a/src/VisualManager.ts +++ b/src/VisualManager.ts @@ -96,10 +96,10 @@ export default class VisualManager { public generatePackage(verbose: boolean = false) { const callback = (err: Error, stats: Stats) => { + this.parseCompilationResults(err, stats); this.createPackageInstance(); const logs = this.validatePackage(); this.outputResults(logs, verbose); - this.parseCompilationResults(err, stats) } this.compiler.run(callback); } @@ -278,6 +278,8 @@ export default class VisualManager { } if (!err && !stats?.compilation.errors.length) { ConsoleWriter.done('Build completed successfully'); + } else { + process.exit(1); } } diff --git a/templates/visuals/rhtml/capabilities.json b/templates/visuals/rhtml/capabilities.json index d74715b9..4efe9c04 100644 --- a/templates/visuals/rhtml/capabilities.json +++ b/templates/visuals/rhtml/capabilities.json @@ -59,5 +59,10 @@ } }, "suppressDefaultTitle": true, - "privileges": [] + "privileges": [ + { + "name": "WebAccess", + "parameters": ["*"] + } + ] }