Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 59 additions & 45 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
},
"devDependencies": {
"@lerna/legacy-package-management": "^8.2.4",
"@lvce-editor/eslint-config": "^17.0.3",
"eslint": "^10.7.0",
"@lvce-editor/eslint-config": "^17.5.0",
"eslint": "^10.8.0",
"lerna": "^8.2.3",
"prettier": "^3.9.5",
"typescript": "^6.0.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ const errorStackLineNode: VirtualDomNode = {
type: VirtualDomElements.Div,
}

const getPrefixDom = (prefix: string): readonly VirtualDomNode[] => {
if (!prefix) {
return []
}
return [text(prefix)]
}

export const getErrorStackLineDom = (stackLine: string, allowedLinkSchemes: readonly string[]): readonly VirtualDomNode[] => {
const location = getStackLineLocation(stackLine)
if (!location) {
Expand All @@ -24,12 +31,12 @@ export const getErrorStackLineDom = (stackLine: string, allowedLinkSchemes: read
childCount: prefix ? 2 : 1,
type: VirtualDomElements.Div,
},
...(prefix ? [text(prefix)] : []),
...getPrefixDom(prefix),
{
childCount: 1,
className: ClassNames.DiffEditorErrorStackLink,
href,
rel: 'noreferrer',
rel: 'noopener noreferrer',
target: '_blank',
type: VirtualDomElements.A,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/diff-view/test/GetContentLeftDom.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ test('getContentLeftDom renders load errors when available', (): void => {
childCount: 1,
className: ClassNames.DiffEditorErrorStackLink,
href: 'file:///tmp/missing-file.js',
rel: 'noreferrer',
rel: 'noopener noreferrer',
target: '_blank',
type: VirtualDomElements.A,
},
Expand Down
6 changes: 3 additions & 3 deletions packages/diff-view/test/GetErrorDom.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ test('getErrorDom renders an error message and stack trace', (): void => {
childCount: 1,
className: ClassNames.DiffEditorErrorStackLink,
href: 'file:///tmp/missing-file.js',
rel: 'noreferrer',
rel: 'noopener noreferrer',
target: '_blank',
type: VirtualDomElements.A,
},
Expand Down Expand Up @@ -99,7 +99,7 @@ test('getErrorDom applies the allowed link scheme allowlist', (): void => {
childCount: 1,
className: ClassNames.DiffEditorErrorStackLink,
href: '#',
rel: 'noreferrer',
rel: 'noopener noreferrer',
target: '_blank',
type: VirtualDomElements.A,
},
Expand Down Expand Up @@ -161,7 +161,7 @@ test('getErrorDom renders an error message with code frame and stack trace', ():
childCount: 1,
className: ClassNames.DiffEditorErrorStackLink,
href: 'file:///tmp/file.js',
rel: 'noreferrer',
rel: 'noopener noreferrer',
target: '_blank',
type: VirtualDomElements.A,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/diff-view/test/GetErrorStackDom.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test('getErrorStackDom renders the stack trace', (): void => {
childCount: 1,
className: ClassNames.DiffEditorErrorStackLink,
href: 'file:///tmp/missing-file.js',
rel: 'noreferrer',
rel: 'noopener noreferrer',
target: '_blank',
type: VirtualDomElements.A,
},
Expand Down Expand Up @@ -63,7 +63,7 @@ test('getErrorStackDom blocks disallowed link schemes', (): void => {
childCount: 1,
className: ClassNames.DiffEditorErrorStackLink,
href: '#',
rel: 'noreferrer',
rel: 'noopener noreferrer',
target: '_blank',
type: VirtualDomElements.A,
},
Expand Down
1 change: 1 addition & 0 deletions packages/e2e/extension/extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "diff-view-e2e",
"activation": ["onWebView:diff-prototype"],
"browser": "main.js",
"contentSecurityPolicy": ["default-src 'none'", "script-src 'self'"],
"rpc": [
{
"id": "test.diff-prototype-worker",
Expand Down