Replace hightlight.js internal bundle with direct npm use

This commit is contained in:
Andrey Antukh
2025-11-28 09:14:08 +01:00
parent 88eb43d785
commit 739a55ce34
6 changed files with 4 additions and 51 deletions

View File

@@ -54,7 +54,6 @@
},
"devDependencies": {
"@penpot/draft-js": "portal:./vendor/draft-js",
"@penpot/hljs": "portal:./vendor/hljs",
"@penpot/mousetrap": "portal:./vendor/mousetrap",
"@penpot/plugins-runtime": "1.3.2",
"@penpot/svgo": "penpot/svgo#v3.2",
@@ -79,6 +78,7 @@
"fancy-log": "^2.0.0",
"getopts": "^2.3.0",
"gettext-parser": "^8.0.0",
"highlight.js": "^11.10.0",
"js-beautify": "^1.15.4",
"jsdom": "^27.0.0",
"lodash": "^4.17.21",

View File

@@ -6,11 +6,11 @@
(ns app.util.code-highlight
(:require
["@penpot/hljs" :as hljs]
["highlight.js" :as hljs]
[app.util.dom :as dom]))
(defn highlight!
{:lazy-loadable true}
[node]
(dom/set-data! node "highlighted" nil)
(hljs/highlightElement node))
(.highlightElement hljs/default node))

View File

@@ -1,5 +0,0 @@
import h from "highlight.js";
export function highlightElement(node) {
return h.highlightElement(node);
}

View File

@@ -1,13 +0,0 @@
{
"name": "@penpot/hljs",
"version": "1.0.0",
"description": "Penpot Hightlight.js ESM wrapper",
"main": "index.js",
"packageManager": "yarn@4.3.1",
"author": "Andrey Antukh",
"license": "MPL-2.0",
"type": "module",
"dependencies": {
"highlight.js": "^11.10.0"
}
}

View File

@@ -1,21 +0,0 @@
# This file is generated by running "yarn install" inside your project.
# Manual changes might be lost - proceed with caution!
__metadata:
version: 8
cacheKey: 10c0
"@penpot/hljs@workspace:.":
version: 0.0.0-use.local
resolution: "@penpot/hljs@workspace:."
dependencies:
highlight.js: "npm:^11.10.0"
languageName: unknown
linkType: soft
"highlight.js@npm:^11.10.0":
version: 11.10.0
resolution: "highlight.js@npm:11.10.0"
checksum: 10c0/cd8bf7ef06cbd72ddb83580ecabe769f08f062be8bb82d2eb492d31c17f7480d1f8d14a66fc81deee0601645435f19f04c470510563f847242a41ccff0ab873e
languageName: node
linkType: hard

View File

@@ -963,14 +963,6 @@ __metadata:
languageName: node
linkType: soft
"@penpot/hljs@portal:./vendor/hljs::locator=frontend%40workspace%3A.":
version: 0.0.0-use.local
resolution: "@penpot/hljs@portal:./vendor/hljs::locator=frontend%40workspace%3A."
dependencies:
highlight.js: "npm:^11.10.0"
languageName: node
linkType: soft
"@penpot/mousetrap@portal:./vendor/mousetrap::locator=frontend%40workspace%3A.":
version: 0.0.0-use.local
resolution: "@penpot/mousetrap@portal:./vendor/mousetrap::locator=frontend%40workspace%3A."
@@ -3765,7 +3757,6 @@ __metadata:
resolution: "frontend@workspace:."
dependencies:
"@penpot/draft-js": "portal:./vendor/draft-js"
"@penpot/hljs": "portal:./vendor/hljs"
"@penpot/mousetrap": "portal:./vendor/mousetrap"
"@penpot/plugins-runtime": "npm:1.3.2"
"@penpot/svgo": "penpot/svgo#v3.2"
@@ -3790,6 +3781,7 @@ __metadata:
fancy-log: "npm:^2.0.0"
getopts: "npm:^2.3.0"
gettext-parser: "npm:^8.0.0"
highlight.js: "npm:^11.10.0"
js-beautify: "npm:^1.15.4"
jsdom: "npm:^27.0.0"
lodash: "npm:^4.17.21"