veslx 0.1.4 → 0.1.14

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/package.json CHANGED
@@ -1,7 +1,14 @@
1
1
  {
2
2
  "name": "veslx",
3
- "version": "0.1.4",
3
+ "version": "0.1.14",
4
4
  "type": "module",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/eoinmurray/veslx.git"
8
+ },
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
5
12
  "bin": {
6
13
  "veslx": "bin/veslx.ts"
7
14
  },
package/vite.config.ts CHANGED
@@ -13,13 +13,17 @@ import fs from 'fs'
13
13
 
14
14
  const __dirname = path.dirname(fileURLToPath(import.meta.url))
15
15
 
16
- // Use pre-built client if available (published package), otherwise use src/ (local dev)
17
16
  const distClientPath = path.join(__dirname, 'dist/client')
18
17
  const srcPath = path.join(__dirname, 'src')
19
- const usePrebuilt = fs.existsSync(path.join(distClientPath, 'main.js'))
20
- const clientPath = usePrebuilt ? distClientPath : srcPath
18
+ const hasPrebuilt = fs.existsSync(path.join(distClientPath, 'main.js'))
21
19
 
22
- export default defineConfig({
20
+ export default defineConfig(({ command }) => {
21
+ // Only use pre-built files for dev server, not production build
22
+ // Pre-built files have externalized React which breaks production bundles
23
+ const usePrebuilt = command === 'serve' && hasPrebuilt
24
+ const clientPath = usePrebuilt ? distClientPath : srcPath
25
+
26
+ return {
23
27
  clearScreen: false,
24
28
  cacheDir: path.join(__dirname, 'node_modules/.vite'),
25
29
  publicDir: path.join(__dirname, 'public'),
@@ -90,4 +94,5 @@ export default defineConfig({
90
94
  'class-variance-authority',
91
95
  ],
92
96
  },
97
+ }
93
98
  })
@@ -1,7 +0,0 @@
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};
@@ -1,10 +0,0 @@
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};