veslx 0.0.28 → 0.1.1
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.
- package/bin/lib/build.ts +3 -0
- package/bin/lib/serve.ts +4 -4
- package/bin/veslx.ts +1 -1
- package/dist/assets/README-DVMP1xaW.js +7 -0
- package/dist/assets/SLIDES-DjNLQtEU.js +10 -0
- package/dist/assets/index-CBkKcH4y.js +469 -0
- package/dist/assets/index-PspMxLnH.css +1 -0
- package/dist/assets/index-UZKwazVi.js +1 -0
- package/dist/index.html +2 -2
- package/dist/raw/.veslx.json +61 -0
- package/dist/raw/README.md +33 -0
- package/dist/raw/test-post/Chart.tsx +16 -0
- package/dist/raw/test-post/README.mdx +21 -0
- package/dist/raw/test-slides/Counter.tsx +25 -0
- package/dist/raw/test-slides/SLIDES.mdx +27 -0
- package/package.json +3 -7
- package/plugin/src/plugin.ts +41 -0
- package/src/components/slides-renderer.tsx +130 -0
- package/src/hooks/use-mdx-content.ts +108 -0
- package/src/pages/post.tsx +15 -13
- package/src/pages/slides.tsx +21 -34
- package/src/vite-env.d.ts +21 -0
- package/vite.config.ts +1 -19
- package/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/assets/index-C75KddSa.css +0 -1
- package/dist/assets/index-DsHb4M_F.js +0 -542
- package/src/components/runtime-mdx.tsx +0 -82
package/bin/lib/build.ts
CHANGED
|
@@ -51,9 +51,11 @@ export default async function buildApp() {
|
|
|
51
51
|
await build({
|
|
52
52
|
root: veslxRoot,
|
|
53
53
|
configFile,
|
|
54
|
+
mode: 'production',
|
|
54
55
|
build: {
|
|
55
56
|
outDir: tempOutDir,
|
|
56
57
|
emptyOutDir: true,
|
|
58
|
+
watch: null, // Explicitly disable watch mode
|
|
57
59
|
rollupOptions: {
|
|
58
60
|
input: path.join(veslxRoot, 'index.html'),
|
|
59
61
|
},
|
|
@@ -61,6 +63,7 @@ export default async function buildApp() {
|
|
|
61
63
|
plugins: [
|
|
62
64
|
veslxPlugin(contentDir)
|
|
63
65
|
],
|
|
66
|
+
logLevel: 'info',
|
|
64
67
|
})
|
|
65
68
|
|
|
66
69
|
// Copy built files to user's dist directory
|
package/bin/lib/serve.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { createServer, preview } from 'vite'
|
|
1
|
+
import { createServer } from 'vite'
|
|
3
2
|
import importConfig from "./import-config";
|
|
4
3
|
import veslxPlugin from '../../plugin/src/plugin'
|
|
5
4
|
import path from 'path'
|
|
@@ -7,7 +6,7 @@ import path from 'path'
|
|
|
7
6
|
export default async function start() {
|
|
8
7
|
const cwd = process.cwd()
|
|
9
8
|
|
|
10
|
-
console.log(`Starting veslx server in ${cwd}`);
|
|
9
|
+
console.log(`Starting veslx dev server in ${cwd}`);
|
|
11
10
|
|
|
12
11
|
const config = await importConfig(cwd);
|
|
13
12
|
|
|
@@ -24,7 +23,7 @@ export default async function start() {
|
|
|
24
23
|
? config.dir
|
|
25
24
|
: path.resolve(cwd, config.dir);
|
|
26
25
|
|
|
27
|
-
const server = await
|
|
26
|
+
const server = await createServer({
|
|
28
27
|
root: veslxRoot,
|
|
29
28
|
configFile,
|
|
30
29
|
plugins: [
|
|
@@ -32,6 +31,7 @@ export default async function start() {
|
|
|
32
31
|
],
|
|
33
32
|
})
|
|
34
33
|
|
|
34
|
+
await server.listen()
|
|
35
35
|
server.printUrls()
|
|
36
36
|
server.bindCLIShortcuts({ print: true })
|
|
37
37
|
}
|
package/bin/veslx.ts
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{j as t}from"./index-CBkKcH4y.js";import{u as r}from"./index-UZKwazVi.js";function a({data:n=[30,60,45,80,55]}){const e=Math.max(...n);return t.jsx("div",{className:"flex items-end gap-2 h-32 p-4 bg-muted rounded-lg",children:n.map((s,i)=>t.jsx("div",{className:"flex-1 bg-primary rounded-t transition-all hover:bg-primary/80",style:{height:`${s/e*100}%`},title:`Value: ${s}`},i))})}const m={title:"Test Post",description:"This is a test post for testing purposes.",date:"2024-06-15"};function o(n){const e={code:"code",h1:"h1",h2:"h2",p:"p",...r(),...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.h1,{children:"Test Post"}),`
|
|
2
|
+
`,t.jsx(e.p,{children:"This post demonstrates local imports in MDX."}),`
|
|
3
|
+
`,t.jsx(e.h2,{children:"Interactive Chart"}),`
|
|
4
|
+
`,t.jsx(e.p,{children:"Here's a chart component imported from a local file:"}),`
|
|
5
|
+
`,t.jsx(a,{data:[25,50,75,40,90]}),`
|
|
6
|
+
`,t.jsx(e.h2,{children:"How it works"}),`
|
|
7
|
+
`,t.jsxs(e.p,{children:["The MDX is compiled at build time by Vite, so ",t.jsx(e.code,{children:"import Chart from './Chart.tsx'"})," works natively. No runtime compilation needed!"]})]})}function h(n={}){const{wrapper:e}={...r(),...n.components};return e?t.jsx(e,{...n,children:t.jsx(o,{...n})}):o(n)}export{h as default,m as frontmatter};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{r as i,j as e}from"./index-CBkKcH4y.js";import{u as o}from"./index-UZKwazVi.js";function c(){const[t,n]=i.useState(0);return e.jsxs("div",{className:"flex flex-col items-center gap-4 p-4 border rounded-lg",children:[e.jsx("p",{className:"text-2xl font-bold",children:t}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:()=>n(s=>s-1),className:"px-4 py-2 bg-red-500 text-white rounded hover:bg-red-600",children:"-"}),e.jsx("button",{onClick:()=>n(s=>s+1),className:"px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600",children:"+"})]})]})}const h={title:"Test Slides",description:"These are test slides for testing purposes.",date:"2024-06-15"};function r(t){const n={h1:"h1",hr:"hr",p:"p",...o(),...t.components};return e.jsxs(e.Fragment,{children:[e.jsx(n.h1,{children:"Slide 1"}),`
|
|
2
|
+
`,e.jsx(n.p,{children:"This is the first slide with some text."}),`
|
|
3
|
+
`,e.jsx(n.hr,{}),`
|
|
4
|
+
`,e.jsx(n.h1,{children:"Slide 2: Interactive Component"}),`
|
|
5
|
+
`,e.jsx(n.p,{children:"Here's an interactive counter component:"}),`
|
|
6
|
+
`,e.jsx(c,{}),`
|
|
7
|
+
`,e.jsx(n.hr,{}),`
|
|
8
|
+
`,e.jsx(n.h1,{children:"Slide 3"}),`
|
|
9
|
+
`,e.jsx(n.p,{children:"This is the final slide."}),`
|
|
10
|
+
`,e.jsx(n.p,{children:"Local imports work in slides now!"})]})}function x(t={}){const{wrapper:n}={...o(),...t.components};return n?e.jsx(n,{...t,children:e.jsx(r,{...t})}):r(t)}export{x as default,h as frontmatter};
|