create-assistant-ui 0.0.18 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,10 +1,7 @@
1
1
  {
2
2
  "name": "create-assistant-ui",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "license": "MIT",
5
- "engines": {
6
- "node": ">=20.0.0"
7
- },
8
5
  "dependencies": {
9
6
  "chalk": "^5.4.1",
10
7
  "commander": "^13.1.0",
@@ -23,6 +20,7 @@
23
20
  },
24
21
  "files": [
25
22
  "dist",
23
+ "src",
26
24
  "README.md"
27
25
  ],
28
26
  "bin": "./dist/index.js",
@@ -33,7 +31,7 @@
33
31
  "homepage": "https://www.assistant-ui.com/",
34
32
  "repository": {
35
33
  "type": "git",
36
- "url": "git+https://github.com/assistant-ui/assistant-ui.git"
34
+ "url": "https://github.com/assistant-ui/assistant-ui/tree/main/packages/create-assistant-ui"
37
35
  },
38
36
  "bugs": {
39
37
  "url": "https://github.com/assistant-ui/assistant-ui/issues"
package/src/index.ts ADDED
@@ -0,0 +1,105 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from "commander";
3
+ import chalk from "chalk";
4
+ import { spawn } from "cross-spawn";
5
+
6
+ // Create a standalone version of the create command instead of importing from CLI package
7
+ const create = new Command()
8
+ .name("create-assistant-ui")
9
+ .description("create a new assistant-ui project")
10
+ .argument("[project-directory]")
11
+ .usage(`${chalk.green("[project-directory]")} [options]`)
12
+ .option(
13
+ "-t, --template <template>",
14
+ `
15
+
16
+ The template to use for the project, e.g. default, langgraph
17
+ `,
18
+ )
19
+ .option(
20
+ "--use-npm",
21
+ `
22
+
23
+ Explicitly tell the CLI to bootstrap the application using npm
24
+ `,
25
+ )
26
+ .option(
27
+ "--use-pnpm",
28
+ `
29
+
30
+ Explicitly tell the CLI to bootstrap the application using pnpm
31
+ `,
32
+ )
33
+ .option(
34
+ "--use-yarn",
35
+ `
36
+
37
+ Explicitly tell the CLI to bootstrap the application using Yarn
38
+ `,
39
+ )
40
+ .option(
41
+ "--use-bun",
42
+ `
43
+
44
+ Explicitly tell the CLI to bootstrap the application using Bun
45
+ `,
46
+ )
47
+ .option(
48
+ "--skip-install",
49
+ `
50
+
51
+ Explicitly tell the CLI to skip installing packages
52
+ `,
53
+ )
54
+ .action((_, opts) => {
55
+ const templates = {
56
+ default: "https://github.com/assistant-ui/assistant-ui-starter",
57
+ langgraph:
58
+ "https://github.com/assistant-ui/assistant-ui-starter-langgraph",
59
+ };
60
+
61
+ const templateUrl =
62
+ templates[(opts.template as keyof typeof templates) ?? "default"];
63
+ if (!templateUrl) {
64
+ console.error(
65
+ `Unknown template: ${opts.template}\nAvailable templates: ${Object.keys(templates).join(", ")}`,
66
+ );
67
+ process.exit(1);
68
+ }
69
+
70
+ const filteredArgs = process.argv.slice(2).filter((arg, index, arr) => {
71
+ return !(
72
+ arg === "-t" ||
73
+ arg === "--template" ||
74
+ arr[index - 1] === "-t" ||
75
+ arr[index - 1] === "--template"
76
+ );
77
+ });
78
+
79
+ const child = spawn(
80
+ "npx",
81
+ [`create-next-app@latest`, ...filteredArgs, "-e", templateUrl],
82
+ {
83
+ stdio: "inherit",
84
+ },
85
+ );
86
+
87
+ child.on("error", (error) => {
88
+ console.error(`Error: ${error.message}`);
89
+ });
90
+
91
+ child.on("close", (code) => {
92
+ if (code !== 0) {
93
+ console.log(`create-next-app process exited with code ${code}`);
94
+ }
95
+ });
96
+ });
97
+
98
+ process.on("SIGINT", () => process.exit(0));
99
+ process.on("SIGTERM", () => process.exit(0));
100
+
101
+ function main() {
102
+ create.parse();
103
+ }
104
+
105
+ main();