assistant-ui 0.0.21 → 0.0.22
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.js +12 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command as Command3 } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "assistant-ui",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.22",
|
|
10
10
|
license: "MIT",
|
|
11
11
|
type: "module",
|
|
12
12
|
dependencies: {
|
|
@@ -33,7 +33,7 @@ var package_default = {
|
|
|
33
33
|
access: "public",
|
|
34
34
|
provenance: true
|
|
35
35
|
},
|
|
36
|
-
homepage: "https://assistant-ui.com/",
|
|
36
|
+
homepage: "https://www.assistant-ui.com/",
|
|
37
37
|
repository: {
|
|
38
38
|
type: "git",
|
|
39
39
|
url: "git+https://github.com/Yonom/assistant-ui.git"
|
|
@@ -116,14 +116,19 @@ var create = new Command().name("create").description("create a new project").ar
|
|
|
116
116
|
// src/commands/shadcn/add.ts
|
|
117
117
|
import { Command as Command2 } from "commander";
|
|
118
118
|
import { spawn as spawn2 } from "cross-spawn";
|
|
119
|
+
var REGISTRY_BASE_URL = "https://r.assistant-ui.com";
|
|
120
|
+
var SHADCN_COMPONENT_BASE_URL = `${REGISTRY_BASE_URL}/shadcn`;
|
|
119
121
|
var shadcnAdd = new Command2().name("add").description("add a component to your project").argument("<components...>", "the components to add").option("-y, --yes", "skip confirmation prompt.", true).option("-o, --overwrite", "overwrite existing files.", false).option(
|
|
120
122
|
"-c, --cwd <cwd>",
|
|
121
123
|
"the working directory. defaults to the current directory.",
|
|
122
124
|
process.cwd()
|
|
123
|
-
).option("-p, --path <path>", "the path to add the component to.").action(
|
|
124
|
-
const componentsToAdd = components.map(
|
|
125
|
-
(c)
|
|
126
|
-
|
|
125
|
+
).option("-p, --path <path>", "the path to add the component to.").action((components, opts) => {
|
|
126
|
+
const componentsToAdd = components.map((c) => {
|
|
127
|
+
if (!/^[a-zA-Z0-9-\/]+$/.test(c)) {
|
|
128
|
+
throw new Error(`Invalid component name: ${c}`);
|
|
129
|
+
}
|
|
130
|
+
return `${SHADCN_COMPONENT_BASE_URL}/${encodeURIComponent(c)}`;
|
|
131
|
+
});
|
|
127
132
|
const args = [`shadcn@latest`, "add", ...componentsToAdd];
|
|
128
133
|
if (opts.yes) args.push("--yes");
|
|
129
134
|
if (opts.overwrite) args.push("--overwrite");
|
|
@@ -146,7 +151,7 @@ var shadcnAdd = new Command2().name("add").description("add a component to your
|
|
|
146
151
|
// src/index.ts
|
|
147
152
|
process.on("SIGINT", () => process.exit(0));
|
|
148
153
|
process.on("SIGTERM", () => process.exit(0));
|
|
149
|
-
|
|
154
|
+
function main() {
|
|
150
155
|
const program = new Command3().name("assistant-ui").description("add components and dependencies to your project").version(
|
|
151
156
|
package_default.version || "1.0.0",
|
|
152
157
|
"-v, --version",
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../package.json","../src/commands/create.ts","../src/commands/shadcn/add.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from \"commander\";\n\nimport packageJson from \"../package.json\";\nimport { create } from \"./commands/create\";\nimport { shadcnAdd } from \"./commands/shadcn/add\";\n\nprocess.on(\"SIGINT\", () => process.exit(0));\nprocess.on(\"SIGTERM\", () => process.exit(0));\n\
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../package.json","../src/commands/create.ts","../src/commands/shadcn/add.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from \"commander\";\n\nimport packageJson from \"../package.json\";\nimport { create } from \"./commands/create\";\nimport { shadcnAdd } from \"./commands/shadcn/add\";\n\nprocess.on(\"SIGINT\", () => process.exit(0));\nprocess.on(\"SIGTERM\", () => process.exit(0));\n\nfunction main() {\n const program = new Command()\n .name(\"assistant-ui\")\n .description(\"add components and dependencies to your project\")\n .version(\n packageJson.version || \"1.0.0\",\n \"-v, --version\",\n \"display the version number\",\n );\n\n program.addCommand(shadcnAdd);\n program.addCommand(create);\n\n program.parse();\n}\n\nmain();\n","{\n \"name\": \"assistant-ui\",\n \"version\": \"0.0.22\",\n \"license\": \"MIT\",\n \"type\": \"module\",\n \"dependencies\": {\n \"chalk\": \"^5.3.0\",\n \"commander\": \"^12.1.0\",\n \"cross-spawn\": \"^7.0.6\"\n },\n \"devDependencies\": {\n \"@assistant-ui/tsconfig\": \"workspace:*\",\n \"@types/cross-spawn\": \"^6.0.6\",\n \"@types/node\": \"^22.9.1\",\n \"eslint-config-next\": \"15.0.3\",\n \"tsup\": \"8.3.5\"\n },\n \"files\": [\n \"dist\",\n \"README.md\"\n ],\n \"bin\": \"./dist/index.js\",\n \"scripts\": {\n \"build\": \"tsup src/index.ts --format esm --sourcemap --clean\"\n },\n \"publishConfig\": {\n \"access\": \"public\",\n \"provenance\": true\n },\n \"homepage\": \"https://www.assistant-ui.com/\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/Yonom/assistant-ui.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/Yonom/assistant-ui/issues\"\n }\n}\n","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/Yonom/assistant-ui-starter\",\n langgraph: \"https://github.com/Yonom/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","import { Command } from \"commander\";\nimport { spawn } from \"cross-spawn\";\n\nconst REGISTRY_BASE_URL = \"https://r.assistant-ui.com\";\nconst SHADCN_COMPONENT_BASE_URL = `${REGISTRY_BASE_URL}/shadcn`;\n\nexport const shadcnAdd = new Command()\n .name(\"add\")\n .description(\"add a component to your project\")\n .argument(\"<components...>\", \"the components to add\")\n .option(\"-y, --yes\", \"skip confirmation prompt.\", true)\n .option(\"-o, --overwrite\", \"overwrite existing files.\", false)\n .option(\n \"-c, --cwd <cwd>\",\n \"the working directory. defaults to the current directory.\",\n process.cwd(),\n )\n .option(\"-p, --path <path>\", \"the path to add the component to.\")\n .action((components: string[], opts) => {\n const componentsToAdd = components.map((c) => {\n if (!/^[a-zA-Z0-9-\\/]+$/.test(c)) {\n throw new Error(`Invalid component name: ${c}`);\n }\n return `${SHADCN_COMPONENT_BASE_URL}/${encodeURIComponent(c)}`;\n });\n\n const args = [`shadcn@latest`, \"add\", ...componentsToAdd];\n\n if (opts.yes) args.push(\"--yes\");\n if (opts.overwrite) args.push(\"--overwrite\");\n if (opts.cwd) args.push(\"--cwd\", opts.cwd);\n if (opts.path) args.push(\"--path\", opts.path);\n\n const child = spawn(\"npx\", args, {\n stdio: \"inherit\",\n shell: true,\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"],"mappings":";;;AAEA,SAAS,WAAAA,gBAAe;;;ACFxB;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,SAAW;AAAA,EACX,MAAQ;AAAA,EACR,cAAgB;AAAA,IACd,OAAS;AAAA,IACT,WAAa;AAAA,IACb,eAAe;AAAA,EACjB;AAAA,EACA,iBAAmB;AAAA,IACjB,0BAA0B;AAAA,IAC1B,sBAAsB;AAAA,IACtB,eAAe;AAAA,IACf,sBAAsB;AAAA,IACtB,MAAQ;AAAA,EACV;AAAA,EACA,OAAS;AAAA,IACP;AAAA,IACA;AAAA,EACF;AAAA,EACA,KAAO;AAAA,EACP,SAAW;AAAA,IACT,OAAS;AAAA,EACX;AAAA,EACA,eAAiB;AAAA,IACf,QAAU;AAAA,IACV,YAAc;AAAA,EAChB;AAAA,EACA,UAAY;AAAA,EACZ,YAAc;AAAA,IACZ,MAAQ;AAAA,IACR,KAAO;AAAA,EACT;AAAA,EACA,MAAQ;AAAA,IACN,KAAO;AAAA,EACT;AACF;;;ACrCA,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;AAAA;A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A;AAAA,EACF;AAEF,UAAQ,WAAW,SAAS;AAC5B,UAAQ,WAAW,MAAM;AAEzB,UAAQ,MAAM;AAChB;AAEA,KAAK;","names":["Command","Command","spawn","Command"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "assistant-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"access": "public",
|
|
25
25
|
"provenance": true
|
|
26
26
|
},
|
|
27
|
-
"homepage": "https://assistant-ui.com/",
|
|
27
|
+
"homepage": "https://www.assistant-ui.com/",
|
|
28
28
|
"repository": {
|
|
29
29
|
"type": "git",
|
|
30
30
|
"url": "git+https://github.com/Yonom/assistant-ui.git"
|