@slicemachine/init 1.1.18 → 1.1.19-dev-release-feb.0

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/build/index.js CHANGED
@@ -72,6 +72,8 @@ const fsExtra__default = /*#__PURE__*/_interopDefaultLegacy(fsExtra);
72
72
  const axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
73
73
  const Libraries__namespace = /*#__PURE__*/_interopNamespace(Libraries);
74
74
 
75
+ const noop = () => void 0;
76
+
75
77
  var __accessCheck = (obj, member, msg) => {
76
78
  if (!member.has(obj))
77
79
  throw TypeError("Cannot " + msg);
@@ -112,7 +114,10 @@ class InitTracker {
112
114
  return;
113
115
  __privateSet(this, _isTrackingActive, isTrackingActive);
114
116
  __privateSet(this, _anonymousId, uuid.v4());
115
- __privateSet(this, _client, new ServerAnalytics__default["default"](segmentKey));
117
+ __privateSet(this, _client, new ServerAnalytics__default["default"](segmentKey, {
118
+ flushAt: 1,
119
+ errorHandler: noop
120
+ }));
116
121
  } catch (error) {
117
122
  }
118
123
  }
@@ -125,7 +130,10 @@ class InitTracker {
125
130
  const payload = {
126
131
  event: eventType,
127
132
  ...identifier,
128
- properties: attributes,
133
+ properties: {
134
+ ...attributes,
135
+ nodeVersion: process.versions.node
136
+ },
129
137
  ...__privateGet(this, _repository) ? { context: { groupId: { Repository: __privateGet(this, _repository) } } } : {}
130
138
  };
131
139
  return __privateGet(this, _client).track(payload, () => {
@@ -3349,7 +3357,7 @@ async function init() {
3349
3357
  const isTrackingAvailable = findArgument(process.argv, "tracking") !== "false";
3350
3358
  const preSelectedRepository = findArgument(process.argv, "repository");
3351
3359
  const pushDocuments = !findFlag(process.argv, "no-docs");
3352
- Tracker.get().initialize("ED3O1FVsa8DteNyRmAuDyMcPoftJ6VdP" , isTrackingAvailable);
3360
+ Tracker.get().initialize("JfTfmHaATChc4xueS7RcCBsixI71dJIJ" , isTrackingAvailable);
3353
3361
  void Tracker.get().trackInitStart(preSelectedRepository);
3354
3362
  const client$1 = new InitClient(mode, null, Prismic__default["default"].PrismicSharedConfigManager.getAuth());
3355
3363
  console.log(purple("You're about to configure Slicemachine... Press ctrl + C to cancel"));
@@ -3366,6 +3374,9 @@ async function init() {
3366
3374
  await configureProject(client$1, cwd, repository, frameworkResult, sliceLibPath, isTrackingAvailable);
3367
3375
  await installRequiredDependencies(cwd, frameworkResult.value, wasStarter, frameworkResult.version);
3368
3376
  setVersion(cwd);
3377
+ if (isTrackingAvailable) {
3378
+ writeInfo("We use tracking tools to improve user experience. Learn more: https://prismic.io/docs/slice-machine#tracking");
3379
+ }
3369
3380
  displayFinalMessage(cwd, wasStarter, repository, client$1.apisEndpoints.Wroom);
3370
3381
  }
3371
3382
  init().then(() => {