create-tina-app 2.1.0 → 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 +25 -41
- 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"];
|
|
@@ -869,7 +869,7 @@ async function fetchPostHogConfig(endpointUrl) {
|
|
|
869
869
|
// src/index.ts
|
|
870
870
|
import { osInfo as getOsSystemInfo } from "systeminformation";
|
|
871
871
|
var posthogClient = null;
|
|
872
|
-
async function initializePostHog(configEndpoint) {
|
|
872
|
+
async function initializePostHog(configEndpoint, disableGeoip) {
|
|
873
873
|
let apiKey;
|
|
874
874
|
let endpoint;
|
|
875
875
|
if (configEndpoint) {
|
|
@@ -884,7 +884,8 @@ async function initializePostHog(configEndpoint) {
|
|
|
884
884
|
return null;
|
|
885
885
|
}
|
|
886
886
|
return new PostHog(apiKey, {
|
|
887
|
-
host: endpoint
|
|
887
|
+
host: endpoint,
|
|
888
|
+
disableGeoip: disableGeoip ?? true
|
|
888
889
|
});
|
|
889
890
|
}
|
|
890
891
|
function formatTemplateChoice(template) {
|
|
@@ -928,12 +929,11 @@ async function run() {
|
|
|
928
929
|
console.log(`
|
|
929
930
|
${TextStylesBold.bold("Telemetry Notice")}`);
|
|
930
931
|
console.log(
|
|
931
|
-
|
|
932
|
-
No personal or project-specific code is ever collected. You can opt out at any time by passing the --noTelemetry flag.
|
|
933
|
-
`
|
|
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"
|
|
934
933
|
);
|
|
935
934
|
posthogClient = await initializePostHog(
|
|
936
|
-
"https://identity-v2.tinajs.io/v2/posthog-token"
|
|
935
|
+
"https://identity-v2.tinajs.io/v2/posthog-token",
|
|
936
|
+
false
|
|
937
937
|
);
|
|
938
938
|
const osInfo = await getOsSystemInfo();
|
|
939
939
|
telemetryData["os-platform"] = osInfo.platform;
|
|
@@ -943,6 +943,12 @@ No personal or project-specific code is ever collected. You can opt out at any t
|
|
|
943
943
|
for (const pkgManager2 of PKG_MANAGERS) {
|
|
944
944
|
telemetryData[`${pkgManager2}-installed`] = installedPkgManagers.includes(pkgManager2);
|
|
945
945
|
}
|
|
946
|
+
if (opts.template) {
|
|
947
|
+
telemetryData["template"] = opts.template;
|
|
948
|
+
}
|
|
949
|
+
if (opts.pkgManager) {
|
|
950
|
+
telemetryData["package-manager"] = opts.pkgManager;
|
|
951
|
+
}
|
|
946
952
|
}
|
|
947
953
|
const spinner = ora();
|
|
948
954
|
preRunChecks(spinner);
|
|
@@ -972,10 +978,7 @@ No personal or project-specific code is ever collected. You can opt out at any t
|
|
|
972
978
|
errorCategory: "validation",
|
|
973
979
|
step: TRACKING_STEPS.TEMPLATE_SELECT,
|
|
974
980
|
fatal: true,
|
|
975
|
-
additionalProperties: {
|
|
976
|
-
...telemetryData,
|
|
977
|
-
provided_template: opts.template
|
|
978
|
-
}
|
|
981
|
+
additionalProperties: { ...telemetryData }
|
|
979
982
|
}
|
|
980
983
|
);
|
|
981
984
|
if (posthogClient) await posthogClient.shutdown();
|
|
@@ -985,9 +988,6 @@ No personal or project-specific code is ever collected. You can opt out at any t
|
|
|
985
988
|
let pkgManager = opts.pkgManager;
|
|
986
989
|
if (pkgManager) {
|
|
987
990
|
if (!PKG_MANAGERS.find((_pkgManager) => _pkgManager === pkgManager)) {
|
|
988
|
-
spinner.fail(
|
|
989
|
-
`The provided package manager '${opts.pkgManager}' is not supported. Please provide one of the following: ${PKG_MANAGERS}`
|
|
990
|
-
);
|
|
991
991
|
postHogCaptureError(
|
|
992
992
|
posthogClient,
|
|
993
993
|
userId,
|
|
@@ -998,13 +998,13 @@ No personal or project-specific code is ever collected. You can opt out at any t
|
|
|
998
998
|
errorCategory: "validation",
|
|
999
999
|
step: TRACKING_STEPS.PKG_MANAGER_SELECT,
|
|
1000
1000
|
fatal: true,
|
|
1001
|
-
additionalProperties: {
|
|
1002
|
-
...telemetryData,
|
|
1003
|
-
provided_pkg_manager: opts.pkgManager
|
|
1004
|
-
}
|
|
1001
|
+
additionalProperties: { ...telemetryData }
|
|
1005
1002
|
}
|
|
1006
1003
|
);
|
|
1007
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
|
+
);
|
|
1008
1008
|
exit(1);
|
|
1009
1009
|
}
|
|
1010
1010
|
}
|
|
@@ -1055,8 +1055,8 @@ No personal or project-specific code is ever collected. You can opt out at any t
|
|
|
1055
1055
|
exit(1);
|
|
1056
1056
|
}
|
|
1057
1057
|
pkgManager = res.packageManager;
|
|
1058
|
-
telemetryData["package-manager"] = pkgManager;
|
|
1059
1058
|
}
|
|
1059
|
+
telemetryData["package-manager"] = pkgManager;
|
|
1060
1060
|
let projectName = opts.projectName;
|
|
1061
1061
|
if (!projectName) {
|
|
1062
1062
|
const res = await prompts({
|
|
@@ -1163,10 +1163,7 @@ No personal or project-specific code is ever collected. You can opt out at any t
|
|
|
1163
1163
|
errorCategory: "filesystem",
|
|
1164
1164
|
step: TRACKING_STEPS.DIRECTORY_SETUP,
|
|
1165
1165
|
fatal: true,
|
|
1166
|
-
additionalProperties: {
|
|
1167
|
-
...telemetryData,
|
|
1168
|
-
template: template.value
|
|
1169
|
-
}
|
|
1166
|
+
additionalProperties: { ...telemetryData }
|
|
1170
1167
|
}
|
|
1171
1168
|
);
|
|
1172
1169
|
if (posthogClient) await posthogClient.shutdown();
|
|
@@ -1184,16 +1181,14 @@ No personal or project-specific code is ever collected. You can opt out at any t
|
|
|
1184
1181
|
errorCategory: "filesystem",
|
|
1185
1182
|
step: TRACKING_STEPS.DIRECTORY_SETUP,
|
|
1186
1183
|
fatal: true,
|
|
1187
|
-
additionalProperties: {
|
|
1188
|
-
...telemetryData,
|
|
1189
|
-
template: template.value
|
|
1190
|
-
}
|
|
1184
|
+
additionalProperties: { ...telemetryData }
|
|
1191
1185
|
});
|
|
1192
1186
|
if (posthogClient) await posthogClient.shutdown();
|
|
1193
1187
|
exit(1);
|
|
1194
1188
|
}
|
|
1195
1189
|
try {
|
|
1196
1190
|
if (themeChoice) {
|
|
1191
|
+
telemetryData["theme"] = themeChoice;
|
|
1197
1192
|
await updateThemeSettings(rootDir, themeChoice);
|
|
1198
1193
|
}
|
|
1199
1194
|
spinner.start("Downloading template...");
|
|
@@ -1211,11 +1206,7 @@ No personal or project-specific code is ever collected. You can opt out at any t
|
|
|
1211
1206
|
errorCategory: "template",
|
|
1212
1207
|
step: TRACKING_STEPS.DOWNLOADING_TEMPLATE,
|
|
1213
1208
|
fatal: true,
|
|
1214
|
-
additionalProperties: {
|
|
1215
|
-
...telemetryData,
|
|
1216
|
-
template: template.value,
|
|
1217
|
-
theme: themeChoice
|
|
1218
|
-
}
|
|
1209
|
+
additionalProperties: { ...telemetryData }
|
|
1219
1210
|
});
|
|
1220
1211
|
if (posthogClient) await posthogClient.shutdown();
|
|
1221
1212
|
exit(1);
|
|
@@ -1233,11 +1224,7 @@ No personal or project-specific code is ever collected. You can opt out at any t
|
|
|
1233
1224
|
errorCategory: "installation",
|
|
1234
1225
|
step: TRACKING_STEPS.INSTALLING_PACKAGES,
|
|
1235
1226
|
fatal: false,
|
|
1236
|
-
additionalProperties: {
|
|
1237
|
-
...telemetryData,
|
|
1238
|
-
template: template.value,
|
|
1239
|
-
package_manager: pkgManager
|
|
1240
|
-
}
|
|
1227
|
+
additionalProperties: { ...telemetryData }
|
|
1241
1228
|
});
|
|
1242
1229
|
}
|
|
1243
1230
|
spinner.start("Initializing git repository.");
|
|
@@ -1254,10 +1241,7 @@ No personal or project-specific code is ever collected. You can opt out at any t
|
|
|
1254
1241
|
errorCategory: "git",
|
|
1255
1242
|
step: TRACKING_STEPS.GIT_INIT,
|
|
1256
1243
|
fatal: false,
|
|
1257
|
-
additionalProperties: {
|
|
1258
|
-
...telemetryData,
|
|
1259
|
-
template: template.value
|
|
1260
|
-
}
|
|
1244
|
+
additionalProperties: { ...telemetryData }
|
|
1261
1245
|
});
|
|
1262
1246
|
}
|
|
1263
1247
|
postHogCapture(
|