@sanity/cli-test 0.3.1 → 0.3.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.
package/dist/index.d.ts CHANGED
@@ -110,6 +110,24 @@ export declare interface CreateTestClientOptions extends ClientConfig {
110
110
  */
111
111
  export declare function createTestToken(token: string): void;
112
112
 
113
+ /**
114
+ * Creates a unique temporary directory for test output.
115
+ * Uses {@link getTempPath} as the base, creating it if needed.
116
+ *
117
+ * @param options - Configuration options: `prefix` (default: 'cli-e2e-') and
118
+ * `useSystemTmp` (default: false) which uses the OS temp directory instead of
119
+ * cwd/tmp to avoid monorepo workspace detection by package managers and git.
120
+ * @returns The path and a cleanup function
121
+ * @public
122
+ */
123
+ export declare function createTmpDir(options?: {
124
+ prefix?: string;
125
+ useSystemTmp?: boolean;
126
+ }): Promise<{
127
+ cleanup: () => Promise<void>;
128
+ path: string;
129
+ }>;
130
+
113
131
  /**
114
132
  * Default fixtures bundled with the package and their options.
115
133
  *
@@ -359,6 +377,13 @@ export declare interface SetupTestFixturesOptions {
359
377
  * ```
360
378
  */
361
379
  additionalFixtures?: string[];
380
+ /**
381
+ * When true, passes `--ignore-workspace` to pnpm install so fixtures get
382
+ * their own node_modules even when the temp directory is inside a pnpm
383
+ * workspace. Required for E2E tests that spawn the CLI binary against
384
+ * fixture directories.
385
+ */
386
+ ignoreWorkspace?: boolean;
362
387
  /**
363
388
  * Custom temp directory path. Defaults to process.cwd()/tmp
364
389
  */
@@ -496,9 +521,15 @@ export declare function testFixture(
496
521
  */
497
522
  export declare interface TestFixtureOptions {
498
523
  /**
499
- * Custom temp directory. Defaults to process.cwd()/tmp
524
+ * Custom temp directory. Defaults to process.cwd()/tmp (or the OS temp directory when
525
+ * `useSystemTmp` is true).
500
526
  */
501
527
  tempDir?: string;
528
+ /**
529
+ * Use the OS temp directory instead of cwd/tmp. Avoids monorepo workspace detection by
530
+ * package managers and git when tests run inside a monorepo. Ignored when `tempDir` is set.
531
+ */
532
+ useSystemTmp?: boolean;
502
533
  }
503
534
 
504
535
  /**
@@ -54,7 +54,7 @@ async function getAdditionalFixturePaths(fixtures) {
54
54
  * })
55
55
  * ```
56
56
  */ export async function setup(_, options = {}) {
57
- const { additionalFixtures, tempDir } = options;
57
+ const { additionalFixtures, ignoreWorkspace, tempDir } = options;
58
58
  const spinner = ora({
59
59
  // Without this, the watch mode input is discarded
60
60
  discardStdin: false,
@@ -98,7 +98,12 @@ async function getAdditionalFixturePaths(fixtures) {
98
98
  await writeFile(packageJsonPath, JSON.stringify(packageJsonData, null, 2));
99
99
  // Run pnpm install --no-lockfile in the temp directory
100
100
  try {
101
- await exec(`pnpm install --prefer-offline --no-lockfile`, {
101
+ const ignoreWsFlag = ignoreWorkspace ? ' --ignore-workspace' : '';
102
+ // Disable pnpm's minimumReleaseAge for fixture installs. With
103
+ // `--ignore-workspace`, the workspace's `minimumReleaseAgeExclude` list
104
+ // is not applied, which can reject freshly-published Sanity versions
105
+ // pinned in fixture package.json files.
106
+ await exec(`pnpm install --prefer-offline --no-lockfile --config.minimum-release-age=0${ignoreWsFlag}`, {
102
107
  cwd: toPath
103
108
  });
104
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 ora from 'ora'\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 * 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, tempDir} = options\n\n const spinner = ora({\n // Without this, the watch mode input is discarded\n discardStdin: false,\n text: 'Initializing test environment...',\n }).start()\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 spinner.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 await exec(`pnpm install --prefer-offline --no-lockfile`, {\n cwd: toPath,\n })\n } catch (error) {\n const execError = error as {message: string; stderr?: string; stdout?: string}\n spinner.fail('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\n spinner.succeed('Test environment initialized')\n } catch (error) {\n spinner.fail('Failed to initialize test environment')\n throw error\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","ora","glob","fileExists","getFixturesPath","getTempPath","DEFAULT_FIXTURES","testCopyDirectory","getAdditionalFixturePaths","fixtures","paths","absolute","ignore","onlyDirectories","additionalFixtures","path","push","fixture","fromPath","includeDist","setup","_","options","tempDir","spinner","discardStdin","text","start","fixturesDir","tempDirectory","allFixturePaths","Object","entries","length","additionalFixturePaths","warn","toPath","packageJsonPath","packageJson","packageJsonData","JSON","parse","name","stringify","cwd","error","execError","fail","console","stderr","stdout","message","Error","cause","succeed","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,OAAOC,SAAS,MAAK;AACrB,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,MAAMd,OAAOO,UAAUN;AA2BvB,eAAec,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,WAAWJ,KAAK,GAAGgB,KAAK,aAAa,CAAC,IAAI;YAClDD,mBAAmBE,IAAI,CAAC;gBACtBC,SAASnB,SAASiB;gBAClBG,UAAUH;gBACVI,aAAa;YACf;QACF;IACF;IAEA,OAAOL;AACT;AAQA;;;;;;;;;;;;;;;;;;;;;;;CAuBC,GACD,OAAO,eAAeM,MAAMC,CAAc,EAAEC,UAAoC,CAAC,CAAC;IAChF,M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AUwC,iBAAiBG,KAAKG,SAAS,CAACJ,iBAAiB,MAAM;YAEvE,uDAAuD;YACvD,IAAI;gBACF,MAAM9C,KAAK,CAAC,2CAA2C,CAAC,EAAE;oBACxDmD,KAAKR;gBACP;YACF,EAAE,OAAOS,OAAO;gBACd,MAAMC,YAAYD;gBAClBrB,QAAQuB,IAAI,CAAC;gBACbC,QAAQH,KAAK,CAACC,UAAUG,MAAM,IAAIH,UAAUI,MAAM,IAAIJ,UAAUK,OAAO;gBACvE,MAAM,IAAIC,MACR,CAAC,iCAAiC,EAAEhB,OAAO,EAAE,EAAEU,UAAUG,MAAM,IAAIH,UAAUI,MAAM,IAAIJ,UAAUK,OAAO,EAAE,EAC1G;oBAACE,OAAOR;gBAAK;YAEjB;QACF;QAEArB,QAAQ8B,OAAO,CAAC;IAClB,EAAE,OAAOT,OAAO;QACdrB,QAAQuB,IAAI,CAAC;QACb,MAAMF;IACR;AACF;AAcA;;;;;;;;;;CAUC,GACD,OAAO,eAAeU,SAASjC,UAAuC,CAAC,CAAC;IACtE,MAAM,EAACC,OAAO,EAAC,GAAGD;IAClB,MAAMO,gBAAgBxB,YAAYkB;IAElC,2BAA2B;IAC3B,MAAM3B,GAAGiC,eAAe;QAAC2B,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 ora from 'ora'\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\n const spinner = ora({\n // Without this, the watch mode input is discarded\n discardStdin: false,\n text: 'Initializing test environment...',\n }).start()\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 spinner.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 spinner.fail('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\n spinner.succeed('Test environment initialized')\n } catch (error) {\n spinner.fail('Failed to initialize test environment')\n throw error\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","ora","glob","fileExists","getFixturesPath","getTempPath","DEFAULT_FIXTURES","testCopyDirectory","getAdditionalFixturePaths","fixtures","paths","absolute","ignore","onlyDirectories","additionalFixtures","path","push","fixture","fromPath","includeDist","setup","_","options","ignoreWorkspace","tempDir","spinner","discardStdin","text","start","fixturesDir","tempDirectory","allFixturePaths","Object","entries","length","additionalFixturePaths","warn","toPath","packageJsonPath","packageJson","packageJsonData","JSON","parse","name","stringify","ignoreWsFlag","cwd","error","execError","fail","console","stderr","stdout","message","Error","cause","succeed","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,OAAOC,SAAS,MAAK;AACrB,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,MAAMd,OAAOO,UAAUN;AAmCvB,eAAec,0BAA0BC,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AC;IACtE,MAAM,EAACE,OAAO,EAAC,GAAGF;IAClB,MAAMQ,gBAAgBzB,YAAYmB;IAElC,2BAA2B;IAC3B,MAAM5B,GAAGkC,eAAe;QAAC4B,OAAO;QAAMC,YAAY;QAAGC,WAAW;IAAI,GAAGC,KAAK,CAAC,KAAO;AACtF"}
@@ -1,5 +1,6 @@
1
1
  import { randomBytes } from 'node:crypto';
2
2
  import { copyFile, mkdir, readdir, readFile, stat, symlink, writeFile } from 'node:fs/promises';
3
+ import { tmpdir } from 'node:os';
3
4
  import { join } from 'node:path';
4
5
  import { getFixturesPath, getTempPath } from '../utils/paths.js';
5
6
  import { DEFAULT_FIXTURES } from './constants.js';
@@ -55,11 +56,19 @@ import { DEFAULT_FIXTURES } from './constants.js';
55
56
  * })
56
57
  * ```
57
58
  */ export async function testFixture(fixtureName, options = {}) {
58
- const { tempDir } = options;
59
+ const { tempDir, useSystemTmp = false } = options;
59
60
  const { includeDist = false } = fixtureName in DEFAULT_FIXTURES ? DEFAULT_FIXTURES[fixtureName] : {};
60
- const tempDirectory = getTempPath(tempDir);
61
- // Fixtures are cloned in the tmp directory by the setup function
62
- let tempFixturePath = join(tempDirectory, `fixture-${fixtureName}`);
61
+ // Source is always looked up in the default temp path (cwd/tmp) where global setup
62
+ // pre-clones fixtures and installs their node_modules. The destination can be redirected
63
+ // to system tmp to keep the working copy out of the monorepo (avoids pnpm treating it as
64
+ // a workspace importer and mutating pnpm-lock.yaml).
65
+ const sourceTempDir = getTempPath(tempDir);
66
+ const destTempDir = tempDir ? sourceTempDir : useSystemTmp ? join(tmpdir(), 'sanity-cli-e2e') : sourceTempDir;
67
+ await mkdir(destTempDir, {
68
+ recursive: true
69
+ });
70
+ // Fixtures are cloned in the source tmp directory by the setup function
71
+ let tempFixturePath = join(sourceTempDir, `fixture-${fixtureName}`);
63
72
  try {
64
73
  const stats = await stat(tempFixturePath);
65
74
  if (!stats.isDirectory()) {
@@ -74,7 +83,7 @@ import { DEFAULT_FIXTURES } from './constants.js';
74
83
  }
75
84
  }
76
85
  const tempId = randomBytes(8).toString('hex');
77
- const tempPath = join(tempDirectory, `fixture-${fixtureName}-${tempId}`);
86
+ const tempPath = join(destTempDir, `fixture-${fixtureName}-${tempId}`);
78
87
  // Always skip node_modules (will be symlinked), tmp and (unless specifically included) dist
79
88
  const skipDirs = [
80
89
  'node_modules',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/test/testFixture.ts"],"sourcesContent":["import {randomBytes} from 'node:crypto'\nimport {copyFile, mkdir, readdir, readFile, stat, symlink, writeFile} from 'node:fs/promises'\nimport {join} from 'node:path'\n\nimport {getFixturesPath, getTempPath} from '../utils/paths.js'\nimport {DEFAULT_FIXTURES, type FixtureName} from './constants.js'\n\n/**\n * @deprecated Use {@link TestFixtureOptions} instead. This type alias will be removed in a future release.\n * @public\n */\nexport type TestExampleOptions = TestFixtureOptions\n\n/**\n * Recursively copy a directory, skipping specified folders.\n *\n * @param srcDir - Source directory to copy from\n * @param destDir - Destination directory to copy to\n * @param skip - Array of directory/file names to skip (e.g., ['node_modules', 'dist'])\n * @internal\n */\nexport async function testCopyDirectory(\n srcDir: string,\n destDir: string,\n skip: string[] = [],\n): Promise<void> {\n await mkdir(destDir, {recursive: true})\n\n const entries = await readdir(srcDir)\n\n for (const entry of entries) {\n if (skip.includes(entry)) {\n continue\n }\n\n const srcPath = join(srcDir, entry)\n const destPath = join(destDir, entry)\n\n const stats = await stat(srcPath)\n\n await (stats.isDirectory()\n ? testCopyDirectory(srcPath, destPath, skip)\n : copyFile(srcPath, destPath))\n }\n}\n\n/**\n * @public\n */\nexport interface TestFixtureOptions {\n /**\n * Custom temp directory. Defaults to process.cwd()/tmp\n */\n tempDir?: string\n}\n\n/**\n * Clones a fixture directory into a temporary directory with an isolated copy.\n *\n * The function creates a unique temporary copy of the specified fixture with:\n * - A random unique ID to avoid conflicts between parallel tests\n * - Symlinked node_modules for performance (from the global setup version)\n * - Modified package.json name to prevent conflicts\n *\n * The fixture is first looked up in the temp directory (if global setup ran),\n * otherwise it falls back to the bundled fixtures in the package.\n *\n * @param fixtureName - The name of the fixture to clone (e.g., 'basic-app', 'basic-studio')\n * @param options - Configuration options\n * @returns The absolute path to the temporary directory containing the fixture\n *\n * @public\n *\n * @example\n * ```typescript\n * import {testFixture} from '@sanity/cli-test'\n * import {describe, test} from 'vitest'\n *\n * describe('my test suite', () => {\n * test('should work with basic-studio', async () => {\n * const cwd = await testFixture('basic-studio')\n * // ... run your tests in this directory\n * })\n * })\n * ```\n */\nexport async function testFixture(\n fixtureName: FixtureName | (string & {}),\n options: TestFixtureOptions = {},\n): Promise<string> {\n const {tempDir} = options\n const {includeDist = false} =\n fixtureName in DEFAULT_FIXTURES ? DEFAULT_FIXTURES[fixtureName as FixtureName] : {}\n\n const tempDirectory = getTempPath(tempDir)\n\n // Fixtures are cloned in the tmp directory by the setup function\n let tempFixturePath = join(tempDirectory, `fixture-${fixtureName}`)\n\n try {\n const stats = await stat(tempFixturePath)\n if (!stats.isDirectory()) {\n throw new Error(`${tempFixturePath} is not a directory`)\n }\n } catch (err: unknown) {\n // If the cloned fixture doesn't exist, copy from the bundled fixtures\n if (err instanceof Error && 'code' in err && err.code === 'ENOENT') {\n tempFixturePath = join(getFixturesPath(), fixtureName)\n } else {\n throw err\n }\n }\n\n const tempId = randomBytes(8).toString('hex')\n const tempPath = join(tempDirectory, `fixture-${fixtureName}-${tempId}`)\n\n // Always skip node_modules (will be symlinked), tmp and (unless specifically included) dist\n const skipDirs = ['node_modules', 'tmp', ...(includeDist ? [] : ['dist'])]\n\n // Copy the fixture to the temp directory\n await testCopyDirectory(tempFixturePath, tempPath, skipDirs)\n\n // Symlink the node_modules directory for performance\n await symlink(join(tempFixturePath, 'node_modules'), join(tempPath, 'node_modules'))\n\n // Replace the package.json name with a temp name\n const packageJsonPath = join(tempPath, 'package.json')\n const packageJson = await readFile(packageJsonPath, 'utf8')\n const packageJsonData = JSON.parse(packageJson)\n packageJsonData.name = `${packageJsonData.name}-${tempId}`\n await writeFile(packageJsonPath, JSON.stringify(packageJsonData, null, 2))\n\n return tempPath\n}\n\n/**\n * @deprecated Use {@link testFixture} instead. This function will be removed in a future release.\n *\n * Clones an example (now called fixture) directory into a temporary directory with an isolated copy.\n *\n * @param exampleName - The name of the example/fixture to clone (e.g., 'basic-app', 'basic-studio')\n * @param options - Configuration options\n * @returns The absolute path to the temporary directory containing the example/fixture\n *\n * @public\n */\nexport async function testExample(\n exampleName: FixtureName | (string & {}),\n options: TestFixtureOptions = {},\n): Promise<string> {\n return testFixture(exampleName, options)\n}\n"],"names":["randomBytes","copyFile","mkdir","readdir","readFile","stat","symlink","writeFile","join","getFixturesPath","getTempPath","DEFAULT_FIXTURES","testCopyDirectory","srcDir","destDir","skip","recursive","entries","entry","includes","srcPath","destPath","stats","isDirectory","testFixture","fixtureName","options","tempDir","includeDist","tempDirectory","tempFixturePath","Error","err","code","tempId","toString","tempPath","skipDirs","packageJsonPath","packageJson","packageJsonData","JSON","parse","name","stringify","testExample","exampleName"],"mappings":"AAAA,SAAQA,WAAW,QAAO,cAAa;AACvC,SAAQC,QAAQ,EAAEC,KAAK,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAEC,SAAS,QAAO,mBAAkB;AAC7F,SAAQC,IAAI,QAAO,YAAW;AAE9B,SAAQC,eAAe,EAAEC,WAAW,QAAO,oBAAmB;AAC9D,SAAQC,gBAAgB,QAAyB,iBAAgB;AAQjE;;;;;;;CAOC,GACD,OAAO,eAAeC,kBACpBC,MAAc,EACdC,OAAe,EACfC,OAAiB,EAAE;IAEnB,MAAMb,MAAMY,SAAS;QAACE,WAAW;IAAI;IAErC,MAAMC,UAAU,MAAMd,QAAQU;IAE9B,KAAK,MAAMK,SAASD,QAAS;QAC3B,IAAIF,KAAKI,QAAQ,CAACD,QAAQ;YACxB;QACF;QAEA,MAAME,UAAUZ,KAAKK,QAAQK;QAC7B,MAAMG,WAAWb,KAAKM,SAASI;QAE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MAAMG,cAAc,MAAMnC,SAASkC,iBAAiB;IACpD,MAAME,kBAAkBC,KAAKC,KAAK,CAACH;IACnCC,gBAAgBG,IAAI,GAAG,GAAGH,gBAAgBG,IAAI,CAAC,CAAC,EAAET,QAAQ;IAC1D,MAAM3B,UAAU+B,iBAAiBG,KAAKG,SAAS,CAACJ,iBAAiB,MAAM;IAEvE,OAAOJ;AACT;AAEA;;;;;;;;;;CAUC,GACD,OAAO,eAAeS,YACpBC,WAAwC,EACxCpB,UAA8B,CAAC,CAAC;IAEhC,OAAOF,YAAYsB,aAAapB;AAClC"}
1
+ {"version":3,"sources":["../../src/test/testFixture.ts"],"sourcesContent":["import {randomBytes} from 'node:crypto'\nimport {copyFile, mkdir, readdir, readFile, stat, symlink, writeFile} from 'node:fs/promises'\nimport {tmpdir} from 'node:os'\nimport {join} from 'node:path'\n\nimport {getFixturesPath, getTempPath} from '../utils/paths.js'\nimport {DEFAULT_FIXTURES, type FixtureName} from './constants.js'\n\n/**\n * @deprecated Use {@link TestFixtureOptions} instead. This type alias will be removed in a future release.\n * @public\n */\nexport type TestExampleOptions = TestFixtureOptions\n\n/**\n * Recursively copy a directory, skipping specified folders.\n *\n * @param srcDir - Source directory to copy from\n * @param destDir - Destination directory to copy to\n * @param skip - Array of directory/file names to skip (e.g., ['node_modules', 'dist'])\n * @internal\n */\nexport async function testCopyDirectory(\n srcDir: string,\n destDir: string,\n skip: string[] = [],\n): Promise<void> {\n await mkdir(destDir, {recursive: true})\n\n const entries = await readdir(srcDir)\n\n for (const entry of entries) {\n if (skip.includes(entry)) {\n continue\n }\n\n const srcPath = join(srcDir, entry)\n const destPath = join(destDir, entry)\n\n const stats = await stat(srcPath)\n\n await (stats.isDirectory()\n ? testCopyDirectory(srcPath, destPath, skip)\n : copyFile(srcPath, destPath))\n }\n}\n\n/**\n * @public\n */\nexport interface TestFixtureOptions {\n /**\n * Custom temp directory. Defaults to process.cwd()/tmp (or the OS temp directory when\n * `useSystemTmp` is true).\n */\n tempDir?: string\n /**\n * Use the OS temp directory instead of cwd/tmp. Avoids monorepo workspace detection by\n * package managers and git when tests run inside a monorepo. Ignored when `tempDir` is set.\n */\n useSystemTmp?: boolean\n}\n\n/**\n * Clones a fixture directory into a temporary directory with an isolated copy.\n *\n * The function creates a unique temporary copy of the specified fixture with:\n * - A random unique ID to avoid conflicts between parallel tests\n * - Symlinked node_modules for performance (from the global setup version)\n * - Modified package.json name to prevent conflicts\n *\n * The fixture is first looked up in the temp directory (if global setup ran),\n * otherwise it falls back to the bundled fixtures in the package.\n *\n * @param fixtureName - The name of the fixture to clone (e.g., 'basic-app', 'basic-studio')\n * @param options - Configuration options\n * @returns The absolute path to the temporary directory containing the fixture\n *\n * @public\n *\n * @example\n * ```typescript\n * import {testFixture} from '@sanity/cli-test'\n * import {describe, test} from 'vitest'\n *\n * describe('my test suite', () => {\n * test('should work with basic-studio', async () => {\n * const cwd = await testFixture('basic-studio')\n * // ... run your tests in this directory\n * })\n * })\n * ```\n */\nexport async function testFixture(\n fixtureName: FixtureName | (string & {}),\n options: TestFixtureOptions = {},\n): Promise<string> {\n const {tempDir, useSystemTmp = false} = options\n const {includeDist = false} =\n fixtureName in DEFAULT_FIXTURES ? DEFAULT_FIXTURES[fixtureName as FixtureName] : {}\n\n // Source is always looked up in the default temp path (cwd/tmp) where global setup\n // pre-clones fixtures and installs their node_modules. The destination can be redirected\n // to system tmp to keep the working copy out of the monorepo (avoids pnpm treating it as\n // a workspace importer and mutating pnpm-lock.yaml).\n const sourceTempDir = getTempPath(tempDir)\n const destTempDir = tempDir\n ? sourceTempDir\n : useSystemTmp\n ? join(tmpdir(), 'sanity-cli-e2e')\n : sourceTempDir\n await mkdir(destTempDir, {recursive: true})\n\n // Fixtures are cloned in the source tmp directory by the setup function\n let tempFixturePath = join(sourceTempDir, `fixture-${fixtureName}`)\n\n try {\n const stats = await stat(tempFixturePath)\n if (!stats.isDirectory()) {\n throw new Error(`${tempFixturePath} is not a directory`)\n }\n } catch (err: unknown) {\n // If the cloned fixture doesn't exist, copy from the bundled fixtures\n if (err instanceof Error && 'code' in err && err.code === 'ENOENT') {\n tempFixturePath = join(getFixturesPath(), fixtureName)\n } else {\n throw err\n }\n }\n\n const tempId = randomBytes(8).toString('hex')\n const tempPath = join(destTempDir, `fixture-${fixtureName}-${tempId}`)\n\n // Always skip node_modules (will be symlinked), tmp and (unless specifically included) dist\n const skipDirs = ['node_modules', 'tmp', ...(includeDist ? [] : ['dist'])]\n\n // Copy the fixture to the temp directory\n await testCopyDirectory(tempFixturePath, tempPath, skipDirs)\n\n // Symlink the node_modules directory for performance\n await symlink(join(tempFixturePath, 'node_modules'), join(tempPath, 'node_modules'))\n\n // Replace the package.json name with a temp name\n const packageJsonPath = join(tempPath, 'package.json')\n const packageJson = await readFile(packageJsonPath, 'utf8')\n const packageJsonData = JSON.parse(packageJson)\n packageJsonData.name = `${packageJsonData.name}-${tempId}`\n await writeFile(packageJsonPath, JSON.stringify(packageJsonData, null, 2))\n\n return tempPath\n}\n\n/**\n * @deprecated Use {@link testFixture} instead. This function will be removed in a future release.\n *\n * Clones an example (now called fixture) directory into a temporary directory with an isolated copy.\n *\n * @param exampleName - The name of the example/fixture to clone (e.g., 'basic-app', 'basic-studio')\n * @param options - Configuration options\n * @returns The absolute path to the temporary directory containing the example/fixture\n *\n * @public\n */\nexport async function testExample(\n exampleName: FixtureName | (string & {}),\n options: TestFixtureOptions = {},\n): Promise<string> {\n return testFixture(exampleName, options)\n}\n"],"names":["randomBytes","copyFile","mkdir","readdir","readFile","stat","symlink","writeFile","tmpdir","join","getFixturesPath","getTempPath","DEFAULT_FIXTURES","testCopyDirectory","srcDir","destDir","skip","recursive","entries","entry","includes","srcPath","destPath","stats","isDirectory","testFixture","fixtureName","options","tempDir","useSystemTmp","includeDist","sourceTempDir","destTempDir","tempFixturePath","Error","err","code","tempId","toString","tempPath","skipDirs","packageJsonPath","packageJson","packageJsonData","JSON","parse","name","stringify","testExample","exampleName"],"mappings":"AAAA,SAA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from 'node:fs/promises';
2
+ import { tmpdir } from 'node:os';
3
+ import { join, resolve } from 'node:path';
2
4
  // Capture the initial working directory before any tests change it
3
5
  const INITIAL_CWD = process.cwd();
4
6
  /**
@@ -26,6 +28,30 @@ const INITIAL_CWD = process.cwd();
26
28
  */ export function getTempPath(customTempDir) {
27
29
  return customTempDir || resolve(INITIAL_CWD, 'tmp');
28
30
  }
31
+ /**
32
+ * Creates a unique temporary directory for test output.
33
+ * Uses {@link getTempPath} as the base, creating it if needed.
34
+ *
35
+ * @param options - Configuration options: `prefix` (default: 'cli-e2e-') and
36
+ * `useSystemTmp` (default: false) which uses the OS temp directory instead of
37
+ * cwd/tmp to avoid monorepo workspace detection by package managers and git.
38
+ * @returns The path and a cleanup function
39
+ * @public
40
+ */ export async function createTmpDir(options = {}) {
41
+ const { prefix = 'cli-e2e-', useSystemTmp = false } = options;
42
+ const basePath = useSystemTmp ? join(tmpdir(), 'sanity-cli-e2e') : getTempPath();
43
+ await mkdir(basePath, {
44
+ recursive: true
45
+ });
46
+ const path = await mkdtemp(join(basePath, prefix));
47
+ return {
48
+ cleanup: ()=>rm(path, {
49
+ force: true,
50
+ recursive: true
51
+ }),
52
+ path
53
+ };
54
+ }
29
55
  /**
30
56
  * Gets the current Windows drive letter from process.cwd().
31
57
  * Falls back to 'C:\\' if detection fails.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/paths.ts"],"sourcesContent":["import {resolve} from 'node:path'\n\n// Capture the initial working directory before any tests change it\nconst INITIAL_CWD = process.cwd()\n\n/**\n * Gets the path to the fixtures directory bundled with this package.\n *\n * The fixtures are copied during build and bundled with the published package.\n * This function works the same whether the package is used in a monorepo\n * or installed from npm.\n *\n * @returns Absolute path to the fixtures directory\n * @internal\n */\nexport function getFixturesPath(): string {\n // From dist/utils/paths.js -> ../../fixtures\n return resolve(import.meta.dirname, '../../fixtures')\n}\n\n/**\n * Gets the path to the temporary directory for test fixtures.\n *\n * Uses the initial working directory captured when this module was first loaded,\n * not process.cwd() which may change during test execution.\n *\n * @param customTempDir - Optional custom temp directory path\n * @returns Absolute path to temp directory (default: initial cwd/tmp)\n * @internal\n */\nexport function getTempPath(customTempDir?: string): string {\n return customTempDir || resolve(INITIAL_CWD, 'tmp')\n}\n\n/**\n * Gets the current Windows drive letter from process.cwd().\n * Falls back to 'C:\\\\' if detection fails.\n *\n * @returns Drive letter with backslash (e.g., 'C:\\\\', 'D:\\\\') or empty string on Unix\n * @internal\n */\nexport function getCurrentDrive(): string {\n if (process.platform !== 'win32') {\n return ''\n }\n const cwd = process.cwd()\n const match = cwd.match(/^([A-Z]:)[\\\\/]/)\n return match ? match[1] + '\\\\' : 'C:\\\\'\n}\n\n/**\n * Converts Unix-style paths to platform-appropriate paths.\n * On Windows:\n * - Absolute paths starting with '/': adds drive letter and converts to backslashes\n * - Relative/partial paths: converts forward slashes to backslashes\n * On Unix: keeps paths as-is.\n *\n * @param pathStr - Unix-style path (e.g., '/test/path' or '.config/file.json')\n * @returns Platform-appropriate path\n * @internal\n */\nexport function convertToSystemPath(pathStr: string): string {\n if (process.platform === 'win32') {\n if (pathStr.startsWith('/')) {\n // Absolute Unix path - add drive letter\n const drive = getCurrentDrive()\n return `${drive}${pathStr.slice(1).replaceAll('/', '\\\\')}`\n }\n // Relative/partial path - just convert separators\n return pathStr.replaceAll('/', '\\\\')\n }\n return pathStr\n}\n"],"names":["resolve","INITIAL_CWD","process","cwd","getFixturesPath","dirname","getTempPath","customTempDir","getCurrentDrive","platform","match","convertToSystemPath","pathStr","startsWith","drive","slice","replaceAll"],"mappings":"AAAA,SAAQA,OAAO,QAAO,YAAW;AAEjC,mEAAmE;AACnE,MAAMC,cAAcC,QAAQC,GAAG;AAE/B;;;;;;;;;CASC,GACD,OAAO,SAASC;IACd,6CAA6C;IAC7C,OAAOJ,QAAQ,YAAYK,OAAO,EAAE;AACtC;AAEA;;;;;;;;;CASC,GACD,OAAO,SAASC,YAAYC,aAAsB;IAChD,OAAOA,iBAAiBP,QAAQC,aAAa;AAC/C;AAEA;;;;;;CAMC,GACD,OAAO,SAASO;IACd,IAAIN,QAAQO,QAAQ,KAAK,SAAS;QAChC,OAAO;IACT;IACA,MAAMN,MAAMD,QAAQC,GAAG;IACvB,MAAMO,QAAQP,IAAIO,KAAK,CAAC;IACxB,OAAOA,QAAQA,KAAK,CAAC,EAAE,GAAG,OAAO;AACnC;AAEA;;;;;;;;;;CAUC,GACD,OAAO,SAASC,oBAAoBC,OAAe;IACjD,IAAIV,QAAQO,QAAQ,KAAK,SAAS;QAChC,IAAIG,QAAQC,UAAU,CAAC,MAAM;YAC3B,wCAAwC;YACxC,MAAMC,QAAQN;YACd,OAAO,GAAGM,QAAQF,QAAQG,KAAK,CAAC,GAAGC,UAAU,CAAC,KAAK,OAAO;QAC5D;QACA,kDAAkD;QAClD,OAAOJ,QAAQI,UAAU,CAAC,KAAK;IACjC;IACA,OAAOJ;AACT"}
1
+ {"version":3,"sources":["../../src/utils/paths.ts"],"sourcesContent":["import {mkdir, mkdtemp, rm} from 'node:fs/promises'\nimport {tmpdir} from 'node:os'\nimport {join, resolve} from 'node:path'\n\n// Capture the initial working directory before any tests change it\nconst INITIAL_CWD = process.cwd()\n\n/**\n * Gets the path to the fixtures directory bundled with this package.\n *\n * The fixtures are copied during build and bundled with the published package.\n * This function works the same whether the package is used in a monorepo\n * or installed from npm.\n *\n * @returns Absolute path to the fixtures directory\n * @internal\n */\nexport function getFixturesPath(): string {\n // From dist/utils/paths.js -> ../../fixtures\n return resolve(import.meta.dirname, '../../fixtures')\n}\n\n/**\n * Gets the path to the temporary directory for test fixtures.\n *\n * Uses the initial working directory captured when this module was first loaded,\n * not process.cwd() which may change during test execution.\n *\n * @param customTempDir - Optional custom temp directory path\n * @returns Absolute path to temp directory (default: initial cwd/tmp)\n * @internal\n */\nexport function getTempPath(customTempDir?: string): string {\n return customTempDir || resolve(INITIAL_CWD, 'tmp')\n}\n\n/**\n * Creates a unique temporary directory for test output.\n * Uses {@link getTempPath} as the base, creating it if needed.\n *\n * @param options - Configuration options: `prefix` (default: 'cli-e2e-') and\n * `useSystemTmp` (default: false) which uses the OS temp directory instead of\n * cwd/tmp to avoid monorepo workspace detection by package managers and git.\n * @returns The path and a cleanup function\n * @public\n */\nexport async function createTmpDir(\n options: {prefix?: string; useSystemTmp?: boolean} = {},\n): Promise<{cleanup: () => Promise<void>; path: string}> {\n const {prefix = 'cli-e2e-', useSystemTmp = false} = options\n const basePath = useSystemTmp ? join(tmpdir(), 'sanity-cli-e2e') : getTempPath()\n await mkdir(basePath, {recursive: true})\n const path = await mkdtemp(join(basePath, prefix))\n return {\n cleanup: () => rm(path, {force: true, recursive: true}),\n path,\n }\n}\n\n/**\n * Gets the current Windows drive letter from process.cwd().\n * Falls back to 'C:\\\\' if detection fails.\n *\n * @returns Drive letter with backslash (e.g., 'C:\\\\', 'D:\\\\') or empty string on Unix\n * @internal\n */\nexport function getCurrentDrive(): string {\n if (process.platform !== 'win32') {\n return ''\n }\n const cwd = process.cwd()\n const match = cwd.match(/^([A-Z]:)[\\\\/]/)\n return match ? match[1] + '\\\\' : 'C:\\\\'\n}\n\n/**\n * Converts Unix-style paths to platform-appropriate paths.\n * On Windows:\n * - Absolute paths starting with '/': adds drive letter and converts to backslashes\n * - Relative/partial paths: converts forward slashes to backslashes\n * On Unix: keeps paths as-is.\n *\n * @param pathStr - Unix-style path (e.g., '/test/path' or '.config/file.json')\n * @returns Platform-appropriate path\n * @internal\n */\nexport function convertToSystemPath(pathStr: string): string {\n if (process.platform === 'win32') {\n if (pathStr.startsWith('/')) {\n // Absolute Unix path - add drive letter\n const drive = getCurrentDrive()\n return `${drive}${pathStr.slice(1).replaceAll('/', '\\\\')}`\n }\n // Relative/partial path - just convert separators\n return pathStr.replaceAll('/', '\\\\')\n }\n return pathStr\n}\n"],"names":["mkdir","mkdtemp","rm","tmpdir","join","resolve","INITIAL_CWD","process","cwd","getFixturesPath","dirname","getTempPath","customTempDir","createTmpDir","options","prefix","useSystemTmp","basePath","recursive","path","cleanup","force","getCurrentDrive","platform","match","convertToSystemPath","pathStr","startsWith","drive","slice","replaceAll"],"mappings":"AAAA,SAAQA,KAAK,EAAEC,OAAO,EAAEC,EAAE,QAAO,mBAAkB;AACnD,SAAQC,MAAM,QAAO,UAAS;AAC9B,SAAQC,IAAI,EAAEC,OAAO,QAAO,YAAW;AAEvC,mEAAmE;AACnE,MAAMC,cAAcC,QAAQC,GAAG;AAE/B;;;;;;;;;CASC,GACD,OAAO,SAASC;IACd,6CAA6C;IAC7C,OAAOJ,QAAQ,YAAYK,OAAO,EAAE;AACtC;AAEA;;;;;;;;;CASC,GACD,OAAO,SAASC,YAAYC,aAAsB;IAChD,OAAOA,iBAAiBP,QAAQC,aAAa;AAC/C;AAEA;;;;;;;;;CASC,GACD,OAAO,eAAeO,aACpBC,UAAqD,CAAC,CAAC;IAEvD,MAAM,EAACC,SAAS,UAAU,EAAEC,eAAe,KAAK,EAAC,GAAGF;IACpD,MAAMG,WAAWD,eAAeZ,KAAKD,UAAU,oBAAoBQ;IACnE,MAAMX,MAAMiB,UAAU;QAACC,WAAW;IAAI;IACtC,MAAMC,OAAO,MAAMlB,QAAQG,KAAKa,UAAUF;IAC1C,OAAO;QACLK,SAAS,IAAMlB,GAAGiB,MAAM;gBAACE,OAAO;gBAAMH,WAAW;YAAI;QACrDC;IACF;AACF;AAEA;;;;;;CAMC,GACD,OAAO,SAASG;IACd,IAAIf,QAAQgB,QAAQ,KAAK,SAAS;QAChC,OAAO;IACT;IACA,MAAMf,MAAMD,QAAQC,GAAG;IACvB,MAAMgB,QAAQhB,IAAIgB,KAAK,CAAC;IACxB,OAAOA,QAAQA,KAAK,CAAC,EAAE,GAAG,OAAO;AACnC;AAEA;;;;;;;;;;CAUC,GACD,OAAO,SAASC,oBAAoBC,OAAe;IACjD,IAAInB,QAAQgB,QAAQ,KAAK,SAAS;QAChC,IAAIG,QAAQC,UAAU,CAAC,MAAM;YAC3B,wCAAwC;YACxC,MAAMC,QAAQN;YACd,OAAO,GAAGM,QAAQF,QAAQG,KAAK,CAAC,GAAGC,UAAU,CAAC,KAAK,OAAO;QAC5D;QACA,kDAAkD;QAClD,OAAOJ,QAAQI,UAAU,CAAC,KAAK;IACjC;IACA,OAAOJ;AACT"}
package/dist/vitest.d.ts CHANGED
@@ -47,6 +47,13 @@ declare interface SetupTestFixturesOptions {
47
47
  * ```
48
48
  */
49
49
  additionalFixtures?: string[];
50
+ /**
51
+ * When true, passes `--ignore-workspace` to pnpm install so fixtures get
52
+ * their own node_modules even when the temp directory is inside a pnpm
53
+ * workspace. Required for E2E tests that spawn the CLI binary against
54
+ * fixture directories.
55
+ */
56
+ ignoreWorkspace?: boolean;
50
57
  /**
51
58
  * Custom temp directory path. Defaults to process.cwd()/tmp
52
59
  */
@@ -12,14 +12,14 @@
12
12
  "start": "sanity start"
13
13
  },
14
14
  "dependencies": {
15
- "@sanity/sdk": "^2.6.0",
16
- "@sanity/sdk-react": "^2.6.0",
17
- "react": "^19.2.3",
18
- "react-dom": "^19.2.3",
19
- "sanity": "^5.20.0"
15
+ "@sanity/sdk": "^2.8.0",
16
+ "@sanity/sdk-react": "^2.8.0",
17
+ "react": "^19.2.5",
18
+ "react-dom": "^19.2.5",
19
+ "sanity": "^5.23.0"
20
20
  },
21
21
  "devDependencies": {
22
- "@types/react": "^19.2.9",
22
+ "@types/react": "^19.2.14",
23
23
  "typescript": "^5.9.3"
24
24
  }
25
25
  }
@@ -5,10 +5,10 @@
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "dependencies": {
8
- "@sanity/blueprints": "^0.12.2",
9
- "@sanity/functions": "^1.2.0"
8
+ "@sanity/blueprints": "^0.15.2",
9
+ "@sanity/functions": "^1.3.1"
10
10
  },
11
11
  "devDependencies": {
12
- "sanity": "^5.20.0"
12
+ "sanity": "^5.23.0"
13
13
  }
14
14
  }
@@ -15,14 +15,14 @@
15
15
  "start": "sanity start"
16
16
  },
17
17
  "dependencies": {
18
- "@sanity/vision": "^5.20.0",
19
- "react": "^19.2.3",
20
- "react-dom": "^19.2.3",
21
- "sanity": "^5.20.0",
22
- "styled-components": "^6.3.8"
18
+ "@sanity/vision": "^5.23.0",
19
+ "react": "^19.2.5",
20
+ "react-dom": "^19.2.5",
21
+ "sanity": "^5.23.0",
22
+ "styled-components": "^6.4.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@types/react": "^19.2.9",
25
+ "@types/react": "^19.2.14",
26
26
  "typescript": "^5.9.3"
27
27
  }
28
28
  }
@@ -2,8 +2,8 @@ import {defineCliConfig} from 'sanity/cli'
2
2
 
3
3
  export default defineCliConfig({
4
4
  api: {
5
- dataset: 'test',
6
- projectId: 'ppsg7ml5',
5
+ dataset: process.env.SANITY_E2E_DATASET || 'test',
6
+ projectId: process.env.SANITY_E2E_PROJECT_ID || 'ppsg7ml5',
7
7
  },
8
8
  deployment: {
9
9
  autoUpdates: true,
@@ -12,14 +12,14 @@
12
12
  "deploy-graphql": "sanity graphql deploy"
13
13
  },
14
14
  "dependencies": {
15
- "@sanity/vision": "^5.20.0",
16
- "react": "^19.2.3",
17
- "react-dom": "^19.2.3",
18
- "sanity": "^5.20.0",
19
- "styled-components": "^6.3.8"
15
+ "@sanity/vision": "^5.23.0",
16
+ "react": "^19.2.5",
17
+ "react-dom": "^19.2.5",
18
+ "sanity": "^5.23.0",
19
+ "styled-components": "^6.4.0"
20
20
  },
21
21
  "devDependencies": {
22
- "@types/react": "^19.2.9",
22
+ "@types/react": "^19.2.14",
23
23
  "typescript": "^5.9.3"
24
24
  }
25
25
  }
@@ -15,14 +15,14 @@
15
15
  "start": "sanity start"
16
16
  },
17
17
  "dependencies": {
18
- "@sanity/vision": "^5.20.0",
19
- "react": "^19.2.3",
20
- "react-dom": "^19.2.3",
21
- "sanity": "^5.20.0",
22
- "styled-components": "^6.3.8"
18
+ "@sanity/vision": "^5.23.0",
19
+ "react": "^19.2.5",
20
+ "react-dom": "^19.2.5",
21
+ "sanity": "^5.23.0",
22
+ "styled-components": "^6.4.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@types/react": "^19.2.9",
25
+ "@types/react": "^19.2.14",
26
26
  "typescript": "^5.9.3"
27
27
  }
28
28
  }
@@ -7,12 +7,12 @@
7
7
  "build": "next build"
8
8
  },
9
9
  "dependencies": {
10
- "next": "^16.2.2",
11
- "react": "^19.2.4",
12
- "react-dom": "^19.2.4"
10
+ "next": "^16.2.3",
11
+ "react": "^19.2.5",
12
+ "react-dom": "^19.2.5"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@types/react": "^19.2.14",
16
- "typescript": "^5.8.3"
16
+ "typescript": "^5.9.3"
17
17
  }
18
18
  }
@@ -12,14 +12,14 @@
12
12
  "preview": "sanity preview"
13
13
  },
14
14
  "dependencies": {
15
- "@sanity/sdk": "^2.6.0",
16
- "@sanity/sdk-react": "^2.6.0",
17
- "react": "^19.2.3",
18
- "react-dom": "^19.2.3",
19
- "sanity": "^5.20.0"
15
+ "@sanity/sdk": "^2.8.0",
16
+ "@sanity/sdk-react": "^2.8.0",
17
+ "react": "^19.2.5",
18
+ "react-dom": "^19.2.5",
19
+ "sanity": "^5.23.0"
20
20
  },
21
21
  "devDependencies": {
22
- "@types/react": "^19.2.9",
22
+ "@types/react": "^19.2.14",
23
23
  "typescript": "^5.9.3"
24
24
  }
25
25
  }
@@ -13,13 +13,13 @@
13
13
  "preview": "sanity preview"
14
14
  },
15
15
  "dependencies": {
16
- "react": "^19.2.3",
17
- "react-dom": "^19.2.3",
18
- "sanity": "^5.20.0",
19
- "styled-components": "^6.3.8"
16
+ "react": "^19.2.5",
17
+ "react-dom": "^19.2.5",
18
+ "sanity": "^5.23.0",
19
+ "styled-components": "^6.4.0"
20
20
  },
21
21
  "devDependencies": {
22
- "@types/react": "^19.2.9",
22
+ "@types/react": "^19.2.14",
23
23
  "typescript": "^5.9.3"
24
24
  }
25
25
  }
@@ -15,19 +15,19 @@
15
15
  "start": "sanity start"
16
16
  },
17
17
  "dependencies": {
18
- "@sanity/code-input": "^7.0.6",
19
- "@sanity/vision": "^5.20.0",
20
- "react": "^19.2.3",
21
- "react-dom": "^19.2.3",
22
- "sanity": "^5.20.0",
18
+ "@sanity/code-input": "^7.1.0",
19
+ "@sanity/vision": "^5.23.0",
20
+ "react": "^19.2.5",
21
+ "react-dom": "^19.2.5",
22
+ "sanity": "^5.23.0",
23
23
  "sanity-plugin-media": "^4.1.1",
24
- "styled-components": "^6.3.8",
25
- "vite-tsconfig-paths": "^6.0.5"
24
+ "styled-components": "^6.4.0",
25
+ "vite-tsconfig-paths": "^6.1.1"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@sanity/color": "^3.0.6",
29
- "@types/react": "^19.2.9",
29
+ "@types/react": "^19.2.14",
30
30
  "typescript": "^5.9.3",
31
- "vite": "^7.3.1"
31
+ "vite": "^7.3.2"
32
32
  }
33
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/cli-test",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Sanity CLI test helpers and utilities",
5
5
  "keywords": [
6
6
  "cli",
@@ -43,7 +43,7 @@
43
43
  "access": "public"
44
44
  },
45
45
  "dependencies": {
46
- "@swc/core": "^1.15.24",
46
+ "@swc/core": "^1.15.30",
47
47
  "ansis": "^4.2.0",
48
48
  "esbuild": "^0.27.4",
49
49
  "nock": "^14.0.12",
@@ -51,23 +51,23 @@
51
51
  "tinyglobby": "^0.2.16"
52
52
  },
53
53
  "devDependencies": {
54
- "@eslint/compat": "^2.0.3",
55
- "@oclif/core": "^4.10.5",
56
- "@sanity/client": "^7.21.0",
57
- "@sanity/pkg-utils": "^10.4.14",
54
+ "@eslint/compat": "^2.0.5",
55
+ "@oclif/core": "^4.10.6",
56
+ "@sanity/client": "^7.22.0",
57
+ "@sanity/pkg-utils": "^10.4.18",
58
58
  "@swc/cli": "^0.8.1",
59
59
  "@types/node": "^20.19.39",
60
- "eslint": "^10.1.0",
60
+ "eslint": "^10.2.1",
61
61
  "publint": "^0.3.18",
62
62
  "rimraf": "^6.0.1",
63
63
  "tsx": "^4.21.0",
64
64
  "typescript": "^5.9.3",
65
- "vitest": "^4.1.2",
65
+ "vitest": "^4.1.5",
66
66
  "yaml": "^2.8.3",
67
67
  "@repo/package.config": "0.0.1",
68
68
  "@repo/tsconfig": "3.70.0",
69
69
  "@sanity/cli-core": "1.3.1",
70
- "@sanity/eslint-config-cli": "1.1.0"
70
+ "@sanity/eslint-config-cli": "1.1.1"
71
71
  },
72
72
  "peerDependencies": {
73
73
  "@oclif/core": "^4.0.0",