@sanity/cli-test 15.1.0 → 16.0.1

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.
@@ -18,10 +18,9 @@ interface SetupTestFixturesOptions {
18
18
  */
19
19
  additionalFixtures?: string[];
20
20
  /**
21
- * When true, passes `--ignore-workspace` to pnpm install so fixtures get
22
- * their own node_modules even when the temp directory is inside a pnpm
23
- * workspace. Required for E2E tests that spawn the CLI binary against
24
- * fixture directories.
21
+ * When true, creates an isolated pnpm workspace so fixtures get their own
22
+ * node_modules even when the temp directory is inside another pnpm workspace.
23
+ * Required for E2E tests that spawn the CLI binary against fixture directories.
25
24
  */
26
25
  ignoreWorkspace?: boolean;
27
26
  /**
@@ -93,14 +93,17 @@ async function getAdditionalFixturePaths(fixtures) {
93
93
  const packageJsonData = JSON.parse(packageJson);
94
94
  packageJsonData.name = `${packageJsonData.name}-test`;
95
95
  await writeFile(packageJsonPath, JSON.stringify(packageJsonData, null, 2));
96
+ if (ignoreWorkspace) {
97
+ // pnpm 11 reads build-script policy from pnpm-workspace.yaml.
98
+ // A fixture-local workspace both isolates the install and applies the repository's policy.
99
+ await writeFile(join(toPath, 'pnpm-workspace.yaml'), "allowBuilds:\n '@swc/core': true\n esbuild: true\n node-pty: true\n sharp: false\n unrs-resolver: false\n");
100
+ }
96
101
  // Run pnpm install --no-lockfile in the temp directory
97
102
  try {
98
- const ignoreWsFlag = ignoreWorkspace ? ' --ignore-workspace' : '';
99
103
  // Disable pnpm's minimumReleaseAge for fixture installs. With
100
- // `--ignore-workspace`, the workspace's `minimumReleaseAgeExclude` list
101
- // is not applied, which can reject freshly-published Sanity versions
102
- // pinned in fixture package.json files.
103
- await exec(`pnpm install --prefer-offline --no-lockfile --config.minimum-release-age=0${ignoreWsFlag}`, {
104
+ // an isolated workspace, the repository's `minimumReleaseAgeExclude`
105
+ // list is not applied, which can reject freshly-published Sanity versions.
106
+ await exec(`pnpm install --prefer-offline --no-lockfile --config.minimum-release-age=0`, {
104
107
  cwd: toPath
105
108
  });
106
109
  } catch (error) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/test/setupFixtures.ts"],"sourcesContent":["import {exec as execNode} from 'node:child_process'\nimport {readFile, rm, writeFile} from 'node:fs/promises'\nimport {basename, join} from 'node:path'\nimport {promisify} from 'node:util'\n\nimport {glob} from 'tinyglobby'\nimport {type TestProject} from 'vitest/node'\n\nimport {fileExists} from '../utils/fileExists.js'\nimport {getFixturesPath, getTempPath} from '../utils/paths.js'\nimport {DEFAULT_FIXTURES} from './constants.js'\nimport {testCopyDirectory} from './testFixture.js'\n\nconst exec = promisify(execNode)\n\n/**\n * Options for setupTestFixtures\n *\n * @public\n */\nexport interface SetupTestFixturesOptions {\n /**\n * Glob patterns for additional fixture directories to set up.\n *\n * Each pattern is matched against directories in the current working directory.\n * Only directories containing a `package.json` file are included.\n *\n * @example\n * ```typescript\n * ['fixtures/*', 'dev/*']\n * ```\n */\n additionalFixtures?: string[]\n\n /**\n * When true, passes `--ignore-workspace` to pnpm install so fixtures get\n * their own node_modules even when the temp directory is inside a pnpm\n * workspace. Required for E2E tests that spawn the CLI binary against\n * fixture directories.\n */\n ignoreWorkspace?: boolean\n\n /**\n * Custom temp directory path. Defaults to process.cwd()/tmp\n */\n tempDir?: string\n}\n\nasync function getAdditionalFixturePaths(fixtures: string[]): Promise<FixtureDetails[]> {\n const paths = await glob(fixtures, {\n absolute: true,\n ignore: ['**/node_modules/**', '**/dist/**'],\n onlyDirectories: true,\n })\n\n const additionalFixtures: FixtureDetails[] = []\n\n for (const path of paths) {\n if (await fileExists(join(`${path}/package.json`))) {\n additionalFixtures.push({\n fixture: basename(path),\n fromPath: path,\n includeDist: false,\n })\n }\n }\n\n return additionalFixtures\n}\n\ninterface FixtureDetails {\n fixture: string\n fromPath: string\n includeDist: boolean\n}\n\n/**\n * Global setup function for initializing test fixtures.\n *\n * Copies fixtures from the bundled location to a temp directory\n * and installs dependencies.\n *\n * Note: Fixtures are NOT built during setup. Tests that need built\n * fixtures should build them as part of the test.\n *\n * This function is designed to be used with vitest globalSetup.\n *\n * @public\n *\n * @param options - Configuration options\n * @example\n * ```typescript\n * // In vitest.config.ts\n * export default defineConfig({\n * test: {\n * globalSetup: ['@sanity/cli-test/vitest']\n * }\n * })\n * ```\n */\nexport async function setup(_: TestProject, options: SetupTestFixturesOptions = {}): Promise<void> {\n const {additionalFixtures, ignoreWorkspace, tempDir} = options\n console.log('Initializing test environment...')\n const timerLabel = 'Test environment initialization'\n console.time(timerLabel)\n\n try {\n const fixturesDir = getFixturesPath()\n const tempDirectory = getTempPath(tempDir)\n\n const allFixturePaths: FixtureDetails[] = []\n\n // Add the default fixtures\n for (const [fixture, options] of Object.entries(DEFAULT_FIXTURES)) {\n allFixturePaths.push({\n fixture,\n fromPath: join(fixturesDir, fixture),\n includeDist: 'includeDist' in options && options.includeDist ? options.includeDist : false,\n })\n }\n\n // Add the additional fixtures\n if (additionalFixtures && additionalFixtures.length > 0) {\n const additionalFixturePaths = await getAdditionalFixturePaths(additionalFixtures)\n\n if (additionalFixturePaths.length > 0) {\n allFixturePaths.push(...additionalFixturePaths)\n } else {\n console.warn(\n `No additional fixtures found, check the glob pattern: ${additionalFixtures.join(', ')}`,\n )\n }\n }\n\n for (const {fixture, fromPath, includeDist} of allFixturePaths) {\n const toPath = join(tempDirectory, `fixture-${fixture}`)\n // Copy the fixture, excluding node_modules and dist\n await testCopyDirectory(fromPath, toPath, ['node_modules', ...(includeDist ? [] : ['dist'])])\n\n // Replace the package.json name with a temp name\n const packageJsonPath = join(toPath, 'package.json')\n const packageJson = await readFile(packageJsonPath, 'utf8')\n const packageJsonData = JSON.parse(packageJson)\n packageJsonData.name = `${packageJsonData.name}-test`\n await writeFile(packageJsonPath, JSON.stringify(packageJsonData, null, 2))\n\n // Run pnpm install --no-lockfile in the temp directory\n try {\n const ignoreWsFlag = ignoreWorkspace ? ' --ignore-workspace' : ''\n // Disable pnpm's minimumReleaseAge for fixture installs. With\n // `--ignore-workspace`, the workspace's `minimumReleaseAgeExclude` list\n // is not applied, which can reject freshly-published Sanity versions\n // pinned in fixture package.json files.\n await exec(\n `pnpm install --prefer-offline --no-lockfile --config.minimum-release-age=0${ignoreWsFlag}`,\n {cwd: toPath},\n )\n } catch (error) {\n const execError = error as {message: string; stderr?: string; stdout?: string}\n console.error('Failed to install dependencies')\n console.error(execError.stderr || execError.stdout || execError.message)\n throw new Error(\n `Error installing dependencies in ${toPath}: ${execError.stderr || execError.stdout || execError.message}`,\n {cause: error},\n )\n }\n }\n } catch (error) {\n console.error('Failed to initialize test environment!')\n throw error\n } finally {\n console.timeEnd(timerLabel)\n }\n}\n\n/**\n * Options for teardownTestFixtures\n *\n * @public\n */\nexport interface TeardownTestFixturesOptions {\n /**\n * Custom temp directory path. Defaults to process.cwd()/tmp\n */\n tempDir?: string\n}\n\n/**\n * Teardown function to clean up test fixtures.\n *\n * Removes the temp directory created by setupTestFixtures.\n *\n * This function is designed to be used with vitest globalSetup.\n *\n * @public\n *\n * @param options - Configuration options\n */\nexport async function teardown(options: TeardownTestFixturesOptions = {}): Promise<void> {\n const {tempDir} = options\n const tempDirectory = getTempPath(tempDir)\n\n // Remove the tmp directory\n await rm(tempDirectory, {force: true, maxRetries: 3, recursive: true}).catch(() => {})\n}\n"],"names":["exec","execNode","readFile","rm","writeFile","basename","join","promisify","glob","fileExists","getFixturesPath","getTempPath","DEFAULT_FIXTURES","testCopyDirectory","getAdditionalFixturePaths","fixtures","paths","absolute","ignore","onlyDirectories","additionalFixtures","path","push","fixture","fromPath","includeDist","setup","_","options","ignoreWorkspace","tempDir","console","log","timerLabel","time","fixturesDir","tempDirectory","allFixturePaths","Object","entries","length","additionalFixturePaths","warn","toPath","packageJsonPath","packageJson","packageJsonData","JSON","parse","name","stringify","ignoreWsFlag","cwd","error","execError","stderr","stdout","message","Error","cause","timeEnd","teardown","force","maxRetries","recursive","catch"],"mappings":"AAAA,SAAQA,QAAQC,QAAQ,QAAO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AAUE,MAAM,IAAIF,UAAUG,OAAO;gBACvE,MAAM,IAAIC,MACR,CAAC,iCAAiC,EAAEf,OAAO,EAAE,EAAEW,UAAUC,MAAM,IAAID,UAAUE,MAAM,IAAIF,UAAUG,OAAO,EAAE,EAC1G;oBAACE,OAAON;gBAAK;YAEjB;QACF;IACF,EAAE,OAAOA,OAAO;QACdtB,QAAQsB,KAAK,CAAC;QACd,MAAMA;IACR,SAAU;QACRtB,QAAQ6B,OAAO,CAAC3B;IAClB;AACF;AAcA;;;;;;;;;;CAUC,GACD,OAAO,eAAe4B,SAASjC,UAAuC,CAAC,CAAC;IACtE,MAAM,EAACE,OAAO,EAAC,GAAGF;IAClB,MAAMQ,gBAAgBzB,YAAYmB;IAElC,2BAA2B;IAC3B,MAAM3B,GAAGiC,eAAe;QAAC0B,OAAO;QAAMC,YAAY;QAAGC,WAAW;IAAI,GAAGC,KAAK,CAAC,KAAO;AACtF"}
1
+ {"version":3,"sources":["../../src/test/setupFixtures.ts"],"sourcesContent":["import {exec as execNode} from 'node:child_process'\nimport {readFile, rm, writeFile} from 'node:fs/promises'\nimport {basename, join} from 'node:path'\nimport {promisify} from 'node:util'\n\nimport {glob} from 'tinyglobby'\nimport {type TestProject} from 'vitest/node'\n\nimport {fileExists} from '../utils/fileExists.js'\nimport {getFixturesPath, getTempPath} from '../utils/paths.js'\nimport {DEFAULT_FIXTURES} from './constants.js'\nimport {testCopyDirectory} from './testFixture.js'\n\nconst exec = promisify(execNode)\n\n/**\n * Options for setupTestFixtures\n *\n * @public\n */\nexport interface SetupTestFixturesOptions {\n /**\n * Glob patterns for additional fixture directories to set up.\n *\n * Each pattern is matched against directories in the current working directory.\n * Only directories containing a `package.json` file are included.\n *\n * @example\n * ```typescript\n * ['fixtures/*', 'dev/*']\n * ```\n */\n additionalFixtures?: string[]\n\n /**\n * When true, creates an isolated pnpm workspace so fixtures get their own\n * node_modules even when the temp directory is inside another pnpm workspace.\n * Required for E2E tests that spawn the CLI binary against fixture directories.\n */\n ignoreWorkspace?: boolean\n\n /**\n * Custom temp directory path. Defaults to process.cwd()/tmp\n */\n tempDir?: string\n}\n\nasync function getAdditionalFixturePaths(fixtures: string[]): Promise<FixtureDetails[]> {\n const paths = await glob(fixtures, {\n absolute: true,\n ignore: ['**/node_modules/**', '**/dist/**'],\n onlyDirectories: true,\n })\n\n const additionalFixtures: FixtureDetails[] = []\n\n for (const path of paths) {\n if (await fileExists(join(`${path}/package.json`))) {\n additionalFixtures.push({\n fixture: basename(path),\n fromPath: path,\n includeDist: false,\n })\n }\n }\n\n return additionalFixtures\n}\n\ninterface FixtureDetails {\n fixture: string\n fromPath: string\n includeDist: boolean\n}\n\n/**\n * Global setup function for initializing test fixtures.\n *\n * Copies fixtures from the bundled location to a temp directory\n * and installs dependencies.\n *\n * Note: Fixtures are NOT built during setup. Tests that need built\n * fixtures should build them as part of the test.\n *\n * This function is designed to be used with vitest globalSetup.\n *\n * @public\n *\n * @param options - Configuration options\n * @example\n * ```typescript\n * // In vitest.config.ts\n * export default defineConfig({\n * test: {\n * globalSetup: ['@sanity/cli-test/vitest']\n * }\n * })\n * ```\n */\nexport async function setup(_: TestProject, options: SetupTestFixturesOptions = {}): Promise<void> {\n const {additionalFixtures, ignoreWorkspace, tempDir} = options\n console.log('Initializing test environment...')\n const timerLabel = 'Test environment initialization'\n console.time(timerLabel)\n\n try {\n const fixturesDir = getFixturesPath()\n const tempDirectory = getTempPath(tempDir)\n\n const allFixturePaths: FixtureDetails[] = []\n\n // Add the default fixtures\n for (const [fixture, options] of Object.entries(DEFAULT_FIXTURES)) {\n allFixturePaths.push({\n fixture,\n fromPath: join(fixturesDir, fixture),\n includeDist: 'includeDist' in options && options.includeDist ? options.includeDist : false,\n })\n }\n\n // Add the additional fixtures\n if (additionalFixtures && additionalFixtures.length > 0) {\n const additionalFixturePaths = await getAdditionalFixturePaths(additionalFixtures)\n\n if (additionalFixturePaths.length > 0) {\n allFixturePaths.push(...additionalFixturePaths)\n } else {\n console.warn(\n `No additional fixtures found, check the glob pattern: ${additionalFixtures.join(', ')}`,\n )\n }\n }\n\n for (const {fixture, fromPath, includeDist} of allFixturePaths) {\n const toPath = join(tempDirectory, `fixture-${fixture}`)\n // Copy the fixture, excluding node_modules and dist\n await testCopyDirectory(fromPath, toPath, ['node_modules', ...(includeDist ? [] : ['dist'])])\n\n // Replace the package.json name with a temp name\n const packageJsonPath = join(toPath, 'package.json')\n const packageJson = await readFile(packageJsonPath, 'utf8')\n const packageJsonData = JSON.parse(packageJson)\n packageJsonData.name = `${packageJsonData.name}-test`\n await writeFile(packageJsonPath, JSON.stringify(packageJsonData, null, 2))\n\n if (ignoreWorkspace) {\n // pnpm 11 reads build-script policy from pnpm-workspace.yaml.\n // A fixture-local workspace both isolates the install and applies the repository's policy.\n await writeFile(\n join(toPath, 'pnpm-workspace.yaml'),\n \"allowBuilds:\\n '@swc/core': true\\n esbuild: true\\n node-pty: true\\n sharp: false\\n unrs-resolver: false\\n\",\n )\n }\n\n // Run pnpm install --no-lockfile in the temp directory\n try {\n // Disable pnpm's minimumReleaseAge for fixture installs. With\n // an isolated workspace, the repository's `minimumReleaseAgeExclude`\n // list is not applied, which can reject freshly-published Sanity versions.\n await exec(`pnpm install --prefer-offline --no-lockfile --config.minimum-release-age=0`, {\n cwd: toPath,\n })\n } catch (error) {\n const execError = error as {message: string; stderr?: string; stdout?: string}\n console.error('Failed to install dependencies')\n console.error(execError.stderr || execError.stdout || execError.message)\n throw new Error(\n `Error installing dependencies in ${toPath}: ${execError.stderr || execError.stdout || execError.message}`,\n {cause: error},\n )\n }\n }\n } catch (error) {\n console.error('Failed to initialize test environment!')\n throw error\n } finally {\n console.timeEnd(timerLabel)\n }\n}\n\n/**\n * Options for teardownTestFixtures\n *\n * @public\n */\nexport interface TeardownTestFixturesOptions {\n /**\n * Custom temp directory path. Defaults to process.cwd()/tmp\n */\n tempDir?: string\n}\n\n/**\n * Teardown function to clean up test fixtures.\n *\n * Removes the temp directory created by setupTestFixtures.\n *\n * This function is designed to be used with vitest globalSetup.\n *\n * @public\n *\n * @param options - Configuration options\n */\nexport async function teardown(options: TeardownTestFixturesOptions = {}): Promise<void> {\n const {tempDir} = options\n const tempDirectory = getTempPath(tempDir)\n\n // Remove the tmp directory\n await rm(tempDirectory, {force: true, maxRetries: 3, recursive: true}).catch(() => {})\n}\n"],"names":["exec","execNode","readFile","rm","writeFile","basename","join","promisify","glob","fileExists","getFixturesPath","getTempPath","DEFAULT_FIXTURES","testCopyDirectory","getAdditionalFixturePaths","fixtures","paths","absolute","ignore","onlyDirectories","additionalFixtures","path","push","fixture","fromPath","includeDist","setup","_","options","ignoreWorkspace","tempDir","console","log","timerLabel","time","fixturesDir","tempDirectory","allFixturePaths","Object","entries","length","additionalFixturePaths","warn","toPath","packageJsonPath","packageJson","packageJsonData","JSON","parse","name","stringify","cwd","error","execError","stderr","stdout","message","Error","cause","timeEnd","teardown","force","maxRetries","recursive","catch"],"mappings":"AAAA,SAAQA,QAAQC,QAAQ,QAAO,qBAAoB;AACnD,SAAQC,QAAQ,EAAEC,EAAE,EAAEC,SAAS,QAAO,mBAAkB;AACxD,SAAQC,QAAQ,EAAEC,IAAI,QAAO,YAAW;AACxC,SAAQC,SAAS,QAAO,YAAW;AAEnC,SAAQC,IAAI,QAAO,aAAY;AAG/B,SAAQC,UAAU,QAAO,yBAAwB;AACjD,SAAQC,eAAe,EAAEC,WAAW,QAAO,oBAAmB;AAC9D,SAAQC,gBAAgB,QAAO,iBAAgB;AAC/C,SAAQC,iBAAiB,QAAO,mBAAkB;AAElD,MAAMb,OAAOO,UAAUN;AAkCvB,eAAea,0BAA0BC,QAAkB;IACzD,MAAMC,QAAQ,MAAMR,KAAKO,UAAU;QACjCE,UAAU;QACVC,QAAQ;YAAC;YAAsB;SAAa;QAC5CC,iBAAiB;IACnB;IAEA,MAAMC,qBAAuC,EAAE;IAE/C,KAAK,MAAMC,QAAQL,MAAO;QACxB,IAAI,MAAMP,WAAWH,KAAK,GAAGe,KAAK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AACtF"}
@@ -16,7 +16,7 @@
16
16
  "@sanity/sdk-react": "^2.13.0",
17
17
  "react": "^19.2.5",
18
18
  "react-dom": "^19.2.5",
19
- "sanity": "^6.7.0"
19
+ "sanity": "^6.11.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/react": "^19.2.14",
@@ -9,6 +9,6 @@
9
9
  "@sanity/functions": "^1.3.1"
10
10
  },
11
11
  "devDependencies": {
12
- "sanity": "^6.7.0"
12
+ "sanity": "^6.11.0"
13
13
  }
14
14
  }
@@ -15,10 +15,10 @@
15
15
  "start": "sanity start"
16
16
  },
