@lovelybunch/api 1.0.21 → 1.0.23

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.
@@ -5,10 +5,21 @@ import Fuse from 'fuse.js';
5
5
  export class FileStorageAdapter {
6
6
  basePath;
7
7
  constructor(basePath) {
8
- // Use environment variable if available (for web server), otherwise default to .gait
9
- this.basePath = basePath || (process.env.GAIT_DATA_PATH ?
10
- path.join(process.env.GAIT_DATA_PATH, '.gait') :
11
- '.gait');
8
+ if (basePath) {
9
+ this.basePath = basePath;
10
+ }
11
+ else if (process.env.NODE_ENV === 'development' && process.env.GAIT_DEV_ROOT) {
12
+ // Dev mode: use project root .gait directory
13
+ this.basePath = process.env.GAIT_DEV_ROOT;
14
+ }
15
+ else if (process.env.GAIT_DATA_PATH) {
16
+ // Production mode: use GAIT_DATA_PATH (set by CLI)
17
+ this.basePath = path.join(process.env.GAIT_DATA_PATH, '.gait');
18
+ }
19
+ else {
20
+ // Fallback: use current directory .gait
21
+ this.basePath = '.gait';
22
+ }
12
23
  }
13
24
  async ensureDirectories() {
14
25
  const dirs = ['proposals', 'specs', 'flags', 'experiments', 'templates'];
@@ -120,6 +120,7 @@ if (staticPath) {
120
120
  app.use('/assets/*', serveStatic({ root: staticPath }));
121
121
  // Serve specific static files
122
122
  app.use('/vite.svg', serveStatic({ root: staticPath }));
123
+ app.use('/coconut.svg', serveStatic({ root: staticPath }));
123
124
  app.use('/favicon.ico', serveStatic({ root: staticPath }));
124
125
  }
125
126
  // Serve index.html for all non-API, non-WebSocket routes (SPA routing) - LAST
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovelybunch/api",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "type": "module",
5
5
  "main": "dist/server-with-static.js",
6
6
  "exports": {
@@ -12,7 +12,7 @@
12
12
  "static/**/*"
13
13
  ],
14
14
  "scripts": {
15
- "dev": "tsx watch src/server.ts",
15
+ "dev": "NODE_ENV=development GAIT_DEV_ROOT=../../.gait tsx watch src/server.ts",
16
16
  "build": "tsc",
17
17
  "build:bundle": "tsc && node scripts/bundle-frontend.js",
18
18
  "start": "node dist/server-with-static.js",
@@ -32,8 +32,8 @@
32
32
  "dependencies": {
33
33
  "@hono/node-server": "^1.13.7",
34
34
  "@hono/node-ws": "^1.0.6",
35
- "@lovelybunch/core": "^1.0.21",
36
- "@lovelybunch/types": "^1.0.21",
35
+ "@lovelybunch/core": "^1.0.23",
36
+ "@lovelybunch/types": "^1.0.23",
37
37
  "dotenv": "^17.2.1",
38
38
  "fuse.js": "^7.0.0",
39
39
  "gray-matter": "^4.0.3",