@tinacms/metrics 0.0.1 → 0.0.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/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # @tinacms/metrics
2
+
3
+ ## 0.0.2
4
+ ### Patch Changes
5
+
6
+ - 8bf0ac832: Update the shape of the mertics payload
7
+ - a05546eb4: Added basic open source telemetry
8
+
9
+ See [this discussion](https://github.com/tinacms/tinacms/discussions/2451) for more information and how to opt out.
package/dist/index.js CHANGED
@@ -1,9 +1,26 @@
1
1
  var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
8
  var __getProtoOf = Object.getPrototypeOf;
6
9
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues = (a, b) => {
13
+ for (var prop in b || (b = {}))
14
+ if (__hasOwnProp.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ if (__getOwnPropSymbols)
17
+ for (var prop of __getOwnPropSymbols(b)) {
18
+ if (__propIsEnum.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ }
21
+ return a;
22
+ };
23
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7
24
  var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
25
  var __export = (target, all) => {
9
26
  __markAsModule(target);
@@ -113,17 +130,14 @@ var Telemetry = class {
113
130
  data: {
114
131
  anonymousId: id,
115
132
  event: event.name,
116
- properties: {
117
- event,
118
- system: {
119
- nodeVersion: process.version,
120
- tinaCliVersion: getTinaCliVersion(),
121
- tinaVersion: getTinaVersion(),
122
- yarnVersion: getYarnVersion(),
123
- npmVersion: getNpmVersion(),
124
- CI: Boolean(process.env.CI)
125
- }
126
- }
133
+ properties: __spreadProps(__spreadValues({}, event), {
134
+ nodeVersion: process.version,
135
+ tinaCliVersion: getTinaCliVersion(),
136
+ tinaVersion: getTinaVersion(),
137
+ yarnVersion: getYarnVersion(),
138
+ npmVersion: getNpmVersion(),
139
+ CI: Boolean(process.env.CI)
140
+ })
127
141
  }
128
142
  };
129
143
  await (0, import_isomorphic_fetch.default)(TINA_METRICS_ENDPOINT, {
@@ -34,22 +34,25 @@ export interface TinaCMSServerError extends EventsBase {
34
34
  errorMessage: string;
35
35
  }
36
36
  export declare type Events = CreateTinaAppInvoke | TinaCMSAuditInvoke | TinaCMSInitInvoke | TinaCMSServerStartInvoke | TinaCMSServerError;
37
+ declare type Merge<A, B> = {
38
+ [K in keyof A]: K extends keyof B ? B[K] : A[K];
39
+ } & B extends infer O ? {
40
+ [K in keyof O]: O[K];
41
+ } : never;
42
+ declare type EventBaseProperties = {
43
+ nodeVersion: string;
44
+ tinaCliVersion: string;
45
+ tinaVersion: string;
46
+ yarnVersion: string;
47
+ npmVersion: string;
48
+ CI: boolean;
49
+ };
37
50
  export interface MetricPayload {
38
51
  partitionKey: string;
39
52
  data: {
40
53
  anonymousId: string;
41
54
  event: Events['name'];
42
- properties: {
43
- event: Events;
44
- system: {
45
- nodeVersion: string;
46
- tinaCliVersion: string;
47
- tinaVersion: string;
48
- yarnVersion: string;
49
- npmVersion: string;
50
- CI: boolean;
51
- };
52
- };
55
+ properties: Merge<Events, EventBaseProperties>;
53
56
  };
54
57
  }
55
58
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/metrics",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "files": [
@@ -20,7 +20,7 @@
20
20
  "fs-extra": "^9.0.1"
21
21
  },
22
22
  "devDependencies": {
23
- "@tinacms/scripts": "0.50.5",
23
+ "@tinacms/scripts": "0.50.6",
24
24
  "@types/fs-extra": "^9.0.11",
25
25
  "@types/isomorphic-fetch": "^0.0.35",
26
26
  "fs-extra": "^9.0.1",