17
17
  "dependencies": {
18
- "@sanity/vision": "^6.7.0",
18
+ "@sanity/vision": "^6.11.0",
19
19
  "react": "^19.2.5",
20
20
  "react-dom": "^19.2.5",
21
- "sanity": "^6.7.0",
21
+ "sanity": "^6.11.0",
22
22
  "styled-components": "^6.4.0"
23
23
  },
24
24
  "devDependencies": {
@@ -0,0 +1,7 @@
1
+ # federated-studio
2
+
3
+ ## 1.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - scaffold workbench configurations using the stable `defineApplication` export. ([#1823](https://github.com/sanity-io/cli/pull/1823)) ([47dba3c](https://github.com/sanity-io/cli/commit/47dba3c810c8edf3cf0eea0c8b1966ad2b49d4f4))
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "federated-studio",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "private": true,
5
5
  "keywords": [
6
6
  "sanity"
@@ -14,7 +14,7 @@
14
14
  "dependencies": {
15
15
  "react": "^19.2.5",
16
16
  "react-dom": "^19.2.5",
17
- "sanity": "^6.7.0",
17
+ "sanity": "^6.12.0",
18
18
  "styled-components": "^6.4.0"
19
19
  },
20
20
  "devDependencies": {
@@ -1,13 +1,13 @@
1
- import {defineCliConfig, unstable_defineApp} from 'sanity/cli'
1
+ import {defineApplication, defineCliConfig} from 'sanity/cli'
2
2
 
3
3
  export default defineCliConfig({
4
4
  api: {
5
5
  dataset: 'test',
6
6
  projectId: 'ppsg7ml5',
7
7
  },
8
- // Calling `unstable_defineApp` opts this studio into workbench (a
8
+ // Calling `defineApplication` opts this studio into workbench (a
9
9
  // `sanity.config.ts` is present, so it resolves to `applicationType: 'studio'`).
10
- app: unstable_defineApp({
10
+ app: defineApplication({
11
11
  organizationId: 'oSyH1iET5',
12
12
  slug: 'federated-studio',
13
13
  title: 'Federated Studio',
@@ -12,10 +12,10 @@
12
12
  "deploy-graphql": "sanity graphql deploy"
13
13
  },
14
14
  "dependencies": {
15
- "@sanity/vision": "^6.7.0",
15
+ "@sanity/vision": "^6.11.0",
16
16
  "react": "^19.2.5",
17
17
  "react-dom": "^19.2.5",
18
- "sanity": "^6.7.0",
18
+ "sanity": "^6.11.0",
19
19
  "styled-components": "^6.4.0"
20
20
  },
21
21
  "devDependencies": {
@@ -15,10 +15,10 @@
15
15
  "start": "sanity start"
16
16
  },
17
17
  "dependencies": {
18
- "@sanity/vision": "^6.7.0",
18
+ "@sanity/vision": "^6.11.0",
19
19
  "react": "^19.2.5",
20
20
  "react-dom": "^19.2.5",
21
- "sanity": "^6.7.0",
21
+ "sanity": "^6.11.0",
22
22
  "styled-components": "^6.4.0"
23
23
  },
24
24
  "devDependencies": {
@@ -16,7 +16,7 @@
16
16
  "@sanity/sdk-react": "^2.13.0",
17
17
  "react": "^19.2.5",
18
18
  "react-dom": "^19.2.5",
19
- "sanity": "^6.7.0"
19
+ "sanity": "^6.11.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/react": "^19.2.14",
@@ -15,7 +15,7 @@
15
15
  "dependencies": {
16
16
  "react": "^19.2.5",
17
17
  "react-dom": "^19.2.5",
18
- "sanity": "^6.7.0",
18
+ "sanity": "^6.11.0",
19
19
  "styled-components": "^6.4.0"
20
20
  },
21
21
  "devDependencies": {
@@ -16,10 +16,10 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@sanity/code-input": "^7.1.2",
19
- "@sanity/vision": "^6.7.0",
19
+ "@sanity/vision": "^6.11.0",
20
20
  "react": "^19.2.5",
21
21
  "react-dom": "^19.2.5",
22
- "sanity": "^6.7.0",
22
+ "sanity": "^6.11.0",
23
23
  "sanity-plugin-media": "^4.3.1",
24
24
  "styled-components": "^6.4.0",
25
25
  "vite-tsconfig-paths": "^6.1.1"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/cli-test",
3
- "version": "15.1.0",
3
+ "version": "16.0.1",
4
4
  "description": "Sanity CLI test helpers and utilities",
5
5
  "keywords": [
6
6
  "cli",
@@ -111,18 +111,21 @@
111
111
  "access": "public"
112
112
  },
113
113
  "dependencies": {
114
+ "@sanity/cli-core": "3.6.1",
114
115
  "@swc/core": "^1.15.43",
115
116
  "ansis": "^4.2.0",
116
- "esbuild": "^0.28.1",
117
+ "esbuild": "^0.28.2",
117
118
  "get-it": "^9.5.2",
118
119
  "nock": "^14.0.15",
119
- "tinyglobby": "^0.2.17",
120
- "@sanity/cli-core": "3.5.1"
120
+ "tinyglobby": "^0.2.17"
121
121
  },
122
122
  "devDependencies": {
123
123
  "@eslint/compat": "^2.1.0",
124
124
  "@oclif/core": "^4.11.14",
125
+ "@repo/package.config": "0.0.1",
126
+ "@repo/tsconfig": "3.70.0",
125
127
  "@sanity/client": "^8.4.0",
128
+ "@sanity/eslint-config-cli": "1.1.3",
126
129
  "@sanity/pkg-utils": "^12.3.4",
127
130
  "@swc/cli": "^0.8.1",
128
131
  "@types/node": "^22.20.0",
@@ -132,16 +135,13 @@
132
135
  "tsx": "^4.23.12",
133
136
  "typescript": "^6.0.3",
134
137
  "vitest": "^4.1.11",
135
- "yaml": "^2.9.0",
136
- "@repo/package.config": "0.0.1",
137
- "@repo/tsconfig": "3.70.0",
138
- "@sanity/eslint-config-cli": "1.1.3"
138
+ "yaml": "^2.9.0"
139
139
  },
140
140
  "peerDependencies": {
141
141
  "@oclif/core": "^4.0.0",
142
+ "@sanity/cli-core": "3.6.1",
142
143
  "@sanity/client": "^8.4.0",
143
- "vitest": ">=3.0.0 <5.0.0",
144
- "@sanity/cli-core": "3.5.1"
144
+ "vitest": ">=3.0.0 <5.0.0"
145
145
  },
146
146
  "engines": {
147
147
  "node": ">=22.12"