ai-forge-cli 0.4.0 → 0.4.1
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/{add-feature-SOACPDYP.js → add-feature-2AR4DP7P.js} +1 -1
- package/dist/{add-integration-DZT6E4XW.js → add-integration-QXB63S3V.js} +4 -25
- package/dist/{chunk-I7QOMYL4.js → chunk-M7T2JD5B.js} +1 -19
- package/dist/index.js +2 -2
- package/dist/templates/init/src/providers/index.tsx.hbs +0 -4
- package/package.json +1 -1
- package/templates/init/src/providers/index.tsx.hbs +0 -4
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
insertAtMarker
|
|
4
|
-
|
|
5
|
-
} from "./chunk-I7QOMYL4.js";
|
|
3
|
+
insertAtMarker
|
|
4
|
+
} from "./chunk-M7T2JD5B.js";
|
|
6
5
|
import {
|
|
7
6
|
renderTemplate
|
|
8
7
|
} from "./chunk-PIFX2L5H.js";
|
|
@@ -206,32 +205,12 @@ async function updateProvidersForAuth(cwd) {
|
|
|
206
205
|
return;
|
|
207
206
|
}
|
|
208
207
|
content = importResult.content;
|
|
209
|
-
const openResult = replaceAtMarker(
|
|
210
|
-
content,
|
|
211
|
-
"providers-open",
|
|
212
|
-
" <ConvexAuthProvider client={convex}>",
|
|
213
|
-
"jsx"
|
|
214
|
-
);
|
|
215
|
-
if (!openResult.success) {
|
|
216
|
-
logger.warn("Provider markers not found - please update providers manually");
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
|
-
content = openResult.content;
|
|
220
|
-
const closeResult = replaceAtMarker(
|
|
221
|
-
content,
|
|
222
|
-
"providers-close",
|
|
223
|
-
" </ConvexAuthProvider>",
|
|
224
|
-
"jsx"
|
|
225
|
-
);
|
|
226
|
-
if (!closeResult.success) {
|
|
227
|
-
logger.warn("Provider close markers not found - please update providers manually");
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
content = closeResult.content;
|
|
231
208
|
content = content.replace(
|
|
232
209
|
'import { ConvexProvider, ConvexReactClient } from "convex/react";',
|
|
233
210
|
'import { ConvexReactClient } from "convex/react";'
|
|
234
211
|
);
|
|
212
|
+
content = content.replace(/<ConvexProvider/g, "<ConvexAuthProvider");
|
|
213
|
+
content = content.replace(/<\/ConvexProvider>/g, "</ConvexAuthProvider>");
|
|
235
214
|
await writeFile(providersPath, content);
|
|
236
215
|
}
|
|
237
216
|
export {
|
|
@@ -21,25 +21,7 @@ function insertAtMarker(content, marker, insertion, commentStyle = "ts") {
|
|
|
21
21
|
${after}`
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function replaceAtMarker(content, marker, replacement, commentStyle = "ts") {
|
|
25
|
-
const startMarker = commentStyle === "ts" ? `// [forge:${marker}]` : `{/* [forge:${marker}] */}`;
|
|
26
|
-
const endMarker = commentStyle === "ts" ? `// [/forge:${marker}]` : `{/* [/forge:${marker}] */}`;
|
|
27
|
-
const startIdx = content.indexOf(startMarker);
|
|
28
|
-
const endIdx = content.indexOf(endMarker);
|
|
29
|
-
if (startIdx === -1 || endIdx === -1) {
|
|
30
|
-
return { success: false, content };
|
|
31
|
-
}
|
|
32
|
-
const before = content.slice(0, startIdx + startMarker.length);
|
|
33
|
-
const after = content.slice(endIdx);
|
|
34
|
-
return {
|
|
35
|
-
success: true,
|
|
36
|
-
content: `${before}
|
|
37
|
-
${replacement}
|
|
38
|
-
${after}`
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
24
|
|
|
42
25
|
export {
|
|
43
|
-
insertAtMarker
|
|
44
|
-
replaceAtMarker
|
|
26
|
+
insertAtMarker
|
|
45
27
|
};
|
package/dist/index.js
CHANGED
|
@@ -20,8 +20,8 @@ var main = defineCommand({
|
|
|
20
20
|
},
|
|
21
21
|
subCommands: {
|
|
22
22
|
init: () => import("./init-OYJP5QCZ.js").then((m) => m.default),
|
|
23
|
-
"add:feature": () => import("./add-feature-
|
|
24
|
-
"add:integration": () => import("./add-integration-
|
|
23
|
+
"add:feature": () => import("./add-feature-2AR4DP7P.js").then((m) => m.default),
|
|
24
|
+
"add:integration": () => import("./add-integration-QXB63S3V.js").then((m) => m.default),
|
|
25
25
|
check: () => import("./check-YMGJNKME.js").then((m) => m.default),
|
|
26
26
|
version: () => import("./version-VO3LHLDO.js").then((m) => m.default)
|
|
27
27
|
},
|
|
@@ -9,12 +9,8 @@ export function Providers({ children }: { children: React.ReactNode }) {
|
|
|
9
9
|
);
|
|
10
10
|
|
|
11
11
|
return (
|
|
12
|
-
{/* [forge:providers-open] */}
|
|
13
12
|
<ConvexProvider client={convex}>
|
|
14
|
-
{/* [/forge:providers-open] */}
|
|
15
13
|
{children}
|
|
16
|
-
{/* [forge:providers-close] */}
|
|
17
14
|
</ConvexProvider>
|
|
18
|
-
{/* [/forge:providers-close] */}
|
|
19
15
|
);
|
|
20
16
|
}
|
package/package.json
CHANGED
|
@@ -9,12 +9,8 @@ export function Providers({ children }: { children: React.ReactNode }) {
|
|
|
9
9
|
);
|
|
10
10
|
|
|
11
11
|
return (
|
|
12
|
-
{/* [forge:providers-open] */}
|
|
13
12
|
<ConvexProvider client={convex}>
|
|
14
|
-
{/* [/forge:providers-open] */}
|
|
15
13
|
{children}
|
|
16
|
-
{/* [forge:providers-close] */}
|
|
17
14
|
</ConvexProvider>
|
|
18
|
-
{/* [/forge:providers-close] */}
|
|
19
15
|
);
|
|
20
16
|
}
|