Skip to content

Commit f51d560

Browse files
fix: suppress oclif TypeScript warning by setting NODE_ENV=production (#35)
- Set NODE_ENV=production before importing @oclif/core - This prevents oclif from attempting TypeScript detection in production - Reverted previous complex solution in favor of this simpler approach - Tested with tsconfig.json in current directory - no warnings 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <[email protected]>
1 parent 0e16a78 commit f51d560

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

bin/run.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
#!/usr/bin/env node
22

3+
// Set production mode before importing to prevent TypeScript detection
4+
process.env.NODE_ENV = 'production'
5+
36
import {execute} from '@oclif/core'
4-
import {dirname} from 'node:path'
5-
import {fileURLToPath} from 'node:url'
67

78
// If no arguments provided, default to 'init' command
89
const args = process.argv.slice(2)
910
if (args.length === 0) {
1011
process.argv.push('init')
1112
}
1213

13-
// Get the actual directory of this script
14-
const __dirname = dirname(fileURLToPath(import.meta.url))
15-
16-
// Execute from the package root, not the current working directory
17-
await execute({
18-
dir: dirname(__dirname),
19-
// Explicitly set production mode to avoid TypeScript checks
20-
development: false,
21-
})
14+
await execute({dir: import.meta.url})

0 commit comments

Comments
 (0)