Skip to content

Commit

Permalink
chore: various DX improvements like working source maps (#85)
Browse files Browse the repository at this point in the history
* init changes

* sourcemaps work

* eff off pbiviz

* more fixes

* moar fixes

* prod build fix

* remove yarn field

* minor scripts change

* moar readme stuff
  • Loading branch information
fabis94 authored Dec 3, 2024
1 parent 6e92c85 commit 52f4325
Show file tree
Hide file tree
Showing 14 changed files with 2,177 additions and 1,055 deletions.
4 changes: 0 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ jobs:
name: "npm run build"
command: "npm run build"
working_directory: src/powerbi-visual
- run:
name: "npm run pack"
command: "npm run pack"
working_directory: src/powerbi-visual
- store_artifacts:
path: dist/*.pbiviz
- persist_to_workspace:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -341,3 +341,6 @@ ASALocalRun/
**/webpack.statistics.html
**/Thumbs.db
installer/

localhost.pem
localhost-key.pem
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 20 additions & 14 deletions speckle-powerbi.code-workspace
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"folders": [
{
"name": "root",
"path": "."
"name": "👀 powerbi-visual",
"path": "src/powerbi-visual"
},
{
"name": "DataConnector",
"name": "➡️ powerbi-data-connector",
"path": "src/powerbi-data-connector"
},
{
"name": "Visual",
"path": "src/powerbi-visual"
}
"name": "🏠 root",
"path": "."
},
],
"settings": {
"powerquery.general.mode": "SDK",
Expand All @@ -23,24 +23,30 @@
"**/node_modules/**": true,
".tmp": true
},
"files.exclude": {
".tmp": true
},
"search.exclude": {
".tmp": true,
"typings": true
"typings": true,
"dist": true,
"wepbpack.statistics.dev.html": true,
"wepbpack.statistics.html": true,
},
"json.schemas": [
{
"fileMatch": ["/pbiviz.json"],
"fileMatch": [
"/pbiviz.json"
],
"url": "./src/powerbi-visual/node_modules/powerbi-visuals-api/schema.pbiviz.json"
},
{
"fileMatch": ["/capabilities.json"],
"fileMatch": [
"/capabilities.json"
],
"url": "./src/powerbi-visual/node_modules/powerbi-visuals-api/schema.capabilities.json"
},
{
"fileMatch": ["/dependencies.json"],
"fileMatch": [
"/dependencies.json"
],
"url": "./src/powerbi-visual/node_modules/powerbi-visuals-api/schema.dependencies.json"
}
]
Expand All @@ -51,4 +57,4 @@
"powerquery.vscode-powerquery-sdk"
]
}
}
}
6 changes: 2 additions & 4 deletions src/powerbi-visual/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
{
"editor.tabSize": 4,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"files.eol": "\n",
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/node_modules/**": true,
".tmp": true
},
"files.exclude": {
".tmp": true
},
"files.associations": {
"*.resjson": "json"
},
"editor.formatOnSave": true,
"search.exclude": {
".tmp": true,
"typings": true
Expand Down
20 changes: 20 additions & 0 deletions src/powerbi-visual/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,26 @@ You'll need to properly set up the certificate in order to be able to use the ho

> Hot Reload will only work on PowerBI Web (**not** on Desktop).
### Local dev guide (for powerbi-visual)

1. Cd into `./src/powerbi-visual`
1. Run `npm install`
1. To ensure proper SSL cert usage
1. Ensure [mkcert](https://github.com/FiloSottile/mkcert) is installed
1. Run `npm run generate-certs`
1. If you're on WSL2, you'll need to copy over the root CA to the Windows side and install it there as a trusted root CA. Typically its in `~/.local/share/mkcert/rootCA.pem` on WSL2. From bash, `cd` to that folder and then do `explorer.exe .` to open it in Windows Explorer and then copy the pem file to someplace better accessible. Then open `crtmgr` and install it into **Trusted Root Certification Authorities**. "Certificates - Current User" > "Trusted Root Certification Authorities" > "Certificates" > Right Click "All Tasks" > "Import" > "Local Machine" > "Place all certificates in the following store" > "Trusted Root Certification Authorities". You may have to set the cert filter to "All Files" to see the `.pem` file.
1. After the cert is installed you may have to restart your browser & dev server
1. Run `npm run dev`
1. PowerBI -> Home > New Report > Paste Or manually enter date > Auto-create > Create
1. In the report, click on 'Edit' to open edit mode, and add a "Developer Visual" visual

#### Source map issues

Make sure you're running the dev build (`npm run dev`) and in your browser's dev tools trigger "Clear source maps cache" and "Enable JavaScript source maps". When everything's working, you should be able to click on the "App mounted" console message's file reference link which will take you to the source-mapped source code in dev tools.

Its still a bit janky in that it maye show multiple files with the same name in the file tree,
but one of those is gonna be the real fully source mapped one.

### Contributing

Please make sure you read the [contribution guidelines](.github/CONTRIBUTING.md) for an overview of the best practices we try to follow.
Expand Down
Loading

0 comments on commit 52f4325

Please sign in to comment.