histoire 1.0.0-alpha.1 → 1.0.0-alpha.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/node/markdown.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,MAAM,CAAA;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAK3C,OAAO,UAAU,MAAM,aAAa,CAAA;AAapC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,OAAO,QAE1D;AAQD,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,OAAO,uBAuExD;AAaD,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,OAAO,8BAqBvD;AAED,wBAAsB,0BAA0B,CAAC,GAAG,EAAE,OAAO;;GAgI5D;AAED,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAA"}
1
+ {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/node/markdown.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,MAAM,CAAA;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAK3C,OAAO,UAAU,MAAM,aAAa,CAAA;AAapC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,OAAO,QAE1D;AAQD,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,OAAO,uBAsExD;AAaD,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,OAAO,8BAqBvD;AAED,wBAAsB,0BAA0B,CAAC,GAAG,EAAE,OAAO;;GAgI5D;AAED,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAA"}
@@ -9,7 +9,7 @@ import { full as emoji } from 'markdown-it-emoji';
9
9
  import micromatch from 'micromatch';
10
10
  import path from 'pathe';
11
11
  import pc from 'picocolors';
12
- import { getHighlighter } from 'shiki-es';
12
+ import { bundledLanguages, createHighlighter } from 'shiki';
13
13
  import { addStory, notifyStoryChange, removeStory } from './stories.js';
14
14
  import { slugify } from './util/slugify.js';
15
15
  const onMarkdownListChangeHandlers = [];
@@ -22,13 +22,12 @@ function notifyMarkdownListChange() {
22
22
  }
23
23
  }
24
24
  export async function createMarkdownRenderer(ctx) {
25
- const highlighter = await getHighlighter({
26
- theme: 'github-dark',
25
+ const highlighter = await createHighlighter({
26
+ themes: ['github-dark'],
27
+ langs: Object.keys(bundledLanguages), // not ideal but markdown-it does not provide async highlight
27
28
  });
28
29
  const md = new MarkdownIt({
29
- highlight: (code, lang) => `<div class="htw-relative htw-not-prose __histoire-code"><div class="htw-absolute htw-top-0 htw-right-0 htw-text-xs htw-text-white/40">${lang}</div>${highlighter.codeToHtml(code, {
30
- lang,
31
- })}</div>`,
30
+ highlight: (code, lang) => `<div class="htw-relative htw-not-prose __histoire-code"><div class="htw-absolute htw-top-0 htw-right-0 htw-text-xs htw-text-white/40">${lang}</div>${highlighter.codeToHtml(code, { theme: 'github-dark', lang })}</div>`,
32
31
  linkify: true,
33
32
  html: true,
34
33
  breaks: false,
package/dist/node/vite.js CHANGED
@@ -82,7 +82,7 @@ export async function getViteConfigWithPlugins(isServer, ctx) {
82
82
  ],
83
83
  include: optimizeDeps([
84
84
  'flexsearch',
85
- 'shiki-es',
85
+ 'shiki',
86
86
  // Shiki dependencies
87
87
  'vscode-oniguruma',
88
88
  'vscode-textmate',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "histoire",
3
3
  "type": "module",
4
- "version": "1.0.0-alpha.1",
4
+ "version": "1.0.0-alpha.2",
5
5
  "description": "A fast story book powered by Vite",
6
6
  "author": {
7
7
  "name": "Guillaume Chau"
@@ -62,13 +62,13 @@
62
62
  "pathe": "^1.1.2",
63
63
  "picocolors": "^1.1.1",
64
64
  "sade": "^1.8.1",
65
- "shiki-es": "^0.14.0",
65
+ "shiki": "^3.0.0",
66
66
  "sirv": "^3.0.0",
67
67
  "vite-node": "0.34.7",
68
- "@histoire/app": "^1.0.0-alpha.1",
69
- "@histoire/controls": "^1.0.0-alpha.1",
70
- "@histoire/shared": "^1.0.0-alpha.1",
71
- "@histoire/vendors": "^1.0.0-alpha.1"
68
+ "@histoire/app": "^1.0.0-alpha.2",
69
+ "@histoire/shared": "^1.0.0-alpha.2",
70
+ "@histoire/vendors": "^1.0.0-alpha.2",
71
+ "@histoire/controls": "^1.0.0-alpha.2"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@types/fs-extra": "^11.0.4",
@@ -12,7 +12,7 @@ import { full as emoji } from 'markdown-it-emoji'
12
12
  import micromatch from 'micromatch'
13
13
  import path from 'pathe'
14
14
  import pc from 'picocolors'
15
- import { getHighlighter } from 'shiki-es'
15
+ import { bundledLanguages, createHighlighter } from 'shiki'
16
16
  import { addStory, notifyStoryChange, removeStory } from './stories.js'
17
17
  import { slugify } from './util/slugify.js'
18
18
 
@@ -29,14 +29,13 @@ function notifyMarkdownListChange() {
29
29
  }
30
30
 
31
31
  export async function createMarkdownRenderer(ctx: Context) {
32
- const highlighter = await getHighlighter({
33
- theme: 'github-dark',
32
+ const highlighter = await createHighlighter({
33
+ themes: ['github-dark'],
34
+ langs: Object.keys(bundledLanguages), // not ideal but markdown-it does not provide async highlight
34
35
  })
35
36
 
36
37
  const md = new MarkdownIt({
37
- highlight: (code, lang) => `<div class="htw-relative htw-not-prose __histoire-code"><div class="htw-absolute htw-top-0 htw-right-0 htw-text-xs htw-text-white/40">${lang}</div>${highlighter.codeToHtml(code, {
38
- lang,
39
- })}</div>`,
38
+ highlight: (code, lang) => `<div class="htw-relative htw-not-prose __histoire-code"><div class="htw-absolute htw-top-0 htw-right-0 htw-text-xs htw-text-white/40">${lang}</div>${highlighter.codeToHtml(code, { theme: 'github-dark', lang })}</div>`,
40
39
  linkify: true,
41
40
  html: true,
42
41
  breaks: false,
package/src/node/vite.ts CHANGED
@@ -107,7 +107,7 @@ export async function getViteConfigWithPlugins(isServer: boolean, ctx: Context):
107
107
  ],
108
108
  include: optimizeDeps([
109
109
  'flexsearch',
110
- 'shiki-es',
110
+ 'shiki',
111
111
  // Shiki dependencies
112
112
  'vscode-oniguruma',
113
113
  'vscode-textmate',