@sanity/cli-core 0.0.0-20260410130107 → 0.0.0-20260413145249

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.
@@ -3,14 +3,12 @@ import { CLIError } from "@oclif/core/errors";
3
3
  import { Command } from "@oclif/core";
4
4
  import { CommandError } from "@oclif/core/interfaces";
5
5
  import { ConfigEnv } from "vite";
6
- import { ConsentStatus } from "@sanity/telemetry";
7
6
  import debugIt from "debug";
8
7
  import { InlineConfig } from "vite";
9
8
  import { Interfaces } from "@oclif/core";
10
9
  import { PluginOptions } from "babel-plugin-react-compiler";
11
10
  import { SanityClient } from "sanity";
12
11
  import { SanityClient as SanityClient_2 } from "@sanity/client";
13
- import { TelemetryLogger } from "@sanity/telemetry";
14
12
  import { URL as URL_2 } from "node:url";
15
13
  import { Worker as Worker_2 } from "node:worker_threads";
16
14
  import { WorkerOptions as WorkerOptions_2 } from "node:worker_threads";
@@ -215,6 +213,14 @@ export declare type ConsentInformation =
215
213
  status: Extract<ConsentStatus, "unset">;
216
214
  };
217
215
 
216
+ /**
217
+ * 'unknown' - we don't know if the user has consented or not (e.g. something went wrong)
218
+ * 'unset' - the user has not yet been asked for consent
219
+ * 'granted' - the user has consented
220
+ * 'denied' - the user has denied consent
221
+ */
222
+ declare type ConsentStatus = "undetermined" | "unset" | "granted" | "denied";
223
+
218
224
  /**
219
225
  * Creates a new worker for a studio worker task.
220
226
  *
@@ -256,6 +262,46 @@ export declare function createStudioWorker(
256
262
  declare const debug_2: debugIt.Debugger;
257
263
  export { debug_2 as debug };
258
264
 
265
+ declare interface DeferredEvent<
266
+ Data = unknown,
267
+ Event extends DefinedTelemetryLog<Data> = DefinedTelemetryLog<Data>,
268
+ > {
269
+ createdAt: string;
270
+ event: Event;
271
+ data: Data;
272
+ }
273
+
274
+ declare interface DefinedTelemetryLog<Schema> {
275
+ type: "log";
276
+ /** Unique name of the event */
277
+ name: string;
278
+ /** Event version. Increment this by 1 whenever the shape of the data changes in a non-backwards compatible way */
279
+ version: number;
280
+ /** Description of log event */
281
+ description?: string;
282
+ /**
283
+ * Max sample rate of this event.
284
+ * Calling telemetry.log(EventDefinition, data) repeatedly will submit at most one event every specified time interval (in milliseconds)
285
+ * */
286
+ maxSampleRate?: number;
287
+ /** Data schema. Will not be accessible at runtime */
288
+ schema: Schema;
289
+ }
290
+
291
+ declare interface DefinedTelemetryTrace<Data = void, Context = void> {
292
+ type: "trace";
293
+ /** Unique name of the trace */
294
+ name: string;
295
+ /** Trace version. Increment this by 1 whenever the shape of the data changes in a non-backwards compatible way */
296
+ version: number;
297
+ /** Description of trace */
298
+ description?: string;
299
+ /** Data schema. Will not be accessible at runtime */
300
+ schema: Data;
301
+ /** Contextual data schema. Will not be accessible at runtime */
302
+ context: Context;
303
+ }
304
+
259
305
  /**
260
306
  * This function is a replacement for built in dynamic import
261
307
  * This handles the case for windows file paths especially for absolute paths.
@@ -648,6 +694,13 @@ export declare class NonInteractiveError extends CLIError {
648
694
  constructor(promptName: string);
649
695
  }
650
696
 
697
+ /**
698
+ * Fallback logger used when telemetry has not been initialized.
699
+ * Exported for use in tests only — do not use in plugins or external code.
700
+ * @internal
701
+ */
702
+ export declare const noopLogger: CLITelemetryStore;
703
+
651
704
  /**
652
705
  * Normalizes a path for cross-platform comparison by converting backslashes to forward slashes.
653
706
  * Useful for converting windows paths to unix paths.
@@ -1305,6 +1358,30 @@ declare interface TelemetryBaseInfo {
1305
1358
  hashedToken: string;
1306
1359
  }
1307
1360
 
1361
+ /**
1362
+ * Note that `sessionId` is removed from the signature of these functions
1363
+ */
1364
+ declare interface TelemetryLogger<UserProperties> {
1365
+ updateUserProperties(properties: UserProperties): void;
1366
+ resume(events: DeferredEvent[]): void;
1367
+ log<Data>(event: DefinedTelemetryLog<Data>, data: Data): void;
1368
+ log<Data extends void>(event: DefinedTelemetryLog<Data>): void;
1369
+ trace<Data>(
1370
+ event: DefinedTelemetryTrace<Data>,
1371
+ context?: unknown,
1372
+ ): TelemetryTrace<UserProperties, Data>;
1373
+ }
1374
+
1375
+ declare interface TelemetryTrace<UserProperties, Data> {
1376
+ start(): void;
1377
+ log(data: Data): void;
1378
+ error(error: Error): void;
1379
+ complete(): void;
1380
+ newContext(name: string): TelemetryLogger<UserProperties>;
1381
+ await<P extends Promise<Data>>(promise: P): P;
1382
+ await<P extends Promise<unknown>>(promise: P, finalData: Data): P;
1383
+ }
1384
+
1308
1385
  /**
1309
1386
  * @public
1310
1387
  */
