powerbi-visuals-tools 4.3.2 → 5.0.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 +7 -0
- package/README.md +1 -1
- package/bin/pbiviz.js +55 -36
- package/certs/PowerBICustomVisualTest_private.key +26 -26
- package/certs/PowerBICustomVisualTest_public.crt +17 -17
- package/config.json +27 -34
- package/lib/CertificateTools.js +119 -143
- package/lib/CommandManager.js +52 -0
- package/lib/ConsoleWriter.js +63 -85
- package/lib/TemplateFetcher.js +23 -30
- package/lib/VisualGenerator.js +42 -56
- package/lib/VisualManager.js +193 -0
- package/lib/WebPackWrap.js +96 -145
- package/lib/utils.js +21 -13
- package/lib/webpack.config.js +47 -56
- package/package.json +34 -26
- package/spec/clean-tests.js +1 -1
- package/spec/e2e/pbivizCertSpec.js +14 -13
- package/spec/e2e/pbivizInfoSpec.js +7 -10
- package/spec/e2e/pbivizNewSpec.js +53 -65
- package/spec/e2e/pbivizPackageSpec.js +86 -90
- package/spec/e2e/pbivizStartSpec.js +6 -7
- package/spec/e2e/pbivizWebpackVerSpec.js +14 -16
- package/spec/e2e/{utils.js → testUtils.js} +9 -12
- package/spec/helpers/FileSystem.js +18 -18
- package/spec/jasmine-runner.js +5 -5
- package/src/CertificateTools.ts +431 -0
- package/src/CommandManager.ts +78 -0
- package/src/ConsoleWriter.ts +206 -0
- package/src/TemplateFetcher.ts +122 -0
- package/src/VisualGenerator.ts +236 -0
- package/src/VisualManager.ts +220 -0
- package/src/WebPackWrap.ts +299 -0
- package/src/utils.ts +41 -0
- package/src/webpack.config.ts +144 -0
- package/templates/pbiviz-json-template.js +2 -2
- package/templates/pbiviz.json.template +1 -1
- package/templates/plugin-ts-template.js +1 -1
- package/templates/visuals/default/.eslintignore +5 -0
- package/templates/visuals/default/.eslintrc.js +20 -0
- package/templates/visuals/default/package.json +9 -8
- package/templates/visuals/default/pbiviz.json +3 -2
- package/templates/visuals/default/tsconfig.json +2 -2
- package/templates/visuals/rhtml/.eslintignore +5 -0
- package/templates/visuals/rhtml/.eslintrc.js +20 -0
- package/templates/visuals/rhtml/package.json +7 -6
- package/templates/visuals/rhtml/pbiviz.json +2 -1
- package/templates/visuals/rvisual/.eslintignore +5 -0
- package/templates/visuals/rvisual/.eslintrc.js +20 -0
- package/templates/visuals/rvisual/package.json +5 -4
- package/templates/visuals/slicer/.eslintignore +5 -0
- package/templates/visuals/slicer/.eslintrc.js +20 -0
- package/templates/visuals/slicer/package.json +8 -7
- package/templates/visuals/table/.eslintignore +5 -0
- package/templates/visuals/table/.eslintrc.js +20 -0
- package/templates/visuals/table/package.json +8 -7
- package/templates/visuals/table/tsconfig.json +4 -0
- package/tsconfig.json +22 -0
- package/bin/pbiviz-info.js +0 -54
- package/bin/pbiviz-new.js +0 -82
- package/bin/pbiviz-package.js +0 -122
- package/bin/pbiviz-start.js +0 -142
- package/lib/CommandHelpManager.js +0 -51
- package/lib/VisualPackage.js +0 -118
- package/templates/visuals/default/tslint.json +0 -9
- package/templates/visuals/rhtml/tslint.json +0 -9
- package/templates/visuals/rvisual/tslint.json +0 -9
- package/templates/visuals/slicer/tslint.json +0 -9
- package/templates/visuals/table/tslint.json +0 -9
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
|
|
2
|
+
import { getRootPath, readJsonFromRoot } from './utils.js';
|
|
3
|
+
import { LocalizationLoader } from "powerbi-visuals-webpack-plugin";
|
|
4
|
+
import MiniCssExtractPlugin from "mini-css-extract-plugin";
|
|
5
|
+
import TerserPlugin from "terser-webpack-plugin";
|
|
6
|
+
import path from "path";
|
|
7
|
+
import webpack from "webpack";
|
|
8
|
+
|
|
9
|
+
const config = readJsonFromRoot("/config.json");
|
|
10
|
+
|
|
11
|
+
const webpackConfig = {
|
|
12
|
+
entry: {
|
|
13
|
+
'visual.js': ['./src/visual.ts']
|
|
14
|
+
},
|
|
15
|
+
target: 'web',
|
|
16
|
+
devtool: false,
|
|
17
|
+
mode: "production",
|
|
18
|
+
optimization: {
|
|
19
|
+
minimizer: [
|
|
20
|
+
new TerserPlugin({
|
|
21
|
+
parallel: true,
|
|
22
|
+
terserOptions: {}
|
|
23
|
+
})
|
|
24
|
+
],
|
|
25
|
+
minimize: false,
|
|
26
|
+
concatenateModules: false
|
|
27
|
+
},
|
|
28
|
+
performance: {
|
|
29
|
+
maxEntrypointSize: 1024000,
|
|
30
|
+
maxAssetSize: 1024000,
|
|
31
|
+
hints: false
|
|
32
|
+
},
|
|
33
|
+
module: {
|
|
34
|
+
rules: [
|
|
35
|
+
{
|
|
36
|
+
parser: {
|
|
37
|
+
amd: false
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
test: /\.json$/,
|
|
42
|
+
loader: 'json-loader',
|
|
43
|
+
type: "javascript/auto"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
test: /(\.less)|(\.css)$/,
|
|
47
|
+
use: [
|
|
48
|
+
{
|
|
49
|
+
loader: MiniCssExtractPlugin.loader
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
loader: 'css-loader'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
loader: 'less-loader',
|
|
56
|
+
options: {
|
|
57
|
+
lessOptions: {
|
|
58
|
+
paths: [path.resolve(getRootPath(), 'node_modules')]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
test: /\.(woff|ttf|ico|woff2|jpg|jpeg|png|webp|gif|svg|eot)$/i,
|
|
66
|
+
type: 'asset/inline'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
test: /powerbiGlobalizeLocales\.js$/,
|
|
70
|
+
loader: LocalizationLoader
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
externals: {
|
|
75
|
+
"powerbi-visuals-api": 'null'
|
|
76
|
+
},
|
|
77
|
+
resolve: {
|
|
78
|
+
extensions: ['.tsx', '.ts', '.jsx', '.js', '.css'],
|
|
79
|
+
fallback: {
|
|
80
|
+
assert: path.resolve("../node-modules/assert/"),
|
|
81
|
+
buffer: path.resolve("../node-modules/buffer/"),
|
|
82
|
+
console: path.resolve("../node-modules/console-browserify/"),
|
|
83
|
+
constants: path.resolve("../node-modules/constants-browserify/"),
|
|
84
|
+
crypto: path.resolve("../node-modules/crypto-browserify/"),
|
|
85
|
+
domain: path.resolve("../node-modules/domain-browser/"),
|
|
86
|
+
events: path.resolve("../node-modules/events/"),
|
|
87
|
+
http: path.resolve("../node-modules/stream-http/"),
|
|
88
|
+
https: path.resolve("../node-modules/https-browserify/"),
|
|
89
|
+
os: path.resolve("../node-modules/os-browserify/"),
|
|
90
|
+
path: path.resolve("../node-modules/path-browserify/"),
|
|
91
|
+
punycode: path.resolve("../node-modules/punycode/"),
|
|
92
|
+
process: path.resolve("../node-modules/process/"),
|
|
93
|
+
querystring: path.resolve("../node-modules/querystring-es3/"),
|
|
94
|
+
stream: path.resolve("../node-modules/stream-browserify/"),
|
|
95
|
+
_stream_duplex: path.resolve("../node-modules/readable-stream/"),
|
|
96
|
+
_stream_passthrough: path.resolve("../node-modules/readable-stream/"),
|
|
97
|
+
_stream_readable: path.resolve("../node-modules/readable-stream/"),
|
|
98
|
+
_stream_transform: path.resolve("../node-modules/readable-stream/"),
|
|
99
|
+
_stream_writable: path.resolve("../node-modules/readable-stream/"),
|
|
100
|
+
string_decoder: path.resolve("../node-modules/string_decoder/"),
|
|
101
|
+
sys: path.resolve("../node-modules/util/"),
|
|
102
|
+
timers: path.resolve("../node-modules/timers-browserify/"),
|
|
103
|
+
tty: path.resolve("../node-modules/tty-browserify/"),
|
|
104
|
+
url: path.resolve("../node-modules/url/"),
|
|
105
|
+
util: path.resolve("../node-modules/util/"),
|
|
106
|
+
vm: path.resolve("../node-modules/vm-browserify/"),
|
|
107
|
+
zlib: path.resolve("../node-modules/browserify-zlib/")
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
output: {
|
|
111
|
+
path: null,
|
|
112
|
+
publicPath: 'assets',
|
|
113
|
+
filename: "[name]"
|
|
114
|
+
},
|
|
115
|
+
devServer: {
|
|
116
|
+
allowedHosts: "all",
|
|
117
|
+
static: {
|
|
118
|
+
directory: null
|
|
119
|
+
},
|
|
120
|
+
compress: true,
|
|
121
|
+
port: 8080,
|
|
122
|
+
hot: false,
|
|
123
|
+
server: 'https',
|
|
124
|
+
headers: {
|
|
125
|
+
"access-control-allow-origin": "*",
|
|
126
|
+
"cache-control": "public, max-age=0"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
watchOptions: {
|
|
130
|
+
ignored: ['node_modules/**']
|
|
131
|
+
},
|
|
132
|
+
plugins: [
|
|
133
|
+
new webpack.ProvidePlugin({
|
|
134
|
+
Buffer: ["buffer", "Buffer"],
|
|
135
|
+
process: "process/browser"
|
|
136
|
+
}),
|
|
137
|
+
new MiniCssExtractPlugin({
|
|
138
|
+
filename: config.build.css,
|
|
139
|
+
chunkFilename: "[id].css"
|
|
140
|
+
})
|
|
141
|
+
]
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export default webpackConfig;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
export default function (options) {
|
|
2
2
|
return `{
|
|
3
3
|
"visual": {
|
|
4
4
|
"name": "${options.name}",
|
|
5
5
|
"displayName": "${options.displayName}",
|
|
6
6
|
"guid": "${options.guid}",
|
|
7
7
|
"visualClassName": "${options.visualClassName}",
|
|
8
|
-
"version": "1.0.0",
|
|
8
|
+
"version": "1.0.0.0",
|
|
9
9
|
"description": "",
|
|
10
10
|
"supportUrl": "",
|
|
11
11
|
"gitHubUrl": ""
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
env: {
|
|
3
|
+
"browser": true,
|
|
4
|
+
"es6": true,
|
|
5
|
+
"es2017": true
|
|
6
|
+
},
|
|
7
|
+
root: true,
|
|
8
|
+
parser: "@typescript-eslint/parser",
|
|
9
|
+
parserOptions: {
|
|
10
|
+
project: "tsconfig.json",
|
|
11
|
+
tsconfigRootDir: ".",
|
|
12
|
+
},
|
|
13
|
+
plugins: [
|
|
14
|
+
"powerbi-visuals"
|
|
15
|
+
],
|
|
16
|
+
extends: [
|
|
17
|
+
"plugin:powerbi-visuals/recommended"
|
|
18
|
+
],
|
|
19
|
+
rules: {}
|
|
20
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "visual",
|
|
3
3
|
"description": "default_template_value",
|
|
4
|
+
"version": "1.0.0.0",
|
|
4
5
|
"repository": {
|
|
5
6
|
"type": "default_template_value",
|
|
6
7
|
"url": "default_template_value"
|
|
@@ -10,18 +11,18 @@
|
|
|
10
11
|
"pbiviz": "pbiviz",
|
|
11
12
|
"start": "pbiviz start",
|
|
12
13
|
"package": "pbiviz package",
|
|
13
|
-
"lint": "
|
|
14
|
+
"lint": "npx eslint . --ext .js,.jsx,.ts,.tsx"
|
|
14
15
|
},
|
|
15
16
|
"dependencies": {
|
|
16
|
-
"@types/d3": "
|
|
17
|
-
"d3": "
|
|
18
|
-
"powerbi-visuals-api": "5.
|
|
17
|
+
"@types/d3": "7.4.0",
|
|
18
|
+
"d3": "7.8.5",
|
|
19
|
+
"powerbi-visuals-api": "5.4.0",
|
|
19
20
|
"powerbi-visuals-utils-formattingmodel": "5.0.0"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"typescript": "
|
|
23
|
+
"@typescript-eslint/eslint-plugin": "^5.59.11",
|
|
24
|
+
"eslint": "^8.42.0",
|
|
25
|
+
"eslint-plugin-powerbi-visuals": "^0.8.1",
|
|
26
|
+
"typescript": "4.9.3"
|
|
26
27
|
}
|
|
27
28
|
}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
"allowJs": false,
|
|
4
4
|
"emitDecoratorMetadata": true,
|
|
5
5
|
"experimentalDecorators": true,
|
|
6
|
-
"target": "
|
|
6
|
+
"target": "es2022",
|
|
7
7
|
"sourceMap": true,
|
|
8
8
|
"outDir": "./.tmp/build/",
|
|
9
9
|
"moduleResolution": "node",
|
|
10
10
|
"declaration": true,
|
|
11
11
|
"lib": [
|
|
12
|
-
"
|
|
12
|
+
"es2022",
|
|
13
13
|
"dom"
|
|
14
14
|
]
|
|
15
15
|
},
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
env: {
|
|
3
|
+
"browser": true,
|
|
4
|
+
"es6": true,
|
|
5
|
+
"es2017": true
|
|
6
|
+
},
|
|
7
|
+
root: true,
|
|
8
|
+
parser: "@typescript-eslint/parser",
|
|
9
|
+
parserOptions: {
|
|
10
|
+
project: "tsconfig.json",
|
|
11
|
+
tsconfigRootDir: ".",
|
|
12
|
+
},
|
|
13
|
+
plugins: [
|
|
14
|
+
"powerbi-visuals"
|
|
15
|
+
],
|
|
16
|
+
extends: [
|
|
17
|
+
"plugin:powerbi-visuals/recommended"
|
|
18
|
+
],
|
|
19
|
+
rules: {}
|
|
20
|
+
};
|
|
@@ -4,16 +4,17 @@
|
|
|
4
4
|
"powerbi-visuals-utils-formattingmodel": "5.0.0"
|
|
5
5
|
},
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"powerbi-visuals-api": "5.
|
|
8
|
-
"ts-loader": "
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
7
|
+
"powerbi-visuals-api": "5.4.0",
|
|
8
|
+
"ts-loader": "9.4.3",
|
|
9
|
+
"@typescript-eslint/eslint-plugin": "^5.59.11",
|
|
10
|
+
"eslint": "^8.42.0",
|
|
11
|
+
"eslint-plugin-powerbi-visuals": "^0.8.1",
|
|
12
|
+
"typescript": "5.1.3"
|
|
12
13
|
},
|
|
13
14
|
"scripts": {
|
|
14
15
|
"pbiviz": "pbiviz",
|
|
15
16
|
"start": "pbiviz start",
|
|
16
17
|
"package": "pbiviz package",
|
|
17
|
-
"lint": "
|
|
18
|
+
"lint": "npx eslint . --ext .js,.jsx,.ts,.tsx"
|
|
18
19
|
}
|
|
19
20
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
env: {
|
|
3
|
+
"browser": true,
|
|
4
|
+
"es6": true,
|
|
5
|
+
"es2017": true
|
|
6
|
+
},
|
|
7
|
+
root: true,
|
|
8
|
+
parser: "@typescript-eslint/parser",
|
|
9
|
+
parserOptions: {
|
|
10
|
+
project: "tsconfig.json",
|
|
11
|
+
tsconfigRootDir: ".",
|
|
12
|
+
},
|
|
13
|
+
plugins: [
|
|
14
|
+
"powerbi-visuals"
|
|
15
|
+
],
|
|
16
|
+
extends: [
|
|
17
|
+
"plugin:powerbi-visuals/recommended"
|
|
18
|
+
],
|
|
19
|
+
rules: {}
|
|
20
|
+
};
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
"powerbi-visuals-utils-formattingmodel": "5.0.0"
|
|
5
5
|
},
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"powerbi-visuals-api": "5.
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
7
|
+
"powerbi-visuals-api": "5.4.0",
|
|
8
|
+
"@typescript-eslint/eslint-plugin": "^5.59.11",
|
|
9
|
+
"eslint": "^8.42.0",
|
|
10
|
+
"eslint-plugin-powerbi-visuals": "^0.8.1",
|
|
11
|
+
"typescript": "4.9.3"
|
|
11
12
|
},
|
|
12
13
|
"scripts": {
|
|
13
14
|
"pbiviz": "pbiviz",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
env: {
|
|
3
|
+
"browser": true,
|
|
4
|
+
"es6": true,
|
|
5
|
+
"es2017": true
|
|
6
|
+
},
|
|
7
|
+
root: true,
|
|
8
|
+
parser: "@typescript-eslint/parser",
|
|
9
|
+
parserOptions: {
|
|
10
|
+
project: "tsconfig.json",
|
|
11
|
+
tsconfigRootDir: ".",
|
|
12
|
+
},
|
|
13
|
+
plugins: [
|
|
14
|
+
"powerbi-visuals"
|
|
15
|
+
],
|
|
16
|
+
extends: [
|
|
17
|
+
"plugin:powerbi-visuals/recommended"
|
|
18
|
+
],
|
|
19
|
+
rules: {}
|
|
20
|
+
};
|
|
@@ -4,17 +4,18 @@
|
|
|
4
4
|
"pbiviz": "pbiviz",
|
|
5
5
|
"start": "pbiviz start",
|
|
6
6
|
"package": "pbiviz package",
|
|
7
|
-
"lint": "
|
|
7
|
+
"lint": "npx eslint . --ext .js,.jsx,.ts,.tsx"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"d3": "
|
|
10
|
+
"d3": "7.8.5",
|
|
11
11
|
"powerbi-visuals-utils-formattingmodel": "5.0.0"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@types/d3": "
|
|
15
|
-
"powerbi-visuals-api": "5.
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
14
|
+
"@types/d3": "7.4.0",
|
|
15
|
+
"powerbi-visuals-api": "5.4.0",
|
|
16
|
+
"@typescript-eslint/eslint-plugin": "^5.59.11",
|
|
17
|
+
"eslint": "^8.42.0",
|
|
18
|
+
"eslint-plugin-powerbi-visuals": "^0.8.1",
|
|
19
|
+
"typescript": "4.9.3"
|
|
19
20
|
}
|
|
20
21
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
env: {
|
|
3
|
+
"browser": true,
|
|
4
|
+
"es6": true,
|
|
5
|
+
"es2017": true
|
|
6
|
+
},
|
|
7
|
+
root: true,
|
|
8
|
+
parser: "@typescript-eslint/parser",
|
|
9
|
+
parserOptions: {
|
|
10
|
+
project: "tsconfig.json",
|
|
11
|
+
tsconfigRootDir: ".",
|
|
12
|
+
},
|
|
13
|
+
plugins: [
|
|
14
|
+
"powerbi-visuals"
|
|
15
|
+
],
|
|
16
|
+
extends: [
|
|
17
|
+
"plugin:powerbi-visuals/recommended"
|
|
18
|
+
],
|
|
19
|
+
rules: {}
|
|
20
|
+
};
|
|
@@ -4,17 +4,18 @@
|
|
|
4
4
|
"pbiviz": "pbiviz",
|
|
5
5
|
"start": "pbiviz start",
|
|
6
6
|
"package": "pbiviz package",
|
|
7
|
-
"lint": "
|
|
7
|
+
"lint": "npx eslint . --ext .js,.jsx,.ts,.tsx"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"d3": "
|
|
10
|
+
"d3": "7.8.5",
|
|
11
11
|
"powerbi-visuals-utils-formattingmodel": "5.0.0"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"powerbi-visuals-api": "5.
|
|
15
|
-
"@types/d3": "
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
14
|
+
"powerbi-visuals-api": "5.4.0",
|
|
15
|
+
"@types/d3": "7.4.0",
|
|
16
|
+
"@typescript-eslint/eslint-plugin": "^5.59.11",
|
|
17
|
+
"eslint": "^8.42.0",
|
|
18
|
+
"eslint-plugin-powerbi-visuals": "^0.8.1",
|
|
19
|
+
"typescript": "4.9.3"
|
|
19
20
|
}
|
|
20
21
|
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowJs": false,
|
|
4
|
+
"emitDecoratorMetadata": true,
|
|
5
|
+
"experimentalDecorators": true,
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"allowSyntheticDefaultImports": true,
|
|
8
|
+
"declaration": false,
|
|
9
|
+
"sourceMap": false,
|
|
10
|
+
"module": "ES2022",
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"target": "ES2022",
|
|
13
|
+
"lib": [
|
|
14
|
+
"ES2022",
|
|
15
|
+
"dom"
|
|
16
|
+
],
|
|
17
|
+
"outDir": "lib"
|
|
18
|
+
},
|
|
19
|
+
"include": [
|
|
20
|
+
"src/**/*.ts"
|
|
21
|
+
]
|
|
22
|
+
}
|
package/bin/pbiviz-info.js
DELETED
|
@@ -1,54 +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
|
-
let program = require('commander');
|
|
30
|
-
let VisualPackage = require('../lib/VisualPackage');
|
|
31
|
-
let ConsoleWriter = require('../lib/ConsoleWriter');
|
|
32
|
-
let CommandHelpManager = require('../lib/CommandHelpManager');
|
|
33
|
-
let options = process.argv;
|
|
34
|
-
|
|
35
|
-
if (options.some(option => option === '--help' || option === '-h')) {
|
|
36
|
-
program.help(CommandHelpManager.createSubCommandHelpCallback(options));
|
|
37
|
-
process.exit(0);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
program.parse(options);
|
|
41
|
-
|
|
42
|
-
let cwd = process.cwd();
|
|
43
|
-
|
|
44
|
-
VisualPackage.loadVisualPackage(cwd).then((visualPackage) => {
|
|
45
|
-
let info = visualPackage.config;
|
|
46
|
-
if (info) {
|
|
47
|
-
ConsoleWriter.infoTable(info);
|
|
48
|
-
} else {
|
|
49
|
-
ConsoleWriter.error('Unable to load visual info. Please ensure the package is valid.');
|
|
50
|
-
}
|
|
51
|
-
}).catch((e) => {
|
|
52
|
-
ConsoleWriter.error('LOAD ERROR', e);
|
|
53
|
-
process.exit(1);
|
|
54
|
-
});
|
package/bin/pbiviz-new.js
DELETED
|
@@ -1,82 +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
|
-
const program = require('commander');
|
|
30
|
-
const VisualPackage = require('../lib/VisualPackage');
|
|
31
|
-
const ConsoleWriter = require('../lib/ConsoleWriter');
|
|
32
|
-
const CommandHelpManager = require('../lib/CommandHelpManager');
|
|
33
|
-
const TemplateFetcher = require('../lib/TemplateFetcher');
|
|
34
|
-
const config = require('../config.json');
|
|
35
|
-
const options = process.argv;
|
|
36
|
-
|
|
37
|
-
program
|
|
38
|
-
.option('-f, --force', 'force creation (overwrites folder if exists)')
|
|
39
|
-
.option('-t, --template [template]', 'use a specific template (default, table, slicer, rvisual, rhtml)');
|
|
40
|
-
|
|
41
|
-
if (options.some(option => option === '--help' || option === '-h')) {
|
|
42
|
-
program.help(CommandHelpManager.createSubCommandHelpCallback(options));
|
|
43
|
-
process.exit(0);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
program.parse(options);
|
|
47
|
-
|
|
48
|
-
let args = program.args;
|
|
49
|
-
|
|
50
|
-
if (!args || args.length < 1) {
|
|
51
|
-
ConsoleWriter.error("You must enter a visual name");
|
|
52
|
-
process.exit(1);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
let visualName = args.join(' ');
|
|
56
|
-
let cwd = process.cwd();
|
|
57
|
-
|
|
58
|
-
ConsoleWriter.info('Creating new visual');
|
|
59
|
-
|
|
60
|
-
if (program.force) {
|
|
61
|
-
ConsoleWriter.warn('Running with force flag. Existing files will be overwritten');
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
let generateOptions = {
|
|
65
|
-
force: program.force,
|
|
66
|
-
template: program.template
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
if (config.visualTemplates[generateOptions.template]) {
|
|
70
|
-
new TemplateFetcher({
|
|
71
|
-
force: program.force,
|
|
72
|
-
templateName: generateOptions.template,
|
|
73
|
-
visualName: visualName
|
|
74
|
-
}).fetch();
|
|
75
|
-
} else {
|
|
76
|
-
VisualPackage.createVisualPackage(cwd, visualName, generateOptions).then(() => {
|
|
77
|
-
ConsoleWriter.done('Visual creation complete');
|
|
78
|
-
}).catch((e) => {
|
|
79
|
-
ConsoleWriter.error('Unable to create visual.\n', e);
|
|
80
|
-
process.exit(1);
|
|
81
|
-
});
|
|
82
|
-
}
|