@xera-ai/core 0.11.6 → 0.12.1

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/internal.ts CHANGED
@@ -1,11 +1,19 @@
1
1
  #!/usr/bin/env bun
2
+ import { existsSync } from 'node:fs';
2
3
  import { config } from 'dotenv';
3
4
  import { run } from '../src/bin-internal/index';
4
5
 
5
- // Load .env.local (secrets, gitignored) then .env (defaults) so every
6
- // xera-internal subcommand has access to credentials without requiring
7
- // the caller to pre-load env.
8
- config({ path: '.env.local' });
6
+ // xera canonicalizes on `.env` (gitignored; see `xera init`, `xera doctor`,
7
+ // scaffolded `.gitignore`). Earlier versions also loaded `.env.local` first,
8
+ // which silently overrode `.env` when both files existed — see issue #92. We
9
+ // now load only `.env`; if `.env.local` is present, warn loudly so legacy
10
+ // users migrate rather than wondering why their values are ignored.
11
+ if (existsSync('.env.local')) {
12
+ console.error(
13
+ '\nwarning: .env.local detected but ignored. xera uses .env only — ' +
14
+ 'merge values from .env.local into .env and delete .env.local to silence this warning.\n',
15
+ );
16
+ }
9
17
  config();
10
18
 
11
19
  const code = await run(process.argv.slice(2));