Skip to content

Commit 4c26578

Browse files
authored
Merge pull request #363 from maqprachimishra/master
[JS SDK]: Description, pipeline, closing tags updates
2 parents bfdf3a7 + e367306 commit 4c26578

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+7150
-6230
lines changed

.pipelines/build.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
$exitCode = 0;
2+
3+
Write-Host "start: npm run build"
4+
& npm run build
5+
Write-Host "done: npm run build"
6+
7+
$exitCode += $LASTEXITCODE;
8+
9+
Write-Host "start: Get dist folder files"
10+
& dir "dist"
11+
Write-Host "Done: Get dist folder files"
12+
13+
exit $exitCode

.pipelines/cdpx_run_ps.cmd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
setlocal enabledelayedexpansion
2+
pushd "%~dp0\.."
3+
powershell.exe -ExecutionPolicy Unrestricted -NoProfile -WindowStyle Hidden -NonInteractive -File "%~dp0%~1"
4+
endlocal
5+
popd
6+
exit /B %ERRORLEVEL%

.pipelines/nuget_pack.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Write-Host "Start running nuget_pack.ps1"
2+
3+
$versionNumber = [Environment]::GetEnvironmentVariable("CustomBuildNumber", "User");
4+
$exitCode = 0;
5+
6+
Write-Host "Nuget Pack ..\PowerBI.JavaScript.nuspec -Version "$versionNumber
7+
& nuget pack "..\PowerBI.JavaScript.nuspec" -Version $versionNumber
8+
9+
$exitCode += $LASTEXITCODE;
10+
11+
exit $exitCode

.pipelines/package.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
$exitCode = 0;
2+
3+
Write-Host "start: npm pack"
4+
& npm pack
5+
Write-Host "done: npm pack"
6+
7+
$exitCode += $LASTEXITCODE;
8+
9+
Write-Host "start: Get content of current folder"
10+
& dir
11+
Write-Host "done: Get content of current folder"
12+
13+
exit $exitCode
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
environment:
2+
host:
3+
os: 'windows'
4+
flavor: 'server'
5+
version: '2016'
6+
runtime:
7+
provider: 'appcontainer'
8+
image: 'cdpxwinrs5.azurecr.io/global/vse2019/16.3.7:latest'
9+
source_mode: 'map'
10+
11+
artifact_publish_options:
12+
publish_to_legacy_artifacts: false
13+
publish_to_pipeline_artifacts: true
14+
publish_to_cloudvault_artifacts: false
15+
16+
signing_options:
17+
profile: 'external_distribution'
18+
19+
static_analysis_options:
20+
moderncop_options:
21+
files_to_scan:
22+
- from: 'src\'
23+
include:
24+
- '**/*.*'
25+
26+
policheck_options:
27+
files_to_scan:
28+
- exclude:
29+
- 'demo\**\*' # Exclude path 'Localize'.
30+
- 'test\**\*'
31+
- 'node_modules\**\*'
32+
33+
binskim_options:
34+
files_to_scan:
35+
- exclude:
36+
- 'demo\**\*' # Exclude path 'Localize'.
37+
- 'test\**\*'
38+
- 'node_modules\**\*'
39+
40+
package_sources:
41+
npm:
42+
feeds:
43+
registry: https://powerbi.pkgs.visualstudio.com/_packaging/SDK.Externals/npm/registry/
44+
45+
version:
46+
major: 1 # <---- Required field but not being used for 'custom' scheme
47+
minor: 0 # <---- Required field but not being used for 'custom' scheme
48+
system: 'custom' # <---- Set this to 'custom'. we will build the version using package.json in versioning commands.
49+
50+
versioning:
51+
commands:
52+
- !!defaultcommand
53+
name: 'Set Version'
54+
arguments: 'version.ps1'
55+
command: '.pipelines\cdpx_run_ps.cmd'
56+
57+
restore:
58+
commands:
59+
- !!defaultcommand
60+
name: 'NPM Install'
61+
arguments: 'restore.ps1'
62+
command: '.pipelines\cdpx_run_ps.cmd'
63+
64+
build:
65+
commands:
66+
- !!buildcommand
67+
name: 'Build'
68+
arguments: 'build.ps1'
69+
command: '.pipelines\cdpx_run_ps.cmd'
70+
artifacts:
71+
- from: 'dist'
72+
to: 'build_artifacts'
73+
include:
74+
- '**/*'
75+
exclude:
76+
- '**/node_modules/**/*.*'
77+
- to: 'source'
78+
include:
79+
- '**/*'
80+
exclude:
81+
- '**/.pipelines/**/*.*'
82+
- '**/.vscode/**/*.*'
83+
- '**/test/**/*.*'
84+
- '**/demo/**/*.*'
85+
- '**/dist/**/*.*'
86+
- '**/node_modules/**/*.*'
87+
88+
- !!buildcommand
89+
name: 'Package'
90+
arguments: 'package.ps1'
91+
command: '.pipelines\cdpx_run_ps.cmd'
92+
artifacts:
93+
- include:
94+
- "**/*.tgz"
95+
96+
- !!buildcommand
97+
name: 'Nuget Pack'
98+
arguments: 'nuget_pack.ps1'
99+
command: '.pipelines\cdpx_run_ps.cmd'
100+
artifacts:
101+
- to: 'Release'
102+
include:
103+
- "**/*.nupkg"
104+
105+
test:
106+
commands:
107+
- !!testcommand
108+
name: 'Test powerbi-javascript'
109+
arguments: 'test.ps1'
110+
command: '.pipelines\cdpx_run_ps.cmd'
111+
testresults:
112+
- title: 'powerbi-javascript test results'
113+
type: 'jasmine'
114+
from: 'reports'
115+
include:
116+
- "**coverage/**/index.html"