@@ -20,6 +20,7 @@ export * from '../services/cliUserConfig.js';
20
20
  export * from '../services/getCliToken.js';
21
21
  export { clearCliTelemetry, CLI_TELEMETRY_SYMBOL, getCliTelemetry, setCliTelemetry } from '../telemetry/getCliTelemetry.js';
22
22
  export { getTelemetryBaseInfo } from '../telemetry/getTelemetryBaseInfo.js';
23
+ export { noopLogger } from '../telemetry/noopTelemetry.js';
23
24
  export { doImport } from '../util/doImport.js';
24
25
  export * from '../util/environment/mockBrowserEnvironment.js';
25
26
  export * from '../util/getSanityEnvVar.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/_exports/index.ts"],"sourcesContent":["export * from '../config/cli/getCliConfig.js'\nexport * from '../config/cli/getCliConfigSync.js'\nexport {type CliConfig} from '../config/cli/types/cliConfig.js'\nexport {type UserViteConfig} from '../config/cli/types/userViteConfig.js'\nexport * from '../config/findProjectRoot.js'\nexport * from '../config/findProjectRootSync.js'\nexport * from '../config/studio/getStudioConfig.js'\nexport * from '../config/studio/getStudioWorkspaces.js'\nexport * from '../config/studio/isStudioConfig.js'\nexport * from '../config/util/findConfigsPaths.js'\nexport * from '../config/util/findStudioConfigPath.js'\nexport {type ProjectRootResult} from '../config/util/recursivelyResolveProjectRoot.js'\nexport * from '../debug.js'\nexport * from '../errors/NonInteractiveError.js'\nexport * from '../errors/NotFoundError.js'\nexport * from '../errors/ProjectRootNotFoundError.js'\nexport * from '../exitCodes.js'\nexport * from '../loaders/studio/studioWorkerTask.js'\nexport * from '../loaders/tsx/tsxWorkerTask.js'\nexport * from '../SanityCommand.js'\nexport * from '../services/apiClient.js'\nexport * from '../services/cliUserConfig.js'\nexport * from '../services/getCliToken.js'\nexport {\n clearCliTelemetry,\n CLI_TELEMETRY_SYMBOL,\n getCliTelemetry,\n setCliTelemetry,\n} from '../telemetry/getCliTelemetry.js'\nexport {getTelemetryBaseInfo} from '../telemetry/getTelemetryBaseInfo.js'\nexport {\n type CLITelemetryStore,\n type ConsentInformation,\n type TelemetryUserProperties,\n} from '../telemetry/types.js'\nexport {type Output, type SanityOrgUser} from '../types.js'\nexport {doImport} from '../util/doImport.js'\nexport * from '../util/environment/mockBrowserEnvironment.js'\nexport * from '../util/getSanityEnvVar.js'\nexport * from '../util/getSanityUrl.js'\nexport * from '../util/importModule.js'\nexport * from '../util/isCi.js'\nexport * from '../util/isInteractive.js'\nexport * from '../util/isStaging.js'\nexport * from '../util/normalizePath.js'\nexport * from '../util/promisifyWorker.js'\nexport * from '../util/readPackageJson.js'\nexport * from '../util/resolveLocalPackage.js'\nexport * from '../util/safeStructuredClone.js'\nexport * from '../ux/colorizeJson.js'\nexport * from '../ux/timer.js'\n"],"names":["clearCliTelemetry","CLI_TELEMETRY_SYMBOL","getCliTelemetry","setCliTelemetry","getTelemetryBaseInfo","doImport"],"mappings":"AAAA,cAAc,gCAA+B;AAC7C,cAAc,oCAAmC;AAGjD,cAAc,+BAA8B;AAC5C,cAAc,mCAAkC;AAChD,cAAc,sCAAqC;AACnD,cAAc,0CAAyC;AACvD,cAAc,qCAAoC;AAClD,cAAc,qCAAoC;AAClD,cAAc,yCAAwC;AAEtD,cAAc,cAAa;AAC3B,cAAc,mCAAkC;AAChD,cAAc,6BAA4B;AAC1C,cAAc,wCAAuC;AACrD,cAAc,kBAAiB;AAC/B,cAAc,wCAAuC;AACrD,cAAc,kCAAiC;AAC/C,cAAc,sBAAqB;AACnC,cAAc,2BAA0B;AACxC,cAAc,+BAA8B;AAC5C,cAAc,6BAA4B;AAC1C,SACEA,iBAAiB,EACjBC,oBAAoB,EACpBC,eAAe,EACfC,eAAe,QACV,kCAAiC;AACxC,SAAQC,oBAAoB,QAAO,uCAAsC;AAOzE,SAAQC,QAAQ,QAAO,sBAAqB;AAC5C,cAAc,gDAA+C;AAC7D,cAAc,6BAA4B;AAC1C,cAAc,0BAAyB;AACvC,cAAc,0BAAyB;AACvC,cAAc,kBAAiB;AAC/B,cAAc,2BAA0B;AACxC,cAAc,uBAAsB;AACpC,cAAc,2BAA0B;AACxC,cAAc,6BAA4B;AAC1C,cAAc,6BAA4B;AAC1C,cAAc,iCAAgC;AAC9C,cAAc,iCAAgC;AAC9C,cAAc,wBAAuB;AACrC,cAAc,iBAAgB"}
