veslx 0.0.23 → 0.0.24

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 CHANGED
@@ -1,11 +1,13 @@
1
1
 
2
2
  import { build } from 'vite'
3
3
  import path from 'path'
4
+ import fs from 'fs'
4
5
  import importConfig from "./import-config";
5
6
  import veslxPlugin from '../../plugin/src/plugin'
6
7
 
7
8
  export default async function buildApp() {
8
- const cwd = process.cwd()
9
+ // Normalize paths to resolve symlinks (e.g., /tmp -> /private/tmp on macOS)
10
+ const cwd = fs.realpathSync(process.cwd())
9
11
 
10
12
  console.log(`Building veslx app in ${cwd}`);
11
13
 
@@ -16,7 +18,8 @@ export default async function buildApp() {
16
18
  return
17
19
  }
18
20
 
19
- const veslxRoot = new URL('../..', import.meta.url).pathname;
21
+ const veslxRoot = fs.realpathSync(new URL('../..', import.meta.url).pathname);
22
+ const configFile = fs.realpathSync(new URL('../../vite.config.ts', import.meta.url).pathname);
20
23
  const outDir = path.join(cwd, 'dist')
21
24
 
22
25
  // Resolve content directory relative to user's cwd (where config lives)
@@ -26,7 +29,7 @@ export default async function buildApp() {
26
29
 
27
30
  await build({
28
31
  root: veslxRoot,
29
- configFile: new URL('../../vite.config.ts', import.meta.url).pathname,
32
+ configFile,
30
33
  build: {
31
34
  outDir,
32
35
  emptyOutDir: true,
package/bin/lib/serve.ts CHANGED
@@ -3,9 +3,11 @@ import { createServer, preview } from 'vite'
3
3
  import importConfig from "./import-config";
4
4
  import veslxPlugin from '../../plugin/src/plugin'
5
5
  import path from 'path'
6
+ import fs from 'fs'
6
7
 
7
8
  export default async function start() {
8
- const cwd = process.cwd()
9
+ // Normalize paths to resolve symlinks (e.g., /tmp -> /private/tmp on macOS)
10
+ const cwd = fs.realpathSync(process.cwd())
9
11
 
10
12
  console.log(`Starting veslx server in ${cwd}`);
11
13
 
@@ -16,7 +18,8 @@ export default async function start() {
16
18
  return
17
19
  }
18
20
 
19
- const veslxRoot = new URL('../..', import.meta.url).pathname;
21
+ const veslxRoot = fs.realpathSync(new URL('../..', import.meta.url).pathname);
22
+ const configFile = fs.realpathSync(new URL('../../vite.config.ts', import.meta.url).pathname);
20
23
 
21
24
  // Resolve content directory relative to user's cwd (where config lives)
22
25
  const contentDir = path.isAbsolute(config.dir)
@@ -25,7 +28,7 @@ export default async function start() {
25
28
 
26
29
  const server = await preview({
27
30
  root: veslxRoot,
28
- configFile: new URL('../../vite.config.ts', import.meta.url).pathname,
31
+ configFile,
29
32
  plugins: [
30
33
  veslxPlugin(contentDir)
31
34
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veslx",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "veslx": "bin/veslx.ts"