create-assistant-ui 0.0.9 → 0.0.11

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.
package/dist/index.cjs ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ // src/index.ts
5
+ var import_create = require("../../cli/src/commands/create.js");
6
+ process.on("SIGINT", () => process.exit(0));
7
+ process.on("SIGTERM", () => process.exit(0));
8
+ function main() {
9
+ import_create.create.parse();
10
+ }
11
+ main();
12
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { create } from \"../../cli/src/commands/create\";\n\nprocess.on(\"SIGINT\", () => process.exit(0));\nprocess.on(\"SIGTERM\", () => process.exit(0));\n\nfunction main() {\n create.parse();\n}\n\nmain();\n"],"mappings":";;;;AACA,oBAAuB;AAEvB,QAAQ,GAAG,UAAU,MAAM,QAAQ,KAAK,CAAC,CAAC;AAC1C,QAAQ,GAAG,WAAW,MAAM,QAAQ,KAAK,CAAC,CAAC;AAE3C,SAAS,OAAO;AACd,uBAAO,MAAM;AACf;AAEA,KAAK;","names":[]}
package/dist/index.js CHANGED
@@ -1,76 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- // ../cli/src/commands/create.ts
4
- import { Command } from "commander";
5
- import chalk from "chalk";
6
- import { spawn } from "cross-spawn";
7
- var create = new Command().name("create").description("create a new project").argument("[project-directory]").usage(`${chalk.green("[project-directory]")} [options]`).option(
8
- "-t, --template <template>",
9
- `
10
-
11
- The template to use for the project, e.g. default, langgraph
12
- `
13
- ).option(
14
- "--use-npm",
15
- `
16
-
17
- Explicitly tell the CLI to bootstrap the application using npm
18
- `
19
- ).option(
20
- "--use-pnpm",
21
- `
22
-
23
- Explicitly tell the CLI to bootstrap the application using pnpm
24
- `
25
- ).option(
26
- "--use-yarn",
27
- `
28
-
29
- Explicitly tell the CLI to bootstrap the application using Yarn
30
- `
31
- ).option(
32
- "--use-bun",
33
- `
34
-
35
- Explicitly tell the CLI to bootstrap the application using Bun
36
- `
37
- ).option(
38
- "--skip-install",
39
- `
40
-
41
- Explicitly tell the CLI to skip installing packages
42
- `
43
- ).action((_, opts) => {
44
- const templates = {
45
- default: "https://github.com/assistant-ui/assistant-ui-starter",
46
- langgraph: "https://github.com/assistant-ui/assistant-ui-starter-langgraph"
47
- };
48
- const templateUrl = templates[opts.template ?? "default"];
49
- if (!templateUrl) {
50
- console.error(`Unknown template: ${opts.template}`);
51
- process.exit(1);
52
- }
53
- const filteredArgs = process.argv.slice(3).filter((arg, index, arr) => {
54
- return !(arg === "-t" || arg === "--template" || arr[index - 1] === "-t" || arr[index - 1] === "--template");
55
- });
56
- const child = spawn(
57
- "npx",
58
- [`create-next-app@latest`, ...filteredArgs, "-e", templateUrl],
59
- {
60
- stdio: "inherit"
61
- }
62
- );
63
- child.on("error", (error) => {
64
- console.error(`Error: ${error.message}`);
65
- });
66
- child.on("close", (code) => {
67
- if (code !== 0) {
68
- console.log(`other-package-script process exited with code ${code}`);
69
- }
70
- });
71
- });
72
-
73
3
  // src/index.ts
4
+ import { create } from "../../cli/src/commands/create.mjs";
74
5
  process.on("SIGINT", () => process.exit(0));
75
6
  process.on("SIGTERM", () => process.exit(0));
