-
-
Notifications
You must be signed in to change notification settings - Fork 394
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
feat: dependency updates incl. textmate #377
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c49c2fe
feat: upgrade to vscode-textmate-v7. fix #343
octref 812b632
feat: update dependencies (incl. vscode-textmate 7.x)
muenzpraeger 47109b5
Merge branch 'main' into rw/textmate7-update
muenzpraeger 0ef1a37
fix: remove obsolte snapshot
muenzpraeger d186738
chore: update dependencies to latest version
muenzpraeger f97c716
fix: adjust Rollup configurations
muenzpraeger 35c0660
feat: upgrade to vscode-textmate 8
muenzpraeger 9593408
feat: add (un)balanced bracket selectors / embedded lang loading
muenzpraeger 7d57af0
Merge branch 'main' into rw/textmate7-update
muenzpraeger 31f9572
Fix builds
orta 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 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 |
---|---|---|
|
@@ -4,12 +4,19 @@ module.exports = { | |
testTimeout: 10000, | ||
testEnvironment: 'node', | ||
globals: { | ||
__BROWSER__: false, | ||
'ts-jest': { | ||
tsconfig: { | ||
__BROWSER__: false | ||
}, | ||
snapshotFormat: { | ||
escapeString: true, | ||
printBasicPrototype: true | ||
}, | ||
transform: { | ||
'^.+\\.tsx?$': [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another Jest change, this needs now to be a part of the |
||
'ts-jest', | ||
{ | ||
target: 'esnext', | ||
lib: ['ESNext', 'DOM', 'WebWorker'] | ||
} | ||
} | ||
] | ||
} | ||
} |
This file contains 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,7 +1,6 @@ | ||
{ | ||
"packages": [ | ||
"packages/*" | ||
], | ||
"packages": ["packages/*"], | ||
"useWorkspaces": true, | ||
"version": "0.11.0", | ||
"npmClient": "pnpm" | ||
} |
This file contains 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 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
8 changes: 7 additions & 1 deletion
8
packages/renderer-path/rollup.config.js → packages/renderer-path/rollup.config.mjs
This file contains 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 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 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
8 changes: 7 additions & 1 deletion
8
packages/renderer-svg/rollup.config.js → packages/renderer-svg/rollup.config.mjs
This file contains 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 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 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 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 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
2 changes: 1 addition & 1 deletion
2
packages/shiki/src/__tests__/__snapshots__/multiFontStyle.test.ts.snap
This file contains 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,3 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Handle multiple font styles 1`] = `"<pre class=\\"shiki\\" style=\\"background-color: #263238\\"><code><span class=\\"line\\"><span style=\\"color: #89DDFF; font-style: italic\\">**</span><span style=\\"color: #89DDFF; font-style: italic\\">*</span><span style=\\"color: #F07178; font-style: italic\\">bold italic</span><span style=\\"color: #89DDFF; font-style: italic\\">*</span><span style=\\"color: #89DDFF; font-style: italic\\">**</span></span></code></pre>"`; | ||
exports[`Handle multiple font styles 1`] = `"<pre class=\\"shiki\\" style=\\"background-color: #263238\\"><code><span class=\\"line\\"><span style=\\"color: #89DDFF; font-weight: bold\\">**</span><span style=\\"color: #89DDFF; font-style: italic; font-weight: bold\\">*</span><span style=\\"color: #F07178; font-style: italic; font-weight: bold\\">bold italic</span><span style=\\"color: #89DDFF; font-style: italic; font-weight: bold\\">*</span><span style=\\"color: #89DDFF; font-weight: bold\\">**</span></span></code></pre>"`; |
This file contains 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,12 @@ | ||
{ | ||
"tokenColors": [ | ||
{ | ||
"name": "Keyword", | ||
"scope": "keyword", | ||
"settings": { | ||
"foreground": "#ffffff", | ||
"fontStyle": "bold" | ||
} | ||
} | ||
] | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/shiki/src/__tests__/custom-fonts/font-italic.json
This file contains 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,12 @@ | ||
{ | ||
"tokenColors": [ | ||
{ | ||
"name": "Keyword", | ||
"scope": "keyword", | ||
"settings": { | ||
"foreground": "#ffffff", | ||
"fontStyle": "italic" | ||
} | ||
} | ||
] | ||
} |
This file contains 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,11 @@ | ||
{ | ||
"tokenColors": [ | ||
{ | ||
"name": "Keyword", | ||
"scope": "keyword", | ||
"settings": { | ||
"foreground": "#ffffff" | ||
} | ||
} | ||
] | ||
} |
This file contains 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,47 @@ | ||
import path from 'path' | ||
import { getHighlighter, loadTheme } from '../index' | ||
|
||
test('No font-style is applied if none is specified', async () => { | ||
const fNone = await loadTheme(path.resolve(__dirname, './custom-fonts/font-none.json')) | ||
const highlighter = await getHighlighter({ | ||
theme: fNone, | ||
langs: ['js'] | ||
}) | ||
const out = highlighter.codeToHtml(`function() {return 1}`, { lang: 'js' }) | ||
|
||
expect(out).not.toContain('font-style:') | ||
}) | ||
|
||
test('An italic font-style is applied if specified', async () => { | ||
const fItalic = await loadTheme(path.resolve(__dirname, './custom-fonts/font-italic.json')) | ||
const highlighter = await getHighlighter({ | ||
theme: fItalic, | ||
langs: ['js'] | ||
}) | ||
const out = highlighter.codeToHtml(`function() {return 1}`, { lang: 'js' }) | ||
|
||
expect(out).toContain('font-style: italic') | ||
}) | ||
|
||
test('A bold font-style is applied if specified', async () => { | ||
const fBold = await loadTheme(path.resolve(__dirname, './custom-fonts/font-bold.json')) | ||
const highlighter = await getHighlighter({ | ||
theme: fBold, | ||
langs: ['js'] | ||
}) | ||
// console.log(JSON.stringify(highlighter.codeToThemedTokens(`function() {return 1}`, 'js'), null, 2)) | ||
const out = highlighter.codeToHtml(`function() {return 1}`, { lang: 'js' }) | ||
|
||
expect(out).toContain('font-weight: bold') | ||
}) | ||
|
||
test('A bold fontStyle should not apply an italic font-style', async () => { | ||
const fBold = await loadTheme(path.resolve(__dirname, './custom-fonts/font-bold.json')) | ||
const highlighter = await getHighlighter({ | ||
theme: fBold, | ||
langs: ['js'] | ||
}) | ||
const out = highlighter.codeToHtml(`function() {return 1}`, { lang: 'js' }) | ||
|
||
expect(out).not.toContain('font-style: italic') | ||
}) |
This file contains 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.
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.
There was a change in Jest -> they don't escape anymore. For the sake of simplicity (no updated snapshots) in this PR I set the tests to use the previous behaviour.
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.
I made those changes in Jest ;) - but I dig not making things change unnecessarily