powerbi-visuals-tools 5.0.1 → 5.0.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 CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  This page contains information about changes to the PowerBI Visual Tools (pbiviz).
4
4
 
5
+ ## 5.0.3
6
+ * Now option `--install-cert` is command. New usage is `pbiviz install-cert`
7
+ * Fixed bug with the incorrect detection of the installed API version
8
+
9
+ ## 5.0.2
10
+ * Implemented common solution for webpack loaders on different environments
11
+
5
12
  ## 5.0.1
6
13
  * Fixed broken imports in webpack.config for some cases
7
14
 
package/bin/pbiviz.js CHANGED
@@ -27,19 +27,16 @@
27
27
 
28
28
  "use strict";
29
29
 
30
- import { createCertificate } from "../lib/CertificateTools.js";
31
30
  import ConsoleWriter from '../lib/ConsoleWriter.js';
32
31
  import CommandManager from '../lib/CommandManager.js';
33
32
  import { readJsonFromRoot } from '../lib/utils.js';
34
- import { Command, Option } from 'commander';
33
+ import { program, Option } from 'commander';
35
34
 
36
35
  const npmPackage = readJsonFromRoot('package.json');
37
36
  const rootPath = process.cwd();
38
- const program = new Command();
39
37
 
40
38
  const pbiviz = program
41
39
  .version(npmPackage.version)
42
- .option('--install-cert', 'Creates and installs localhost certificate', createCertificate)
43
40
  .showHelpAfterError('Run "pbiviz help" for usage instructions.')
44
41
  .addHelpText('beforeAll', ConsoleWriter.info(`${npmPackage.name} version - ${npmPackage.version}`))
45
42
  .addHelpText('before', ConsoleWriter.getLogoVisualization());
@@ -59,9 +56,17 @@ pbiviz
59
56
 
60
57
  pbiviz
61
58
  .command('info')
59
+ .description('Displays visual info')
62
60
  .action(() => {
63
61
  CommandManager.info(rootPath);
64
62
  });
63
+
64
+ pbiviz
65
+ .command('install-cert')
66
+ .description('Creates and installs localhost certificate')
67
+ .action(() => {
68
+ CommandManager.installCert();
69
+ });
65
70
 
66
71
  pbiviz
67
72
  .command('start')
@@ -1,28 +1,28 @@
1
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SoZdgQgncfLtYwHwYDVR0jBBgwFoAU5X2k15HyvorxnwSo
12
+ ZdgQgncfLtYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAOypg
13
+ 7ioP4P6R/8gomTzzo+PrFO9YeM4ZyJrwLRTSlWTudjfmMRwIMKmhWo/tFo+e5+IZ
14
+ uYaXYWCtyQSz6fb/XF1RlbmeBd4NhT81mITh9h8s7Hjece1UX73Gc5n2uZr7sokl
15
+ 9D+rcXPPKhrCvNAuRIEcQSKpueKcADizT/KFDjqX5DhztiiZmk62Ki/K+aTWSl0q
16
+ Pj3s0KNBCL8sUecvjGoaxNamJ3v22tYmKPi5G79suat5kvEjkndU+F0Y/EM5lwsH
17
+ whChIjCR4RBU01pPG6S2zzvgNUrVHc7W7CsSX55U641oHd9r5gLkBQ0t9Sa5xXqd
18
+ saWvwAR8yKA6G+t5PQ==
19
19
  -----END CERTIFICATE-----
@@ -221,7 +221,7 @@ async function getCertFile(config, silent) {
221
221
  return pfx;
222
222
  }
223
223
  if (!silent) {
224
- ConsoleWriter.info('Certificate not found. Call `pbiviz --install-cert` command to create the new certificate');
224
+ ConsoleWriter.info('Certificate not found. Call `pbiviz install-cert` command to create the new certificate');
225
225
  }
226
226
  return null;
227
227
  }
