From 948ff170dd12d07b90f0c8ba5c2c959a5afa207d Mon Sep 17 00:00:00 2001 From: Simon Farshid Date: Tue, 19 Nov 2024 14:11:14 -0800 Subject: [PATCH] cli: npm create assistant-ui (#1181) --- packages/create-assistant-ui/.eslintrc.json | 3 ++ packages/create-assistant-ui/README.md | 9 +++++ packages/create-assistant-ui/package.json | 41 +++++++++++++++++++++ packages/create-assistant-ui/src/index.ts | 11 ++++++ packages/create-assistant-ui/tsconfig.json | 11 ++++++ 5 files changed, 75 insertions(+) create mode 100644 packages/create-assistant-ui/.eslintrc.json create mode 100644 packages/create-assistant-ui/README.md create mode 100644 packages/create-assistant-ui/package.json create mode 100644 packages/create-assistant-ui/src/index.ts create mode 100644 packages/create-assistant-ui/tsconfig.json diff --git a/packages/create-assistant-ui/.eslintrc.json b/packages/create-assistant-ui/.eslintrc.json new file mode 100644 index 000000000..372241854 --- /dev/null +++ b/packages/create-assistant-ui/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": ["next/core-web-vitals", "next/typescript"] +} diff --git a/packages/create-assistant-ui/README.md b/packages/create-assistant-ui/README.md new file mode 100644 index 000000000..94f5abd59 --- /dev/null +++ b/packages/create-assistant-ui/README.md @@ -0,0 +1,9 @@ +# `create-assistant-ui` + +This package contains the command line interface for `create-assistant-ui`. + +## Usage + +```sh +npm create assistant-ui +``` diff --git a/packages/create-assistant-ui/package.json b/packages/create-assistant-ui/package.json new file mode 100644 index 000000000..33b050722 --- /dev/null +++ b/packages/create-assistant-ui/package.json @@ -0,0 +1,41 @@ +{ + "name": "create-assistant-ui", + "version": "0.0.1", + "license": "MIT", + "type": "module", + "dependencies": { + "chalk": "^5.3.0", + "commander": "^12.1.0", + "cosmiconfig": "^9.0.0", + "cross-spawn": "^7.0.5", + "shadcn-ui": "0.8.0", + "tsconfig-paths": "^4.2.0", + "zod": "^3.23.8" + }, + "devDependencies": { + "@assistant-ui/tsconfig": "workspace:*", + "@types/cross-spawn": "^6.0.6", + "@types/node": "^22.9.0", + "tsup": "8.3.5" + }, + "files": [ + "dist", + "README.md" + ], + "bin": "./dist/index.js", + "scripts": { + "build": "tsup src/index.ts --format esm --sourcemap --clean" + }, + "publishConfig": { + "access": "public", + "provenance": true + }, + "homepage": "https://assistant-ui.com/", + "repository": { + "type": "git", + "url": "git+https://github.com/Yonom/assistant-ui.git" + }, + "bugs": { + "url": "https://github.com/Yonom/assistant-ui/issues" + } +} diff --git a/packages/create-assistant-ui/src/index.ts b/packages/create-assistant-ui/src/index.ts new file mode 100644 index 000000000..326de1519 --- /dev/null +++ b/packages/create-assistant-ui/src/index.ts @@ -0,0 +1,11 @@ +#!/usr/bin/env node +import { create } from "../../cli/src/commands/create"; + +process.on("SIGINT", () => process.exit(0)); +process.on("SIGTERM", () => process.exit(0)); + +async function main() { + create.parse(); +} + +main(); diff --git a/packages/create-assistant-ui/tsconfig.json b/packages/create-assistant-ui/tsconfig.json new file mode 100644 index 000000000..db681b889 --- /dev/null +++ b/packages/create-assistant-ui/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "@assistant-ui/tsconfig/base.json", + "compilerOptions": { + "paths": { + "@/*": ["./*"], + "@assistant-ui/*": ["../../packages/*/src"] + } + }, + "include": ["**/*.ts", "**/*.tsx"], + "exclude": ["node_modules", "dist"] +}