@sanity/cli-test 17.0.0 → 18.0.0
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/README.md +1 -0
- package/dist/test/setupFixtures.d.ts +5 -3
- package/dist/test/setupFixtures.js +1 -1
- package/dist/test/setupFixtures.js.map +1 -1
- package/fixtures/basic-app/.gitignore +29 -0
- package/fixtures/basic-app/package.json +1 -1
- package/fixtures/basic-functions/.gitignore +9 -0
- package/fixtures/basic-functions/package.json +1 -1
- package/fixtures/basic-studio/.gitignore +29 -0
- package/fixtures/basic-studio/package.json +2 -2
- package/fixtures/federated-studio/.gitignore +29 -0
- package/fixtures/graphql-studio/.gitignore +29 -0
- package/fixtures/graphql-studio/package.json +2 -2
- package/fixtures/multi-workspace-studio/.gitignore +29 -0
- package/fixtures/multi-workspace-studio/package.json +2 -2
- package/fixtures/nextjs-app/.gitignore +41 -0
- package/fixtures/prebuilt-app/.gitignore +31 -0
- package/fixtures/prebuilt-app/package.json +1 -1
- package/fixtures/prebuilt-studio/.gitignore +31 -0
- package/fixtures/prebuilt-studio/package.json +1 -1
- package/fixtures/worst-case-studio/.gitignore +35 -0
- package/fixtures/worst-case-studio/package.json +3 -3
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -73,6 +73,7 @@ Vitest global setup function that copies fixtures and installs dependencies. Thi
|
|
|
73
73
|
**Parameters:**
|
|
74
74
|
|
|
75
75
|
- `options.additionalFixtures` - Glob patterns for additional fixture directories from your local repo to set up alongside the default bundled fixtures (e.g., `['fixtures/*', 'dev/*']`). Only directories containing a `package.json` are included.
|
|
76
|
+
- `options.ignoreWorkspace` - Give each fixture its own pnpm workspace so it installs its own `node_modules` even when the temp directory sits inside another workspace (defaults to `true`)
|
|
76
77
|
- `options.tempDir` - Custom temp directory path (defaults to `process.cwd()/tmp`)
|
|
77
78
|
|
|
78
79
|
**Note:** Fixtures are NOT built during setup. Tests that need built output should build explicitly.
|
|
@@ -18,9 +18,11 @@ interface SetupTestFixturesOptions {
|
|
|
18
18
|
*/
|
|
19
19
|
additionalFixtures?: string[];
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* Creates an isolated pnpm workspace so fixtures get their own node_modules even
|
|
22
|
+
* when the temp directory is inside another pnpm workspace. Defaults to true:
|
|
23
|
+
* fixtures copied into this repository's tmp directory are not workspace members,
|
|
24
|
+
* so pnpm would otherwise resolve the install to the repository root and leave the
|
|
25
|
+
* fixture without node_modules.
|
|
24
26
|
*/
|
|
25
27
|
ignoreWorkspace?: boolean;
|
|
26
28
|
/**
|
|
@@ -53,7 +53,7 @@ async function getAdditionalFixturePaths(fixtures) {
|
|
|
53
53
|
* })
|
|
54
54
|
* ```
|
|
55
55
|
*/ export async function setup(_, options = {}) {
|
|
56
|
-
const { additionalFixtures, ignoreWorkspace, tempDir } = options;
|
|
56
|
+
const { additionalFixtures, ignoreWorkspace = true, tempDir } = options;
|
|
57
57
|
console.log('Initializing test environment...');
|
|
58
58
|
const timerLabel = 'Test environment initialization';
|
|
59
59
|
console.time(timerLabel);
|
|
@@ -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, 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;YAA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,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} 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,I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B,UACJE,KAAKqC,QAAQ,wBACb;YAEJ;YAEA,uDAAuD;YACvD,IAAI;gBACF,8DAA8D;gBAC9D,qEAAqE;gBACrE,2EAA2E;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"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# Dependencies
|
|
4
|
+
/node_modules
|
|
5
|
+
/.pnp
|
|
6
|
+
.pnp.js
|
|
7
|
+
|
|
8
|
+
# Compiled Sanity Studio
|
|
9
|
+
/dist
|
|
10
|
+
|
|
11
|
+
# Temporary Sanity runtime, generated by the CLI on every dev server start
|
|
12
|
+
/.sanity
|
|
13
|
+
|
|
14
|
+
# Logs
|
|
15
|
+
/logs
|
|
16
|
+
*.log
|
|
17
|
+
|
|
18
|
+
# Coverage directory used by testing tools
|
|
19
|
+
/coverage
|
|
20
|
+
|
|
21
|
+
# Misc
|
|
22
|
+
.DS_Store
|
|
23
|
+
*.pem
|
|
24
|
+
|
|
25
|
+
# Typescript
|
|
26
|
+
*.tsbuildinfo
|
|
27
|
+
|
|
28
|
+
# Dotenv and similar local-only files
|
|
29
|
+
*.local
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# Dependencies
|
|
4
|
+
/node_modules
|
|
5
|
+
/.pnp
|
|
6
|
+
.pnp.js
|
|
7
|
+
|
|
8
|
+
# Compiled Sanity Studio
|
|
9
|
+
/dist
|
|
10
|
+
|
|
11
|
+
# Temporary Sanity runtime, generated by the CLI on every dev server start
|
|
12
|
+
/.sanity
|
|
13
|
+
|
|
14
|
+
# Logs
|
|
15
|
+
/logs
|
|
16
|
+
*.log
|
|
17
|
+
|
|
18
|
+
# Coverage directory used by testing tools
|
|
19
|
+
/coverage
|
|
20
|
+
|
|
21
|
+
# Misc
|
|
22
|
+
.DS_Store
|
|
23
|
+
*.pem
|
|
24
|
+
|
|
25
|
+
# Typescript
|
|
26
|
+
*.tsbuildinfo
|
|
27
|
+
|
|
28
|
+
# Dotenv and similar local-only files
|
|
29
|
+
*.local
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"start": "sanity start"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@sanity/vision": "^6.
|
|
18
|
+
"@sanity/vision": "^6.15.0",
|
|
19
19
|
"react": "^19.2.5",
|
|
20
20
|
"react-dom": "^19.2.5",
|
|
21
|
-
"sanity": "^6.
|
|
21
|
+
"sanity": "^6.15.0",
|
|
22
22
|
"styled-components": "^6.4.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# Dependencies
|
|
4
|
+
/node_modules
|
|
5
|
+
/.pnp
|
|
6
|
+
.pnp.js
|
|
7
|
+
|
|
8
|
+
# Compiled Sanity Studio
|
|
9
|
+
/dist
|
|
10
|
+
|
|
11
|
+
# Temporary Sanity runtime, generated by the CLI on every dev server start
|
|
12
|
+
/.sanity
|
|
13
|
+
|
|
14
|
+
# Logs
|
|
15
|
+
/logs
|
|
16
|
+
*.log
|
|
17
|
+
|
|
18
|
+
# Coverage directory used by testing tools
|
|
19
|
+
/coverage
|
|
20
|
+
|
|
21
|
+
# Misc
|
|
22
|
+
.DS_Store
|
|
23
|
+
*.pem
|
|
24
|
+
|
|
25
|
+
# Typescript
|
|
26
|
+
*.tsbuildinfo
|
|
27
|
+
|
|
28
|
+
# Dotenv and similar local-only files
|
|
29
|
+
*.local
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# Dependencies
|
|
4
|
+
/node_modules
|
|
5
|
+
/.pnp
|
|
6
|
+
.pnp.js
|
|
7
|
+
|
|
8
|
+
# Compiled Sanity Studio
|
|
9
|
+
/dist
|
|
10
|
+
|
|
11
|
+
# Temporary Sanity runtime, generated by the CLI on every dev server start
|
|
12
|
+
/.sanity
|
|
13
|
+
|
|
14
|
+
# Logs
|
|
15
|
+
/logs
|
|
16
|
+
*.log
|
|
17
|
+
|
|
18
|
+
# Coverage directory used by testing tools
|
|
19
|
+
/coverage
|
|
20
|
+
|
|
21
|
+
# Misc
|
|
22
|
+
.DS_Store
|
|
23
|
+
*.pem
|
|
24
|
+
|
|
25
|
+
# Typescript
|
|
26
|
+
*.tsbuildinfo
|
|
27
|
+
|
|
28
|
+
# Dotenv and similar local-only files
|
|
29
|
+
*.local
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"deploy-graphql": "sanity graphql deploy"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@sanity/vision": "^6.
|
|
15
|
+
"@sanity/vision": "^6.15.0",
|
|
16
16
|
"react": "^19.2.5",
|
|
17
17
|
"react-dom": "^19.2.5",
|
|
18
|
-
"sanity": "^6.
|
|
18
|
+
"sanity": "^6.15.0",
|
|
19
19
|
"styled-components": "^6.4.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# Dependencies
|
|
4
|
+
/node_modules
|
|
5
|
+
/.pnp
|
|
6
|
+
.pnp.js
|
|
7
|
+
|
|
8
|
+
# Compiled Sanity Studio
|
|
9
|
+
/dist
|
|
10
|
+
|
|
11
|
+
# Temporary Sanity runtime, generated by the CLI on every dev server start
|
|
12
|
+
/.sanity
|
|
13
|
+
|
|
14
|
+
# Logs
|
|
15
|
+
/logs
|
|
16
|
+
*.log
|
|
17
|
+
|
|
18
|
+
# Coverage directory used by testing tools
|
|
19
|
+
/coverage
|
|
20
|
+
|
|
21
|
+
# Misc
|
|
22
|
+
.DS_Store
|
|
23
|
+
*.pem
|
|
24
|
+
|
|
25
|
+
# Typescript
|
|
26
|
+
*.tsbuildinfo
|
|
27
|
+
|
|
28
|
+
# Dotenv and similar local-only files
|
|
29
|
+
*.local
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"start": "sanity start"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@sanity/vision": "^6.
|
|
18
|
+
"@sanity/vision": "^6.15.0",
|
|
19
19
|
"react": "^19.2.5",
|
|
20
20
|
"react-dom": "^19.2.5",
|
|
21
|
-
"sanity": "^6.
|
|
21
|
+
"sanity": "^6.15.0",
|
|
22
22
|
"styled-components": "^6.4.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# dependencies
|
|
4
|
+
/node_modules
|
|
5
|
+
/.pnp
|
|
6
|
+
.pnp.*
|
|
7
|
+
.yarn/*
|
|
8
|
+
!.yarn/patches
|
|
9
|
+
!.yarn/plugins
|
|
10
|
+
!.yarn/releases
|
|
11
|
+
!.yarn/versions
|
|
12
|
+
|
|
13
|
+
# testing
|
|
14
|
+
/coverage
|
|
15
|
+
|
|
16
|
+
# next.js
|
|
17
|
+
/.next/
|
|
18
|
+
/out/
|
|
19
|
+
|
|
20
|
+
# production
|
|
21
|
+
/build
|
|
22
|
+
|
|
23
|
+
# misc
|
|
24
|
+
.DS_Store
|
|
25
|
+
*.pem
|
|
26
|
+
|
|
27
|
+
# debug
|
|
28
|
+
npm-debug.log*
|
|
29
|
+
yarn-debug.log*
|
|
30
|
+
yarn-error.log*
|
|
31
|
+
.pnpm-debug.log*
|
|
32
|
+
|
|
33
|
+
# env files (can opt-in for committing if needed)
|
|
34
|
+
.env*
|
|
35
|
+
|
|
36
|
+
# vercel
|
|
37
|
+
.vercel
|
|
38
|
+
|
|
39
|
+
# typescript
|
|
40
|
+
*.tsbuildinfo
|
|
41
|
+
next-env.d.ts
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# Dependencies
|
|
4
|
+
/node_modules
|
|
5
|
+
/.pnp
|
|
6
|
+
.pnp.js
|
|
7
|
+
|
|
8
|
+
# Explicitly _including_ the dist folder as this is what this fixture is about
|
|
9
|
+
!/dist
|
|
10
|
+
# …but excluding vendor since it can get quite large
|
|
11
|
+
/dist/vendor
|
|
12
|
+
|
|
13
|
+
# Temporary Sanity runtime, generated by the CLI on every dev server start
|
|
14
|
+
/.sanity
|
|
15
|
+
|
|
16
|
+
# Logs
|
|
17
|
+
/logs
|
|
18
|
+
*.log
|
|
19
|
+
|
|
20
|
+
# Coverage directory used by testing tools
|
|
21
|
+
/coverage
|
|
22
|
+
|
|
23
|
+
# Misc
|
|
24
|
+
.DS_Store
|
|
25
|
+
*.pem
|
|
26
|
+
|
|
27
|
+
# Typescript
|
|
28
|
+
*.tsbuildinfo
|
|
29
|
+
|
|
30
|
+
# Dotenv and similar local-only files
|
|
31
|
+
*.local
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# Dependencies
|
|
4
|
+
/node_modules
|
|
5
|
+
/.pnp
|
|
6
|
+
.pnp.js
|
|
7
|
+
|
|
8
|
+
# Explicitly _including_ the dist folder as this is what this fixture is about
|
|
9
|
+
!/dist
|
|
10
|
+
# …but excluding vendor since it can get quite large
|
|
11
|
+
/dist/vendor
|
|
12
|
+
|
|
13
|
+
# Temporary Sanity runtime, generated by the CLI on every dev server start
|
|
14
|
+
/.sanity
|
|
15
|
+
|
|
16
|
+
# Logs
|
|
17
|
+
/logs
|
|
18
|
+
*.log
|
|
19
|
+
|
|
20
|
+
# Coverage directory used by testing tools
|
|
21
|
+
/coverage
|
|
22
|
+
|
|
23
|
+
# Misc
|
|
24
|
+
.DS_Store
|
|
25
|
+
*.pem
|
|
26
|
+
|
|
27
|
+
# Typescript
|
|
28
|
+
*.tsbuildinfo
|
|
29
|
+
|
|
30
|
+
# Dotenv and similar local-only files
|
|
31
|
+
*.local
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# Dependencies
|
|
4
|
+
/node_modules
|
|
5
|
+
/.pnp
|
|
6
|
+
.pnp.js
|
|
7
|
+
|
|
8
|
+
# Compiled Sanity Studio
|
|
9
|
+
/dist
|
|
10
|
+
|
|
11
|
+
# Temporary Sanity runtime, generated by the CLI on every dev server start
|
|
12
|
+
/.sanity
|
|
13
|
+
|
|
14
|
+
# Logs
|
|
15
|
+
/logs
|
|
16
|
+
*.log
|
|
17
|
+
|
|
18
|
+
# Coverage directory used by testing tools
|
|
19
|
+
/coverage
|
|
20
|
+
|
|
21
|
+
# Misc
|
|
22
|
+
.DS_Store
|
|
23
|
+
*.pem
|
|
24
|
+
|
|
25
|
+
# Typescript
|
|
26
|
+
*.tsbuildinfo
|
|
27
|
+
|
|
28
|
+
# Dotenv and similar local-only files
|
|
29
|
+
*.local
|
|
30
|
+
|
|
31
|
+
# Schema extraction output
|
|
32
|
+
schema.json
|
|
33
|
+
|
|
34
|
+
# Override root .gitignore to track .env in this fixture
|
|
35
|
+
!.env
|
|
@@ -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.15.0",
|
|
20
20
|
"react": "^19.2.5",
|
|
21
21
|
"react-dom": "^19.2.5",
|
|
22
|
-
"sanity": "^6.
|
|
22
|
+
"sanity": "^6.15.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.
|
|
31
|
+
"vite": "^8.3.0"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/cli-test",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.0.0",
|
|
4
4
|
"description": "Sanity CLI test helpers and utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -111,11 +111,11 @@
|
|
|
111
111
|
"access": "public"
|
|
112
112
|
},
|
|
113
113
|
"dependencies": {
|
|
114
|
-
"@sanity/cli-core": "3.
|
|
114
|
+
"@sanity/cli-core": "3.8.0",
|
|
115
115
|
"@swc/core": "^1.15.43",
|
|
116
116
|
"ansis": "^4.2.0",
|
|
117
117
|
"esbuild": "^0.28.2",
|
|
118
|
-
"get-it": "^9.5.
|
|
118
|
+
"get-it": "^9.5.4",
|
|
119
119
|
"nock": "^14.0.15",
|
|
120
120
|
"tinyglobby": "^0.2.17"
|
|
121
121
|
},
|
|
@@ -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.6.2",
|
|
128
128
|
"@sanity/eslint-config-cli": "1.1.3",
|
|
129
129
|
"@sanity/pkg-utils": "^12.3.4",
|
|
130
130
|
"@swc/cli": "^0.8.1",
|
|
@@ -139,8 +139,8 @@
|
|
|
139
139
|
},
|
|
140
140
|
"peerDependencies": {
|
|
141
141
|
"@oclif/core": "^4.0.0",
|
|
142
|
-
"@sanity/cli-core": "3.
|
|
143
|
-
"@sanity/client": "^8.
|
|
142
|
+
"@sanity/cli-core": "3.8.0",
|
|
143
|
+
"@sanity/client": "^8.6.2",
|
|
144
144
|
"vitest": ">=3.0.0 <5.0.0"
|
|
145
145
|
},
|
|
146
146
|
"engines": {
|