create-tina-app 2.1.1 → 2.1.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 +20 -38
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -458,7 +458,7 @@ import { Command } from "commander";
|
|
|
458
458
|
|
|
459
459
|
// package.json
|
|
460
460
|
var name = "create-tina-app";
|
|
461
|
-
var version = "2.1.
|
|
461
|
+
var version = "2.1.2";
|
|
462
462
|
|
|
463
463
|
// src/util/packageManagers.ts
|
|
464
464
|
var PKG_MANAGERS = ["npm", "yarn", "pnpm", "bun"];
|
|
@@ -929,9 +929,7 @@ async function run() {
|
|
|
929
929
|
console.log(`
|
|
930
930
|
${TextStylesBold.bold("Telemetry Notice")}`);
|
|
931
931
|
console.log(
|
|
932
|
-
|
|
933
|
-
No personal or project-specific code is ever collected. You can opt out at any time by passing the --noTelemetry flag.
|
|
934
|
-
`
|
|
932
|
+
"To help the TinaCMS team improve the developer experience, create-tina-app collects anonymous usage statistics. This data helps us understand which environments and features are most important to support. Usage analytics may include: Operating system and version, package manager name and version (local only), Node.js version (local only), and the selected TinaCMS starter template.\nNo personal or project-specific code is ever collected. You can opt out at any time by passing the --noTelemetry flag.\n"
|
|
935
933
|
);
|
|
936
934
|
posthogClient = await initializePostHog(
|
|
937
935
|
"https://identity-v2.tinajs.io/v2/posthog-token",
|
|
@@ -945,6 +943,12 @@ No personal or project-specific code is ever collected. You can opt out at any t
|
|
|
945
943
|
for (const pkgManager2 of PKG_MANAGERS) {
|
|
946
944
|
telemetryData[`${pkgManager2}-installed`] = installedPkgManagers.includes(pkgManager2);
|
|
947
945
|
}
|
|
946
|
+
if (opts.template) {
|
|
947
|
+
telemetryData["template"] = opts.template;
|
|
948
|
+
}
|
|
949
|
+
if (opts.pkgManager) {
|
|
950
|
+
telemetryData["package-manager"] = opts.pkgManager;
|
|
951
|
+
}
|
|
948
952
|
}
|
|
949
953
|
const spinner = ora();
|
|
950
954
|
preRunChecks(spinner);
|
|
@@ -974,10 +978,7 @@ No personal or project-specific code is ever collected. You can opt out at any t
|
|
|
974
978
|
errorCategory: "validation",
|
|
975
979
|
step: TRACKING_STEPS.TEMPLATE_SELECT,
|
|
976
980
|
fatal: true,
|
|
977
|
-
additionalProperties: {
|
|
978
|
-
...telemetryData,
|
|
979
|
-
provided_template: opts.template
|
|
980
|
-
}
|
|
981
|
+
additionalProperties: { ...telemetryData }
|
|
981
982
|
}
|
|
982
983
|
);
|
|
983
984
|
if (posthogClient) await posthogClient.shutdown();
|
|
@@ -987,9 +988,6 @@ No personal or project-specific code is ever collected. You can opt out at any t
|
|
|
987
988
|
let pkgManager = opts.pkgManager;
|
|
988
989
|
if (pkgManager) {
|
|
989
990
|
if (!PKG_MANAGERS.find((_pkgManager) => _pkgManager === pkgManager)) {
|
|
990
|
-
spinner.fail(
|
|
991
|
-
`The provided package manager '${opts.pkgManager}' is not supported. Please provide one of the following: ${PKG_MANAGERS}`
|
|
992
|
-
);
|
|
993
991
|
postHogCaptureError(
|
|
994
992
|
posthogClient,
|
|
995
993
|
userId,
|
|
@@ -1000,13 +998,13 @@ No personal or project-specific code is ever collected. You can opt out at any t
|
|
|
1000
998
|
errorCategory: "validation",
|
|
1001
999
|
step: TRACKING_STEPS.PKG_MANAGER_SELECT,
|
|
1002
1000
|
fatal: true,
|
|
1003
|
-
additionalProperties: {
|
|
1004
|
-
...telemetryData,
|
|
1005
|
-
provided_pkg_manager: opts.pkgManager
|
|
1006
|
-
}
|
|
1001
|
+
additionalProperties: { ...telemetryData }
|
|
1007
1002
|
}
|
|
1008
1003
|
);
|
|
1009
1004
|
if (posthogClient) await posthogClient.shutdown();
|
|
1005
|
+
spinner.fail(
|
|
1006
|
+
`The provided package manager '${opts.pkgManager}' is not supported. Please provide one of the following: ${PKG_MANAGERS}`
|
|
1007
|
+
);
|
|
1010
1008
|
exit(1);
|
|
1011
1009
|
}
|
|
1012
1010
|
}
|
|
@@ -1057,8 +1055,8 @@ No personal or project-specific code is ever collected. You can opt out at any t
|
|
|
1057
1055
|
exit(1);
|
|
1058
1056
|
}
|
|
1059
1057
|
pkgManager = res.packageManager;
|
|
1060
|
-
telemetryData["package-manager"] = pkgManager;
|
|
1061
1058
|
}
|
|
1059
|
+
telemetryData["package-manager"] = pkgManager;
|
|
1062
1060
|
let projectName = opts.projectName;
|
|
1063
1061
|
if (!projectName) {
|
|
1064
1062
|
const res = await prompts({
|
|
@@ -1165,10 +1163,7 @@ No personal or project-specific code is ever collected. You can opt out at any t
|
|
|
1165
1163
|
errorCategory: "filesystem",
|
|
1166
1164
|
step: TRACKING_STEPS.DIRECTORY_SETUP,
|
|
1167
1165
|
fatal: true,
|
|
1168
|
-
additionalProperties: {
|
|
1169
|
-
...telemetryData,
|
|
1170
|
-
template: template.value
|
|
1171
|
-
}
|
|
1166
|
+
additionalProperties: { ...telemetryData }
|
|
1172
1167
|
}
|
|
1173
1168
|
);
|
|
1174
1169
|
if (posthogClient) await posthogClient.shutdown();
|
|
@@ -1186,16 +1181,14 @@ No personal or project-specific code is ever collected. You can opt out at any t
|
|
|
1186
1181
|
errorCategory: "filesystem",
|
|
1187
1182
|
step: TRACKING_STEPS.DIRECTORY_SETUP,
|
|
1188
1183
|
fatal: true,
|
|
1189
|
-
additionalProperties: {
|
|
1190
|
-
...telemetryData,
|
|
1191
|
-
template: template.value
|
|
1192
|
-
}
|
|
1184
|
+
additionalProperties: { ...telemetryData }
|
|
1193
1185
|
});
|
|
1194
1186
|
if (posthogClient) await posthogClient.shutdown();
|
|
1195
1187
|
exit(1);
|
|
1196
1188
|
}
|
|
1197
1189
|
try {
|
|
1198
1190
|
if (themeChoice) {
|
|
1191
|
+
telemetryData["theme"] = themeChoice;
|
|
1199
1192
|
await updateThemeSettings(rootDir, themeChoice);
|
|
1200
1193
|
}
|
|
1201
1194
|
spinner.start("Downloading template...");
|
|
@@ -1213,11 +1206,7 @@ No personal or project-specific code is ever collected. You can opt out at any t
|
|
|
1213
1206
|
errorCategory: "template",
|
|
1214
1207
|
step: TRACKING_STEPS.DOWNLOADING_TEMPLATE,
|
|
1215
1208
|
fatal: true,
|
|
1216
|
-
additionalProperties: {
|
|
1217
|
-
...telemetryData,
|
|
1218
|
-
template: template.value,
|
|
1219
|
-
theme: themeChoice
|
|
1220
|
-
}
|
|
1209
|
+
additionalProperties: { ...telemetryData }
|
|
1221
1210
|
});
|
|
1222
1211
|
if (posthogClient) await posthogClient.shutdown();
|
|
1223
1212
|
exit(1);
|
|
@@ -1235,11 +1224,7 @@ No personal or project-specific code is ever collected. You can opt out at any t
|
|
|
1235
1224
|
errorCategory: "installation",
|
|
1236
1225
|
step: TRACKING_STEPS.INSTALLING_PACKAGES,
|
|
1237
1226
|
fatal: false,
|
|
1238
|
-
additionalProperties: {
|
|
1239
|
-
...telemetryData,
|
|
1240
|
-
template: template.value,
|
|
1241
|
-
package_manager: pkgManager
|
|
1242
|
-
}
|
|
1227
|
+
additionalProperties: { ...telemetryData }
|
|
1243
1228
|
});
|
|
1244
1229
|
}
|
|
1245
1230
|
spinner.start("Initializing git repository.");
|
|
@@ -1256,10 +1241,7 @@ No personal or project-specific code is ever collected. You can opt out at any t
|
|
|
1256
1241
|
errorCategory: "git",
|
|
1257
1242
|
step: TRACKING_STEPS.GIT_INIT,
|
|
1258
1243
|
fatal: false,
|
|
1259
|
-
additionalProperties: {
|
|
1260
|
-
...telemetryData,
|
|
1261
|
-
template: template.value
|
|
1262
|
-
}
|
|
1244
|
+
additionalProperties: { ...telemetryData }
|
|
1263
1245
|
});
|
|
1264
1246
|
}
|
|
1265
1247
|
postHogCapture(
|