🐛 cannot run
parent
4de156fa33
commit
7c01e3534c
|
@ -9,7 +9,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"dev": "tsx src",
|
||||
"build": "tsup",
|
||||
"build": "tsup-node",
|
||||
"prepack": "pnpm build"
|
||||
},
|
||||
"keywords": [],
|
||||
|
|
10
src/index.ts
10
src/index.ts
|
@ -1,17 +1,23 @@
|
|||
#!/bin/env node
|
||||
#!/usr/bin/env node
|
||||
|
||||
import { program } from 'commander'
|
||||
import chalk from 'chalk'
|
||||
import { PropertiesSchema } from './schema'
|
||||
import prettier from 'prettier'
|
||||
import fs from 'fs'
|
||||
import { getPropertyType, propertyTypes } from './types'
|
||||
import { getPropertyType } from './types'
|
||||
import path from 'path'
|
||||
|
||||
await program.parseAsync()
|
||||
|
||||
const url = program.args[0]
|
||||
|
||||
if (!url) {
|
||||
console.error(chalk.red('Usage: adofai-typegen <url>'))
|
||||
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
console.log(chalk.blue`Fetching properties json`)
|
||||
|
||||
const data: PropertiesSchema = await (await fetch(url)).json()
|
||||
|
|
Loading…
Reference in New Issue