@sanity/cli-test 24.0.1 → 24.0.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 +2 -2
- package/dist/test/constants.js +9 -0
- package/dist/test/constants.js.map +1 -1
- package/dist/test/setupFixtures.js +20 -7
- package/dist/test/setupFixtures.js.map +1 -1
- package/dist/test/util.d.ts +2 -2
- package/dist/{testFixture-8PtoG-6z.d.ts → testFixture-BSYY9y-u.d.ts} +12 -2
- package/fixtures/basic-app/package.json +1 -1
- package/fixtures/basic-functions/package.json +1 -1
- package/fixtures/basic-studio/package.json +2 -2
- package/fixtures/fixture-workspace.yaml +46 -0
- package/fixtures/graphql-studio/package.json +2 -2
- package/fixtures/multi-workspace-studio/package.json +2 -2
- package/fixtures/prebuilt-app/package.json +1 -1
- package/fixtures/prebuilt-studio/package.json +1 -1
- package/fixtures/worst-case-studio/package.json +3 -3
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as testFixture, c as createMockWatcher, d as DEFAULT_FIXTURES, f as ExampleName, i as testExample, l as createMockSpinner, m as
|
|
1
|
+
import { a as testFixture, c as createMockWatcher, d as DEFAULT_FIXTURES, f as ExampleName, h as FixtureOptions, i as testExample, l as createMockSpinner, m as FixtureName, n as TestFixtureOptions, o as createTestToken, p as FIXTURE_WORKSPACE_FILE, r as testCopyDirectory, s as MockWatcher, t as TestExampleOptions, u as createMockHttpServer } from "./testFixture-BSYY9y-u.js";
|
|
2
2
|
import { CreateTestClientOptions, createTestClient } from "./test/createTestClient.js";
|
|
3
3
|
import { MockApiOptions, mockApi } from "./test/mockApi.js";
|
|
4
4
|
import { c as mockSanityCommand, n as TestCommandOptions, r as testCommand, s as MockSanityCommandOptions, t as testHook } from "./testHook-CG6GhHGq.js";
|
|
5
5
|
import { n as mockTelemetry, t as MockTelemetryOptions } from "./mockTelemetry-Bh1va02-.js";
|
|
6
6
|
import { SetupTestFixturesOptions, TeardownTestFixturesOptions, setup, teardown } from "./test/setupFixtures.js";
|
|
7
7
|
import { convertToSystemPath, createTmpDir, getCurrentDrive, getFixturesPath, getTempPath } from "./utils/paths.js";
|
|
8
|
-
export { CreateTestClientOptions, DEFAULT_FIXTURES, ExampleName, FixtureName, FixtureOptions, MockApiOptions, MockSanityCommandOptions, MockTelemetryOptions, MockWatcher, SetupTestFixturesOptions, TeardownTestFixturesOptions, TestCommandOptions, TestExampleOptions, TestFixtureOptions, convertToSystemPath, createMockHttpServer, createMockSpinner, createMockWatcher, createTestClient, createTestToken, createTmpDir, getCurrentDrive, getFixturesPath, getTempPath, mockApi, mockSanityCommand, mockTelemetry, setup, teardown, testCommand, testCopyDirectory, testExample, testFixture, testHook };
|
|
8
|
+
export { CreateTestClientOptions, DEFAULT_FIXTURES, ExampleName, FIXTURE_WORKSPACE_FILE, FixtureName, FixtureOptions, MockApiOptions, MockSanityCommandOptions, MockTelemetryOptions, MockWatcher, SetupTestFixturesOptions, TeardownTestFixturesOptions, TestCommandOptions, TestExampleOptions, TestFixtureOptions, convertToSystemPath, createMockHttpServer, createMockSpinner, createMockWatcher, createTestClient, createTestToken, createTmpDir, getCurrentDrive, getFixturesPath, getTempPath, mockApi, mockSanityCommand, mockTelemetry, setup, teardown, testCommand, testCopyDirectory, testExample, testFixture, testHook };
|
package/dist/test/constants.js
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
* Options for each fixture.
|
|
3
3
|
* @public
|
|
4
4
|
*/ /**
|
|
5
|
+
* Name of the `pnpm-workspace.yaml` template bundled alongside the fixtures.
|
|
6
|
+
*
|
|
7
|
+
* The build generates it from the repository's own `pnpm-workspace.yaml` so fixture
|
|
8
|
+
* installs apply the same install policy as the repository, and fixture setup writes
|
|
9
|
+
* it into each fixture as its `pnpm-workspace.yaml`.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/ export const FIXTURE_WORKSPACE_FILE = 'fixture-workspace.yaml';
|
|
13
|
+
/**
|
|
5
14
|
* Default fixtures bundled with the package and their options.
|
|
6
15
|
*
|
|
7
16
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/test/constants.ts"],"sourcesContent":["/**\n * Options for each fixture.\n * @public\n */\nexport interface FixtureOptions {\n includeDist?: boolean\n}\n\n/**\n * Default fixtures bundled with the package and their options.\n *\n * @public\n */\nexport const DEFAULT_FIXTURES: Record<FixtureName, FixtureOptions> = {\n 'basic-app': {},\n 'basic-functions': {},\n 'basic-studio': {},\n 'federated-studio': {},\n 'graphql-studio': {},\n 'multi-workspace-studio': {},\n 'nextjs-app': {},\n 'prebuilt-app': {includeDist: true},\n 'prebuilt-studio': {includeDist: true},\n 'worst-case-studio': {},\n} as const\n\n/**\n * Valid fixture name type.\n * @public\n */\nexport type FixtureName =\n | 'basic-app'\n | 'basic-functions'\n | 'basic-studio'\n | 'federated-studio'\n | 'graphql-studio'\n | 'multi-workspace-studio'\n | 'nextjs-app'\n | 'prebuilt-app'\n | 'prebuilt-studio'\n | 'worst-case-studio'\n\n/**\n * @deprecated Use {@link FixtureName} instead. This type alias will be removed in a future release.\n * @public\n */\nexport type ExampleName = FixtureName\n"],"names":["DEFAULT_FIXTURES","includeDist"],"mappings":"AAAA;;;CAGC,GAKD;;;;CAIC,GACD,OAAO,
|
|
1
|
+
{"version":3,"sources":["../../src/test/constants.ts"],"sourcesContent":["/**\n * Options for each fixture.\n * @public\n */\nexport interface FixtureOptions {\n includeDist?: boolean\n}\n\n/**\n * Name of the `pnpm-workspace.yaml` template bundled alongside the fixtures.\n *\n * The build generates it from the repository's own `pnpm-workspace.yaml` so fixture\n * installs apply the same install policy as the repository, and fixture setup writes\n * it into each fixture as its `pnpm-workspace.yaml`.\n *\n * @internal\n */\nexport const FIXTURE_WORKSPACE_FILE = 'fixture-workspace.yaml'\n\n/**\n * Default fixtures bundled with the package and their options.\n *\n * @public\n */\nexport const DEFAULT_FIXTURES: Record<FixtureName, FixtureOptions> = {\n 'basic-app': {},\n 'basic-functions': {},\n 'basic-studio': {},\n 'federated-studio': {},\n 'graphql-studio': {},\n 'multi-workspace-studio': {},\n 'nextjs-app': {},\n 'prebuilt-app': {includeDist: true},\n 'prebuilt-studio': {includeDist: true},\n 'worst-case-studio': {},\n} as const\n\n/**\n * Valid fixture name type.\n * @public\n */\nexport type FixtureName =\n | 'basic-app'\n | 'basic-functions'\n | 'basic-studio'\n | 'federated-studio'\n | 'graphql-studio'\n | 'multi-workspace-studio'\n | 'nextjs-app'\n | 'prebuilt-app'\n | 'prebuilt-studio'\n | 'worst-case-studio'\n\n/**\n * @deprecated Use {@link FixtureName} instead. This type alias will be removed in a future release.\n * @public\n */\nexport type ExampleName = FixtureName\n"],"names":["FIXTURE_WORKSPACE_FILE","DEFAULT_FIXTURES","includeDist"],"mappings":"AAAA;;;CAGC,GAKD;;;;;;;;CAQC,GACD,OAAO,MAAMA,yBAAyB,yBAAwB;AAE9D;;;;CAIC,GACD,OAAO,MAAMC,mBAAwD;IACnE,aAAa,CAAC;IACd,mBAAmB,CAAC;IACpB,gBAAgB,CAAC;IACjB,oBAAoB,CAAC;IACrB,kBAAkB,CAAC;IACnB,0BAA0B,CAAC;IAC3B,cAAc,CAAC;IACf,gBAAgB;QAACC,aAAa;IAAI;IAClC,mBAAmB;QAACA,aAAa;IAAI;IACrC,qBAAqB,CAAC;AACxB,EAAU"}
|
|
@@ -5,9 +5,24 @@ import { promisify } from 'node:util';
|
|
|
5
5
|
import { glob } from 'tinyglobby';
|
|
6
6
|
import { fileExists } from '../utils/fileExists.js';
|
|
7
7
|
import { getFixturesPath, getTempPath } from '../utils/paths.js';
|
|
8
|
-
import { DEFAULT_FIXTURES } from './constants.js';
|
|
8
|
+
import { DEFAULT_FIXTURES, FIXTURE_WORKSPACE_FILE } from './constants.js';
|
|
9
9
|
import { testCopyDirectory } from './testFixture.js';
|
|
10
10
|
const exec = promisify(execNode);
|
|
11
|
+
/**
|
|
12
|
+
* Reads the bundled `pnpm-workspace.yaml` template that fixture installs run under.
|
|
13
|
+
*
|
|
14
|
+
* It is generated from the repository's own workspace config by the package build, so a
|
|
15
|
+
* missing file means the package was not built rather than a misconfigured consumer.
|
|
16
|
+
*/ async function readFixtureWorkspace() {
|
|
17
|
+
const workspacePath = join(getFixturesPath(), FIXTURE_WORKSPACE_FILE);
|
|
18
|
+
try {
|
|
19
|
+
return await readFile(workspacePath, 'utf8');
|
|
20
|
+
} catch (error) {
|
|
21
|
+
throw new Error(`Could not read the fixture workspace config at ${workspacePath}. Build @sanity/cli-test before running fixture setup.`, {
|
|
22
|
+
cause: error
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
11
26
|
async function getAdditionalFixturePaths(fixtures) {
|
|
12
27
|
const paths = await glob(fixtures, {
|
|
13
28
|
absolute: true,
|
|
@@ -95,15 +110,13 @@ async function getAdditionalFixturePaths(fixtures) {
|
|
|
95
110
|
await writeFile(packageJsonPath, JSON.stringify(packageJsonData, null, 2));
|
|
96
111
|
if (ignoreWorkspace) {
|
|
97
112
|
// 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
|
-
|
|
113
|
+
// A fixture-local workspace both isolates the install and applies the repository's policy,
|
|
114
|
+
// which the build generated from the repository's own pnpm-workspace.yaml.
|
|
115
|
+
await writeFile(join(toPath, 'pnpm-workspace.yaml'), await readFixtureWorkspace());
|
|
100
116
|
}
|
|
101
117
|
// Run pnpm install --no-lockfile in the temp directory
|
|
102
118
|
try {
|
|
103
|
-
|
|
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`, {
|
|
119
|
+
await exec(`pnpm install --prefer-offline --no-lockfile`, {
|
|
107
120
|
cwd: toPath
|
|
108
121
|
});
|
|
109
122
|
} 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 * Creates an isolated pnpm workspace so fixtures get their own node_modules even\n * when the temp directory is inside another pnpm workspace. Defaults to true:\n * fixtures copied into this repository's tmp directory are not workspace members,\n * so pnpm would otherwise resolve the install to the repository root and leave the\n * fixture without node_modules.\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 = true, 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;AAoCvB,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,aAAa,CAAC,IAAI;YAClDD,mBAAmBE,IAAI,CAAC;gBACtBC,SAASlB,SAASgB;gBAClBG,UAAUH;gBACVI,aAAa;YACf;QACF;IACF;IAEA,OAAOL;AACT;AAQA;;;;;;;;;;;;;;;;;;;;;;;CAuBC,GACD,OAAO,eAAeM,MAAMC,CAAc,EAAEC,UAAoC,CAAC,CAAC;IAChF,MAAM,EAACR,kBAAkB,EAAES,kBAAkB,IAAI,EAAEC,OAAO,EAAC,GAAGF;IAC9DG,QAAQC,GAAG,CAAC;IACZ,MAAMC,aAAa;IACnBF,QAAQG,IAAI,CAACD;IAEb,IAAI;QACF,MAAME,cAAczB;QACpB,MAAM0B,gBAAgBzB,YAAYmB;QAElC,MAAMO,kBAAoC,EAAE;QAE5C,2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gBAC3E,MAAM3C,KAAK,CAAC,0EAA0E,CAAC,EAAE;oBACvFmD,KAAKR;gBACP;YACF,EAAE,OAAOS,OAAO;gBACd,MAAMC,YAAYD;gBAClBrB,QAAQqB,KAAK,CAAC;gBACdrB,QAAQqB,KAAK,CAACC,UAAUC,MAAM,IAAID,UAAUE,MAAM,IAAIF,UAAUG,OAAO;gBACvE,MAAM,IAAIC,MACR,CAAC,iCAAiC,EAAEd,OAAO,EAAE,EAAEU,UAAUC,MAAM,IAAID,UAAUE,MAAM,IAAIF,UAAUG,OAAO,EAAE,EAC1G;oBAACE,OAAON;gBAAK;YAEjB;QACF;IACF,EAAE,OAAOA,OAAO;QACdrB,QAAQqB,KAAK,CAAC;QACd,MAAMA;IACR,SAAU;QACRrB,QAAQ4B,OAAO,CAAC1B;IAClB;AACF;AAcA;;;;;;;;;;CAUC,GACD,OAAO,eAAe2B,SAAShC,UAAuC,CAAC,CAAC;IACtE,MAAM,EAACE,OAAO,EAAC,GAAGF;IAClB,MAAMQ,gBAAgBzB,YAAYmB;IAElC,2BAA2B;IAC3B,MAAM3B,GAAGiC,eAAe;QAACyB,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, FIXTURE_WORKSPACE_FILE} from './constants.js'\nimport {testCopyDirectory} from './testFixture.js'\n\nconst exec = promisify(execNode)\n\n/**\n * Reads the bundled `pnpm-workspace.yaml` template that fixture installs run under.\n *\n * It is generated from the repository's own workspace config by the package build, so a\n * missing file means the package was not built rather than a misconfigured consumer.\n */\nasync function readFixtureWorkspace(): Promise<string> {\n const workspacePath = join(getFixturesPath(), FIXTURE_WORKSPACE_FILE)\n\n try {\n return await readFile(workspacePath, 'utf8')\n } catch (error) {\n throw new Error(\n `Could not read the fixture workspace config at ${workspacePath}. Build @sanity/cli-test before running fixture setup.`,\n {cause: error},\n )\n }\n}\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 * Creates an isolated pnpm workspace so fixtures get their own node_modules even\n * when the temp directory is inside another pnpm workspace. Defaults to true:\n * fixtures copied into this repository's tmp directory are not workspace members,\n * so pnpm would otherwise resolve the install to the repository root and leave the\n * fixture without node_modules.\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 = true, 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 // which the build generated from the repository's own pnpm-workspace.yaml.\n await writeFile(join(toPath, 'pnpm-workspace.yaml'), await readFixtureWorkspace())\n }\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 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","FIXTURE_WORKSPACE_FILE","testCopyDirectory","readFixtureWorkspace","workspacePath","error","Error","cause","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","execError","stderr","stdout","message","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,S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2C,CAAC,EAAE;oBACxDyD,KAAKR;gBACP;YACF,EAAE,OAAOhC,OAAO;gBACd,MAAMyC,YAAYzC;gBAClBoB,QAAQpB,KAAK,CAAC;gBACdoB,QAAQpB,KAAK,CAACyC,UAAUC,MAAM,IAAID,UAAUE,MAAM,IAAIF,UAAUG,OAAO;gBACvE,MAAM,IAAI3C,MACR,CAAC,iCAAiC,EAAE+B,OAAO,EAAE,EAAES,UAAUC,MAAM,IAAID,UAAUE,MAAM,IAAIF,UAAUG,OAAO,EAAE,EAC1G;oBAAC1C,OAAOF;gBAAK;YAEjB;QACF;IACF,EAAE,OAAOA,OAAO;QACdoB,QAAQpB,KAAK,CAAC;QACd,MAAMA;IACR,SAAU;QACRoB,QAAQyB,OAAO,CAACvB;IAClB;AACF;AAcA;;;;;;;;;;CAUC,GACD,OAAO,eAAewB,SAAS7B,UAAuC,CAAC,CAAC;IACtE,MAAM,EAACE,OAAO,EAAC,GAAGF;IAClB,MAAMQ,gBAAgB/B,YAAYyB;IAElC,2BAA2B;IAC3B,MAAMjC,GAAGuC,eAAe;QAACsB,OAAO;QAAMC,YAAY;QAAGC,WAAW;IAAI,GAAGC,KAAK,CAAC,KAAO;AACtF"}
|
package/dist/test/util.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as testFixture, c as createMockWatcher, d as DEFAULT_FIXTURES, f as ExampleName, i as testExample, l as createMockSpinner, m as
|
|
1
|
+
import { a as testFixture, c as createMockWatcher, d as DEFAULT_FIXTURES, f as ExampleName, h as FixtureOptions, i as testExample, l as createMockSpinner, m as FixtureName, n as TestFixtureOptions, o as createTestToken, p as FIXTURE_WORKSPACE_FILE, r as testCopyDirectory, s as MockWatcher, t as TestExampleOptions, u as createMockHttpServer } from "../testFixture-BSYY9y-u.js";
|
|
2
2
|
import { n as mockTelemetry, t as MockTelemetryOptions } from "../mockTelemetry-Bh1va02-.js";
|
|
3
3
|
import { t as snapshotSerializer } from "../snapshotSerializer-B3X8EXGX.js";
|
|
4
|
-
export { DEFAULT_FIXTURES, ExampleName, FixtureName, FixtureOptions, MockTelemetryOptions, MockWatcher, TestExampleOptions, TestFixtureOptions, createMockHttpServer, createMockSpinner, createMockWatcher, createTestToken, mockTelemetry, snapshotSerializer, testCopyDirectory, testExample, testFixture };
|
|
4
|
+
export { DEFAULT_FIXTURES, ExampleName, FIXTURE_WORKSPACE_FILE, FixtureName, FixtureOptions, MockTelemetryOptions, MockWatcher, TestExampleOptions, TestFixtureOptions, createMockHttpServer, createMockSpinner, createMockWatcher, createTestToken, mockTelemetry, snapshotSerializer, testCopyDirectory, testExample, testFixture };
|
|
@@ -7,6 +7,16 @@ import { Mock } from "vitest";
|
|
|
7
7
|
interface FixtureOptions {
|
|
8
8
|
includeDist?: boolean;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Name of the `pnpm-workspace.yaml` template bundled alongside the fixtures.
|
|
12
|
+
*
|
|
13
|
+
* The build generates it from the repository's own `pnpm-workspace.yaml` so fixture
|
|
14
|
+
* installs apply the same install policy as the repository, and fixture setup writes
|
|
15
|
+
* it into each fixture as its `pnpm-workspace.yaml`.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
declare const FIXTURE_WORKSPACE_FILE = "fixture-workspace.yaml";
|
|
10
20
|
/**
|
|
11
21
|
* Default fixtures bundled with the package and their options.
|
|
12
22
|
*
|
|
@@ -136,5 +146,5 @@ declare function testFixture(fixtureName: FixtureName | (string & {}), options?:
|
|
|
136
146
|
* @public
|
|
137
147
|
*/
|
|
138
148
|
declare function testExample(exampleName: FixtureName | (string & {}), options?: TestFixtureOptions): Promise<string>;
|
|
139
|
-
export { testFixture as a, createMockWatcher as c, DEFAULT_FIXTURES as d, ExampleName as f, testExample as i, createMockSpinner as l,
|
|
140
|
-
//# sourceMappingURL=testFixture-
|
|
149
|
+
export { testFixture as a, createMockWatcher as c, DEFAULT_FIXTURES as d, ExampleName as f, FixtureOptions as h, testExample as i, createMockSpinner as l, FixtureName as m, TestFixtureOptions as n, createTestToken as o, FIXTURE_WORKSPACE_FILE as p, testCopyDirectory as r, MockWatcher as s, TestExampleOptions as t, createMockHttpServer as u };
|
|
150
|
+
//# sourceMappingURL=testFixture-BSYY9y-u.d.ts.map
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"start": "sanity start"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@sanity/vision": "^6.
|
|
18
|
+
"@sanity/vision": "^6.22.0",
|
|
19
19
|
"react": "^19.2.5",
|
|
20
20
|
"react-dom": "^19.2.5",
|
|
21
|
-
"sanity": "^6.
|
|
21
|
+
"sanity": "^6.22.0",
|
|
22
22
|
"styled-components": "^6.4.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
allowBuilds:
|
|
2
|
+
"@swc/core": true
|
|
3
|
+
esbuild: true
|
|
4
|
+
node-pty: true
|
|
5
|
+
sharp: false
|
|
6
|
+
unrs-resolver: false
|
|
7
|
+
minimumReleaseAge: 4320
|
|
8
|
+
minimumReleaseAgeExclude:
|
|
9
|
+
- "@portabletext/*"
|
|
10
|
+
- "@sanity/*"
|
|
11
|
+
- "@types/*"
|
|
12
|
+
- eventsource
|
|
13
|
+
- eventsource-parser
|
|
14
|
+
- get-it
|
|
15
|
+
- groq-js
|
|
16
|
+
- groq
|
|
17
|
+
- lodash-es
|
|
18
|
+
- react-rx
|
|
19
|
+
- sanity
|
|
20
|
+
- sanity-plugin-media
|
|
21
|
+
- use-effect-event
|
|
22
|
+
- oxfmt
|
|
23
|
+
- "@oxfmt/*"
|
|
24
|
+
- vite
|
|
25
|
+
- "@vitejs/*"
|
|
26
|
+
- rolldown
|
|
27
|
+
- "@rolldown/*"
|
|
28
|
+
- oxc-transform-react
|
|
29
|
+
- "@oxc-transform-react/*"
|
|
30
|
+
- vitest
|
|
31
|
+
- postcss
|
|
32
|
+
- "@vitest/*"
|
|
33
|
+
- "@codemirror/search@6.7.2"
|
|
34
|
+
- "@codemirror/state@6.7.2"
|
|
35
|
+
- "@codemirror/view@6.43.10"
|
|
36
|
+
- "@sentry/browser-utils@10.73.0"
|
|
37
|
+
- "@sentry/browser@10.73.0"
|
|
38
|
+
- "@sentry/core@10.73.0"
|
|
39
|
+
- "@sentry/feedback@10.73.0"
|
|
40
|
+
- "@sentry/react@10.73.0"
|
|
41
|
+
- "@sentry/replay-canvas@10.73.0"
|
|
42
|
+
- "@sentry/replay@10.73.0"
|
|
43
|
+
- i18next@26.4.1
|
|
44
|
+
- react-i18next@17.0.13
|
|
45
|
+
- smol-toml@1.9.0
|
|
46
|
+
- dompurify@3.4.17
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"deploy-graphql": "sanity graphql deploy"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@sanity/vision": "^6.
|
|
15
|
+
"@sanity/vision": "^6.22.0",
|
|
16
16
|
"react": "^19.2.5",
|
|
17
17
|
"react-dom": "^19.2.5",
|
|
18
|
-
"sanity": "^6.
|
|
18
|
+
"sanity": "^6.22.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.
|
|
18
|
+
"@sanity/vision": "^6.22.0",
|
|
19
19
|
"react": "^19.2.5",
|
|
20
20
|
"react-dom": "^19.2.5",
|
|
21
|
-
"sanity": "^6.
|
|
21
|
+
"sanity": "^6.22.0",
|
|
22
22
|
"styled-components": "^6.4.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@sanity/code-input": "^7.1.2",
|
|
19
|
-
"@sanity/vision": "^6.
|
|
19
|
+
"@sanity/vision": "^6.22.0",
|
|
20
20
|
"react": "^19.2.5",
|
|
21
21
|
"react-dom": "^19.2.5",
|
|
22
|
-
"sanity": "^6.
|
|
22
|
+
"sanity": "^6.22.0",
|
|
23
23
|
"sanity-plugin-media": "^4.3.1",
|
|
24
24
|
"styled-components": "^6.4.0",
|
|
25
25
|
"vite-tsconfig-paths": "^6.1.1"
|
|
@@ -28,6 +28,6 @@
|
|
|
28
28
|
"@sanity/color": "^3.0.6",
|
|
29
29
|
"@types/react": "^19.2.14",
|
|
30
30
|
"typescript": "^6.0.3",
|
|
31
|
-
"vite": "^8.3.
|
|
31
|
+
"vite": "^8.3.6"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/cli-test",
|
|
3
|
-
"version": "24.0.
|
|
3
|
+
"version": "24.0.2",
|
|
4
4
|
"description": "Sanity CLI test helpers and utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
"@oclif/core": "^4.11.14",
|
|
125
125
|
"@repo/package.config": "0.0.1",
|
|
126
126
|
"@repo/tsconfig": "3.70.0",
|
|
127
|
-
"@sanity/client": "^8.
|
|
127
|
+
"@sanity/client": "^8.15.0",
|
|
128
128
|
"@sanity/eslint-config-cli": "1.1.3",
|
|
129
129
|
"@sanity/pkg-utils": "^12.3.4",
|
|
130
130
|
"@swc/cli": "^0.8.1",
|
|
@@ -134,14 +134,14 @@
|
|
|
134
134
|
"rimraf": "^6.0.1",
|
|
135
135
|
"tsx": "^4.23.12",
|
|
136
136
|
"typescript": "^6.0.3",
|
|
137
|
-
"vitest": "^
|
|
137
|
+
"vitest": "^5.1.0",
|
|
138
138
|
"yaml": "^2.9.0"
|
|
139
139
|
},
|
|
140
140
|
"peerDependencies": {
|
|
141
141
|
"@oclif/core": "^4.0.0",
|
|
142
142
|
"@sanity/cli-core": "3.14.1",
|
|
143
|
-
"@sanity/client": "^8.
|
|
144
|
-
"vitest": ">=3.0.0 <
|
|
143
|
+
"@sanity/client": "^8.15.0",
|
|
144
|
+
"vitest": ">=3.0.0 <6.0.0"
|
|
145
145
|
},
|
|
146
146
|
"engines": {
|
|
147
147
|
"node": ">=22.12"
|