🐛 cannot run

main
paring 2023-03-30 15:12:04 +09:00
parent 4de156fa33
commit 7c01e3534c
Signed by: pikokr
GPG Key ID: 8C7ABCEF704FD728
2 changed files with 9 additions and 3 deletions

View File

@ -9,7 +9,7 @@
}, },
"scripts": { "scripts": {
"dev": "tsx src", "dev": "tsx src",
"build": "tsup", "build": "tsup-node",
"prepack": "pnpm build" "prepack": "pnpm build"
}, },
"keywords": [], "keywords": [],

View File

@ -1,17 +1,23 @@
#!/bin/env node #!/usr/bin/env node
import { program } from 'commander' import { program } from 'commander'
import chalk from 'chalk' import chalk from 'chalk'
import { PropertiesSchema } from './schema' import { PropertiesSchema } from './schema'
import prettier from 'prettier' import prettier from 'prettier'
import fs from 'fs' import fs from 'fs'
import { getPropertyType, propertyTypes } from './types' import { getPropertyType } from './types'
import path from 'path' import path from 'path'
await program.parseAsync() await program.parseAsync()
const url = program.args[0] 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`) console.log(chalk.blue`Fetching properties json`)
const data: PropertiesSchema = await (await fetch(url)).json() const data: PropertiesSchema = await (await fetch(url)).json()