create-mastra 0.10.22-alpha.0 → 0.10.22-alpha.2

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 CHANGED
@@ -2443,7 +2443,7 @@ var createMastraProject = async ({
2443
2443
  };
2444
2444
  var create = async (args2) => {
2445
2445
  if (args2.template !== void 0) {
2446
- await createFromTemplate(args2);
2446
+ await createFromTemplate({ ...args2, injectedAnalytics: args2.analytics });
2447
2447
  return;
2448
2448
  }
2449
2449
  const { projectName } = await createMastraProject({
@@ -2613,8 +2613,13 @@ async function createFromTemplate(args2) {
2613
2613
  projectName = response;
2614
2614
  }
2615
2615
  try {
2616
- const analytics = getAnalytics();
2617
- if (analytics) ;
2616
+ const analytics = args2.injectedAnalytics || getAnalytics();
2617
+ if (analytics) {
2618
+ analytics.trackEvent("cli_template_used", {
2619
+ template_slug: selectedTemplate.slug,
2620
+ template_title: selectedTemplate.title
2621
+ });
2622
+ }
2618
2623
  const projectPath = await cloneTemplate({
2619
2624
  template: selectedTemplate,
2620
2625
  projectName
@@ -2623,7 +2628,7 @@ async function createFromTemplate(args2) {
2623
2628
  Me(`
2624
2629
  ${color2.green("Mastra template installed!")}
2625
2630
 
2626
- Add the necessary environment
2631
+ Add the necessary environment
2627
2632
  variables in your ${color2.cyan(".env")} file
2628
2633
  `);
2629
2634
  postCreate({ projectName });
@@ -2689,7 +2694,8 @@ program.name("create-mastra").description("Create a new Mastra project").argumen
2689
2694
  timeout,
2690
2695
  mcpServer: args.mcp,
2691
2696
  directory: "src/",
2692
- template: args.template
2697
+ template: args.template,
2698
+ analytics
2693
2699
  });
2694
2700
  return;
2695
2701
  }
@@ -2703,7 +2709,8 @@ program.name("create-mastra").description("Create a new Mastra project").argumen
2703
2709
  projectName,
2704
2710
  directory: args.dir,
2705
2711
  mcpServer: args.mcp,
2706
- template: args.template
2712
+ template: args.template,
2713
+ analytics
2707
2714
  });
2708
2715
  });
2709
2716
  program.parse(process.argv);