-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use generate codicon.css with embedded TTF instead of imported one
- This removes the need to have codicon as depedency to the sprotty core - Replace rimraf wih shx - Generated file contains license links
- Loading branch information
Showing
9 changed files
with
72 additions
and
16 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/lib/ | ||
/artifacts/ | ||
/css/generated |
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,34 @@ | ||
const fs = require('fs'); | ||
|
||
function transformCodicon() { | ||
fs.readFile('../../node_modules/@vscode/codicons/dist/codicon.css', 'utf8', (err, cssData) => { | ||
if (err) { | ||
console.error(err); | ||
return; | ||
} | ||
|
||
if (!fs.existsSync('./css/generated')) { | ||
fs.mkdirSync('./css/generated'); | ||
} | ||
|
||
fs.readFile('../../node_modules/@vscode/codicons/dist/codicon.ttf', 'base64', (errTtf, dataTtf) => { | ||
if (errTtf) { | ||
console.error(errTtf); | ||
return; | ||
} | ||
const ttfData = `data:font/ttf;base64,${dataTtf}`; | ||
let alteredCssData = cssData.replace(/\"\.\/codicon\.ttf.*\"/gi, ttfData); | ||
const licRef = `/* See license here: | ||
* https://github.com/microsoft/vscode-codicons/blob/main/LICENSE-CODE | ||
* https://github.com/microsoft/vscode-codicons/blob/main/LICENSE | ||
*/ | ||
@font-face {` | ||
alteredCssData = alteredCssData.replace('@font-face {', licRef); | ||
|
||
fs.writeFileSync('./css/generated/codicon.css', alteredCssData); | ||
}); | ||
}); | ||
} | ||
|
||
transformCodicon(); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1428,6 +1428,11 @@ | |
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.6.tgz#6bef7a2a0ad684cf6e90fcfe31cecabd9ce0a3ae" | ||
integrity sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w== | ||
|
||
"@types/[email protected]": | ||
version "16.18.3" | ||
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.3.tgz#d7f7ba828ad9e540270f01ce00d391c54e6e0abc" | ||
integrity sha512-jh6m0QUhIRcZpNv7Z/rpN+ZWXOicUUQbSoWks7Htkbb9IjFQj4kzcX/xFCkjstCj5flMsN8FiSvt+q+Tcs4Llg== | ||
|
||
"@types/normalize-package-data@^2.4.0": | ||
version "2.4.1" | ||
resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" | ||
|
@@ -1546,10 +1551,10 @@ | |
resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" | ||
integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== | ||
|
||
"@vscode/codicons@^0.0.25": | ||
version "0.0.25" | ||
resolved "https://registry.yarnpkg.com/@vscode/codicons/-/codicons-0.0.25.tgz#4ebc3e2c9e707ac46aea0becceda79f7738c647c" | ||
integrity sha512-uqPhTdADjwoCh5Ufbv0M6TZiiP2mqbfJVB4grhVx1k+YeP03LDMOHBWPsNwGKn4/0S5Mq9o1w1GeftvR031Gzg== | ||
"@vscode/codicons@^0.0.32": | ||
version "0.0.32" | ||
resolved "https://registry.yarnpkg.com/@vscode/codicons/-/codicons-0.0.32.tgz#9e27de90d509c69762b073719ba3bf46c3cd2530" | ||
integrity sha512-3lgSTWhAzzWN/EPURoY4ZDBEA80OPmnaknNujA3qnI4Iu7AONWd9xF3iE4L+4prIe8E3TUnLQ4pxoaFTEEZNwg== | ||
|
||
"@webassemblyjs/[email protected]": | ||
version "1.11.1" | ||
|
@@ -5117,6 +5122,11 @@ minimist@^1.2.0, minimist@^1.2.5: | |
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" | ||
integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== | ||
|
||
minimist@^1.2.3: | ||
version "1.2.7" | ||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" | ||
integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== | ||
|
||
minipass-collect@^1.0.2: | ||
version "1.0.2" | ||
resolved "https://registry.yarnpkg.com/minipass-collect/-/minipass-collect-1.0.2.tgz#22b813bf745dc6edba2576b940022ad6edc8c617" | ||
|
@@ -6778,7 +6788,7 @@ shell-escape@^0.2.0: | |
resolved "https://registry.yarnpkg.com/shell-escape/-/shell-escape-0.2.0.tgz#68fd025eb0490b4f567a027f0bf22480b5f84133" | ||
integrity sha1-aP0CXrBJC09WegJ/C/IkgLX4QTM= | ||
|
||
shelljs@^0.8.3: | ||
shelljs@^0.8.3, shelljs@^0.8.5: | ||
version "0.8.5" | ||
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c" | ||
integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow== | ||
|
@@ -6787,6 +6797,14 @@ shelljs@^0.8.3: | |
interpret "^1.0.0" | ||
rechoir "^0.6.2" | ||
|
||
shx@^0.3.4: | ||
version "0.3.4" | ||
resolved "https://registry.yarnpkg.com/shx/-/shx-0.3.4.tgz#74289230b4b663979167f94e1935901406e40f02" | ||
integrity sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g== | ||
dependencies: | ||
minimist "^1.2.3" | ||
shelljs "^0.8.5" | ||
|
||
side-channel@^1.0.4: | ||
version "1.0.4" | ||
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" | ||
|