76
7
  function main() {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../cli/src/commands/create.ts","../src/index.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { spawn } from \"cross-spawn\";\n\nexport const create = new Command()\n .name(\"create\")\n .description(\"create a new project\")\n .argument(\"[project-directory]\")\n .usage(`${chalk.green(\"[project-directory]\")} [options]`)\n .option(\n \"-t, --template <template>\",\n `\n\n The template to use for the project, e.g. default, langgraph\n`,\n )\n .option(\n \"--use-npm\",\n `\n\n Explicitly tell the CLI to bootstrap the application using npm\n`,\n )\n .option(\n \"--use-pnpm\",\n `\n\n Explicitly tell the CLI to bootstrap the application using pnpm\n`,\n )\n .option(\n \"--use-yarn\",\n `\n\n Explicitly tell the CLI to bootstrap the application using Yarn\n`,\n )\n .option(\n \"--use-bun\",\n `\n\n Explicitly tell the CLI to bootstrap the application using Bun\n`,\n )\n .option(\n \"--skip-install\",\n `\n\n Explicitly tell the CLI to skip installing packages\n`,\n )\n .action((_, opts) => {\n const templates = {\n default: \"https://github.com/assistant-ui/assistant-ui-starter\",\n langgraph:\n \"https://github.com/assistant-ui/assistant-ui-starter-langgraph\",\n };\n\n const templateUrl =\n templates[(opts.template as keyof typeof templates) ?? \"default\"];\n if (!templateUrl) {\n console.error(`Unknown template: ${opts.template}`);\n process.exit(1);\n }\n\n const filteredArgs = process.argv.slice(3).filter((arg, index, arr) => {\n return !(\n arg === \"-t\" ||\n arg === \"--template\" ||\n arr[index - 1] === \"-t\" ||\n arr[index - 1] === \"--template\"\n );\n });\n\n const child = spawn(\n \"npx\",\n [`create-next-app@latest`, ...filteredArgs, \"-e\", templateUrl],\n {\n stdio: \"inherit\",\n },\n );\n\n child.on(\"error\", (error) => {\n console.error(`Error: ${error.message}`);\n });\n\n child.on(\"close\", (code) => {\n if (code !== 0) {\n console.log(`other-package-script process exited with code ${code}`);\n }\n });\n });\n","#!/usr/bin/env node\nimport { create } from \"../../cli/src/commands/create\";\n\nprocess.on(\"SIGINT\", () => process.exit(0));\nprocess.on(\"SIGTERM\", () => process.exit(0));\n\nfunction main() {\n create.parse();\n}\n\nmain();\n"],"mappings":";;;AAAA,SAAS,eAAe;AACxB,OAAO,WAAW;AAClB,SAAS,aAAa;AAEf,IAAM,SAAS,IAAI,QAAQ,EAC/B,KAAK,QAAQ,EACb,YAAY,sBAAsB,EAClC,SAAS,qBAAqB,EAC9B,MAAM,GAAG,MAAM,MAAM,qBAAqB,CAAC,YAAY,EACvD;AAAA,EACC;AAAA,EACA;AAAA;AAAA;AAAA;AAIF,EACC;AAAA,EACC;AAAA,EACA;AAAA;AAAA;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],"sourcesContent":["#!/usr/bin/env node\nimport { create } from \"../../cli/src/commands/create\";\n\nprocess.on(\"SIGINT\", () => process.exit(0));\nprocess.on(\"SIGTERM\", () => process.exit(0));\n\nfunction main() {\n create.parse();\n}\n\nmain();\n"],"mappings":";;;AACA,SAAS,cAAc;AAEvB,QAAQ,GAAG,UAAU,MAAM,QAAQ,KAAK,CAAC,CAAC;AAC1C,QAAQ,GAAG,WAAW,MAAM,QAAQ,KAAK,CAAC,CAAC;AAE3C,SAAS,OAAO;AACd,SAAO,MAAM;AACf;AAEA,KAAK;","names":[]}
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "create-assistant-ui",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "chalk": "^5.4.1",
8
- "commander": "^13.0.0",
8
+ "commander": "^13.1.0",
9
9
  "cosmiconfig": "^9.0.0",
10
10
  "cross-spawn": "^7.0.6",
11
11
  "tsconfig-paths": "^4.2.0",
@@ -13,15 +13,16 @@
13
13
  },
14
14
  "devDependencies": {
15
15
  "@types/cross-spawn": "^6.0.6",
16
- "@types/node": "^22.10.7",
17
- "tsup": "8.3.5",
16
+ "@types/node": "^22.13.1",
17
+ "tsx": "^4.19.2",
18
+ "@assistant-ui/tsbuildutils": "^0.0.1",
18
19
  "@assistant-ui/tsconfig": "0.0.0"
19
20
  },
20
21
  "files": [
21
22
  "dist",
22
23
  "README.md"
23
24
  ],
24
- "bin": "./dist/index.js",
25
+ "bin": "./dist/index.mjs",
25
26
  "publishConfig": {
26
27
  "access": "public",
27
28
  "provenance": true
@@ -35,6 +36,6 @@
35
36
  "url": "https://github.com/assistant-ui/assistant-ui/issues"
36
37
  },
37
38
  "scripts": {
38
- "build": "tsup src/index.ts --format esm --sourcemap --clean"
39
+ "build": "tsx scripts/build.mts"
39
40
  }
40
41
  }