@uniswap/ai-toolkit-nx-claude 0.5.25 → 0.5.26-next.0
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/cli-generator.cjs
CHANGED
|
@@ -29,13 +29,9 @@ var path = __toESM(require("path"));
|
|
|
29
29
|
var fs = __toESM(require("fs"));
|
|
30
30
|
async function handleNxExecution(generatorName, args) {
|
|
31
31
|
if (args.includes("--help") || args.includes("-h")) {
|
|
32
|
-
console.log(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
console.log(
|
|
36
|
-
`
|
|
37
|
-
This command runs the nx-claude ${generatorName} generator.`
|
|
38
|
-
);
|
|
32
|
+
console.log(`Usage: npx @uniswap/ai-toolkit-nx-claude@latest ${generatorName}`);
|
|
33
|
+
console.log(`
|
|
34
|
+
This command runs the nx-claude ${generatorName} generator.`);
|
|
39
35
|
console.log("\nOptions are handled interactively during execution.");
|
|
40
36
|
console.log("\nFor more information, see the package documentation.");
|
|
41
37
|
process.exit(0);
|
|
@@ -45,12 +41,7 @@ This command runs the nx-claude ${generatorName} generator.`
|
|
|
45
41
|
await runGeneratorDirectly(generatorName, args);
|
|
46
42
|
} else {
|
|
47
43
|
try {
|
|
48
|
-
const nxArgs = [
|
|
49
|
-
"nx",
|
|
50
|
-
"generate",
|
|
51
|
-
`@uniswap/ai-toolkit-nx-claude:${generatorName}`,
|
|
52
|
-
...args
|
|
53
|
-
];
|
|
44
|
+
const nxArgs = ["nx", "generate", `@uniswap/ai-toolkit-nx-claude:${generatorName}`, ...args];
|
|
54
45
|
(0, import_child_process.execSync)(nxArgs.join(" "), {
|
|
55
46
|
stdio: "inherit",
|
|
56
47
|
cwd: process.cwd()
|
|
@@ -63,49 +54,33 @@ This command runs the nx-claude ${generatorName} generator.`
|
|
|
63
54
|
function handleExecutionError(error, generatorName) {
|
|
64
55
|
if (error.code === "403" || error.message?.includes("Forbidden") || error.message?.includes("unauthorized")) {
|
|
65
56
|
console.error("\n\u274C Authentication Error");
|
|
66
|
-
console.error(
|
|
67
|
-
"\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"
|
|
68
|
-
);
|
|
57
|
+
console.error("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501");
|
|
69
58
|
console.error("You do not have permission to access this package.");
|
|
70
59
|
console.error(
|
|
71
60
|
"\nThis package requires a read-only npm token to access the private npmjs registry."
|
|
72
61
|
);
|
|
73
62
|
console.error("\nTo gain access:");
|
|
74
63
|
console.error("1. See the top-level README for setup instructions.");
|
|
75
|
-
console.error(
|
|
76
|
-
"\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"
|
|
77
|
-
);
|
|
64
|
+
console.error("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501");
|
|
78
65
|
} else if (error.code === "404" || error.message?.includes("Not Found")) {
|
|
79
66
|
console.error("\n\u274C Package Not Found");
|
|
80
|
-
console.error(
|
|
81
|
-
|
|
82
|
-
);
|
|
83
|
-
console.error(
|
|
84
|
-
"The package @uniswap/ai-toolkit-nx-claude could not be found."
|
|
85
|
-
);
|
|
67
|
+
console.error("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501");
|
|
68
|
+
console.error("The package @uniswap/ai-toolkit-nx-claude could not be found.");
|
|
86
69
|
console.error("\nThis may be because:");
|
|
87
70
|
console.error("1. The package has not been published yet");
|
|
88
71
|
console.error(
|
|
89
72
|
"2. You are not authenticated properly (check the top-level README for NPM authenticationsetup instructions)"
|
|
90
73
|
);
|
|
91
|
-
console.error(
|
|
92
|
-
"\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"
|
|
93
|
-
);
|
|
74
|
+
console.error("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501");
|
|
94
75
|
} else if (error.code === "ENOENT") {
|
|
95
76
|
console.error("\n\u274C Nx CLI Not Found");
|
|
96
|
-
console.error(
|
|
97
|
-
"\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"
|
|
98
|
-
);
|
|
77
|
+
console.error("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501");
|
|
99
78
|
console.error("The Nx CLI is required but not installed.");
|
|
100
79
|
console.error("\nPlease install Nx globally:");
|
|
101
80
|
console.error(" npm install -g nx");
|
|
102
81
|
console.error("\nOr use npx to run without installing:");
|
|
103
|
-
console.error(
|
|
104
|
-
|
|
105
|
-
);
|
|
106
|
-
console.error(
|
|
107
|
-
"\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"
|
|
108
|
-
);
|
|
82
|
+
console.error(` npx nx generate @uniswap/ai-toolkit-nx-claude@latest ${generatorName}`);
|
|
83
|
+
console.error("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501");
|
|
109
84
|
} else {
|
|
110
85
|
process.exit(error.status || 1);
|
|
111
86
|
}
|
|
@@ -113,9 +88,7 @@ function handleExecutionError(error, generatorName) {
|
|
|
113
88
|
}
|
|
114
89
|
function shouldRunStandalone() {
|
|
115
90
|
const scriptPath = process.argv[1];
|
|
116
|
-
const isInAiToolkitWorkspace = scriptPath.includes(
|
|
117
|
-
"/ai-toolkit/packages/ai-toolkit-nx-claude/"
|
|
118
|
-
);
|
|
91
|
+
const isInAiToolkitWorkspace = scriptPath.includes("/ai-toolkit/packages/ai-toolkit-nx-claude/");
|
|
119
92
|
if (!isInAiToolkitWorkspace) {
|
|
120
93
|
return true;
|
|
121
94
|
}
|
|
@@ -136,23 +109,11 @@ async function runGeneratorDirectly(generatorName, args) {
|
|
|
136
109
|
if (!generatorFnName) {
|
|
137
110
|
console.error(`
|
|
138
111
|
\u274C Generator '${generatorName}' not found`);
|
|
139
|
-
console.error(
|
|
140
|
-
`Available generators: ${Object.keys(generatorFunctionMap).join(", ")}`
|
|
141
|
-
);
|
|
112
|
+
console.error(`Available generators: ${Object.keys(generatorFunctionMap).join(", ")}`);
|
|
142
113
|
process.exit(1);
|
|
143
114
|
}
|
|
144
|
-
const jsPath = path.join(
|
|
145
|
-
|
|
146
|
-
"generators",
|
|
147
|
-
generatorName,
|
|
148
|
-
"generator.js"
|
|
149
|
-
);
|
|
150
|
-
const cjsPath = path.join(
|
|
151
|
-
__dirname,
|
|
152
|
-
"generators",
|
|
153
|
-
generatorName,
|
|
154
|
-
"generator.cjs"
|
|
155
|
-
);
|
|
115
|
+
const jsPath = path.join(__dirname, "generators", generatorName, "generator.js");
|
|
116
|
+
const cjsPath = path.join(__dirname, "generators", generatorName, "generator.cjs");
|
|
156
117
|
const generatorPath = fs.existsSync(jsPath) ? jsPath : cjsPath;
|
|
157
118
|
if (!fs.existsSync(generatorPath)) {
|
|
158
119
|
console.error(`
|
|
@@ -214,12 +175,8 @@ Contents of generators directory:`);
|
|
|
214
175
|
if (!error.message?.includes("Generator file not found")) {
|
|
215
176
|
console.error(`Error details: ${error.message}`);
|
|
216
177
|
}
|
|
217
|
-
console.error(
|
|
218
|
-
|
|
219
|
-
);
|
|
220
|
-
console.error(
|
|
221
|
-
"Please report this issue at: https://github.com/uniswap/ai-toolkit/issues"
|
|
222
|
-
);
|
|
178
|
+
console.error("\nThis may indicate a packaging or installation issue with the npm package.");
|
|
179
|
+
console.error("Please report this issue at: https://github.com/uniswap/ai-toolkit/issues");
|
|
223
180
|
process.exit(1);
|
|
224
181
|
}
|
|
225
182
|
console.error(`Error running generator '${generatorName}':`, error.message);
|
|
@@ -245,10 +202,7 @@ function parseCliArgs(args) {
|
|
|
245
202
|
value = nextArg;
|
|
246
203
|
i++;
|
|
247
204
|
}
|
|
248
|
-
const camelKey = key.replace(
|
|
249
|
-
/-([a-z])/g,
|
|
250
|
-
(_, letter) => letter.toUpperCase()
|
|
251
|
-
);
|
|
205
|
+
const camelKey = key.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
252
206
|
if (camelKey.startsWith("no") && camelKey.length > 2) {
|
|
253
207
|
const actualKey = camelKey[2].toLowerCase() + camelKey.slice(3);
|
|
254
208
|
if (actualKey === "interactive") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-utils.d.ts","sourceRoot":"","sources":["../../../../src/cli-utils.ts"],"names":[],"mappings":";AAMA;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"cli-utils.d.ts","sourceRoot":"","sources":["../../../../src/cli-utils.ts"],"names":[],"mappings":";AAMA;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,iBA6B5E"}
|