@mintlify/cli 4.0.1229 → 4.0.1230
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/__test__/telemetry.test.ts +0 -27
- package/bin/cli.js +0 -2
- package/bin/middlewares/telemetryMiddleware.js +0 -16
- package/bin/tsconfig.build.tsbuildinfo +1 -1
- package/bin/welcome.js +1 -4
- package/package.json +2 -2
- package/src/cli.tsx +0 -2
- package/src/middlewares/telemetryMiddleware.ts +0 -17
- package/src/welcome.ts +1 -4
- package/__test__/analytics/client.test.ts +0 -166
- package/__test__/analytics/format.test.ts +0 -137
- package/bin/analytics/client.js +0 -55
- package/bin/analytics/format.js +0 -13
- package/bin/analytics/index.js +0 -509
- package/bin/analytics/output.js +0 -75
- package/bin/analytics/types.js +0 -1
- package/src/analytics/client.ts +0 -146
- package/src/analytics/format.ts +0 -13
- package/src/analytics/index.tsx +0 -605
- package/src/analytics/output.ts +0 -99
- package/src/analytics/types.ts +0 -132
|
@@ -71,33 +71,6 @@ describe('getSanitizedCommandForTelemetry', () => {
|
|
|
71
71
|
expect(getSanitizedCommandForTelemetry(['new', './my-docs'])).toBe('new');
|
|
72
72
|
});
|
|
73
73
|
|
|
74
|
-
it('includes known analytics subcommands', () => {
|
|
75
|
-
expect(getSanitizedCommandForTelemetry(['analytics', 'stats'])).toBe('analytics stats');
|
|
76
|
-
expect(getSanitizedCommandForTelemetry(['analytics', 'search'])).toBe('analytics search');
|
|
77
|
-
expect(getSanitizedCommandForTelemetry(['analytics', 'feedback'])).toBe('analytics feedback');
|
|
78
|
-
expect(getSanitizedCommandForTelemetry(['analytics', 'conversation'])).toBe(
|
|
79
|
-
'analytics conversation'
|
|
80
|
-
);
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('includes analytics conversation subcommands', () => {
|
|
84
|
-
expect(getSanitizedCommandForTelemetry(['analytics', 'conversation', 'list'])).toBe(
|
|
85
|
-
'analytics conversation list'
|
|
86
|
-
);
|
|
87
|
-
expect(getSanitizedCommandForTelemetry(['analytics', 'conversation', 'view', 'abc123'])).toBe(
|
|
88
|
-
'analytics conversation view'
|
|
89
|
-
);
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
it('includes analytics conversation buckets subcommands', () => {
|
|
93
|
-
expect(getSanitizedCommandForTelemetry(['analytics', 'conversation', 'buckets', 'list'])).toBe(
|
|
94
|
-
'analytics conversation buckets list'
|
|
95
|
-
);
|
|
96
|
-
expect(
|
|
97
|
-
getSanitizedCommandForTelemetry(['analytics', 'conversation', 'buckets', 'view', 'abc123'])
|
|
98
|
-
).toBe('analytics conversation buckets view');
|
|
99
|
-
});
|
|
100
|
-
|
|
101
74
|
it('includes known config subcommands', () => {
|
|
102
75
|
expect(getSanitizedCommandForTelemetry(['config', 'set', 'subdomain', 'my-docs'])).toBe(
|
|
103
76
|
'config set'
|
package/bin/cli.js
CHANGED
|
@@ -16,7 +16,6 @@ import path from 'path';
|
|
|
16
16
|
import yargs from 'yargs';
|
|
17
17
|
import { hideBin } from 'yargs/helpers';
|
|
18
18
|
import { accessibilityCheck } from './accessibilityCheck.js';
|
|
19
|
-
import { analyticsBuilder } from './analytics/index.js';
|
|
20
19
|
import { comingSoon } from './comingSoon.js';
|
|
21
20
|
import { setTelemetryEnabled } from './config.js';
|
|
22
21
|
import { getConfigValue, setConfigValue, clearConfigValue } from './config.js';
|
|
@@ -455,7 +454,6 @@ export const cli = ({ packageName = 'mint' }) => {
|
|
|
455
454
|
yield terminate(1);
|
|
456
455
|
}
|
|
457
456
|
}))
|
|
458
|
-
.command('analytics', 'View analytics for your documentation', analyticsBuilder)
|
|
459
457
|
.command('workflow', 'Create and manage workflows', workflowsBuilder)
|
|
460
458
|
.command('score [url]', 'Run agent readiness checks on a docs site', (yargs) => yargs
|
|
461
459
|
.positional('url', {
|
|
@@ -11,35 +11,19 @@ import { getConfigValue } from '../config.js';
|
|
|
11
11
|
import { getVersions } from '../helpers.js';
|
|
12
12
|
import { trackCommand } from '../telemetry/track.js';
|
|
13
13
|
const SCRAPE_SUBCOMMANDS = new Set(['page', 'site', 'openapi']);
|
|
14
|
-
const ANALYTICS_SUBCOMMANDS = new Set(['stats', 'search', 'feedback', 'conversation']);
|
|
15
14
|
const CONFIG_SUBCOMMANDS = new Set(['set', 'get', 'clear']);
|
|
16
|
-
const CONVERSATION_SUBCOMMANDS = new Set(['list', 'view', 'buckets']);
|
|
17
|
-
const BUCKETS_SUBCOMMANDS = new Set(['list', 'view']);
|
|
18
15
|
export function getSanitizedCommandForTelemetry(_) {
|
|
19
16
|
const parts = _.filter((p) => typeof p === 'string');
|
|
20
17
|
if (parts.length === 0)
|
|
21
18
|
return '';
|
|
22
19
|
const first = parts[0];
|
|
23
20
|
const second = parts[1];
|
|
24
|
-
const third = parts[2];
|
|
25
21
|
if (first === 'scrape' && second !== undefined && SCRAPE_SUBCOMMANDS.has(second)) {
|
|
26
22
|
return `scrape ${second}`;
|
|
27
23
|
}
|
|
28
24
|
if (first === 'config' && second !== undefined && CONFIG_SUBCOMMANDS.has(second)) {
|
|
29
25
|
return `config ${second}`;
|
|
30
26
|
}
|
|
31
|
-
if (first === 'analytics' && second !== undefined && ANALYTICS_SUBCOMMANDS.has(second)) {
|
|
32
|
-
if (second === 'conversation' && third !== undefined) {
|
|
33
|
-
if (CONVERSATION_SUBCOMMANDS.has(third)) {
|
|
34
|
-
const fourth = parts[3];
|
|
35
|
-
if (third === 'buckets' && fourth !== undefined && BUCKETS_SUBCOMMANDS.has(fourth)) {
|
|
36
|
-
return `analytics conversation buckets ${fourth}`;
|
|
37
|
-
}
|
|
38
|
-
return `analytics conversation ${third}`;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return `analytics ${second}`;
|
|
42
|
-
}
|
|
43
27
|
return first;
|
|
44
28
|
}
|
|
45
29
|
export function createTelemetryMiddleware() {
|