@tinacms/metrics 1.0.1 → 1.0.3
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/LICENSE +1 -1
- package/dist/index.d.ts +1 -10
- package/dist/index.js +33 -42
- package/dist/interfaces/index.d.ts +1 -10
- package/dist/telemetry/getId.d.ts +1 -10
- package/dist/telemetry/getVersion.d.ts +1 -10
- package/dist/telemetry/index.d.ts +1 -10
- package/dist/telemetry/telemetry.d.ts +1 -10
- package/package.json +5 -5
package/LICENSE
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
export * from './telemetry';
|
|
14
5
|
export * from './interfaces';
|
package/dist/index.js
CHANGED
|
@@ -1,60 +1,48 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
6
|
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));
|
|
24
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
25
7
|
var __export = (target, all) => {
|
|
26
|
-
__markAsModule(target);
|
|
27
8
|
for (var name in all)
|
|
28
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
29
10
|
};
|
|
30
|
-
var
|
|
31
|
-
if (
|
|
32
|
-
for (let key of __getOwnPropNames(
|
|
33
|
-
if (!__hasOwnProp.call(
|
|
34
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
35
16
|
}
|
|
36
|
-
return
|
|
37
|
-
};
|
|
38
|
-
var __toModule = (module2) => {
|
|
39
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
17
|
+
return to;
|
|
40
18
|
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
|
+
mod
|
|
22
|
+
));
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
41
24
|
|
|
42
25
|
// src/index.ts
|
|
43
|
-
|
|
26
|
+
var src_exports = {};
|
|
27
|
+
__export(src_exports, {
|
|
44
28
|
Telemetry: () => Telemetry
|
|
45
29
|
});
|
|
30
|
+
module.exports = __toCommonJS(src_exports);
|
|
46
31
|
|
|
47
32
|
// src/telemetry/telemetry.ts
|
|
48
|
-
var import_crypto =
|
|
33
|
+
var import_crypto = require("crypto");
|
|
49
34
|
|
|
50
35
|
// src/telemetry/getId.ts
|
|
51
|
-
var import_child_process =
|
|
36
|
+
var import_child_process = require("child_process");
|
|
52
37
|
function _getProjectIdByGit() {
|
|
53
38
|
try {
|
|
54
|
-
const originBuffer = (0, import_child_process.execSync)(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
39
|
+
const originBuffer = (0, import_child_process.execSync)(
|
|
40
|
+
`git config --local --get remote.origin.url`,
|
|
41
|
+
{
|
|
42
|
+
timeout: 1e3,
|
|
43
|
+
stdio: `pipe`
|
|
44
|
+
}
|
|
45
|
+
);
|
|
58
46
|
return String(originBuffer).trim();
|
|
59
47
|
} catch (_) {
|
|
60
48
|
return null;
|
|
@@ -65,12 +53,12 @@ function getID() {
|
|
|
65
53
|
}
|
|
66
54
|
|
|
67
55
|
// src/telemetry/telemetry.ts
|
|
68
|
-
var import_isomorphic_fetch =
|
|
56
|
+
var import_isomorphic_fetch = __toESM(require("isomorphic-fetch"));
|
|
69
57
|
|
|
70
58
|
// src/telemetry/getVersion.ts
|
|
71
|
-
var import_fs_extra =
|
|
72
|
-
var import_child_process2 =
|
|
73
|
-
var import_path =
|
|
59
|
+
var import_fs_extra = require("fs-extra");
|
|
60
|
+
var import_child_process2 = require("child_process");
|
|
61
|
+
var import_path = require("path");
|
|
74
62
|
function _executeCommand(cmd) {
|
|
75
63
|
try {
|
|
76
64
|
const originBuffer = (0, import_child_process2.execSync)(cmd, {
|
|
@@ -85,7 +73,9 @@ function _executeCommand(cmd) {
|
|
|
85
73
|
var _getPack = (rootDir) => {
|
|
86
74
|
let pack = {};
|
|
87
75
|
try {
|
|
88
|
-
const rawJSON = (0, import_fs_extra.readFileSync)(
|
|
76
|
+
const rawJSON = (0, import_fs_extra.readFileSync)(
|
|
77
|
+
(0, import_path.join)(rootDir, "package.json")
|
|
78
|
+
).toString();
|
|
89
79
|
pack = JSON.parse(rawJSON);
|
|
90
80
|
} catch (_e) {
|
|
91
81
|
}
|
|
@@ -130,14 +120,15 @@ var Telemetry = class {
|
|
|
130
120
|
data: {
|
|
131
121
|
anonymousId: id,
|
|
132
122
|
event: event.name,
|
|
133
|
-
properties:
|
|
123
|
+
properties: {
|
|
124
|
+
...event,
|
|
134
125
|
nodeVersion: process.version,
|
|
135
126
|
tinaCliVersion: getTinaCliVersion(),
|
|
136
127
|
tinaVersion: getTinaVersion(),
|
|
137
128
|
yarnVersion: getYarnVersion(),
|
|
138
129
|
npmVersion: getNpmVersion(),
|
|
139
130
|
CI: Boolean(process.env.CI)
|
|
140
|
-
}
|
|
131
|
+
}
|
|
141
132
|
}
|
|
142
133
|
};
|
|
143
134
|
await (0, import_isomorphic_fetch.default)(TINA_METRICS_ENDPOINT, {
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
interface EventsBase {
|
|
14
5
|
name: string;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
export declare function getID(): string;
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
export declare const getTinaVersion: () => any;
|
|
14
5
|
export declare const getTinaCliVersion: () => any;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
export * from './telemetry';
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
import { Events } from '../interfaces';
|
|
14
5
|
export declare class Telemetry {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/metrics",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"fs-extra": "^9.0.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@tinacms/scripts": "1.0.0",
|
|
24
23
|
"@types/fs-extra": "^9.0.11",
|
|
25
24
|
"@types/isomorphic-fetch": "^0.0.35",
|
|
26
25
|
"fs-extra": "^9.0.1",
|
|
27
|
-
"jest": "^
|
|
28
|
-
"typescript": "4.
|
|
26
|
+
"jest": "^29.5.0",
|
|
27
|
+
"typescript": "4.6.4",
|
|
28
|
+
"@tinacms/scripts": "1.1.5"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"registry": "https://registry.npmjs.org"
|
|
@@ -42,6 +42,6 @@
|
|
|
42
42
|
"test": "jest --passWithNoTests",
|
|
43
43
|
"types": "pnpm tsc",
|
|
44
44
|
"test-watch": "jest --passWithNoTests --watch",
|
|
45
|
-
"generate:schema": "
|
|
45
|
+
"generate:schema": "pnpm node scripts/generateSchema.js"
|
|
46
46
|
}
|
|
47
47
|
}
|