veslx 0.1.2 → 0.1.4
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 +2 -0
- package/bin/lib/serve.ts +2 -0
- package/dist/client/App.js +17 -0
- package/dist/client/App.js.map +1 -0
- package/dist/client/components/front-matter.js +33 -0
- package/dist/client/components/front-matter.js.map +1 -0
- package/dist/client/components/gallery/components/figure-caption.js +14 -0
- package/dist/client/components/gallery/components/figure-caption.js.map +1 -0
- package/dist/client/components/gallery/components/figure-header.js +13 -0
- package/dist/client/components/gallery/components/figure-header.js.map +1 -0
- package/dist/client/components/gallery/components/lightbox.js +96 -0
- package/dist/client/components/gallery/components/lightbox.js.map +1 -0
- package/dist/client/components/gallery/components/loading-image.js +46 -0
- package/dist/client/components/gallery/components/loading-image.js.map +1 -0
- package/dist/client/components/gallery/hooks/use-gallery-images.js +84 -0
- package/dist/client/components/gallery/hooks/use-gallery-images.js.map +1 -0
- package/dist/client/components/gallery/hooks/use-lightbox.js +37 -0
- package/dist/client/components/gallery/hooks/use-lightbox.js.map +1 -0
- package/dist/client/components/gallery/index.js +96 -0
- package/dist/client/components/gallery/index.js.map +1 -0
- package/dist/client/components/gallery/lib/render-math-in-text.js +42 -0
- package/dist/client/components/gallery/lib/render-math-in-text.js.map +1 -0
- package/dist/client/components/header.js +60 -0
- package/dist/client/components/header.js.map +1 -0
- package/dist/client/components/loading.js +15 -0
- package/dist/client/components/loading.js.map +1 -0
- package/dist/client/components/mdx-components.js +134 -0
- package/dist/client/components/mdx-components.js.map +1 -0
- package/dist/client/components/mode-toggle.js +39 -0
- package/dist/client/components/mode-toggle.js.map +1 -0
- package/dist/client/components/page-error.js +39 -0
- package/dist/client/components/page-error.js.map +1 -0
- package/dist/client/components/parameter-badge.js +48 -0
- package/dist/client/components/parameter-badge.js.map +1 -0
- package/dist/client/components/parameter-table.js +301 -0
- package/dist/client/components/parameter-table.js.map +1 -0
- package/dist/client/components/post-list.js +119 -0
- package/dist/client/components/post-list.js.map +1 -0
- package/dist/client/components/running-bar.js +15 -0
- package/dist/client/components/running-bar.js.map +1 -0
- package/dist/client/components/slides-renderer.js +75 -0
- package/dist/client/components/slides-renderer.js.map +1 -0
- package/dist/client/components/theme-provider.js +9 -0
- package/dist/client/components/theme-provider.js.map +1 -0
- package/dist/client/components/ui/button.js +49 -0
- package/dist/client/components/ui/button.js.map +1 -0
- package/dist/client/components/ui/carousel.js +195 -0
- package/dist/client/components/ui/carousel.js.map +1 -0
- package/dist/client/components/ui/dropdown-menu.js +132 -0
- package/dist/client/components/ui/dropdown-menu.js.map +1 -0
- package/dist/client/hooks/use-key-bindings.js +40 -0
- package/dist/client/hooks/use-key-bindings.js.map +1 -0
- package/dist/client/hooks/use-mdx-content.js +78 -0
- package/dist/client/hooks/use-mdx-content.js.map +1 -0
- package/dist/client/lib/constants.js +5 -0
- package/dist/client/lib/constants.js.map +1 -0
- package/dist/client/lib/format-date.js +8 -0
- package/dist/client/lib/format-date.js.map +1 -0
- package/dist/client/lib/parameter-utils.js +110 -0
- package/dist/client/lib/parameter-utils.js.map +1 -0
- package/dist/client/lib/utils.js +9 -0
- package/dist/client/lib/utils.js.map +1 -0
- package/dist/client/logo_dark.png +0 -0
- package/dist/client/logo_light.png +0 -0
- package/dist/client/main.js +9 -0
- package/dist/client/main.js.map +1 -0
- package/dist/client/pages/home.js +30 -0
- package/dist/client/pages/home.js.map +1 -0
- package/dist/client/pages/post.js +53 -0
- package/dist/client/pages/post.js.map +1 -0
- package/dist/client/pages/slides.js +137 -0
- package/dist/client/pages/slides.js.map +1 -0
- package/dist/client/plugin/src/client.js +185 -0
- package/dist/client/plugin/src/client.js.map +1 -0
- package/package.json +8 -4
- package/src/main.tsx +1 -1
- package/vite.config.ts +22 -3
- package/vite.lib.config.ts +47 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "veslx",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"veslx": "bin/veslx.ts"
|
|
@@ -12,11 +12,14 @@
|
|
|
12
12
|
"src",
|
|
13
13
|
"public",
|
|
14
14
|
"index.html",
|
|
15
|
-
"vite.config.ts"
|
|
15
|
+
"vite.config.ts",
|
|
16
|
+
"vite.lib.config.ts"
|
|
16
17
|
],
|
|
17
18
|
"scripts": {
|
|
18
19
|
"dev": "bun bin/veslx.ts serve",
|
|
19
|
-
"build": "bun bin/veslx.ts build"
|
|
20
|
+
"build": "bun bin/veslx.ts build",
|
|
21
|
+
"build:lib": "vite build --config vite.lib.config.ts",
|
|
22
|
+
"prepublishOnly": "npm run build:lib"
|
|
20
23
|
},
|
|
21
24
|
"dependencies": {
|
|
22
25
|
"acorn": "^8.15.0",
|
|
@@ -82,7 +85,8 @@
|
|
|
82
85
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
83
86
|
"globals": "^16.5.0",
|
|
84
87
|
"typescript": "~5.9.3",
|
|
85
|
-
"typescript-eslint": "^8.46.3"
|
|
88
|
+
"typescript-eslint": "^8.46.3",
|
|
89
|
+
"vite-plugin-dts": "^4.5.4"
|
|
86
90
|
},
|
|
87
91
|
"overrides": {}
|
|
88
92
|
}
|
package/src/main.tsx
CHANGED
package/vite.config.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import { defineConfig } from 'vite'
|
|
3
2
|
import react from '@vitejs/plugin-react'
|
|
4
3
|
import tailwindcss from '@tailwindcss/vite'
|
|
@@ -10,9 +9,16 @@ import remarkGfm from 'remark-gfm'
|
|
|
10
9
|
import remarkMdxFrontmatter from 'remark-mdx-frontmatter'
|
|
11
10
|
import { fileURLToPath } from 'url'
|
|
12
11
|
import path from 'path'
|
|
12
|
+
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
|
+
const distClientPath = path.join(__dirname, 'dist/client')
|
|
18
|
+
const srcPath = path.join(__dirname, 'src')
|
|
19
|
+
const usePrebuilt = fs.existsSync(path.join(distClientPath, 'main.js'))
|
|
20
|
+
const clientPath = usePrebuilt ? distClientPath : srcPath
|
|
21
|
+
|
|
16
22
|
export default defineConfig({
|
|
17
23
|
clearScreen: false,
|
|
18
24
|
cacheDir: path.join(__dirname, 'node_modules/.vite'),
|
|
@@ -37,7 +43,7 @@ export default defineConfig({
|
|
|
37
43
|
],
|
|
38
44
|
resolve: {
|
|
39
45
|
alias: {
|
|
40
|
-
'@':
|
|
46
|
+
'@': clientPath,
|
|
41
47
|
},
|
|
42
48
|
},
|
|
43
49
|
server: {
|
|
@@ -60,7 +66,7 @@ export default defineConfig({
|
|
|
60
66
|
reportCompressedSize: false,
|
|
61
67
|
},
|
|
62
68
|
optimizeDeps: {
|
|
63
|
-
entries: [path.join(
|
|
69
|
+
entries: [path.join(clientPath, usePrebuilt ? 'main.js' : 'main.tsx')],
|
|
64
70
|
include: [
|
|
65
71
|
'react',
|
|
66
72
|
'react-dom',
|
|
@@ -69,6 +75,19 @@ export default defineConfig({
|
|
|
69
75
|
'react/jsx-dev-runtime',
|
|
70
76
|
'@mdx-js/react',
|
|
71
77
|
'react-router-dom',
|
|
78
|
+
// Pre-bundle heavy UI deps
|
|
79
|
+
'@radix-ui/react-collapsible',
|
|
80
|
+
'@radix-ui/react-dialog',
|
|
81
|
+
'@radix-ui/react-dropdown-menu',
|
|
82
|
+
'@radix-ui/react-scroll-area',
|
|
83
|
+
'@radix-ui/react-select',
|
|
84
|
+
'@radix-ui/react-tooltip',
|
|
85
|
+
'lucide-react',
|
|
86
|
+
'embla-carousel-react',
|
|
87
|
+
'next-themes',
|
|
88
|
+
'clsx',
|
|
89
|
+
'tailwind-merge',
|
|
90
|
+
'class-variance-authority',
|
|
72
91
|
],
|
|
73
92
|
},
|
|
74
93
|
})
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import react from '@vitejs/plugin-react'
|
|
3
|
+
import { resolve } from 'path'
|
|
4
|
+
|
|
5
|
+
// Library build config - pre-compiles src/ components for distribution
|
|
6
|
+
// CSS is left to runtime processing (Tailwind needs to scan for classes)
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
plugins: [
|
|
9
|
+
react(),
|
|
10
|
+
],
|
|
11
|
+
build: {
|
|
12
|
+
lib: {
|
|
13
|
+
entry: resolve(__dirname, 'src/main.tsx'),
|
|
14
|
+
formats: ['es'],
|
|
15
|
+
fileName: 'main'
|
|
16
|
+
},
|
|
17
|
+
rollupOptions: {
|
|
18
|
+
// Externalize all deps - they're resolved at runtime
|
|
19
|
+
external: (id) => {
|
|
20
|
+
// Virtual modules
|
|
21
|
+
if (id === 'virtual:content-modules') return true
|
|
22
|
+
// CSS files (processed at runtime by Tailwind)
|
|
23
|
+
if (id.endsWith('.css')) return true
|
|
24
|
+
// All node_modules
|
|
25
|
+
if (id.includes('node_modules')) return true
|
|
26
|
+
// Bare imports (dependencies)
|
|
27
|
+
if (!id.startsWith('.') && !id.startsWith('/') && !id.startsWith('@/')) return true
|
|
28
|
+
return false
|
|
29
|
+
},
|
|
30
|
+
output: {
|
|
31
|
+
preserveModules: true,
|
|
32
|
+
preserveModulesRoot: 'src',
|
|
33
|
+
entryFileNames: '[name].js',
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
outDir: 'dist/client',
|
|
37
|
+
emptyOutDir: true,
|
|
38
|
+
// Don't minify for better debugging
|
|
39
|
+
minify: false,
|
|
40
|
+
sourcemap: true,
|
|
41
|
+
},
|
|
42
|
+
resolve: {
|
|
43
|
+
alias: {
|
|
44
|
+
'@': resolve(__dirname, 'src'),
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
})
|