@farm.js/create-app 0.1.0-beta.52 → 0.1.0-beta.54

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
@@ -2534,6 +2534,7 @@ const TELEMETRY_SCHEMA_VERSION = 1;
2534
2534
  const DEFAULT_TELEMETRY_ENDPOINT = "https://farmjs.dev/api/telemetry/v1/events";
2535
2535
  const TELEMETRY_NOTICE_URL = "https://farmjs.dev/docs/telemetry";
2536
2536
  const REQUEST_TIMEOUT_MS = 750;
2537
+ const CREATE_APP_COMMANDS = ["create", "list-templates"];
2537
2538
  const FARM_TEMPLATES = [
2538
2539
  "basic",
2539
2540
  "react-compiler",
@@ -2734,6 +2735,17 @@ async function showFarmTelemetryNotice() {
2734
2735
  noticeShown: true
2735
2736
  });
2736
2737
  }
2738
+ async function trackFarmCreateAppCommand(input) {
2739
+ const command = allowlisted(input.command, CREATE_APP_COMMANDS);
2740
+ if (!command) return;
2741
+ await track({
2742
+ eventType: "command_invoked",
2743
+ source: "create-app",
2744
+ packageName: "@farm.js/create-app",
2745
+ packageVersion: sanitizeVersion(input.packageVersion),
2746
+ command
2747
+ });
2748
+ }
2737
2749
  async function trackFarmProjectCreated(input) {
2738
2750
  const template = allowlisted(input.template, FARM_TEMPLATES);
2739
2751
  const renderer = allowlisted(input.renderer, RENDERERS);
@@ -2944,6 +2956,10 @@ function integrationTemplate(input) {
2944
2956
  async function createApp(projectName, options = {}) {
2945
2957
  require_utils.showBanner();
2946
2958
  await showFarmTelemetryNotice();
2959
+ await trackFarmCreateAppCommand({
2960
+ command: options.listTemplates ? "list-templates" : "create",
2961
+ packageVersion: options.telemetryPackageVersion ?? "unknown"
2962
+ });
2947
2963
  const templates = await getAvailableTemplates();
2948
2964
  if (templates.length === 0) {
2949
2965
  require_utils.logger.error("No templates are available in this package.");