@farm.js/create-app 0.1.0-beta.52 → 0.1.0-beta.53
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 +16 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/templates/_renderers/preact/package.json +2 -2
- package/templates/_renderers/solid/package.json +2 -2
- package/templates/_renderers/svelte/package.json +2 -2
- package/templates/_renderers/vue/package.json +2 -2
- package/templates/auth/package.json +3 -3
- package/templates/basic/package.json +2 -2
- package/templates/better-auth/package.json +3 -3
- package/templates/react-compiler/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -2527,6 +2527,7 @@ const TELEMETRY_SCHEMA_VERSION = 1;
|
|
|
2527
2527
|
const DEFAULT_TELEMETRY_ENDPOINT = "https://farmjs.dev/api/telemetry/v1/events";
|
|
2528
2528
|
const TELEMETRY_NOTICE_URL = "https://farmjs.dev/docs/telemetry";
|
|
2529
2529
|
const REQUEST_TIMEOUT_MS = 750;
|
|
2530
|
+
const CREATE_APP_COMMANDS = ["create", "list-templates"];
|
|
2530
2531
|
const FARM_TEMPLATES = [
|
|
2531
2532
|
"basic",
|
|
2532
2533
|
"react-compiler",
|
|
@@ -2727,6 +2728,17 @@ async function showFarmTelemetryNotice() {
|
|
|
2727
2728
|
noticeShown: true
|
|
2728
2729
|
});
|
|
2729
2730
|
}
|
|
2731
|
+
async function trackFarmCreateAppCommand(input) {
|
|
2732
|
+
const command = allowlisted(input.command, CREATE_APP_COMMANDS);
|
|
2733
|
+
if (!command) return;
|
|
2734
|
+
await track({
|
|
2735
|
+
eventType: "command_invoked",
|
|
2736
|
+
source: "create-app",
|
|
2737
|
+
packageName: "@farm.js/create-app",
|
|
2738
|
+
packageVersion: sanitizeVersion(input.packageVersion),
|
|
2739
|
+
command
|
|
2740
|
+
});
|
|
2741
|
+
}
|
|
2730
2742
|
async function trackFarmProjectCreated(input) {
|
|
2731
2743
|
const template = allowlisted(input.template, FARM_TEMPLATES);
|
|
2732
2744
|
const renderer = allowlisted(input.renderer, RENDERERS);
|
|
@@ -2937,6 +2949,10 @@ function integrationTemplate(input) {
|
|
|
2937
2949
|
async function createApp(projectName, options = {}) {
|
|
2938
2950
|
showBanner();
|
|
2939
2951
|
await showFarmTelemetryNotice();
|
|
2952
|
+
await trackFarmCreateAppCommand({
|
|
2953
|
+
command: options.listTemplates ? "list-templates" : "create",
|
|
2954
|
+
packageVersion: options.telemetryPackageVersion ?? "unknown"
|
|
2955
|
+
});
|
|
2940
2956
|
const templates = await getAvailableTemplates();
|
|
2941
2957
|
if (templates.length === 0) {
|
|
2942
2958
|
logger.error("No templates are available in this package.");
|