burnrate 0.1.3 → 0.1.5

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.
Files changed (2) hide show
  1. package/dist/cli/index.js +14 -12
  2. package/package.json +3 -2
package/dist/cli/index.js CHANGED
@@ -4,22 +4,23 @@
4
4
  * A logistics war MMO for Claude Code
5
5
  * The front doesn't feed itself.
6
6
  */
7
- // Route 'setup' command to the setup script before loading heavy dependencies
7
+ // Route 'setup' command BEFORE any heavy imports.
8
+ // ESM resolves all static imports before executing code, so we must
9
+ // dynamic-import setup and exit before static imports would load better-sqlite3.
8
10
  if (process.argv[2] === 'setup') {
9
- // setup.ts uses top-level await, so this import won't resolve
10
- // until the entire setup wizard completes
11
11
  await import('./setup.js');
12
12
  process.exit(0);
13
13
  }
14
- import { Command } from 'commander';
15
- import { GameDatabase } from '../db/database.js';
16
- import { GameEngine } from '../core/engine.js';
17
- import { generateWorld, seedMarkets } from '../core/worldgen.js';
18
- import { formatView, formatZone, formatRoutes, formatMarket, formatShipments, formatEvents, formatHelp } from './format.js';
19
- import { TIER_LIMITS } from '../core/types.js';
20
- import path from 'path';
21
- import os from 'os';
22
- import fs from 'fs';
14
+ // Heavy imports only reached when NOT running setup
15
+ const { Command } = await import('commander');
16
+ const { GameDatabase } = await import('../db/database.js');
17
+ const { GameEngine } = await import('../core/engine.js');
18
+ const { generateWorld, seedMarkets } = await import('../core/worldgen.js');
19
+ const { formatView, formatZone, formatRoutes, formatMarket, formatShipments, formatEvents, formatHelp } = await import('./format.js');
20
+ const { getSupplyState, TIER_LIMITS, SHIPMENT_SPECS } = await import('../core/types.js');
21
+ const path = await import('path');
22
+ const os = await import('os');
23
+ const fs = await import('fs');
23
24
  // Database path
24
25
  const DB_DIR = path.join(os.homedir(), '.burnrate');
25
26
  const DB_PATH = path.join(DB_DIR, 'game.db');
@@ -1121,3 +1122,4 @@ program
1121
1122
  });
1122
1123
  // Parse and execute
1123
1124
  program.parse();
1125
+ export {};
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "burnrate",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "A logistics war MMO for Claude Code. The front doesn't feed itself.",
5
5
  "type": "module",
6
6
  "main": "dist/cli/index.js",
7
7
  "bin": {
8
- "burnrate": "./dist/cli/index.js"
8
+ "burnrate": "./dist/cli/index.js",
9
+ "burnrate-setup": "./dist/cli/setup.js"
9
10
  },
10
11
  "files": [
11
12
  "dist/",