1
+ {"version":3,"sources":["../../src/_exports/index.ts"],"sourcesContent":["export * from '../config/cli/getCliConfig.js'\nexport * from '../config/cli/getCliConfigSync.js'\nexport {type CliConfig} from '../config/cli/types/cliConfig.js'\nexport {type UserViteConfig} from '../config/cli/types/userViteConfig.js'\nexport * from '../config/findProjectRoot.js'\nexport * from '../config/findProjectRootSync.js'\nexport * from '../config/studio/getStudioConfig.js'\nexport * from '../config/studio/getStudioWorkspaces.js'\nexport * from '../config/studio/isStudioConfig.js'\nexport * from '../config/util/findConfigsPaths.js'\nexport * from '../config/util/findStudioConfigPath.js'\nexport {type ProjectRootResult} from '../config/util/recursivelyResolveProjectRoot.js'\nexport * from '../debug.js'\nexport * from '../errors/NonInteractiveError.js'\nexport * from '../errors/NotFoundError.js'\nexport * from '../errors/ProjectRootNotFoundError.js'\nexport * from '../exitCodes.js'\nexport * from '../loaders/studio/studioWorkerTask.js'\nexport * from '../loaders/tsx/tsxWorkerTask.js'\nexport * from '../SanityCommand.js'\nexport * from '../services/apiClient.js'\nexport * from '../services/cliUserConfig.js'\nexport * from '../services/getCliToken.js'\nexport {\n clearCliTelemetry,\n CLI_TELEMETRY_SYMBOL,\n getCliTelemetry,\n setCliTelemetry,\n} from '../telemetry/getCliTelemetry.js'\nexport {getTelemetryBaseInfo} from '../telemetry/getTelemetryBaseInfo.js'\nexport {noopLogger} from '../telemetry/noopTelemetry.js'\nexport {\n type CLITelemetryStore,\n type ConsentInformation,\n type TelemetryUserProperties,\n} from '../telemetry/types.js'\nexport {type Output, type SanityOrgUser} from '../types.js'\nexport {doImport} from '../util/doImport.js'\nexport * from '../util/environment/mockBrowserEnvironment.js'\nexport * from '../util/getSanityEnvVar.js'\nexport * from '../util/getSanityUrl.js'\nexport * from '../util/importModule.js'\nexport * from '../util/isCi.js'\nexport * from '../util/isInteractive.js'\nexport * from '../util/isStaging.js'\nexport * from '../util/normalizePath.js'\nexport * from '../util/promisifyWorker.js'\nexport * from '../util/readPackageJson.js'\nexport * from '../util/resolveLocalPackage.js'\nexport * from '../util/safeStructuredClone.js'\nexport * from '../ux/colorizeJson.js'\nexport * from '../ux/timer.js'\n"],"names":["clearCliTelemetry","CLI_TELEMETRY_SYMBOL","getCliTelemetry","setCliTelemetry","getTelemetryBaseInfo","noopLogger","doImport"],"mappings":"AAAA,cAAc,gCAA+B;AAC7C,cAAc,oCAAmC;AAGjD,cAAc,+BAA8B;AAC5C,cAAc,mCAAkC;AAChD,cAAc,sCAAqC;AACnD,cAAc,0CAAyC;AACvD,cAAc,qCAAoC;AAClD,cAAc,qCAAoC;AAClD,cAAc,yCAAwC;AAEtD,cAAc,cAAa;AAC3B,cAAc,mCAAkC;AAChD,cAAc,6BAA4B;AAC1C,cAAc,wCAAuC;AACrD,cAAc,kBAAiB;AAC/B,cAAc,wCAAuC;AACrD,cAAc,kCAAiC;AAC/C,cAAc,sBAAqB;AACnC,cAAc,2BAA0B;AACxC,cAAc,+BAA8B;AAC5C,cAAc,6BAA4B;AAC1C,SACEA,iBAAiB,EACjBC,oBAAoB,EACpBC,eAAe,EACfC,eAAe,QACV,kCAAiC;AACxC,SAAQC,oBAAoB,QAAO,uCAAsC;AACzE,SAAQC,UAAU,QAAO,gCAA+B;AAOxD,SAAQC,QAAQ,QAAO,sBAAqB;AAC5C,cAAc,gDAA+C;AAC7D,cAAc,6BAA4B;AAC1C,cAAc,0BAAyB;AACvC,cAAc,0BAAyB;AACvC,cAAc,kBAAiB;AAC/B,cAAc,2BAA0B;AACxC,cAAc,uBAAsB;AACpC,cAAc,2BAA0B;AACxC,cAAc,6BAA4B;AAC1C,cAAc,6BAA4B;AAC1C,cAAc,iCAAgC;AAC9C,cAAc,iCAAgC;AAC9C,cAAc,wBAAuB;AACrC,cAAc,iBAAgB"}
@@ -1,5 +1,5 @@
1
1
  import { ux } from '@oclif/core';