.pipelines/restore.ps1

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Write-Host "Start build ..."
2+
Write-Host "Global node/npm paths ..."
3+
& where.exe npm
4+
& where.exe node
5+
6+
Write-Host "Global node version"
7+
& node -v
8+
9+
Write-Host "Global npm version"
10+
& npm -v
11+
12+
$exitCode = 0;
13+
14+
Write-Host "start: try install latest npm version"
15+
& npm install npm@latest -g
16+
Write-Host "done: try install latest npm version"
17+
18+
Write-Host "start: install typings globaly"
19+
& npm install typings -g
20+
Write-Host "done: install typings globaly"
21+
22+
# Do not update $exitCode because we do not want to fail if install latest npm version fails.
23+
24+
Write-Host "start: typings install"
25+
& typings install
26+
Write-Host "done: typings install"
27+
$exitCode += $LASTEXITCODE;
28+
29+
Write-Host "start: npm install"
30+
& npm install --no-audit --no-save
31+
Write-Host "done: npm install"
32+
$exitCode += $LASTEXITCODE;
33+
34+
exit $exitCode

.pipelines/test.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
$exitCode = 0;
2+
3+
Write-Host "start: npm run test"
4+
& npm run test
5+
Write-Host "done: npm run test"
6+
7+
$exitCode += $LASTEXITCODE;
8+
9+
exit $exitCode;

.pipelines/version.ps1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
try {
2+
# package.json is in root folder, while version.ps1 runs in .pipelines folder.
3+
$version = (Get-Content "package.json") -join "`n" | ConvertFrom-Json | Select -ExpandProperty "version"
4+
$revision = $env:CDP_DEFINITION_BUILD_COUNT_DAY
5+
$buildNumber = "$version.$revision"
6+
7+
Write-Host "Build Number is" $buildNumber
8+
9+
[Environment]::SetEnvironmentVariable("CustomBuildNumber", $buildNumber, "User") # This will allow you to use it from env var in later steps of the same phase
10+
Write-Host "##vso[build.updatebuildnumber]${buildNumber}" # This will update build number on your build
11+
}
12+
catch {
13+
Write-Error $_.Exception
14+
exit 1;
15+
}

demo/code-demo/log_window.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
<img src="images\clear.png"/> Clear
99
</button>
1010
</div>
11-
<textarea id="txtResponse" class="responseTextArea" />
11+
<textarea id="txtResponse" class="responseTextArea"></textarea>
1212
</div>

demo/code-demo/settings_embed.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ <h4>Embed Report</h4>
44
</div>
55

66
<h8>Select mode to embed your report in:</h8>
7-
<div class="spacer" />
7+
<div class="spacer"></div>
88
<div id="modeSelector">
99
<div onclick="OpenViewMode();"><input type="radio" name="embedMode" value="view" checked="checked"> View mode </input></div>
1010
<div onclick="OpenEditMode();"><input type="radio" name="embedMode" value="edit"> Edit mode</input></div>
@@ -13,7 +13,7 @@ <h4>Embed Report</h4>
1313

1414
<div id="embedModeInput">
1515
<h8>Fill in the fields below to get the code to embed your report.</h8>
16-
<div class="spacer" />
16+
<div class="spacer"></div>
1717

1818
<div class="inputLine">
1919
<div class="inputLineTitle">Embed Token</div>
@@ -31,7 +31,7 @@ <h4>Embed Report</h4>
3131

3232
<div id="createModeInput">
3333
<h8>Fill in the fields below to get the code to embed your report.</h8>
34-
<div class="spacer" />
34+
<div class="spacer"></div>
3535

3636
<div class="inputLine">
3737
<div class="inputLineTitle">Embed Token</div>

0 commit comments

Comments
 (0)