create-mastra 0.0.0-fix-issue-10434-concurrent-write-corruption-20251124213939 → 0.0.0-fix-request-context-as-query-key-20251209093005
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/CHANGELOG.md +47 -1
- package/dist/index.js +104 -12
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# create-mastra
|
|
2
2
|
|
|
3
|
-
## 0.0.0-fix-
|
|
3
|
+
## 0.0.0-fix-request-context-as-query-key-20251209093005
|
|
4
4
|
|
|
5
5
|
### Major Changes
|
|
6
6
|
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
### Patch Changes
|
|
14
14
|
|
|
15
|
+
- Fix select options overflow when list is long by adding maximum height ([#10813](https://github.com/mastra-ai/mastra/pull/10813))
|
|
16
|
+
|
|
15
17
|
- dependencies updates: ([#10111](https://github.com/mastra-ai/mastra/pull/10111))
|
|
16
18
|
- Updated dependency [`pino@^10.1.0` ↗︎](https://www.npmjs.com/package/pino/v/10.1.0) (from `^9.7.0`, in `dependencies`)
|
|
17
19
|
|
|
@@ -20,16 +22,60 @@
|
|
|
20
22
|
|
|
21
23
|
- Update MainSidebar component to fit required changes in Cloud CTA link ([#9318](https://github.com/mastra-ai/mastra/pull/9318))
|
|
22
24
|
|
|
25
|
+
- Fix default value showing on workflow form after user submits ([#10983](https://github.com/mastra-ai/mastra/pull/10983))
|
|
26
|
+
|
|
23
27
|
- Make MainSidebar toggle button sticky to bottom, always visible ([#9682](https://github.com/mastra-ai/mastra/pull/9682))
|
|
24
28
|
|
|
25
29
|
- fix: detect bun runtime and cleanup on failure ([#10242](https://github.com/mastra-ai/mastra/pull/10242))
|
|
26
30
|
|
|
27
31
|
- Add timeTravel APIs and add timeTravel feature to studio ([#10361](https://github.com/mastra-ai/mastra/pull/10361))
|
|
28
32
|
|
|
33
|
+
- Fix discriminatedUnion schema information lost when json schema is converted to zod ([#10500](https://github.com/mastra-ai/mastra/pull/10500))
|
|
34
|
+
|
|
35
|
+
- Move useScorers down to trace page to trigger it once for all trace spans ([#10985](https://github.com/mastra-ai/mastra/pull/10985))
|
|
36
|
+
|
|
37
|
+
- Update Observability Trace Spans list UI, so a user can expand/collapse span children/descendants and can filter the list by span type or name ([#10378](https://github.com/mastra-ai/mastra/pull/10378))
|
|
38
|
+
|
|
39
|
+
- Fix workflow trigger form overflow ([#10986](https://github.com/mastra-ai/mastra/pull/10986))
|
|
40
|
+
|
|
29
41
|
- Fix scorer filtering for SpanScoring, add error and info message for user ([#10160](https://github.com/mastra-ai/mastra/pull/10160))
|
|
30
42
|
|
|
43
|
+
- Hide time travel on map steps in Studio ([#10631](https://github.com/mastra-ai/mastra/pull/10631))
|
|
44
|
+
|
|
31
45
|
- Fix double scroll on agent chat container ([#10253](https://github.com/mastra-ai/mastra/pull/10253))
|
|
32
46
|
|
|
47
|
+
## 1.0.0-beta.7
|
|
48
|
+
|
|
49
|
+
### Patch Changes
|
|
50
|
+
|
|
51
|
+
- Fix default value showing on workflow form after user submits ([#10983](https://github.com/mastra-ai/mastra/pull/10983))
|
|
52
|
+
|
|
53
|
+
- Move useScorers down to trace page to trigger it once for all trace spans ([#10985](https://github.com/mastra-ai/mastra/pull/10985))
|
|
54
|
+
|
|
55
|
+
- Update Observability Trace Spans list UI, so a user can expand/collapse span children/descendants and can filter the list by span type or name ([#10378](https://github.com/mastra-ai/mastra/pull/10378))
|
|
56
|
+
|
|
57
|
+
- Fix workflow trigger form overflow ([#10986](https://github.com/mastra-ai/mastra/pull/10986))
|
|
58
|
+
|
|
59
|
+
## 1.0.0-beta.6
|
|
60
|
+
|
|
61
|
+
### Patch Changes
|
|
62
|
+
|
|
63
|
+
- Fix select options overflow when list is long by adding maximum height ([#10813](https://github.com/mastra-ai/mastra/pull/10813))
|
|
64
|
+
|
|
65
|
+
## 1.0.0-beta.5
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- Fix discriminatedUnion schema information lost when json schema is converted to zod ([#10500](https://github.com/mastra-ai/mastra/pull/10500))
|
|
70
|
+
|
|
71
|
+
- Hide time travel on map steps in Studio ([#10631](https://github.com/mastra-ai/mastra/pull/10631))
|
|
72
|
+
|
|
73
|
+
## 1.0.0-beta.4
|
|
74
|
+
|
|
75
|
+
### Patch Changes
|
|
76
|
+
|
|
77
|
+
- Add timeTravel APIs and add timeTravel feature to studio ([#10361](https://github.com/mastra-ai/mastra/pull/10361))
|
|
78
|
+
|
|
33
79
|
## 1.0.0-beta.3
|
|
34
80
|
|
|
35
81
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -18,9 +18,9 @@ import tty from 'node:tty';
|
|
|
18
18
|
import fsExtra, { readJSON, ensureFile, writeJSON } from 'fs-extra/esm';
|
|
19
19
|
import prettier from 'prettier';
|
|
20
20
|
import { execa } from 'execa';
|
|
21
|
+
import fsExtra$1 from 'fs-extra';
|
|
21
22
|
import pino from 'pino';
|
|
22
23
|
import pretty from 'pino-pretty';
|
|
23
|
-
import fsExtra$1 from 'fs-extra';
|
|
24
24
|
|
|
25
25
|
var __filename = fileURLToPath(import.meta.url);
|
|
26
26
|
var __dirname = path3.dirname(__filename);
|
|
@@ -382,7 +382,7 @@ function DD({onlyFirst:e=false}={}){const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:
|
|
|
382
382
|
`).length-1;this.output.write(srcExports.cursor.move(-999,u*-1));}render(){const u=Y$1(this._render(this)??"",process.stdout.columns,{hard:true});if(u!==this._prevFrame){if(this.state==="initial")this.output.write(srcExports.cursor.hide);else {const t=BD(this._prevFrame,u);if(this.restoreCursor(),t&&t?.length===1){const F=t[0];this.output.write(srcExports.cursor.move(0,F)),this.output.write(srcExports.erase.lines(1));const s=u.split(`
|
|
383
383
|
`);this.output.write(s[F]),this._prevFrame=u,this.output.write(srcExports.cursor.move(0,s.length-F-1));return}if(t&&t?.length>1){const F=t[0];this.output.write(srcExports.cursor.move(0,F)),this.output.write(srcExports.erase.down());const s=u.split(`
|
|
384
384
|
`).slice(F);this.output.write(s.join(`
|
|
385
|
-
`)),this._prevFrame=u;return}this.output.write(srcExports.erase.down());}this.output.write(u),this.state==="initial"&&(this.state="active"),this._prevFrame=u;}}}var OD=Object.defineProperty,PD=(e,u,t)=>u in e?OD(e,u,{enumerable:true,configurable:true,writable:true,value:t}):e[u]=t,J=(e,u,t)=>(PD(e,typeof u!="symbol"?u+"":u,t),t);class LD extends x{constructor(u){super(u,false),J(this,"options"),J(this,"cursor",0),this.options=u.options,this.cursor=this.options.findIndex(({value:t})=>t===u.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",t=>{switch(t){case "left":case "up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case "down":case "right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue();});}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value;}}class RD extends x{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return `${this.value}\u2588`;const u=this.value.slice(0,this.cursor),[t,...F]=this.value.slice(this.cursor);return `${u}${color2.inverse(t)}${F.join("")}`}get cursor(){return this._cursor}constructor(u){super(u),this.on("finalize",()=>{this.value||(this.value=u.defaultValue);});}}
|
|
385
|
+
`)),this._prevFrame=u;return}this.output.write(srcExports.erase.down());}this.output.write(u),this.state==="initial"&&(this.state="active"),this._prevFrame=u;}}}class dD extends x{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(u){super(u,false),this.value=!!u.initialValue,this.on("value",()=>{this.value=this._value;}),this.on("confirm",t=>{this.output.write(srcExports.cursor.move(0,-1)),this.value=t,this.state="submit",this.close();}),this.on("cursor",()=>{this.value=!this.value;});}}var OD=Object.defineProperty,PD=(e,u,t)=>u in e?OD(e,u,{enumerable:true,configurable:true,writable:true,value:t}):e[u]=t,J=(e,u,t)=>(PD(e,typeof u!="symbol"?u+"":u,t),t);class LD extends x{constructor(u){super(u,false),J(this,"options"),J(this,"cursor",0),this.options=u.options,this.cursor=this.options.findIndex(({value:t})=>t===u.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",t=>{switch(t){case "left":case "up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case "down":case "right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue();});}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value;}}class RD extends x{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return `${this.value}\u2588`;const u=this.value.slice(0,this.cursor),[t,...F]=this.value.slice(this.cursor);return `${u}${color2.inverse(t)}${F.join("")}`}get cursor(){return this._cursor}constructor(u){super(u),this.on("finalize",()=>{this.value||(this.value=u.defaultValue);});}}
|
|
386
386
|
|
|
387
387
|
function ce(){return y$1.platform!=="win32"?y$1.env.TERM!=="linux":!!y$1.env.CI||!!y$1.env.WT_SESSION||!!y$1.env.TERMINUS_SUBLIME||y$1.env.ConEmuTask==="{cmd::Cmder}"||y$1.env.TERM_PROGRAM==="Terminus-Sublime"||y$1.env.TERM_PROGRAM==="vscode"||y$1.env.TERM==="xterm-256color"||y$1.env.TERM==="alacritty"||y$1.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const V=ce(),u=(t,n)=>V?t:n,le=u("\u25C6","*"),L=u("\u25A0","x"),W=u("\u25B2","x"),C=u("\u25C7","o"),ue=u("\u250C","T"),o=u("\u2502","|"),d=u("\u2514","\u2014"),k=u("\u25CF",">"),P=u("\u25CB"," "),_=u("\u2500","-"),me=u("\u256E","+"),de=u("\u251C","+"),pe=u("\u256F","+"),q=u("\u25CF","\u2022"),D=u("\u25C6","*"),U=u("\u25B2","!"),K=u("\u25A0","x"),b=t=>{switch(t){case "initial":case "active":return color2.cyan(le);case "cancel":return color2.red(L);case "error":return color2.yellow(W);case "submit":return color2.green(C)}},G=t=>{const{cursor:n,options:r,style:i}=t,s=t.maxItems??Number.POSITIVE_INFINITY,c=Math.max(process.stdout.rows-4,0),a=Math.min(c,Math.max(s,5));let l=0;n>=l+a-3?l=Math.max(Math.min(n-a+3,r.length-a),0):n<l+2&&(l=Math.max(n-2,0));const $=a<r.length&&l>0,g=a<r.length&&l+a<r.length;return r.slice(l,l+a).map((p,v,f)=>{const j=v===0&&$,E=v===f.length-1&&g;return j||E?color2.dim("..."):i(p,v+l===n)})},he=t=>new RD({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){const n=`${color2.gray(o)}
|
|
388
388
|
${b(this.state)} ${t.message}
|
|
@@ -392,7 +392,12 @@ ${color2.yellow(d)} ${color2.yellow(this.error)}
|
|
|
392
392
|
`;case "submit":return `${n}${color2.gray(o)} ${color2.dim(this.value||t.placeholder)}`;case "cancel":return `${n}${color2.gray(o)} ${color2.strikethrough(color2.dim(this.value??""))}${this.value?.trim()?`
|
|
393
393
|
${color2.gray(o)}`:""}`;default:return `${n}${color2.cyan(o)} ${i}
|
|
394
394
|
${color2.cyan(d)}
|
|
395
|
-
`}}}).prompt(),
|
|
395
|
+
`}}}).prompt(),ye=t=>{const n=t.active??"Yes",r=t.inactive??"No";return new dD({active:n,inactive:r,initialValue:t.initialValue??true,render(){const i=`${color2.gray(o)}
|
|
396
|
+
${b(this.state)} ${t.message}
|
|
397
|
+
`,s=this.value?n:r;switch(this.state){case "submit":return `${i}${color2.gray(o)} ${color2.dim(s)}`;case "cancel":return `${i}${color2.gray(o)} ${color2.strikethrough(color2.dim(s))}
|
|
398
|
+
${color2.gray(o)}`;default:return `${i}${color2.cyan(o)} ${this.value?`${color2.green(k)} ${n}`:`${color2.dim(P)} ${color2.dim(n)}`} ${color2.dim("/")} ${this.value?`${color2.dim(P)} ${color2.dim(r)}`:`${color2.green(k)} ${r}`}
|
|
399
|
+
${color2.cyan(d)}
|
|
400
|
+
`}}}).prompt()},ve=t=>{const n=(r,i)=>{const s=r.label??String(r.value);switch(i){case "selected":return `${color2.dim(s)}`;case "active":return `${color2.green(k)} ${s} ${r.hint?color2.dim(`(${r.hint})`):""}`;case "cancelled":return `${color2.strikethrough(color2.dim(s))}`;default:return `${color2.dim(P)} ${color2.dim(s)}`}};return new LD({options:t.options,initialValue:t.initialValue,render(){const r=`${color2.gray(o)}
|
|
396
401
|
${b(this.state)} ${t.message}
|
|
397
402
|
`;switch(this.state){case "submit":return `${r}${color2.gray(o)} ${n(this.options[this.cursor],"selected")}`;case "cancel":return `${r}${color2.gray(o)} ${n(this.options[this.cursor],"cancelled")}
|
|
398
403
|
${color2.gray(o)}`;default:return `${r}${color2.cyan(o)} ${G({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(i,s)=>n(i,s?"active":"inactive")}).join(`
|
|
@@ -1139,10 +1144,15 @@ var MastraLogger = class {
|
|
|
1139
1144
|
}
|
|
1140
1145
|
};
|
|
1141
1146
|
|
|
1142
|
-
var PinoLogger = class extends MastraLogger {
|
|
1147
|
+
var PinoLogger = class _PinoLogger extends MastraLogger {
|
|
1143
1148
|
logger;
|
|
1144
1149
|
constructor(options = {}) {
|
|
1145
1150
|
super(options);
|
|
1151
|
+
const internalOptions = options;
|
|
1152
|
+
if (internalOptions._logger) {
|
|
1153
|
+
this.logger = internalOptions._logger;
|
|
1154
|
+
return;
|
|
1155
|
+
}
|
|
1146
1156
|
let prettyStream = void 0;
|
|
1147
1157
|
if (!options.overrideDefaultTransports) {
|
|
1148
1158
|
prettyStream = pretty({
|
|
@@ -1159,7 +1169,8 @@ var PinoLogger = class extends MastraLogger {
|
|
|
1159
1169
|
{
|
|
1160
1170
|
name: options.name || "app",
|
|
1161
1171
|
level: options.level || LogLevel.INFO,
|
|
1162
|
-
formatters: options.formatters
|
|
1172
|
+
formatters: options.formatters,
|
|
1173
|
+
redact: options.redact
|
|
1163
1174
|
},
|
|
1164
1175
|
options.overrideDefaultTransports ? options?.transports?.default : transportsAry.length === 0 ? prettyStream : pino.multistream([
|
|
1165
1176
|
...transportsAry.map(([, transport]) => ({
|
|
@@ -1173,6 +1184,38 @@ var PinoLogger = class extends MastraLogger {
|
|
|
1173
1184
|
])
|
|
1174
1185
|
);
|
|
1175
1186
|
}
|
|
1187
|
+
/**
|
|
1188
|
+
* Creates a child logger with additional bound context.
|
|
1189
|
+
* All logs from the child logger will include the bound context.
|
|
1190
|
+
*
|
|
1191
|
+
* @param bindings - Key-value pairs to include in all logs from this child logger
|
|
1192
|
+
* @returns A new PinoLogger instance with the bound context
|
|
1193
|
+
*
|
|
1194
|
+
* @example
|
|
1195
|
+
* ```typescript
|
|
1196
|
+
* const baseLogger = new PinoLogger({ name: 'MyApp' });
|
|
1197
|
+
*
|
|
1198
|
+
* // Create module-scoped logger
|
|
1199
|
+
* const serviceLogger = baseLogger.child({ module: 'UserService' });
|
|
1200
|
+
* serviceLogger.info('User created', { userId: '123' });
|
|
1201
|
+
* // Output includes: { module: 'UserService', userId: '123', msg: 'User created' }
|
|
1202
|
+
*
|
|
1203
|
+
* // Create request-scoped logger
|
|
1204
|
+
* const requestLogger = baseLogger.child({ requestId: req.id });
|
|
1205
|
+
* requestLogger.error('Request failed', { err: error });
|
|
1206
|
+
* // Output includes: { requestId: 'abc', msg: 'Request failed', err: {...} }
|
|
1207
|
+
* ```
|
|
1208
|
+
*/
|
|
1209
|
+
child(bindings) {
|
|
1210
|
+
const childPino = this.logger.child(bindings);
|
|
1211
|
+
const childOptions = {
|
|
1212
|
+
name: this.name,
|
|
1213
|
+
level: this.level,
|
|
1214
|
+
transports: Object.fromEntries(this.transports),
|
|
1215
|
+
_logger: childPino
|
|
1216
|
+
};
|
|
1217
|
+
return new _PinoLogger(childOptions);
|
|
1218
|
+
}
|
|
1176
1219
|
debug(message, args = {}) {
|
|
1177
1220
|
this.logger.debug(args, message);
|
|
1178
1221
|
}
|
|
@@ -1188,7 +1231,7 @@ var PinoLogger = class extends MastraLogger {
|
|
|
1188
1231
|
};
|
|
1189
1232
|
|
|
1190
1233
|
var package_default = {
|
|
1191
|
-
version: "1.0.0-beta.
|
|
1234
|
+
version: "1.0.0-beta.7"};
|
|
1192
1235
|
function getPackageManagerAddCommand(pm) {
|
|
1193
1236
|
switch (pm) {
|
|
1194
1237
|
case "npm":
|
|
@@ -2089,19 +2132,19 @@ Note: you will need to go into Cursor Settings -> MCP Settings and manually enab
|
|
|
2089
2132
|
);
|
|
2090
2133
|
}
|
|
2091
2134
|
if (editor === `cursor-global`) {
|
|
2092
|
-
const
|
|
2135
|
+
const confirm3 = await ve({
|
|
2093
2136
|
message: `Global install will add/update ${cursorGlobalMCPConfigPath} and make the Mastra docs MCP server available in all your Cursor projects. Continue?`,
|
|
2094
2137
|
options: [
|
|
2095
2138
|
{ value: "yes", label: "Yes, I understand" },
|
|
2096
2139
|
{ value: "skip", label: "No, skip for now" }
|
|
2097
2140
|
]
|
|
2098
2141
|
});
|
|
2099
|
-
if (
|
|
2142
|
+
if (confirm3 !== `yes`) {
|
|
2100
2143
|
return void 0;
|
|
2101
2144
|
}
|
|
2102
2145
|
}
|
|
2103
2146
|
if (editor === `windsurf`) {
|
|
2104
|
-
const
|
|
2147
|
+
const confirm3 = await ve({
|
|
2105
2148
|
message: `Windsurf only supports a global MCP config (at ${windsurfGlobalMCPConfigPath}) is it ok to add/update that global config?
|
|
2106
2149
|
This means the Mastra docs MCP server will be available in all your Windsurf projects.`,
|
|
2107
2150
|
options: [
|
|
@@ -2109,11 +2152,17 @@ This means the Mastra docs MCP server will be available in all your Windsurf pro
|
|
|
2109
2152
|
{ value: "skip", label: "No, skip for now" }
|
|
2110
2153
|
]
|
|
2111
2154
|
});
|
|
2112
|
-
if (
|
|
2155
|
+
if (confirm3 !== `yes`) {
|
|
2113
2156
|
return void 0;
|
|
2114
2157
|
}
|
|
2115
2158
|
}
|
|
2116
2159
|
return editor;
|
|
2160
|
+
},
|
|
2161
|
+
initGit: async () => {
|
|
2162
|
+
return ye({
|
|
2163
|
+
message: "Initialize a new git repository?",
|
|
2164
|
+
initialValue: true
|
|
2165
|
+
});
|
|
2117
2166
|
}
|
|
2118
2167
|
},
|
|
2119
2168
|
{
|
|
@@ -2154,6 +2203,20 @@ function getPackageManager() {
|
|
|
2154
2203
|
}
|
|
2155
2204
|
return "npm";
|
|
2156
2205
|
}
|
|
2206
|
+
async function gitInit({ cwd }) {
|
|
2207
|
+
await execa("git", ["init"], { cwd, stdio: "ignore" });
|
|
2208
|
+
await execa("git", ["add", "-A"], { cwd, stdio: "ignore" });
|
|
2209
|
+
await execa(
|
|
2210
|
+
"git",
|
|
2211
|
+
[
|
|
2212
|
+
"commit",
|
|
2213
|
+
"-m",
|
|
2214
|
+
'"Initial commit from Mastra"',
|
|
2215
|
+
'--author="dane-ai-mastra[bot] <dane-ai-mastra[bot]@users.noreply.github.com>"'
|
|
2216
|
+
],
|
|
2217
|
+
{ cwd, stdio: "ignore" }
|
|
2218
|
+
);
|
|
2219
|
+
}
|
|
2157
2220
|
var logger = createLogger(false);
|
|
2158
2221
|
function createLogger(debug = false) {
|
|
2159
2222
|
return new PinoLogger({
|
|
@@ -2345,7 +2408,8 @@ var init = async ({
|
|
|
2345
2408
|
llmApiKey,
|
|
2346
2409
|
addExample = false,
|
|
2347
2410
|
configureEditorWithDocsMCP,
|
|
2348
|
-
versionTag
|
|
2411
|
+
versionTag,
|
|
2412
|
+
initGit = false
|
|
2349
2413
|
}) => {
|
|
2350
2414
|
s.start("Initializing Mastra");
|
|
2351
2415
|
const packageVersionTag = versionTag ? `@${versionTag}` : "";
|
|
@@ -2404,6 +2468,16 @@ var init = async ({
|
|
|
2404
2468
|
});
|
|
2405
2469
|
}
|
|
2406
2470
|
s.stop();
|
|
2471
|
+
if (initGit) {
|
|
2472
|
+
const s2 = Y();
|
|
2473
|
+
try {
|
|
2474
|
+
s2.start("Initializing git repository");
|
|
2475
|
+
await gitInit({ cwd: process.cwd() });
|
|
2476
|
+
s2.stop("Git repository initialized");
|
|
2477
|
+
} catch {
|
|
2478
|
+
s2.stop();
|
|
2479
|
+
}
|
|
2480
|
+
}
|
|
2407
2481
|
if (!llmApiKey) {
|
|
2408
2482
|
Me(`
|
|
2409
2483
|
${color2.green("Mastra initialized successfully!")}
|
|
@@ -2521,7 +2595,7 @@ var createMastraProject = async ({
|
|
|
2521
2595
|
xe("Operation cancelled");
|
|
2522
2596
|
process.exit(0);
|
|
2523
2597
|
}
|
|
2524
|
-
let result;
|
|
2598
|
+
let result = void 0;
|
|
2525
2599
|
if (needsInteractive) {
|
|
2526
2600
|
result = await interactivePrompt({
|
|
2527
2601
|
options: { showBanner: false },
|
|
@@ -2837,6 +2911,14 @@ async function createFromTemplate(args) {
|
|
|
2837
2911
|
}
|
|
2838
2912
|
llmProvider = providerResponse;
|
|
2839
2913
|
}
|
|
2914
|
+
let initGit = false;
|
|
2915
|
+
const gitConfirmResult = await ye({
|
|
2916
|
+
message: "Initialize a new git repository?",
|
|
2917
|
+
initialValue: true
|
|
2918
|
+
});
|
|
2919
|
+
if (!pD(gitConfirmResult)) {
|
|
2920
|
+
initGit = gitConfirmResult;
|
|
2921
|
+
}
|
|
2840
2922
|
let projectPath = null;
|
|
2841
2923
|
try {
|
|
2842
2924
|
const analytics = args.injectedAnalytics || getAnalytics();
|
|
@@ -2862,6 +2944,16 @@ async function createFromTemplate(args) {
|
|
|
2862
2944
|
llmProvider
|
|
2863
2945
|
});
|
|
2864
2946
|
await installDependencies(projectPath);
|
|
2947
|
+
if (initGit) {
|
|
2948
|
+
const s2 = Y();
|
|
2949
|
+
try {
|
|
2950
|
+
s2.start("Initializing git repository");
|
|
2951
|
+
await gitInit({ cwd: projectPath });
|
|
2952
|
+
s2.stop("Git repository initialized");
|
|
2953
|
+
} catch {
|
|
2954
|
+
s2.stop();
|
|
2955
|
+
}
|
|
2956
|
+
}
|
|
2865
2957
|
Me(`
|
|
2866
2958
|
${color2.green("Mastra template installed!")}
|
|
2867
2959
|
|