2
- import { noopLogger } from '@sanity/telemetry';
2
+ import { noopLogger } from './noopTelemetry.js';
3
3
  /**
4
4
  * @public
5
5
  * Symbol used to store CLI telemetry state on globalThis.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/telemetry/getCliTelemetry.ts"],"sourcesContent":["import {ux} from '@oclif/core'\nimport {noopLogger} from '@sanity/telemetry'\n\nimport {type CLITelemetryStore} from './types.js'\n\n/**\n * @public\n * Symbol used to store CLI telemetry state on globalThis.\n * Use the accessor functions instead of accessing this directly.\n */\nexport const CLI_TELEMETRY_SYMBOL = Symbol.for('sanity.cli.telemetry')\n\ntype TraceErrorReporter = (error: Error) => void\n\ninterface CliTelemetryState {\n logger: CLITelemetryStore\n\n reportTraceError?: TraceErrorReporter\n}\n\ntype GlobalWithTelemetry = typeof globalThis & {\n [CLI_TELEMETRY_SYMBOL]?: CliTelemetryState\n}\n\nfunction getState(): CliTelemetryState | undefined {\n return (globalThis as GlobalWithTelemetry)[CLI_TELEMETRY_SYMBOL]\n}\n\n/**\n * @public\n */\nexport function getCliTelemetry(): CLITelemetryStore {\n const state = getState()\n // This should never happen, but if it does, we return a noop logger to avoid errors.\n if (!state) {\n ux.warn('CLI telemetry not initialized, returning noop logger')\n return noopLogger\n }\n\n return state.logger\n}\n\n/**\n * Sets the global CLI telemetry state.\n * @internal\n */\nexport function setCliTelemetry(\n telemetry: CLITelemetryStore,\n options?: {reportTraceError?: TraceErrorReporter},\n): void {\n ;(globalThis as GlobalWithTelemetry)[CLI_TELEMETRY_SYMBOL] = {\n logger: telemetry,\n reportTraceError: options?.reportTraceError,\n }\n}\n\n/**\n * Reports an error to the CLI command trace. Called from SanityCommand.catch()\n * for real command errors (not user aborts).\n * @internal\n */\nexport function reportCliTraceError(error: Error): void {\n getState()?.reportTraceError?.(error)\n}\n\n/**\n * Clears the global CLI telemetry store.\n * @internal\n */\nexport function clearCliTelemetry(): void {\n const global = globalThis as GlobalWithTelemetry\n delete global[CLI_TELEMETRY_SYMBOL]\n}\n"],"names":["ux","noopLogger","CLI_TELEMETRY_SYMBOL","Symbol","for","getState","globalThis","getCliTelemetry","state","warn","logger","setCliTelemetry","telemetry","options","reportTraceError","reportCliTraceError","error","clearCliTelemetry","global"],"mappings":"AAAA,SAAQA,EAAE,QAAO,cAAa;AAC9B,SAAQC,UAAU,QAAO,oBAAmB;AAI5C;;;;CAIC,GACD,OAAO,MAAMC,uBAAuBC,OAAOC,GAAG,CAAC,wBAAuB;AActE,SAASC;IACP,OAAO,AAACC,UAAkC,CAACJ,qBAAqB;AAClE;AAEA;;CAEC,GACD,OAAO,SAASK;IACd,MAAMC,QAAQH;IACd,qFAAqF;IACrF,IAAI,CAACG,OAAO;QACVR,GAAGS,IAAI,CAAC;QACR,OAAOR;IACT;IAEA,OAAOO,MAAME,MAAM;AACrB;AAEA;;;CAGC,GACD,OAAO,SAASC,gBACdC,SAA4B,EAC5BC,OAAiD;;IAE/CP,UAAkC,CAACJ,qBAAqB,GAAG;QAC3DQ,QAAQE;QACRE,kBAAkBD,SAASC;IAC7B;AACF;AAEA;;;;CAIC,GACD,OAAO,SAASC,oBAAoBC,KAAY;IAC9CX,YAAYS,mBAAmBE;AACjC;AAEA;;;CAGC,GACD,OAAO,SAASC;IACd,MAAMC,SAASZ;IACf,OAAOY,MAAM,CAAChB,qBAAqB;AACrC"}
1
+ {"version":3,"sources":["../../src/telemetry/getCliTelemetry.ts"],"sourcesContent":["import {ux} from '@oclif/core'\n\nimport {noopLogger} from './noopTelemetry.js'\nimport {type CLITelemetryStore} from './types.js'\n\n/**\n * @public\n * Symbol used to store CLI telemetry state on globalThis.\n * Use the accessor functions instead of accessing this directly.\n */\nexport const CLI_TELEMETRY_SYMBOL = Symbol.for('sanity.cli.telemetry')\n\ntype TraceErrorReporter = (error: Error) => void\n\ninterface CliTelemetryState {\n logger: CLITelemetryStore\n\n reportTraceError?: TraceErrorReporter\n}\n\ntype GlobalWithTelemetry = typeof globalThis & {\n [CLI_TELEMETRY_SYMBOL]?: CliTelemetryState\n}\n\nfunction getState(): CliTelemetryState | undefined {\n return (globalThis as GlobalWithTelemetry)[CLI_TELEMETRY_SYMBOL]\n}\n\n/**\n * @public\n */\nexport function getCliTelemetry(): CLITelemetryStore {\n const state = getState()\n // This should never happen, but if it does, we return a noop logger to avoid errors.\n if (!state) {\n ux.warn('CLI telemetry not initialized, returning noop logger')\n return noopLogger\n }\n\n return state.logger\n}\n\n/**\n * Sets the global CLI telemetry state.\n * @internal\n */\nexport function setCliTelemetry(\n telemetry: CLITelemetryStore,\n options?: {reportTraceError?: TraceErrorReporter},\n): void {\n ;(globalThis as GlobalWithTelemetry)[CLI_TELEMETRY_SYMBOL] = {\n logger: telemetry,\n reportTraceError: options?.reportTraceError,\n }\n}\n\n/**\n * Reports an error to the CLI command trace. Called from SanityCommand.catch()\n * for real command errors (not user aborts).\n * @internal\n */\nexport function reportCliTraceError(error: Error): void {\n getState()?.reportTraceError?.(error)\n}\n\n/**\n * Clears the global CLI telemetry store.\n * @internal\n */\nexport function clearCliTelemetry(): void {\n const global = globalThis as GlobalWithTelemetry\n delete global[CLI_TELEMETRY_SYMBOL]\n}\n"],"names":["ux","noopLogger","CLI_TELEMETRY_SYMBOL","Symbol","for","getState","globalThis","getCliTelemetry","state","warn","logger","setCliTelemetry","telemetry","options","reportTraceError","reportCliTraceError","error","clearCliTelemetry","global"],"mappings":"AAAA,SAAQA,EAAE,QAAO,cAAa;AAE9B,SAAQC,UAAU,QAAO,qBAAoB;AAG7C;;;;CAIC,GACD,OAAO,MAAMC,uBAAuBC,OAAOC,GAAG,CAAC,wBAAuB;AActE,SAASC;IACP,OAAO,AAACC,UAAkC,CAACJ,qBAAqB;AAClE;AAEA;;CAEC,GACD,OAAO,SAASK;IACd,MAAMC,QAAQH;IACd,qFAAqF;IACrF,IAAI,CAACG,OAAO;QACVR,GAAGS,IAAI,CAAC;QACR,OAAOR;IACT;IAEA,OAAOO,MAAME,MAAM;AACrB;AAEA;;;CAGC,GACD,OAAO,SAASC,gBACdC,SAA4B,EAC5BC,OAAiD;;IAE/CP,UAAkC,CAACJ,qBAAqB,GAAG;QAC3DQ,QAAQE;QACRE,kBAAkBD,SAASC;IAC7B;AACF;AAEA;;;;CAIC,GACD,OAAO,SAASC,oBAAoBC,KAAY;IAC9CX,YAAYS,mBAAmBE;AACjC;AAEA;;;CAGC,GACD,OAAO,SAASC;IACd,MAAMC,SAASZ;IACf,OAAOY,MAAM,CAAChB,qBAAqB;AACrC"}
@@ -0,0 +1,23 @@
1
+ // Inline noop implementation — avoids a runtime dependency on @sanity/telemetry
2
+ // (types-only usage keeps it as a devDependency). Explicit types ensure this
3
+ // stays structurally in sync with TelemetryLogger/TelemetryTrace.
4
+ const noopTrace = {
5
+ await: (promise)=>promise,
6
+ complete: ()=>{},
7
+ error: ()=>{},
8
+ log: ()=>{},
9
+ newContext: ()=>noopLogger,
10
+ start: ()=>{}
11
+ };
12
+ /**
13
+ * Fallback logger used when telemetry has not been initialized.
14
+ * Exported for use in tests only — do not use in plugins or external code.
15
+ * @internal
16
+ */ export const noopLogger = {
17
+ log: ()=>{},
18
+ resume: ()=>{},
19
+ trace: ()=>noopTrace,
20
+ updateUserProperties: ()=>{}
21
+ };
22
+
23
+ //# sourceMappingURL=noopTelemetry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/telemetry/noopTelemetry.ts"],"sourcesContent":["import {type TelemetryTrace} from '@sanity/telemetry'\n\nimport {type CLITelemetryStore, type TelemetryUserProperties} from './types.js'\n\n// Inline noop implementation — avoids a runtime dependency on @sanity/telemetry\n// (types-only usage keeps it as a devDependency). Explicit types ensure this\n// stays structurally in sync with TelemetryLogger/TelemetryTrace.\nconst noopTrace: TelemetryTrace<TelemetryUserProperties, never> = {\n await: <P extends Promise<unknown>>(promise: P): P => promise,\n complete: () => {},\n error: () => {},\n log: () => {},\n newContext: (): CLITelemetryStore => noopLogger,\n start: () => {},\n}\n\n/**\n * Fallback logger used when telemetry has not been initialized.\n * Exported for use in tests only — do not use in plugins or external code.\n * @internal\n */\nexport const noopLogger: CLITelemetryStore = {\n log: () => {},\n resume: () => {},\n trace: () => noopTrace,\n updateUserProperties: () => {},\n}\n"],"names":["noopTrace","await","promise","complete","error","log","newContext","noopLogger","start","resume","trace","updateUserProperties"],"mappings":"AAIA,gFAAgF;AAChF,6EAA6E;AAC7E,kEAAkE;AAClE,MAAMA,YAA4D;IAChEC,OAAO,CAA6BC,UAAkBA;IACtDC,UAAU,KAAO;IACjBC,OAAO,KAAO;IACdC,KAAK,KAAO;IACZC,YAAY,IAAyBC;IACrCC,OAAO,KAAO;AAChB;AAEA;;;;CAIC,GACD,OAAO,MAAMD,aAAgC;IAC3CF,KAAK,KAAO;IACZI,QAAQ,KAAO;IACfC,OAAO,IAAMV;IACbW,sBAAsB,KAAO;AAC/B,EAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/cli-core",
3
- "version": "0.0.0-20260410130107",
3
+ "version": "0.0.0-20260413145249",
4
4
  "description": "Sanity CLI core package",
5
5
  "keywords": [
6
6
  "cli",
@@ -90,9 +90,6 @@
90
90
  "@repo/tsconfig": "3.70.0",
91
91
  "@sanity/eslint-config-cli": "1.1.0"
92
92
  },
93
- "peerDependencies": {
94
- "@sanity/telemetry": ">=0.9.0 <0.10.0"
95
- },
96
93
  "engines": {
97
94
  "node": ">=20.19.1 <22 || >=22.12"
98
95
  },