-
Notifications
You must be signed in to change notification settings - Fork 1
Add graphical model view #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
e-filchenko-bosh
wants to merge
8
commits into
eclipse-esmf:main
Choose a base branch
from
bci-oss:add-graphical-model-view
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3a35707
Add graphical view functionality and enhance language client integration
e-filchenko-bosh 4438a2f
Enhance graphical view functionality and add webview assets
e-filchenko-bosh b406d54
Add support for attribute navigation in graphical view
e-filchenko-bosh 4a841f7
Update SVG references in graphical view tests to use full URLs
e-filchenko-bosh 56bfeb1
refactoring
e-filchenko-bosh 9555968
refactoring
e-filchenko-bosh c53c451
Merge remote-tracking branch 'origin/main'
e-filchenko-bosh 0d3691d
resolve merge conflicts
e-filchenko-bosh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,8 @@ | ||
| .vscode/** | ||
| .vscode-test/** | ||
| scripts/ | ||
| src/** | ||
| out/test/** | ||
| .gitignore | ||
| .yarnrc | ||
| .prettierrc | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* | ||
| * Copyright (c) 2026 Robert Bosch Manufacturing Solutions GmbH | ||
| * SPDX-License-Identifier: MPL-2.0 | ||
| */ | ||
|
|
||
| import {copyFileSync, mkdirSync, readdirSync, rmSync} from 'node:fs'; | ||
| import {join} from 'node:path'; | ||
| import {outputDirectory, sha256, webviewAssets} from './webview-assets.mjs'; | ||
|
|
||
| for (const asset of webviewAssets) { | ||
| if (asset.expectedSha256 && sha256(asset.source) !== asset.expectedSha256) { | ||
| throw new Error(`Pinned webview asset hash mismatch: ${asset.destination}`); | ||
| } | ||
| } | ||
|
|
||
| rmSync(outputDirectory, {recursive: true, force: true}); | ||
| mkdirSync(outputDirectory, {recursive: true}); | ||
| for (const asset of webviewAssets) { | ||
| copyFileSync(asset.source, join(outputDirectory, asset.destination)); | ||
| } | ||
|
|
||
| const actual = readdirSync(outputDirectory).sort(); | ||
| const expected = webviewAssets.map(asset => asset.destination).sort(); | ||
| if (JSON.stringify(actual) !== JSON.stringify(expected)) { | ||
| throw new Error('Webview asset copy produced an unexpected inventory.'); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /* | ||
| * Copyright (c) 2026 Robert Bosch Manufacturing Solutions GmbH | ||
| * SPDX-License-Identifier: MPL-2.0 | ||
| */ | ||
|
|
||
| import {readFileSync, readdirSync, statSync} from 'node:fs'; | ||
| import {join} from 'node:path'; | ||
| import {extensionRoot, outputDirectory, sha256, webviewAssets} from './webview-assets.mjs'; | ||
|
|
||
| const packageJson = JSON.parse(readFileSync(join(extensionRoot, 'package.json'), 'utf8')); | ||
| if (packageJson.dependencies?.dompurify !== '3.4.13') { | ||
| throw new Error('DOMPurify must remain pinned exactly to 3.4.13.'); | ||
| } | ||
|
|
||
| const actual = readdirSync(outputDirectory).sort(); | ||
| const expected = webviewAssets.map(asset => asset.destination).sort(); | ||
| if (JSON.stringify(actual) !== JSON.stringify(expected)) { | ||
| throw new Error(`Unexpected out/webview inventory: ${actual.join(', ')}`); | ||
| } | ||
|
|
||
| for (const asset of webviewAssets) { | ||
| const output = join(outputDirectory, asset.destination); | ||
| if (!statSync(output).isFile() || statSync(output).size === 0) { | ||
| throw new Error(`Missing or empty webview asset: ${asset.destination}`); | ||
| } | ||
| if (sha256(asset.source) !== sha256(output)) { | ||
| throw new Error(`Copied webview asset differs from its source: ${asset.destination}`); | ||
| } | ||
| if (asset.expectedSha256 && sha256(output) !== asset.expectedSha256) { | ||
| throw new Error(`Pinned webview asset hash mismatch: ${asset.destination}`); | ||
| } | ||
| } | ||
|
|
||
| process.stdout.write(`Verified ${webviewAssets.length} deterministic webview assets.\n`); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /* | ||
| * Copyright (c) 2026 Robert Bosch Manufacturing Solutions GmbH | ||
| * SPDX-License-Identifier: MPL-2.0 | ||
| */ | ||
|
|
||
| import {createHash} from 'node:crypto'; | ||
| import {readFileSync} from 'node:fs'; | ||
| import {dirname, resolve} from 'node:path'; | ||
| import {fileURLToPath} from 'node:url'; | ||
|
|
||
| export const extensionRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..'); | ||
| export const outputDirectory = resolve(extensionRoot, 'out', 'webview'); | ||
|
|
||
| export const webviewAssets = Object.freeze([ | ||
| asset('node_modules/dompurify/LICENSE', 'DOMPurify-LICENSE-Apache-2.0.txt'), | ||
| asset('node_modules/dompurify/LICENSE-MPL', 'DOMPurify-LICENSE-MPL-2.0.txt'), | ||
| asset( | ||
| 'node_modules/dompurify/dist/purify.min.js', | ||
| 'purify.min.js', | ||
| '9ab3d44d73c3e3947f9ab72e0f0bc15c7f1931d60b365ba261fc85fe59013c56', | ||
| ), | ||
| asset('src/webview/RobotoCondensed-NOTICE.txt', 'RobotoCondensed-NOTICE.txt'), | ||
| asset( | ||
| 'src/webview/RobotoCondensed-Regular.ttf', | ||
| 'RobotoCondensed-Regular.ttf', | ||
| '4a7c36df4318fee50a8159c3a0ebde4572abab65447ae4a651c2fe87212302b5', | ||
| ), | ||
| asset('src/webview/sanitizer-contract.js', 'sanitizer-contract.js'), | ||
| asset('src/webview/webview.css', 'webview.css'), | ||
| asset('src/webview/webview.js', 'webview.js'), | ||
| ]); | ||
|
|
||
| export function sha256(file) { | ||
| return createHash('sha256').update(readFileSync(file)).digest('hex'); | ||
| } | ||
|
|
||
| function asset(source, destination, expectedSha256) { | ||
| return Object.freeze({ | ||
| source: resolve(extensionRoot, source), | ||
| destination, | ||
| ...(expectedSha256 ? {expectedSha256} : {}), | ||
| }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the logic behind this validation? potential unexpected behavior from modifying library version?