Skip to content

Commit 6c6a7c9

Browse files
May HartovMay Hartov
authored andcommitted
Merged PR 833106: fixed powerbi-clients.d.ts file generation
2 issues in generated d.ts file: 1. module names contains "src/" prefix - this breaks package consumers - "import x from powerbi-client" will fail with invalid modules names. 2. tests typings are included in d.ts file Caused by: https://dev.azure.com/powerbi/Embedded/_git/powerbi-javascript/commit/ad7bf5aadbee40c752f01cb8535357c5ce854512?refName=refs/heads/master&path=/tsconfig.json&_a=contents This change will not effect tests execution ---- #### AI description (iteration 1) #### PR Classification This pull request fixes a bug in the generation of the Power BI TypeScript declarations by cleaning up extra test module declarations and correcting module path names. #### PR Summary The changes update the generated `powerbi-client.d.ts` file by removing unnecessary test-related module declarations and standardizing module paths (removing the redundant `src/` prefix). Additionally, the tsconfig update excludes test files from the build to ensure only production code is generated. - In `dist/powerbi-client.d.ts`, test modules (e.g., mocks and utilities) were removed and module paths were updated. - Several modules (e.g., `FilterBuilders/index`, `powerbi-client`, `report`, `visual`) now use adjusted paths without the `src/` prefix. - The `tsconfig.json` file was modified to exclude test directories from the compilation output. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #1875016
1 parent 29fb78b commit 6c6a7c9

9 files changed

Lines changed: 107 additions & 261 deletions

File tree

.pipelines/OneBranch.Buddy.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,6 @@ extends:
8888
displayName: 'NPM Authenticate'
8989
inputs:
9090
workingFile: '$(Build.SourcesDirectory)/.npmrc'
91-
92-
- script: |
93-
echo "📦 Installing test dependencies..."
94-
npm install --save-dev karma karma-coverage karma-typescript typescript
95-
displayName: 'Install Karma + Coverage Dependencies'
9691

9792
- task: PowerShell@2
9893
displayName: 'Restore'
@@ -109,8 +104,6 @@ extends:
109104
workingDirectory: '$(Build.SourcesDirectory)'
110105

111106
- script: |
112-
echo "Installing puppeteer (includes headless Chromium)..."
113-
npm install puppeteer --save-dev
114107
echo "Setting CHROME_BIN for Karma..."
115108
echo "##vso[task.setvariable variable=CHROME_BIN]$(Build.SourcesDirectory)/node_modules/puppeteer/.local-chromium/*/chrome-linux/chrome"
116109
displayName: 'Install Puppeteer and set CHROME_BIN'

dist/powerbi-client.d.ts

Lines changed: 79 additions & 243 deletions
Large diffs are not rendered by default.

dist/powerbi.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// powerbi-client v2.23.8
1+
// powerbi-client v2.23.9
22
// Copyright (c) Microsoft Corporation.
33
// Licensed under the MIT License.
44
(function webpackUniversalModuleDefinition(root, factory) {
@@ -7505,7 +7505,7 @@ exports.BookmarksManager = BookmarksManager;
75057505
Object.defineProperty(exports, "__esModule", ({ value: true }));
75067506
/** @ignore */ /** */
75077507
var config = {
7508-
version: '2.23.8',
7508+
version: '2.23.9',
75097509
type: 'js'
75107510
};
75117511
exports["default"] = config;

dist/powerbi.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ module.exports = function (config) {
6767
]
6868
},
6969
karmaTypescriptConfig: {
70-
tsconfig: './tsconfig.json',
70+
tsconfig: './tsconfig.test.json',
7171
reports: {
7272
"cobertura": {
7373
"directory": "coverage",

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "powerbi-client",
3-
"version": "2.23.8",
3+
"version": "2.23.9",
44
"description": "JavaScript library for embedding Power BI into your apps. Provides service which makes it easy to embed different types of components and an object model which allows easy interaction with these components such as changing pages, applying filters, and responding to data selection.",
55
"main": "dist/powerbi.js",
66
"types": "dist/powerbi-client.d.ts",
@@ -46,8 +46,8 @@
4646
"gulp": "^4.0.2",
4747
"gulp-eslint": "^6.0.0",
4848
"gulp-flatten": "^0.4.0",
49-
"gulp-prepend": "^0.3.0",
5049
"gulp-help-four": "^0.2.3",
50+
"gulp-prepend": "^0.3.0",
5151
"gulp-rename": "^1.2.2",
5252
"gulp-replace": "^0.5.4",
5353
"gulp-typedoc": "^2.0.0",
@@ -59,14 +59,16 @@
5959
"jasmine-core": "3.10.1",
6060
"jquery": "^3.3.1",
6161
"json-loader": "^0.5.4",
62-
"karma": "^6.3.5",
62+
"karma": "^6.4.4",
6363
"karma-chrome-launcher": "^3.1.0",
64+
"karma-coverage": "~2.0.3",
6465
"karma-firefox-launcher": "^1.2.0",
6566
"karma-jasmine": "4.0.1",
6667
"karma-jasmine-html-reporter": "1.7.0",
6768
"karma-junit-reporter": "^2.0.1",
6869
"karma-spec-reporter": "0.0.32",
69-
"karma-coverage": "~2.0.3",
70+
"karma-typescript": "^5.5.4",
71+
"puppeteer": "^24.26.0",
7072
"ts-loader": "^6.2.2",
7173
"typedoc": "^0.23.23",
7274
"typescript": "~4.6.0",

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
/** @ignore *//** */
55
const config = {
6-
version: '2.23.8',
6+
version: '2.23.9',
77
type: 'js'
88
};
99

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
"noImplicitUseStrict": true,
77
"outDir": "dist"
88
},
9-
"include": ["src/**/*.ts", "test/**/*.ts"],
109
"exclude": [
1110
"node_modules",
1211
"dist",
1312
"docs",
13+
"test",
1414
"tmp",
1515
".publish"
1616
]

tsconfig.test.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"noImplicitAny": false,
5+
"sourceMap": true
6+
},
7+
"include": ["src/**/*.ts", "test/**/*.ts"],
8+
"exclude": [
9+
"node_modules",
10+
"dist",
11+
"docs",
12+
"tmp",
13+
".publish"
14+
]
15+
}

0 commit comments

Comments
 (0)