@youtyan/code-viewer 0.6.4 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11789,9 +11789,22 @@ var init_source_meta = __esm(() => {
11789
11789
  hcl: "terraform",
11790
11790
  xml: "xml",
11791
11791
  html: "xml",
11792
- vue: "xml",
11792
+ vue: "vue",
11793
+ svelte: "svelte",
11794
+ astro: "astro",
11795
+ erb: "erb",
11796
+ rhtml: "erb",
11797
+ ejs: "html",
11798
+ hbs: "handlebars",
11799
+ mustache: "handlebars",
11800
+ liquid: "liquid",
11801
+ pug: "pug",
11802
+ twig: "twig",
11803
+ haml: "haml",
11793
11804
  css: "css",
11794
11805
  scss: "scss",
11806
+ sass: "sass",
11807
+ less: "less",
11795
11808
  md: "markdown",
11796
11809
  dockerfile: "dockerfile",
11797
11810
  proto: "protobuf",
@@ -11834,7 +11847,26 @@ var init_source_meta = __esm(() => {
11834
11847
  mm: "objective-cpp",
11835
11848
  tex: "tex",
11836
11849
  bib: "bibtex",
11837
- rst: "rst"
11850
+ rst: "rst",
11851
+ graphql: "graphql",
11852
+ graphqls: "graphql",
11853
+ gql: "graphql",
11854
+ ps1: "powershell",
11855
+ psm1: "powershell",
11856
+ psd1: "powershell",
11857
+ ini: "ini",
11858
+ conf: "ini",
11859
+ env: "dotenv",
11860
+ prisma: "prisma",
11861
+ pas: "pascal",
11862
+ adoc: "asciidoc",
11863
+ asciidoc: "asciidoc",
11864
+ jsonc: "jsonc",
11865
+ mts: "typescript",
11866
+ cts: "typescript",
11867
+ kts: "kotlin",
11868
+ cxx: "cpp",
11869
+ hxx: "cpp"
11838
11870
  };
11839
11871
  TEXT_SOURCE_EXTENSIONS = new Set([
11840
11872
  ...Object.keys(EXT_TO_LANG),
@@ -11986,6 +12018,12 @@ var init_source_meta = __esm(() => {
11986
12018
  "rakefile",
11987
12019
  "procfile",
11988
12020
  "brewfile",
12021
+ "guardfile",
12022
+ "capfile",
12023
+ "vagrantfile",
12024
+ "podfile",
12025
+ "fastfile",
12026
+ "berksfile",
11989
12027
  "gnumakefile",
11990
12028
  "bsdmakefile",
11991
12029
  ".gitattributes",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@youtyan/code-viewer",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "Local browser-based code and git diff viewer",
5
5
  "type": "module",
6
6
  "bin": {
@@ -28,7 +28,7 @@
28
28
  ],
29
29
  "scripts": {
30
30
  "build": "bun run build:web && bun run build:server",
31
- "build:web": "bun build --target=browser --format=iife --outfile=web/app.js web-src/app.ts && bun build --target=browser --format=esm --outfile=web/mermaid.js web-src/mermaid-entry.ts && bun build --target=browser --format=esm --outfile=web/shiki.js web-src/shiki-entry.ts && node scripts/generate-third-party-notices.mjs",
31
+ "build:web": "bun build --target=browser --format=iife --outfile=web/app.js web-src/app.ts && bun build --target=browser --format=esm --outfile=web/mermaid.js web-src/mermaid-entry.ts && bun build --target=browser --format=esm --outfile=web/shiki.js web-src/shiki-entry.ts && bun build --target=browser --format=iife --outfile=web/vendor/highlight.js/highlight.min.js web-src/highlight-entry.ts && node scripts/generate-third-party-notices.mjs",
32
32
  "build:server": "bun build --target=node --format=esm --outfile=dist/code-viewer.js web-src/server/cli.ts",
33
33
  "check": "bun run typecheck",
34
34
  "typecheck": "tsc --noEmit",
@@ -49,7 +49,7 @@
49
49
  "test:postgres:down": "docker compose -f data/test/postgresql/docker-compose.yml down -v",
50
50
  "test": "bun test",
51
51
  "lint": "biome lint web-src package.json biome.jsonc",
52
- "verify": "bun run check && bun run lint && bun run check:format && bun run build && bun run check:bundle && bun run test && node --check web/app.js && node --check web/mermaid.js && node --check web/shiki.js && node --check dist/code-viewer.js && node dist/code-viewer.js --help && node scripts/node-smoke.mjs",
52
+ "verify": "bun run check && bun run lint && bun run check:format && bun run build && bun run check:bundle && bun run test && node --check web/app.js && node --check web/mermaid.js && node --check web/shiki.js && node --check web/vendor/highlight.js/highlight.min.js && node --check dist/code-viewer.js && node dist/code-viewer.js --help && node scripts/node-smoke.mjs",
53
53
  "pack:dry": "npm pack --dry-run",
54
54
  "prepack": "bun run build",
55
55
  "prepublishOnly": "bun run verify"
@@ -68,6 +68,7 @@
68
68
  "@happy-dom/global-registrator": "^20.10.6",
69
69
  "@types/bun": "1.3.13",
70
70
  "@types/markdown-it": "14.1.2",
71
+ "highlight.js": "11.9.0",
71
72
  "markdown-it": "14.1.1",
72
73
  "markdown-it-anchor": "9.2.0",
73
74
  "markdown-it-footnote": "4.0.0",
package/web/app.js CHANGED
@@ -1186,9 +1186,22 @@ ${lines.join(`
1186
1186
  hcl: "terraform",
1187
1187
  xml: "xml",
1188
1188
  html: "xml",
1189
- vue: "xml",
1189
+ vue: "vue",
1190
+ svelte: "svelte",
1191
+ astro: "astro",
1192
+ erb: "erb",
1193
+ rhtml: "erb",
1194
+ ejs: "html",
1195
+ hbs: "handlebars",
1196
+ mustache: "handlebars",
1197
+ liquid: "liquid",
1198
+ pug: "pug",
1199
+ twig: "twig",
1200
+ haml: "haml",
1190
1201
  css: "css",
1191
1202
  scss: "scss",
1203
+ sass: "sass",
1204
+ less: "less",
1192
1205
  md: "markdown",
1193
1206
  dockerfile: "dockerfile",
1194
1207
  proto: "protobuf",
@@ -1231,7 +1244,26 @@ ${lines.join(`
1231
1244
  mm: "objective-cpp",
1232
1245
  tex: "tex",
1233
1246
  bib: "bibtex",
1234
- rst: "rst"
1247
+ rst: "rst",
1248
+ graphql: "graphql",
1249
+ graphqls: "graphql",
1250
+ gql: "graphql",
1251
+ ps1: "powershell",
1252
+ psm1: "powershell",
1253
+ psd1: "powershell",
1254
+ ini: "ini",
1255
+ conf: "ini",
1256
+ env: "dotenv",
1257
+ prisma: "prisma",
1258
+ pas: "pascal",
1259
+ adoc: "asciidoc",
1260
+ asciidoc: "asciidoc",
1261
+ jsonc: "jsonc",
1262
+ mts: "typescript",
1263
+ cts: "typescript",
1264
+ kts: "kotlin",
1265
+ cxx: "cpp",
1266
+ hxx: "cpp"
1235
1267
  };
1236
1268
  var TEXT_SOURCE_EXTENSIONS = new Set([
1237
1269
  ...Object.keys(EXT_TO_LANG),
@@ -1383,6 +1415,12 @@ ${lines.join(`
1383
1415
  "rakefile",
1384
1416
  "procfile",
1385
1417
  "brewfile",
1418
+ "guardfile",
1419
+ "capfile",
1420
+ "vagrantfile",
1421
+ "podfile",
1422
+ "fastfile",
1423
+ "berksfile",
1386
1424
  "gnumakefile",
1387
1425
  "bsdmakefile",
1388
1426
  ".gitattributes",
@@ -1403,7 +1441,16 @@ ${lines.join(`
1403
1441
  "go.mod": "go",
1404
1442
  "build.bazel": "starlark",
1405
1443
  "workspace.bazel": "starlark",
1406
- "module.bazel": "starlark"
1444
+ "module.bazel": "starlark",
1445
+ gemfile: "ruby",
1446
+ rakefile: "ruby",
1447
+ brewfile: "ruby",
1448
+ guardfile: "ruby",
1449
+ capfile: "ruby",
1450
+ vagrantfile: "ruby",
1451
+ podfile: "ruby",
1452
+ fastfile: "ruby",
1453
+ berksfile: "ruby"
1407
1454
  };
1408
1455
  function sourceFileName(path) {
1409
1456
  return (path.split("/").pop() || path).toLowerCase();
@@ -32092,6 +32139,8 @@ code-viewer query agent-help`
32092
32139
  return true;
32093
32140
  }
32094
32141
  const SOURCE_SHIKI_LANGS = Array.from(new Set([
32142
+ "asciidoc",
32143
+ "astro",
32095
32144
  "bash",
32096
32145
  "bibtex",
32097
32146
  "c",
@@ -32103,33 +32152,46 @@ code-viewer query agent-help`
32103
32152
  "dart",
32104
32153
  "diff",
32105
32154
  "dockerfile",
32155
+ "dotenv",
32106
32156
  "elixir",
32157
+ "erb",
32107
32158
  "erlang",
32108
32159
  "fortran",
32109
32160
  "go",
32110
32161
  "gradle",
32111
32162
  "graphql",
32163
+ "haml",
32164
+ "handlebars",
32112
32165
  "haskell",
32113
32166
  "html",
32167
+ "ini",
32114
32168
  "java",
32115
32169
  "javascript",
32116
32170
  "json",
32171
+ "jsonc",
32117
32172
  "julia",
32118
32173
  "kotlin",
32174
+ "less",
32175
+ "liquid",
32119
32176
  "lua",
32120
32177
  "make",
32121
32178
  "markdown",
32122
32179
  "nix",
32123
32180
  "ocaml",
32181
+ "pascal",
32124
32182
  "perl",
32125
32183
  "php",
32184
+ "powershell",
32185
+ "prisma",
32126
32186
  "properties",
32127
32187
  "protobuf",
32188
+ "pug",
32128
32189
  "python",
32129
32190
  "r",
32130
32191
  "rst",
32131
32192
  "ruby",
32132
32193
  "rust",
32194
+ "sass",
32133
32195
  "scala",
32134
32196
  "scss",
32135
32197
  "sql",
@@ -32137,6 +32199,7 @@ code-viewer query agent-help`
32137
32199
  "terraform",
32138
32200
  "tex",
32139
32201
  "toml",
32202
+ "twig",
32140
32203
  "typescript",
32141
32204
  "vim",
32142
32205
  "vue",
@@ -7,13 +7,17 @@ the generated bundles next to this directory are produced at build / pack time.
7
7
  | Package | Version | Files | License |
8
8
  | --- | --- | --- | --- |
9
9
  | diff2html | 3.4.56 | `diff2html/diff2html.min.css`, `diff2html/diff2html-ui.min.js` | MIT, https://github.com/rtfpessoa/diff2html |
10
- | highlight.js | 11.9.0 | `highlight.js/highlight.min.js`, `highlight.js/styles/github*.min.css` | BSD-3-Clause, https://github.com/highlightjs/highlight.js |
11
- | Browser bundle dependencies | fixed by `bun.lock` | generated `../app.js`, `../mermaid.js`, `../shiki.js` | see `THIRD_PARTY_NOTICES.txt` |
10
+ | highlight.js styles | 11.9.0 | `highlight.js/LICENSE`, `highlight.js/styles/github*.min.css` | BSD-3-Clause, https://github.com/highlightjs/highlight.js |
11
+ | Browser bundle dependencies | fixed by `bun.lock` | generated `../app.js`, `../mermaid.js`, `../shiki.js`, `highlight.js/highlight.min.js` | see `THIRD_PARTY_NOTICES.txt` |
12
12
 
13
- `diff2html-ui.min.js` is the UI bundle from the npm package. `highlight.min.js`
14
- is the standard browser build for highlight.js 11.9.0.
13
+ `diff2html-ui.min.js` is the UI bundle from the npm package. The
14
+ `highlight.js/styles/*.min.css` theme files and `highlight.js/LICENSE` are
15
+ committed manually; they only need to be refreshed when upgrading the
16
+ `highlight.js` version pinned in `package.json`.
15
17
 
16
- `../app.js`, `../mermaid.js`, and `../shiki.js` are generated by
17
- `bun run build:web` and are included in npm tarballs, but are not tracked in git.
18
+ `../app.js`, `../mermaid.js`, `../shiki.js`, and `highlight.js/highlight.min.js`
19
+ are generated by `bun run build:web` (the last one registers every language
20
+ bundled with `highlight.js`, not just its CDN "common" subset) and are
21
+ included in npm tarballs, but are not tracked in git.
18
22
  `THIRD_PARTY_NOTICES.txt` is generated from the installed npm packages during
19
23
  the same build.
@@ -2,7 +2,7 @@ Third Party Notices
2
2
  ===================
3
3
 
4
4
  This file is generated by scripts/generate-third-party-notices.mjs.
5
- It covers npm packages pulled into the browser bundles generated as web/app.js, web/mermaid.js, and web/shiki.js.
5
+ It covers npm packages pulled into the browser bundles generated as web/app.js, web/mermaid.js, web/shiki.js, and web/vendor/highlight.js/highlight.min.js.
6
6
 
7
7
  Package Summary
8
8
  ---------------
@@ -126,6 +126,7 @@ Package Summary
126
126
  | hachure-fill | 0.5.2 | MIT | https://github.com/pshihn/hachure-fill#readme |
127
127
  | hast-util-to-html | 9.0.5 | MIT | syntax-tree/hast-util-to-html |
128
128
  | hast-util-whitespace | 3.0.0 | MIT | syntax-tree/hast-util-whitespace |
129
+ | highlight.js | 11.9.0 | BSD-3-Clause | https://highlightjs.org/ |
129
130
  | html-void-elements | 3.0.0 | MIT | wooorm/html-void-elements |
130
131
  | iconv-lite | 0.6.3 | MIT | https://github.com/ashtuchkin/iconv-lite |
131
132
  | internmap | 1.0.1 | ISC | https://github.com/mbostock/internmap/ |
@@ -5635,6 +5636,45 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
5635
5636
  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
5636
5637
  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5637
5638
 
5639
+ highlight.js@11.9.0
5640
+ -------------------
5641
+
5642
+ License metadata: BSD-3-Clause
5643
+ Source: https://highlightjs.org/
5644
+ Package metadata: node_modules/highlight.js/package.json
5645
+
5646
+ File: node_modules/highlight.js/LICENSE
5647
+
5648
+ BSD 3-Clause License
5649
+
5650
+ Copyright (c) 2006, Ivan Sagalaev.
5651
+ All rights reserved.
5652
+
5653
+ Redistribution and use in source and binary forms, with or without
5654
+ modification, are permitted provided that the following conditions are met:
5655
+
5656
+ * Redistributions of source code must retain the above copyright notice, this
5657
+ list of conditions and the following disclaimer.
5658
+
5659
+ * Redistributions in binary form must reproduce the above copyright notice,
5660
+ this list of conditions and the following disclaimer in the documentation
5661
+ and/or other materials provided with the distribution.
5662
+
5663
+ * Neither the name of the copyright holder nor the names of its
5664
+ contributors may be used to endorse or promote products derived from
5665
+ this software without specific prior written permission.
5666
+
5667
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
5668
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
5669
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
5670
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
5671
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5672
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
5673
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
5674
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
5675
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
5676
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5677
+
5638
5678
  html-void-elements@3.0.0
5639
5679
  ------------------------
5640
5680