powerbi-visuals-tools 5.0.1 → 5.0.2

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,9 @@
2
2
 
3
3
  This page contains information about changes to the PowerBI Visual Tools (pbiviz).
4
4
 
5
+ ## 5.0.2
6
+ * Implemented common solution for webpack loaders on different environments
7
+
5
8
  ## 5.0.1
6
9
  * Fixed broken imports in webpack.config for some cases
7
10
 
@@ -1,28 +1,28 @@
1
1
  -----BEGIN PRIVATE KEY-----
2
- MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDR1WMQoToRp+2T
3
- IBC+pR/KnnaeF0QcKQF+0BmjSPKiJ7gRv9NlOX2ZuiDj/uFdHvVWO4ALhIt+NhKO
4
- eAxPPN/ekMHKJoxLxBrVHcvi8P5QKOraeklY5xiICLevUWsQ4XAWL3HaKx0ocPJQ
5
- qNnVzYykT01kg1HKBMmx2bFx3vff7wJMTN0luU4YFnvjtjFr/PD7d8No889Ud6Ho
6
- BzMSeOVyApvMI5TzsPqLiabZqZYiASw3E+P6RwZGYBwGcNegZVzhGOCIEHV6X1s0
7
- McVkwHjYnFTd808kZ2swU3uCDOW8t9mCxsT81gD2X9JfGQH8QnDLi12gC67TIb7P
8
- wxZXDcZ9AgMBAAECgf9NdPecq+dDnTmVlcCYn1uc7+HZeb0qp/hlV2wfWk42jXLl
9
- Gmpuc0pp9MsvXmbSeRsXOd+KYOMdM9ilvqrMlSwOfGEMvi4Lydgd02Hv5AX8kR4g
10
- iAOLTcNAc/daQDPFh3JYvirI3iFlTEwmei3vPnEsNhnbgJ4wdJP/ktxtrGDTyDtv
11
- lAL8Kjm0QYQzsmaeTZ97/Z5jBQf/UzUnPW+MeEteer185kuL8lKzAn5MLU5qzpsV
12
- h7FDemCg0RLShJ8GAyIb0F6SqK8m5oJAssxXALklfUibwFFyIJXTnGTzcz/t+5rk
13
- PVIItw9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FxI4fU2dZlMLaI7/n1LizZbjGQSJ8enMXJNE
8
+ G4UW0kXPNuEOAxkkGOveH+MX01oKzOed4ES7tC7Ty5KeJyQwURNuzg92uoCi5jHJ
9
+ PyI2c2tCfzA6SBNaRo21ObKChNEj4HBlBi92mzjyyEdXhpfD67rppn5iuHM5sJfa
10
+ 2lB2oBnPRmy0LIjTV+JvzE7zDg5JbkbWE2vVRts3CwIDAQABo1MwUTAdBgNVHQ4E
11
+ FgQUFk6Ui7+8kloWFs48trbUw0MHxrcwHwYDVR0jBBgwFoAUFk6Ui7+8kloWFs48
12
+ trbUw0MHxrcwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAjJ78
13
+ 8iUuC1JEuCpgNeD3xQtZGaOFxrpoTgqsOKhXETQ5D0vQi32elHONaknzmlRIgzuN
14
+ KaBWSfZ1pjiWx2rnU0n9MzULLRKbyYNjj9FvfZv/twNS6uvbJQQp8aLvqNOE5+ge
15
+ wqA++cdPc0jUH0n0+35luIU3EUVIs9LlXQM+E6oSnZ72QCB2f0kIAENVapZgERhG
16
+ 3/OCPm9OAwpT8Uq+XEqXmdnslcJ1URbkQ6PHlMGuP5AMVB0p9gwVkd4S55d40i9h
17
+ GlxakNGKGg6HNyz/SGmQSmjl4W1lGhgyT7J3NUhSIMjqc6JXF4eoHuKgtBouRh7D
18
+ kaDRt73qYpB3iYQzcA==
19
19
  -----END CERTIFICATE-----
@@ -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";
@@ -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.2",
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
- });