@@ -323,7 +323,7 @@ export async function resolveCertificate() {
323
323
  await createCertFile(config, true);
324
324
  if (!(await getCertFile(config, true))) {
325
325
  ConsoleWriter.error('Certificate wasn\'t created');
326
- throw new Error("Call `pbiviz --install-cert` command to create the new certificate");
326
+ throw new Error("Call `pbiviz install-cert` command to create the new certificate");
327
327
  }
328
328
  else {
329
329
  if (config.server.passphrase) {
@@ -1,3 +1,4 @@
1
+ import { createCertificate } from './CertificateTools.js';
1
2
  import ConsoleWriter from './ConsoleWriter.js';
2
3
  import VisualManager from './VisualManager.js';
3
4
  export default class CommandManager {
@@ -49,4 +50,7 @@ export default class CommandManager {
49
50
  .prepareVisual()
50
51
  .displayInfo();
51
52
  }
53
+ static async installCert() {
54
+ await createCertificate();
55
+ }
52
56
  }
@@ -12,7 +12,7 @@ import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
12
12
  import { PowerBICustomVisualsWebpackPlugin } from 'powerbi-visuals-webpack-plugin';
13
13
  import ConsoleWriter from './ConsoleWriter.js';
14
14
  import { resolveCertificate } from "./CertificateTools.js";
15
- import { getRootPath, readJsonFromRoot, readJsonFromVisual } from './utils.js';
15
+ import { readJsonFromRoot, readJsonFromVisual } from './utils.js';
16
16
  const config = readJsonFromRoot('config.json');
17
17
  const npmPackage = readJsonFromRoot('package.json');
18
18
  const visualPlugin = "visualPlugin.ts";
@@ -117,7 +117,7 @@ export default class WebPackWrap {
117
117
  async configureCustomVisualsWebpackPlugin(visualPackage, options, tsconfig) {
118
118
  const pluginConfiguration = lodashCloneDeep(visualPackage.pbivizConfig);
119
119
  //(?=\D*$) - positive look-ahead to find last version symbols and exclude any non-digit symbols after the version.
120
- const regexFullVersion = /(?:\d+\.?){1,3}(?=\D*$)/;
120
+ const regexFullVersion = /(?<=powerbi-visuals-api@)((?:\d+\.?){1,3})/g;
121
121
  const regexMinorVersion = /\d+(?:\.\d+)?/;
122
122
  let apiVersionInstalled;
123
123
  try {
@@ -189,7 +189,7 @@ export default class WebPackWrap {
189
189
  test: /(\.ts)x?$/,
190
190
  use: [
191
191
  {
192
- loader: path.resolve(getRootPath(), "node_modules", "ts-loader"),
192
+ loader: "ts-loader",
193
193
  options: tsOptions
194
194
  }
195
195
  ]
@@ -37,7 +37,7 @@ const webpackConfig = {
37
37
  },
38
38
  {
39
39
  test: /\.json$/,
40
- loader: path.resolve(rootPath, "node_modules", "json-loader"),
40
+ loader: "json-loader",
41
41
  type: "javascript/auto"
42
42
  },
43
43
  {
@@ -47,10 +47,10 @@ const webpackConfig = {
47
47
  loader: MiniCssExtractPlugin.loader
48
48
  },
49
49
  {
50
- loader: path.resolve(rootPath, "node_modules", "css-loader")
50
+ loader: "css-loader"
51
51
  },
52
52
  {
53
- loader: path.resolve(rootPath, "node_modules", "less-loader"),
53
+ loader: "less-loader",
54
54
  options: {
55
55
  lessOptions: {
56
56
  paths: [path.resolve(rootPath, 'node_modules')]
@@ -69,40 +69,44 @@ const webpackConfig = {
69
69
  }
70
70
  ]
71
71
  },
72
+ resolveLoader: {
73
+ modules: ['node_modules', path.resolve(rootPath, 'node_modules')],
74
+ },
72
75
  externals: {
73
76
  "powerbi-visuals-api": 'null'
74
77
  },
75
78
  resolve: {
76
79
  extensions: ['.tsx', '.ts', '.jsx', '.js', '.css'],
80
+ modules: ['node_modules', path.resolve(rootPath, 'node_modules')],
77
81
  fallback: {
78
- assert: path.resolve(rootPath, "node_modules", "assert"),
79
- buffer: path.resolve(rootPath, "node_modules", "buffer"),
80
- console: path.resolve(rootPath, "node_modules", "console-browserify"),
81
- constants: path.resolve(rootPath, "node_modules", "constants-browserify"),
82
- crypto: path.resolve(rootPath, "node_modules", "crypto-browserify"),
83
- domain: path.resolve(rootPath, "node_modules", "domain-browser"),
84
- events: path.resolve(rootPath, "node_modules", "events"),
85
- http: path.resolve(rootPath, "node_modules", "stream-http"),
86
- https: path.resolve(rootPath, "node_modules", "https-browserify"),
87
- os: path.resolve(rootPath, "node_modules", "os-browserify"),
88
- path: path.resolve(rootPath, "node_modules", "path-browserify"),
89
- punycode: path.resolve(rootPath, "node_modules", "punycode"),
90
- process: path.resolve(rootPath, "node_modules", "process"),
91
- querystring: path.resolve(rootPath, "node_modules", "querystring-es3"),
92
- stream: path.resolve(rootPath, "node_modules", "stream-browserify"),
93
- _stream_duplex: path.resolve(rootPath, "node_modules", "readable-stream"),
94
- _stream_passthrough: path.resolve(rootPath, "node_modules", "readable-stream"),
95
- _stream_readable: path.resolve(rootPath, "node_modules", "readable-stream"),
96
- _stream_transform: path.resolve(rootPath, "node_modules", "readable-stream"),
97
- _stream_writable: path.resolve(rootPath, "node_modules", "readable-stream"),
98
- string_decoder: path.resolve(rootPath, "node_modules", "string_decoder"),
99
- sys: path.resolve(rootPath, "node_modules", "util"),
100
- timers: path.resolve(rootPath, "node_modules", "timers-browserify"),
101
- tty: path.resolve(rootPath, "node_modules", "tty-browserify"),
102
- url: path.resolve(rootPath, "node_modules", "url"),
103
- util: path.resolve(rootPath, "node_modules", "util"),
104
- vm: path.resolve(rootPath, "node_modules", "vm-browserify"),
105
- zlib: path.resolve(rootPath, "node_modules", "browserify-zlib")
82
+ assert: "assert",
83
+ buffer: "buffer",
84
+ console: "console-browserify",
85
+ constants: "constants-browserify",
86
+ crypto: "crypto-browserify",
87
+ domain: "domain-browser",
88
+ events: "events",
89
+ http: "stream-http",
90
+ https: "https-browserify",
91
+ os: "os-browserify",
92
+ path: "path-browserify",
93
+ punycode: "punycode",
94
+ process: "process",
95
+ querystring: "querystring-es3",
96
+ stream: "stream-browserify",
97
+ _stream_duplex: "readable-stream",
98
+ _stream_passthrough: "readable-stream",
99
+ _stream_readable: "readable-stream",
100
+ _stream_transform: "readable-stream",
101
+ _stream_writable: "readable-stream",
102
+ string_decoder: "string_decoder",
103
+ sys: "util",
104
+ timers: "timers-browserify",
105
+ tty: "tty-browserify",
106
+ url: "url",
107
+ util: "util",
108
+ vm: "vm-browserify",
109
+ zlib: "browserify-zlib"
106
110
  }
107
111
  },
108
112
  output: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powerbi-visuals-tools",
3
- "version": "5.0.1",
3
+ "version": "5.0.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",
@@ -43,7 +43,6 @@
43
43
  "css-loader": "^6.8.1",
44
44
  "domain-browser": "^4.22.0",
45
45
  "events": "^3.3.0",
46
- "terser-webpack-plugin": "^5.3.9",
47
46
  "extra-watch-webpack-plugin": "^1.0.3",
48
47
  "fs-extra": "^11.1.1",
49
48
  "https-browserify": "^1.0.0",
@@ -66,9 +65,10 @@
66
65
  "stream-browserify": "^3.0.0",
67
66
  "stream-http": "^3.2.0",
68
67
  "string_decoder": "^1.3.0",
68
+ "terser-webpack-plugin": "^5.3.9",
69
69
  "timers-browserify": "^2.0.12",
70
70
  "ts-loader": "^9.4.4",
71
- "tty-browserify": "0.0.1",
71
+ "tty-browserify": "^0.0.1",
72
72
  "typescript": "^4.9.5",
73
73
  "url": "^0.11.1",
74
74
  "util": "^0.12.5",
@@ -78,13 +78,13 @@
78
78
  "webpack-dev-server": "^4.15.1"
79
79
  },
80
80
  "devDependencies": {
81
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
81
82
  "eslint": "^8.45.0",
83
+ "eslint-plugin-powerbi-visuals": "^0.8.1",
82
84
  "jasmine": "5.0.2",
83
85
  "jasmine-spec-reporter": "7.0.0",
84
86
  "semver": "7.5.4",
85
87
  "tree-kill": "1.2.2",
86
- "@typescript-eslint/eslint-plugin": "^5.62.0",
87
- "eslint-plugin-powerbi-visuals": "^0.8.1",
88
88
  "webpack-cli": "^5.1.4"
89
89
  },
90
90
  "optionalDependencies": {
package/spec/.jshintrc DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "esversion": 6,
3
- "node": true,
4
- "jasmine": true
5
- }
@@ -1,31 +0,0 @@
1
- /*
2
- * Power BI Visual CLI
3
- *
4
- * Copyright (c) Microsoft Corporation
5
- * All rights reserved.
6
- * MIT License
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the ""Software""), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is
13
- * furnished to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in
16
- * all copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- "use strict";
28
-
29
- import FileSystem from './helpers/FileSystem.js';
30
-
31
- FileSystem.deleteTempDirectory();
@@ -1,57 +0,0 @@
1
- /*
2
- * Power BI Visual CLI
3
- *
4
- * Copyright (c) Microsoft Corporation
5
- * All rights reserved.
6
- * MIT License
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the ""Software""), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is
13
- * furnished to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in
16
- * all copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- "use strict";
28
-
29
- import fs from 'fs-extra';
30
- import path from 'path';
31
- import { getRootPath, readJsonFromRoot } from '../../lib/utils.js';
32
- import { createCertFile } from '../../lib/CertificateTools.js';
33
-
34
- const config = readJsonFromRoot('config.json');
35
-
36
- describe("E2E - pbiviz --install-cert", () => {
37
- beforeEach((done) => {
38
- createCertFile(config, false).then(done);
39
- });
40
-
41
- describe("pbiviz", () => {
42
- it("pbiviz --install-cert command should generate certificate", (done) => {
43
- const rootPath = getRootPath();
44
- const certPath = path.join(rootPath, config.server.certificate);
45
- const keyPath = path.join(rootPath, config.server.privateKey);
46
- const pfxPath = path.join(rootPath, config.server.pfx);
47
- const certExists = fs.existsSync(certPath);
48
- const keyExists = fs.existsSync(keyPath);
49
- const pfxExists = fs.existsSync(pfxPath);
50
-
51
- const result = (certExists && keyExists) || pfxExists;
52
-
53
- expect(result).toBeTruthy();
54
- done();
55
- });
56
- });
57
- });
@@ -1,79 +0,0 @@
1
- /*
2
- * Power BI Visual CLI
3
- *
4
- * Copyright (c) Microsoft Corporation
5
- * All rights reserved.
6
- * MIT License
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the ""Software""), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is
13
- * furnished to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in
16
- * all copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- "use strict";
28
-
29
- import fs from 'fs-extra';
30
- import path from 'path';
31
- import FileSystem from '../helpers/FileSystem.js';
32
- import { writeMetadata } from "./testUtils.js";
33
-
34
- const tempPath = FileSystem.getTempPath();
35
- const startPath = process.cwd();
36
-
37
- describe("E2E - pbiviz info", () => {
38
-
39
- const visualName = 'myvisualname';
40
- const visualPath = path.join(tempPath, visualName);
41
-
42
- beforeEach(() => {
43
- process.chdir(startPath);
44
- FileSystem.resetTempDirectory();
45
- process.chdir(tempPath);
46
- FileSystem.runPbiviz('new', visualName);
47
- process.chdir(visualPath);
48
-
49
- writeMetadata(visualPath);
50
- });
51
-
52
- afterAll(() => {
53
- process.chdir(startPath);
54
- FileSystem.deleteTempDirectory();
55
- });
56
-
57
- it("Should throw error if not in the visual root", () => {
58
- let error;
59
- process.chdir(tempPath);
60
-
61
- try {
62
- FileSystem.runPbiviz('info');
63
- } catch (e) {
64
- error = e;
65
- }
66
-
67
- expect(error).toBeDefined();
68
- expect(error.status).toBe(1);
69
- expect(error.message).toContain("Error: pbiviz.json not found. You must be in the root of a visual project to run this command");
70
-
71
- });
72
-
73
- it("Should output visual info", () => {
74
- const output = FileSystem.runPbiviz('info').toString();
75
- const visualConfig = fs.readJsonSync(path.join(visualPath, 'pbiviz.json')).visual;
76
- expect(output).toContain(visualName);
77
- expect(output).toContain(visualConfig.guid);
78
- });
79
- });