Send the useTypescript event in the telemetry usage

This commit is contained in:
Convly 2022-04-01 18:41:36 +02:00
parent 973cf6796b
commit 47ae55ed7a
3 changed files with 5 additions and 0 deletions

View File

@ -6,6 +6,7 @@ const { isFunction } = require('lodash/fp');
const { createLogger } = require('@strapi/logger');
const { Database } = require('@strapi/database');
const { createAsyncParallelHook } = require('@strapi/utils').hooks;
const { isTypeScriptProjectSync } = require('@strapi/typescript-utils');
const loadConfiguration = require('./core/app-configuration');
@ -77,6 +78,7 @@ class Strapi {
// Load the app configuration from the dist directory
const appConfig = loadConfiguration(this.dirs.dist.root, opts);
appConfig.server.useTypescript = isTypeScriptProjectSync(this.dirs.app.root);
// Instanciate the Strapi container
this.container = createContainer(this);

View File

@ -47,6 +47,7 @@ module.exports = strapi => {
version: strapi.config.get('info.strapi'),
strapiVersion: strapi.config.get('info.strapi'),
projectType: isEE ? 'Enterprise' : 'Community',
useTypescript: strapi.config.server.useTypescript,
};
addPackageJsonStrapiMetadata(anonymous_metadata, strapi);

View File

@ -82,6 +82,7 @@ function trackError({ scope, error }) {
nodeVersion: process.version,
docker: scope.docker,
useYarn: scope.useYarn,
useTypescript: scope.useTypescript,
};
try {
@ -108,6 +109,7 @@ function trackUsage({ event, scope, error }) {
version: scope.strapiVersion,
docker: scope.docker,
useYarn: scope.useYarn.toString(),
useTypescript: scope.useTypescript.toString(),
noRun: (scope.runQuickstartApp !== true).toString(),
};