@sanity/cli-test 0.2.1 → 0.2.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.
@@ -15,7 +15,9 @@ import { vi } from 'vitest';
15
15
  updateUserProperties: vi.fn(),
16
16
  ...options
17
17
  };
18
- globalThis[Symbol.for('sanity.cli.telemetry')] = telemetry;
18
+ globalThis[Symbol.for('sanity.cli.telemetry')] = {
19
+ logger: telemetry
20
+ };
19
21
  return telemetry;
20
22
  };
21
23
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/test/mockTelemetry.ts"],"sourcesContent":["import {type CLITelemetryStore} from '@sanity/cli-core'\nimport {vi} from 'vitest'\n\n/**\n * @public\n */\nexport interface MockTelemetryOptions {\n trace?: () => void\n updateUserProperties?: () => void\n}\n\n/**\n * @public\n * @param options - Options for mocking the telemetry store.\n * @returns The mocked telemetry store.\n */\nexport const mockTelemetry = (options: MockTelemetryOptions = {}): CLITelemetryStore => {\n const telemetry = {\n trace: vi.fn().mockReturnValue({\n complete: vi.fn(),\n error: vi.fn(),\n log: vi.fn(),\n newContext: vi.fn(),\n start: vi.fn(),\n }),\n updateUserProperties: vi.fn(),\n ...options,\n } as unknown as CLITelemetryStore\n\n // We are not using the export from @sanity/cli-core because\n // This can be used where `@sanity/cli-core` is mocked and vitest will run into issues.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(globalThis as any)[Symbol.for('sanity.cli.telemetry')] = telemetry\n\n return telemetry\n}\n"],"names":["vi","mockTelemetry","options","telemetry","trace","fn","mockReturnValue","complete","error","log","newContext","start","updateUserProperties","globalThis","Symbol","for"],"mappings":"AACA,SAAQA,EAAE,QAAO,SAAQ;AAUzB;;;;CAIC,GACD,OAAO,MAAMC,gBAAgB,CAACC,UAAgC,CAAC,CAAC;IAC9D,MAAMC,YAAY;QAChBC,OAAOJ,GAAGK,EAAE,GAAGC,eAAe,CAAC;YAC7BC,UAAUP,GAAGK,EAAE;YACfG,OAAOR,GAAGK,EAAE;YACZI,KAAKT,GAAGK,EAAE;YACVK,YAAYV,GAAGK,EAAE;YACjBM,OAAOX,GAAGK,EAAE;QACd;QACAO,sBAAsBZ,GAAGK,EAAE;QAC3B,GAAGH,OAAO;IACZ;IAKEW,UAAkB,CAACC,OAAOC,GAAG,CAAC,wBAAwB,GAAGZ;IAE3D,OAAOA;AACT,EAAC"}
1
+ {"version":3,"sources":["../../src/test/mockTelemetry.ts"],"sourcesContent":["import {type CLITelemetryStore} from '@sanity/cli-core'\nimport {vi} from 'vitest'\n\n/**\n * @public\n */\nexport interface MockTelemetryOptions {\n trace?: () => void\n updateUserProperties?: () => void\n}\n\n/**\n * @public\n * @param options - Options for mocking the telemetry store.\n * @returns The mocked telemetry store.\n */\nexport const mockTelemetry = (options: MockTelemetryOptions = {}): CLITelemetryStore => {\n const telemetry = {\n trace: vi.fn().mockReturnValue({\n complete: vi.fn(),\n error: vi.fn(),\n log: vi.fn(),\n newContext: vi.fn(),\n start: vi.fn(),\n }),\n updateUserProperties: vi.fn(),\n ...options,\n } as unknown as CLITelemetryStore\n\n // We are not using the export from @sanity/cli-core because\n // This can be used where `@sanity/cli-core` is mocked and vitest will run into issues.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(globalThis as any)[Symbol.for('sanity.cli.telemetry')] = {logger: telemetry}\n\n return telemetry\n}\n"],"names":["vi","mockTelemetry","options","telemetry","trace","fn","mockReturnValue","complete","error","log","newContext","start","updateUserProperties","globalThis","Symbol","for","logger"],"mappings":"AACA,SAAQA,EAAE,QAAO,SAAQ;AAUzB;;;;CAIC,GACD,OAAO,MAAMC,gBAAgB,CAACC,UAAgC,CAAC,CAAC;IAC9D,MAAMC,YAAY;QAChBC,OAAOJ,GAAGK,EAAE,GAAGC,eAAe,CAAC;YAC7BC,UAAUP,GAAGK,EAAE;YACfG,OAAOR,GAAGK,EAAE;YACZI,KAAKT,GAAGK,EAAE;YACVK,YAAYV,GAAGK,EAAE;YACjBM,OAAOX,GAAGK,EAAE;QACd;QACAO,sBAAsBZ,GAAGK,EAAE;QAC3B,GAAGH,OAAO;IACZ;IAKEW,UAAkB,CAACC,OAAOC,GAAG,CAAC,wBAAwB,GAAG;QAACC,QAAQb;IAAS;IAE7E,OAAOA;AACT,EAAC"}
@@ -1,7 +1,7 @@
1
1
  import {defineCliConfig} from 'sanity/cli'
2
2
  import tsconfigPaths from 'vite-tsconfig-paths'
3
3
 
4
- // eslint-disable-next-line import/no-unresolved
4
+ // eslint-disable-next-line import-x/no-unresolved
5
5
  import {defines} from '@/defines'
6
6
 
7
7
  export default defineCliConfig({
@@ -1,6 +1,6 @@
1
1
  import {codeInput} from '@sanity/code-input'
2
2
  import {visionTool} from '@sanity/vision'
3
- // eslint-disable-next-line import/no-unresolved
3
+ // eslint-disable-next-line import-x/no-unresolved
4
4
  import {theme} from 'https://themer.sanity.build/api/hues?preset=dew'
5
5
  import {defineConfig, defineField, defineType} from 'sanity'
6
6
  import {media} from 'sanity-plugin-media'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/cli-test",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Sanity CLI test helpers and utilities",
5
5
  "keywords": [
6
6
  "cli",
@@ -66,14 +66,14 @@
66
66
  "yaml": "^2.8.2",
67
67
  "@repo/package.config": "0.0.1",
68
68
  "@repo/tsconfig": "3.70.0",
69
- "@sanity/cli-core": "1.0.1",
69
+ "@sanity/cli-core": "1.1.0",
70
70
  "@sanity/eslint-config-cli": "1.0.0"
71
71
  },
72
72
  "peerDependencies": {
73
73
  "@oclif/core": "^4.0.0",
74
74
  "@sanity/client": "^7.0.0",
75
75
  "vitest": ">=3.0.0 <5.0.0",
76
- "@sanity/cli-core": "1.0.1"
76
+ "@sanity/cli-core": "1.1.0"
77
77
  },
78
78
  "engines": {
79
79
  "node": ">=20.19.1 <22 || >=22.12"