@slicemachine/init 1.1.19-dev-release-0.7.1.0 → 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 +13 -2
- package/build/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +7 -0
- package/src/utils/noop.ts +3 -0
- package/src/utils/tracker.ts +9 -2
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:
|
|
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, () => {
|
|
@@ -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(() => {
|