powerbi-visuals-tools 5.3.0 → 5.4.0
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 +4 -0
- package/bin/pbiviz.js +8 -0
- package/certs/PowerBICustomVisualTest_private.key +26 -26
- package/certs/PowerBICustomVisualTest_public.crt +17 -17
- package/config.json +0 -1
- package/lib/CommandManager.js +13 -3
- package/lib/LintValidator.js +78 -0
- package/lib/Visual.js +1 -6
- package/lib/VisualManager.js +22 -3
- package/lib/features/index.js +1 -2
- package/lib/utils.js +3 -0
- package/package.json +9 -9
- package/templates/visuals/_global/.vscode/launch.json +1 -2
- package/lib/features/ESLint.js +0 -12
- package/webRoot/favicon.ico +0 -0
- package/webRoot/index.html +0 -34
package/Changelog.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This page contains information about changes to the PowerBI Visual Tools (pbiviz).
|
|
4
4
|
|
|
5
|
+
## 5.4.0
|
|
6
|
+
* Updated packages
|
|
7
|
+
* New command `pbiviz lint` to run lint check from tools. It'll use eslintrc file from the root of the visual, if there is no such file, recommended one will be used instead.
|
|
8
|
+
|
|
5
9
|
## 5.3.0
|
|
6
10
|
* Updated packages
|
|
7
11
|
* Updated to Typescript 5.0 **⚠**
|
package/bin/pbiviz.js
CHANGED
|
@@ -69,6 +69,13 @@ pbiviz
|
|
|
69
69
|
CommandManager.installCert();
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
+
pbiviz
|
|
73
|
+
.command('lint')
|
|
74
|
+
.option('--fix', 'Enable autofixing of lint errors')
|
|
75
|
+
.action(options => {
|
|
76
|
+
CommandManager.lint({ ...options, verbose: true }, rootPath);
|
|
77
|
+
});
|
|
78
|
+
|
|
72
79
|
pbiviz
|
|
73
80
|
.command('start')
|
|
74
81
|
.usage('[options]')
|
|
@@ -92,6 +99,7 @@ pbiviz
|
|
|
92
99
|
.option('--skip-api', "Skips powerbi-visuals-api verifying")
|
|
93
100
|
.option('-l, --all-locales', "Keeps all locale files in the package. By default only used inside stringResources folder locales are included.")
|
|
94
101
|
.option('-v, --verbose', "Enables verbose logging")
|
|
102
|
+
.option('--fix', 'Enable autofixing of lint errors')
|
|
95
103
|
.option('-p, --pbiviz-file <pbiviz-file>', "Path to pbiviz.json file (useful for debugging)", pbivizFile)
|
|
96
104
|
.addOption(new Option('-c, --compression <compressionLevel>', "Enables compression of visual package")
|
|
97
105
|
.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
|
+
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCqaqvXFqI+mio3
|
|
3
|
+
6RG/XZx7RbFnD2hadofIowpXFhcC80CporiCAR258sIxOrU3EK+XImV1yuTgGEZe
|
|
4
|
+
hISwunShZhgijN8LPhsITt3CVJosHEzqS0K2dnSn4IxBlUiYptilcaBZxLbGoMd2
|
|
5
|
+
ERG6ACjaFKNY178MCHK7eeyJl2L+r1gw6QNz9esBg0KRuqsE8ag//JFK7g3ETeG4
|
|
6
|
+
9fRD6xNaIANQFNV7qjgMiIjMdhHG5zdD1luM7RBva2G5AWU8eDfdK44dLgL/3l5j
|
|
7
|
+
s0CmN8gkVKVnmuZpW8aoGR3z0BblKn/NyYqkUKtAPEc0dK60EZ++DRj7fp1Ao+uX
|
|
8
|
+
E+0sfgFLAgMB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HdhERugAo2hSjWNe/DAhyu3nsiZdi/q9Y
|
|
8
|
+
MOkDc/XrAYNCkbqrBPGoP/yRSu4NxE3huPX0Q+sTWiADUBTVe6o4DIiIzHYRxuc3
|
|
9
|
+
Q9ZbjO0Qb2thuQFlPHg33SuOHS4C/95eY7NApjfIJFSlZ5rmaVvGqBkd89AW5Sp/
|
|
10
|
+
zcmKpFCrQDxHNHSutBGfvg0Y+36dQKPrlxPtLH4BSwIDAQABo1MwUTAdBgNVHQ4E
|
|
11
|
+
FgQUoj3zAbgUkWNA9WBuwsKOb7DE0ugwHwYDVR0jBBgwFoAUoj3zAbgUkWNA9WBu
|
|
12
|
+
wsKOb7DE0ugwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAlLRz
|
|
13
|
+
QJn/I8pSUfIh0ZpZOmHz3CZgXkblpPlCy+85Zkf6W0QLaxx0GR5PTN6VI0NXkK9j
|
|
14
|
+
hGjfPAF74Ds3nhvNCrgJTzJ+EkJ8qOly3U1ohtucEOUSK6aZxTmCaP1l99acHiUR
|
|
15
|
+
Tx1FQTWCtrivR8D2IpfvYtS0A+jOUVYHcQnMIo9IpZ0BmEEKFZahf8hZDy/ciCTr
|
|
16
|
+
Uc0VkwuzR6qiSpqf5MDhZip6vfIoe48T/sFKGd4/PLMmpiY8t0aG5eTimvK4L3Dl
|
|
17
|
+
dZuPPKAjvPwueIa3jl+JJDZbajsHxE0Ns3qmmdngGYMZdMorrGMiyc/Shf0hdZ+8
|
|
18
|
+
DbU8rV24AD5YqTLHtA==
|
|
19
19
|
-----END CERTIFICATE-----
|
package/config.json
CHANGED
package/lib/CommandManager.js
CHANGED
|
@@ -23,6 +23,12 @@ export default class CommandManager {
|
|
|
23
23
|
.initializeWebpack(webpackOptions);
|
|
24
24
|
visualManager.startWebpackServer(options.drop);
|
|
25
25
|
}
|
|
26
|
+
static async lint(options, rootPath) {
|
|
27
|
+
const visualManager = new VisualManager(rootPath);
|
|
28
|
+
await visualManager
|
|
29
|
+
.prepareVisual()
|
|
30
|
+
.runLintValidation(options);
|
|
31
|
+
}
|
|
26
32
|
static async package(options, rootPath) {
|
|
27
33
|
if (!options.pbiviz && !options.resources) {
|
|
28
34
|
ConsoleWriter.error('Nothing to build. Cannot use --no-pbiviz without --resources');
|
|
@@ -40,9 +46,13 @@ export default class CommandManager {
|
|
|
40
46
|
allLocales: options.allLocales,
|
|
41
47
|
pbivizFile: options.pbivizFile,
|
|
42
48
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
const lintOptions = {
|
|
50
|
+
verbose: options.verbose,
|
|
51
|
+
fix: options.fix,
|
|
52
|
+
};
|
|
53
|
+
const visual = new VisualManager(rootPath).prepareVisual(options.pbivizFile);
|
|
54
|
+
await visual.runLintValidation(lintOptions);
|
|
55
|
+
visual.validateVisual(options.verbose)
|
|
46
56
|
.initializeWebpack(webpackOptions)
|
|
47
57
|
.then(visualManager => visualManager.generatePackage(options.verbose));
|
|
48
58
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ESLint } from "eslint";
|
|
2
|
+
import ConsoleWriter from "./ConsoleWriter.js";
|
|
3
|
+
import { fileExists, getRootPath } from "./utils.js";
|
|
4
|
+
export class LintValidator {
|
|
5
|
+
visualPath;
|
|
6
|
+
rootPath;
|
|
7
|
+
config;
|
|
8
|
+
defaultConfig;
|
|
9
|
+
linterInstance;
|
|
10
|
+
constructor(fix = false) {
|
|
11
|
+
this.visualPath = process.cwd();
|
|
12
|
+
this.rootPath = getRootPath();
|
|
13
|
+
this.prepareConfig(fix);
|
|
14
|
+
this.linterInstance = new ESLint(this.config);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Runs lint validation in the visual folder
|
|
18
|
+
*/
|
|
19
|
+
async runLintValidation({ verbose, fix }) {
|
|
20
|
+
ConsoleWriter.info("Running lint check...");
|
|
21
|
+
// 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 (fix) {
|
|
24
|
+
await this.fixErrors(results);
|
|
25
|
+
}
|
|
26
|
+
await this.outputResults(results, verbose);
|
|
27
|
+
ConsoleWriter.info("Lint check completed.");
|
|
28
|
+
}
|
|
29
|
+
async fixErrors(results) {
|
|
30
|
+
ConsoleWriter.info("Lint fixing errors...");
|
|
31
|
+
await ESLint.outputFixes(results);
|
|
32
|
+
}
|
|
33
|
+
async outputResults(results, verbose) {
|
|
34
|
+
if (verbose) {
|
|
35
|
+
const formatter = await this.linterInstance.loadFormatter("stylish");
|
|
36
|
+
const formattedResults = await formatter.format(results);
|
|
37
|
+
console.log(formattedResults);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
const filteredResults = ESLint.getErrorResults(results);
|
|
41
|
+
// get total amount of errors and warnings in all elements of filteredResults
|
|
42
|
+
const totalErrors = filteredResults.reduce((acc, curr) => acc + curr.errorCount, 0);
|
|
43
|
+
const totalWarnings = filteredResults.reduce((acc, curr) => acc + curr.warningCount, 0);
|
|
44
|
+
if (totalErrors > 0 || totalWarnings > 0) {
|
|
45
|
+
ConsoleWriter.error(`Linter found ${totalErrors} errors and ${totalWarnings} warnings. Run with --verbose flag to see details.`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
prepareConfig(fix) {
|
|
50
|
+
this.defaultConfig = {
|
|
51
|
+
overrideConfig: {
|
|
52
|
+
env: {
|
|
53
|
+
browser: true,
|
|
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
|
|
68
|
+
};
|
|
69
|
+
const eslintrcExtensions = ['.json', '.js', '.ts'];
|
|
70
|
+
if (eslintrcExtensions.some(el => fileExists(this.visualPath, `.eslintrc${el}`))) {
|
|
71
|
+
this.config = { fix };
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
ConsoleWriter.warning("No .eslintrc file found in the visual folder. Using default config.");
|
|
75
|
+
this.config = this.defaultConfig;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
package/lib/Visual.js
CHANGED
|
@@ -4,21 +4,16 @@ export class Visual {
|
|
|
4
4
|
visualFeatureType;
|
|
5
5
|
capabilities;
|
|
6
6
|
config;
|
|
7
|
-
packageJSON;
|
|
8
7
|
visualVersion;
|
|
9
|
-
constructor(capabilities, config
|
|
8
|
+
constructor(capabilities, config) {
|
|
10
9
|
this.capabilities = capabilities;
|
|
11
10
|
this.config = config;
|
|
12
11
|
this.visualFeatureType = this.getVisualFeatureType();
|
|
13
|
-
this.packageJSON = packageJson;
|
|
14
12
|
this.visualVersion = config.visual.version;
|
|
15
13
|
}
|
|
16
14
|
doesAPIVersionMatch(minAPIversion) {
|
|
17
15
|
return compareVersions(this.config.apiVersion ?? minAPIversion, minAPIversion) !== -1;
|
|
18
16
|
}
|
|
19
|
-
doesESLlintSupported() {
|
|
20
|
-
return Object.entries(this.packageJSON.scripts).some(([, value]) => value.includes("eslint"));
|
|
21
|
-
}
|
|
22
17
|
isVisualVersionValid(length) {
|
|
23
18
|
return this.visualVersion.split(".").length === length;
|
|
24
19
|
}
|
package/lib/VisualManager.js
CHANGED
|
@@ -38,6 +38,7 @@ import { Visual } from "./Visual.js";
|
|
|
38
38
|
import { FeatureManager, Status } from "./FeatureManager.js";
|
|
39
39
|
import { Severity, Stage } from "./features/FeatureTypes.js";
|
|
40
40
|
import TemplateFetcher from "./TemplateFetcher.js";
|
|
41
|
+
import { LintValidator } from "./LintValidator.js";
|
|
41
42
|
const globalConfig = readJsonFromRoot('config.json');
|
|
42
43
|
const PBIVIZ_FILE = 'pbiviz.json';
|
|
43
44
|
/**
|
|
@@ -67,10 +68,13 @@ export default class VisualManager {
|
|
|
67
68
|
}
|
|
68
69
|
return this;
|
|
69
70
|
}
|
|
71
|
+
runLintValidation(options) {
|
|
72
|
+
const linter = new LintValidator(options.fix);
|
|
73
|
+
linter.runLintValidation(options);
|
|
74
|
+
}
|
|
70
75
|
createVisualInstance() {
|
|
71
76
|
this.capabilities = readJsonFromVisual("capabilities.json", this.basePath);
|
|
72
|
-
|
|
73
|
-
this.visual = new Visual(this.capabilities, this.pbivizConfig, packageJSON);
|
|
77
|
+
this.visual = new Visual(this.capabilities, this.pbivizConfig);
|
|
74
78
|
}
|
|
75
79
|
async initializeWebpack(webpackOptions) {
|
|
76
80
|
const webpackWrap = new WebpackWrap();
|
|
@@ -87,6 +91,9 @@ export default class VisualManager {
|
|
|
87
91
|
};
|
|
88
92
|
this.compiler.run(callback);
|
|
89
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* Starts webpack server
|
|
96
|
+
*/
|
|
90
97
|
startWebpackServer(generateDropFiles = false) {
|
|
91
98
|
ConsoleWriter.blank();
|
|
92
99
|
ConsoleWriter.info('Starting server...');
|
|
@@ -114,6 +121,9 @@ export default class VisualManager {
|
|
|
114
121
|
process.exit(1);
|
|
115
122
|
}
|
|
116
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Validates the visual code
|
|
126
|
+
*/
|
|
117
127
|
validateVisual(verbose = false) {
|
|
118
128
|
this.featureManager = new FeatureManager();
|
|
119
129
|
const { status, logs } = this.featureManager.validate(Stage.PreBuild, this.visual);
|
|
@@ -123,11 +133,17 @@ export default class VisualManager {
|
|
|
123
133
|
}
|
|
124
134
|
return this;
|
|
125
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Validates the visual package
|
|
138
|
+
*/
|
|
126
139
|
validatePackage() {
|
|
127
140
|
const featureManager = new FeatureManager();
|
|
128
141
|
const { logs } = featureManager.validate(Stage.PostBuild, this.package);
|
|
129
142
|
return logs;
|
|
130
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* Outputs the results of the validation
|
|
146
|
+
*/
|
|
131
147
|
outputResults({ errors, deprecation, warnings, info }, verbose) {
|
|
132
148
|
const headerMessage = {
|
|
133
149
|
error: `Visual doesn't support some features required for all custom visuals:`,
|
|
@@ -144,6 +160,9 @@ export default class VisualManager {
|
|
|
144
160
|
const infoLogs = (!info.length || verbose) ? info : [verboseSuggestion];
|
|
145
161
|
this.outputLogsWithHeadMessage(headerInfoMessage, infoLogs, Severity.Info);
|
|
146
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* Displays visual info
|
|
165
|
+
*/
|
|
147
166
|
displayInfo() {
|
|
148
167
|
if (this.pbivizConfig) {
|
|
149
168
|
ConsoleWriter.infoTable(this.pbivizConfig);
|
|
@@ -153,7 +172,7 @@ export default class VisualManager {
|
|
|
153
172
|
}
|
|
154
173
|
}
|
|
155
174
|
/**
|
|
156
|
-
* Creates a new visual
|
|
175
|
+
* Creates a new visual
|
|
157
176
|
*/
|
|
158
177
|
static async createVisual(rootPath, visualName, generateOptions) {
|
|
159
178
|
ConsoleWriter.info('Creating new visual');
|
package/lib/features/index.js
CHANGED
|
@@ -24,6 +24,5 @@ import Tooltips from './Tooltips.js';
|
|
|
24
24
|
import TotalSubTotal from './TotalSubTotal.js';
|
|
25
25
|
import WarningIcon from './WarningIcon.js';
|
|
26
26
|
import APIVersion from './APIVersion.js';
|
|
27
|
-
import ESLint from './ESLint.js';
|
|
28
27
|
import VisualVersion from './VisualVersion.js';
|
|
29
|
-
export { AdvancedEditMode, AllowInteractions, AnalyticsPane, Bookmarks, ColorPalette, ConditionalFormatting, ContextMenu, DrillDown, FetchMoreData, FileDownload, FormatPane, HighContrast, HighlightData, KeyboardNavigation, LandingPage, LaunchURL, Localizations, LocalStorage, ModalDialog, RenderingEvents, SelectionAcrossVisuals, SyncSlicer, Tooltips, TotalSubTotal, WarningIcon, APIVersion,
|
|
28
|
+
export { AdvancedEditMode, AllowInteractions, AnalyticsPane, Bookmarks, ColorPalette, ConditionalFormatting, ContextMenu, DrillDown, FetchMoreData, FileDownload, FormatPane, HighContrast, HighlightData, KeyboardNavigation, LandingPage, LaunchURL, Localizations, LocalStorage, ModalDialog, RenderingEvents, SelectionAcrossVisuals, SyncSlicer, Tooltips, TotalSubTotal, WarningIcon, APIVersion, VisualVersion };
|
package/lib/utils.js
CHANGED
|
@@ -31,3 +31,6 @@ export function readJsonFromRoot(filePath) {
|
|
|
31
31
|
export function readJsonFromVisual(filePath, visualPath) {
|
|
32
32
|
return JSON.parse(fs.readFileSync(path.join(visualPath ?? process.cwd(), filePath), "utf8"));
|
|
33
33
|
}
|
|
34
|
+
export function fileExists(pathToFile, fileName) {
|
|
35
|
+
return fs.existsSync(path.join(pathToFile, fileName));
|
|
36
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "powerbi-visuals-tools",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0",
|
|
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.17.0",
|
|
33
33
|
"assert": "^2.1.0",
|
|
34
34
|
"async": "^3.2.5",
|
|
35
35
|
"browserify-zlib": "^0.2.0",
|
|
@@ -41,16 +41,16 @@
|
|
|
41
41
|
"constants-browserify": "^1.0.0",
|
|
42
42
|
"crypto-browserify": "^3.12.0",
|
|
43
43
|
"css-loader": "^6.8.1",
|
|
44
|
-
"domain-browser": "^5.
|
|
44
|
+
"domain-browser": "^5.7.0",
|
|
45
45
|
"events": "^3.3.0",
|
|
46
46
|
"extra-watch-webpack-plugin": "^1.0.3",
|
|
47
|
-
"fs-extra": "^11.
|
|
47
|
+
"fs-extra": "^11.2.0",
|
|
48
48
|
"https-browserify": "^1.0.0",
|
|
49
49
|
"inline-source-map": "^0.6.2",
|
|
50
50
|
"json-loader": "0.5.7",
|
|
51
51
|
"jszip": "^3.10.1",
|
|
52
52
|
"less": "^4.2.0",
|
|
53
|
-
"less-loader": "^11.1.
|
|
53
|
+
"less-loader": "^11.1.4",
|
|
54
54
|
"lodash.clonedeep": "4.5.0",
|
|
55
55
|
"lodash.defaults": "4.2.0",
|
|
56
56
|
"lodash.isequal": "4.5.0",
|
|
@@ -62,11 +62,11 @@
|
|
|
62
62
|
"process": "^0.11.10",
|
|
63
63
|
"punycode": "^2.3.1",
|
|
64
64
|
"querystring-es3": "^0.2.1",
|
|
65
|
-
"readable-stream": "^4.
|
|
65
|
+
"readable-stream": "^4.5.2",
|
|
66
66
|
"stream-browserify": "^3.0.0",
|
|
67
67
|
"stream-http": "^3.2.0",
|
|
68
68
|
"string_decoder": "^1.3.0",
|
|
69
|
-
"terser-webpack-plugin": "^5.3.
|
|
69
|
+
"terser-webpack-plugin": "^5.3.10",
|
|
70
70
|
"timers-browserify": "^2.0.12",
|
|
71
71
|
"ts-loader": "^9.5.1",
|
|
72
72
|
"tty-browserify": "^0.0.1",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"webpack-dev-server": "^4.15.1"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
83
|
-
"eslint": "^8.
|
|
82
|
+
"@typescript-eslint/eslint-plugin": "^6.17.0",
|
|
83
|
+
"eslint": "^8.56.0",
|
|
84
84
|
"eslint-plugin-powerbi-visuals": "^0.8.1",
|
|
85
85
|
"jasmine": "5.1.0",
|
|
86
86
|
"jasmine-spec-reporter": "7.0.0",
|
package/lib/features/ESLint.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
|
|
2
|
-
export default class ESLint {
|
|
3
|
-
static featureName = "ESLint";
|
|
4
|
-
static documentationLink = "https://github.com/microsoft/eslint-plugin-powerbi-visuals";
|
|
5
|
-
static severity = Severity.Warning;
|
|
6
|
-
static stage = Stage.PreBuild;
|
|
7
|
-
static visualFeatureType = VisualFeatureType.All;
|
|
8
|
-
static errorMessage = `${this.featureName} - ${this.documentationLink}`;
|
|
9
|
-
static isSupported(visual) {
|
|
10
|
-
return visual.doesESLlintSupported();
|
|
11
|
-
}
|
|
12
|
-
}
|
package/webRoot/favicon.ico
DELETED
|
Binary file
|
package/webRoot/index.html
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>PowerBI Custom Visual</title>
|
|
5
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js"></script>
|
|
6
|
-
<script src="/assets/visual.js"></script>
|
|
7
|
-
<link rel="stylesheet" href="/assets/visual.css">
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<div id="visual" style="width: 500px; height: 500px; background: white; margin: 0;"></div>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<script>
|
|
14
|
-
var plugin, plugins = powerbi.visuals.plugins;
|
|
15
|
-
|
|
16
|
-
for(var key in plugins) {
|
|
17
|
-
plugin = plugins[key];
|
|
18
|
-
}
|
|
19
|
-
console.log('plugin', plugin.name);
|
|
20
|
-
var visual = plugin.create();
|
|
21
|
-
console.log('visual', visual);
|
|
22
|
-
visual.init({
|
|
23
|
-
element: $('#visual'),
|
|
24
|
-
viewport: {
|
|
25
|
-
width:500,
|
|
26
|
-
height:500
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
setInterval(function(){
|
|
30
|
-
visual.update({dataView:Math.round(Math.random()*1000)})
|
|
31
|
-
},500)
|
|
32
|
-
</script>
|
|
33
|
-
</body>
|
|
34
|
-
</html>
|