code-squad-cli 1.2.9 → 1.2.10

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.
@@ -8,10 +8,14 @@ export function createStaticRouter() {
8
8
  // Get __dirname equivalent in ESM
9
9
  const __filename = fileURLToPath(import.meta.url);
10
10
  const __dirname = path.dirname(__filename);
11
- // Path to the built web-ui
12
- // In development (tsx): __dirname is src/flip/routes, go up 3 levels to packages/cli
13
- // In production (bundled): __dirname is dist/flip/routes, go up 3 levels to packages/cli
14
- const distPath = path.resolve(__dirname, '../../../flip-ui/dist');
11
+ // First, check for the bundled path. This is more robust than checking the filename.
12
+ // - Bundled: dist/flip-ui/dist
13
+ let distPath = path.resolve(__dirname, 'flip-ui/dist');
14
+ // If the bundled path doesn't exist, fall back to the unbundled (development) path.
15
+ // - Unbundled: packages/cli/flip-ui/dist
16
+ if (!fs.existsSync(distPath)) {
17
+ distPath = path.resolve(__dirname, '../../../flip-ui/dist');
18
+ }
15
19
  // Check if dist exists (for development vs production)
16
20
  if (fs.existsSync(distPath)) {
17
21
  // Serve static files
package/dist/index.js CHANGED
@@ -1106,7 +1106,10 @@ function createStaticRouter() {
1106
1106
  const router6 = Router6();
1107
1107
  const __filename = fileURLToPath(import.meta.url);
1108
1108
  const __dirname = path7.dirname(__filename);
1109
- const distPath = path7.resolve(__dirname, "../../../flip-ui/dist");
1109
+ let distPath = path7.resolve(__dirname, "flip-ui/dist");
1110
+ if (!fs7.existsSync(distPath)) {
1111
+ distPath = path7.resolve(__dirname, "../../../flip-ui/dist");
1112
+ }
1110
1113
  if (fs7.existsSync(distPath)) {
1111
1114
  router6.use(express.static(distPath));
1112
1115
  router6.get("*", (req, res) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-squad-cli",
3
- "version": "1.2.9",
3
+ "version": "1.2.10",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "csq": "./dist/index.js"