26 lines
889 B
JavaScript
Executable File
26 lines
889 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
// Auto-generated by @tanstack/intent setup
|
|
// Exposes the intent end-user CLI for consumers of this library.
|
|
// Commit this file, then add to your package.json:
|
|
// "bin": { "intent": "./bin/intent.js" }
|
|
try {
|
|
await import('@tanstack/intent/intent-library')
|
|
} catch (e) {
|
|
const isModuleNotFound =
|
|
e?.code === 'ERR_MODULE_NOT_FOUND' || e?.code === 'MODULE_NOT_FOUND'
|
|
const missingIntentLibrary =
|
|
typeof e?.message === 'string' && e.message.includes('@tanstack/intent')
|
|
|
|
if (isModuleNotFound && missingIntentLibrary) {
|
|
console.error('@tanstack/intent is not installed.')
|
|
console.error('')
|
|
console.error('Install it as a dev dependency:')
|
|
console.error(' npm add -D @tanstack/intent')
|
|
console.error('')
|
|
console.error('Or run directly:')
|
|
console.error(' npx @tanstack/intent@latest list')
|
|
process.exit(1)
|
|
}
|
|
throw e
|
|
}
|