@sanity/cli-test 0.0.2-alpha.7 → 0.0.2-alpha.8
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 +31 -31
- package/dist/index.d.ts +517 -9
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/test/constants.js +19 -6
- package/dist/test/constants.js.map +1 -1
- package/dist/test/createTestClient.js +2 -0
- package/dist/test/createTestClient.js.map +1 -1
- package/dist/test/createTestToken.js +8 -1
- package/dist/test/createTestToken.js.map +1 -1
- package/dist/test/mockApi.js +5 -3
- package/dist/test/mockApi.js.map +1 -1
- package/dist/test/mockSanityCommand.js +16 -0
- package/dist/test/mockSanityCommand.js.map +1 -1
- package/dist/test/mockTelemetry.js +22 -0
- package/dist/test/mockTelemetry.js.map +1 -0
- package/dist/test/{setupExamples.js → setupFixtures.js} +43 -35
- package/dist/test/setupFixtures.js.map +1 -0
- package/dist/test/snapshotSerializer.js +12 -0
- package/dist/test/snapshotSerializer.js.map +1 -0
- package/dist/test/testCommand.js +6 -1
- package/dist/test/testCommand.js.map +1 -1
- package/dist/test/{testExample.js → testFixture.js} +46 -27
- package/dist/test/testFixture.js.map +1 -0
- package/dist/test/testHook.js +23 -7
- package/dist/test/testHook.js.map +1 -1
- package/dist/utils/paths.js +43 -7
- package/dist/utils/paths.js.map +1 -1
- package/dist/vitest.d.ts +104 -8
- package/dist/vitest.js +3 -2
- package/dist/vitest.js.map +1 -1
- package/dist/vitestWorker.js +4 -0
- package/dist/vitestWorker.js.map +1 -1
- package/{examples → fixtures}/basic-app/package.json +5 -6
- package/{examples → fixtures}/basic-studio/package.json +5 -6
- package/{examples → fixtures}/multi-workspace-studio/package.json +5 -6
- package/fixtures/prebuilt-app/README.md +3 -0
- package/fixtures/prebuilt-app/dist/favicon.ico +0 -0
- package/fixtures/prebuilt-app/dist/index.html +102 -0
- package/fixtures/prebuilt-app/dist/static/sanity-CtOxKsdo.css +24 -0
- package/fixtures/prebuilt-app/dist/static/sanity-D4a4eOYZ.js +17 -0
- package/fixtures/prebuilt-app/package.json +26 -0
- package/fixtures/prebuilt-app/sanity.cli.ts +12 -0
- package/fixtures/prebuilt-app/src/App.css +20 -0
- package/fixtures/prebuilt-app/src/App.tsx +24 -0
- package/fixtures/prebuilt-app/tsconfig.json +17 -0
- package/fixtures/prebuilt-studio/README.md +3 -0
- package/fixtures/prebuilt-studio/dist/favicon.ico +0 -0
- package/fixtures/prebuilt-studio/dist/index.html +113 -0
- package/fixtures/prebuilt-studio/dist/static/sanity-DxH-rpFr.js +9 -0
- package/fixtures/prebuilt-studio/package.json +25 -0
- package/fixtures/prebuilt-studio/sanity.cli.ts +11 -0
- package/fixtures/prebuilt-studio/sanity.config.ts +11 -0
- package/fixtures/prebuilt-studio/tsconfig.json +17 -0
- package/{examples → fixtures}/worst-case-studio/package.json +7 -8
- package/package.json +21 -19
- package/dist/test/captureOutput.d.ts +0 -33
- package/dist/test/constants.d.ts +0 -2
- package/dist/test/createTestClient.d.ts +0 -44
- package/dist/test/createTestToken.d.ts +0 -1
- package/dist/test/mockApi.d.ts +0 -34
- package/dist/test/mockSanityCommand.d.ts +0 -45
- package/dist/test/setupExamples.d.ts +0 -60
- package/dist/test/setupExamples.js.map +0 -1
- package/dist/test/testCommand.d.ts +0 -21
- package/dist/test/testExample.d.ts +0 -46
- package/dist/test/testExample.js.map +0 -1
- package/dist/test/testHook.d.ts +0 -8
- package/dist/utils/fileExists.d.ts +0 -9
- package/dist/utils/paths.d.ts +0 -22
- package/dist/vitestWorker.d.ts +0 -23
- /package/{examples → fixtures}/basic-app/sanity.cli.ts +0 -0
- /package/{examples → fixtures}/basic-app/src/App.css +0 -0
- /package/{examples → fixtures}/basic-app/src/App.tsx +0 -0
- /package/{examples → fixtures}/basic-app/src/ExampleComponent.css +0 -0
- /package/{examples → fixtures}/basic-app/src/ExampleComponent.tsx +0 -0
- /package/{examples → fixtures}/basic-app/tsconfig.json +0 -0
- /package/{examples → fixtures}/basic-studio/sanity.cli.ts +0 -0
- /package/{examples → fixtures}/basic-studio/sanity.config.ts +0 -0
- /package/{examples → fixtures}/basic-studio/schemaTypes/author.ts +0 -0
- /package/{examples → fixtures}/basic-studio/schemaTypes/blockContent.ts +0 -0
- /package/{examples → fixtures}/basic-studio/schemaTypes/category.ts +0 -0
- /package/{examples → fixtures}/basic-studio/schemaTypes/index.ts +0 -0
- /package/{examples → fixtures}/basic-studio/schemaTypes/post.ts +0 -0
- /package/{examples → fixtures}/basic-studio/tsconfig.json +0 -0
- /package/{examples → fixtures}/multi-workspace-studio/sanity.cli.ts +0 -0
- /package/{examples → fixtures}/multi-workspace-studio/sanity.config.ts +0 -0
- /package/{examples → fixtures}/multi-workspace-studio/schemaTypes/author.ts +0 -0
- /package/{examples → fixtures}/multi-workspace-studio/schemaTypes/blockContent.ts +0 -0
- /package/{examples → fixtures}/multi-workspace-studio/schemaTypes/category.ts +0 -0
- /package/{examples → fixtures}/multi-workspace-studio/schemaTypes/index.ts +0 -0
- /package/{examples → fixtures}/multi-workspace-studio/schemaTypes/post.ts +0 -0
- /package/{examples → fixtures}/multi-workspace-studio/tsconfig.json +0 -0
- /package/{examples → fixtures}/worst-case-studio/README.md +0 -0
- /package/{examples → fixtures}/worst-case-studio/sanity.cli.ts +0 -0
- /package/{examples → fixtures}/worst-case-studio/sanity.config.tsx +0 -0
- /package/{examples → fixtures}/worst-case-studio/src/defines.ts +0 -0
- /package/{examples → fixtures}/worst-case-studio/src/descriptionIcon.svg +0 -0
- /package/{examples → fixtures}/worst-case-studio/src/descriptionInput.module.css +0 -0
- /package/{examples → fixtures}/worst-case-studio/src/descriptionInput.tsx +0 -0
- /package/{examples → fixtures}/worst-case-studio/src/schemaTypes/author.ts +0 -0
- /package/{examples → fixtures}/worst-case-studio/src/schemaTypes/blockContent.ts +0 -0
- /package/{examples → fixtures}/worst-case-studio/src/schemaTypes/category.ts +0 -0
- /package/{examples → fixtures}/worst-case-studio/src/schemaTypes/index.ts +0 -0
- /package/{examples → fixtures}/worst-case-studio/src/schemaTypes/post.ts +0 -0
- /package/{examples → fixtures}/worst-case-studio/src/typings.d.ts +0 -0
- /package/{examples → fixtures}/worst-case-studio/tsconfig.json +0 -0
package/dist/test/testHook.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
2
|
-
import { type Hook, type Hooks } from '@oclif/core/hooks';
|
|
3
|
-
interface Options {
|
|
4
|
-
Command?: Command.Loadable;
|
|
5
|
-
context?: Hook.Context;
|
|
6
|
-
}
|
|
7
|
-
export declare function testHook<T extends keyof Hooks>(hook: Hook<T>, options?: Options): Promise<import("./captureOutput.js").CaptureResult<Hooks[T]["return"]>>;
|
|
8
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if a file exists and can be "accessed".
|
|
3
|
-
* Prone to race conditions, but good enough for our use cases.
|
|
4
|
-
*
|
|
5
|
-
* @param filePath - The path to the file to check
|
|
6
|
-
* @returns A promise that resolves to true if the file exists, false otherwise
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export declare function fileExists(filePath: string): Promise<boolean>;
|
package/dist/utils/paths.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gets the path to the examples directory bundled with this package.
|
|
3
|
-
*
|
|
4
|
-
* The examples are copied during build and bundled with the published package.
|
|
5
|
-
* This function works the same whether the package is used in a monorepo
|
|
6
|
-
* or installed from npm.
|
|
7
|
-
*
|
|
8
|
-
* @returns Absolute path to the examples directory
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
export declare function getExamplesPath(): string;
|
|
12
|
-
/**
|
|
13
|
-
* Gets the path to the temporary directory for test examples.
|
|
14
|
-
*
|
|
15
|
-
* Uses the initial working directory captured when this module was first loaded,
|
|
16
|
-
* not process.cwd() which may change during test execution.
|
|
17
|
-
*
|
|
18
|
-
* @param customTempDir - Optional custom temp directory path
|
|
19
|
-
* @returns Absolute path to temp directory (default: initial cwd/tmp)
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
export declare function getTempPath(customTempDir?: string): string;
|
package/dist/vitestWorker.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Setup function to build the worker files with esbuild.
|
|
3
|
-
*
|
|
4
|
-
* Bundles the worker files with esbuild and sets up watch mode if in watch mode.
|
|
5
|
-
* All npm packages are automatically marked as external (loaded from node_modules at runtime).
|
|
6
|
-
* Only internal project code is bundled inline.
|
|
7
|
-
*
|
|
8
|
-
* @param filePaths - The paths to the worker files to build
|
|
9
|
-
* @returns A promise that resolves when the worker build is setup
|
|
10
|
-
* @throws If the worker files cannot be bundled
|
|
11
|
-
* @throws If the watcher cannot be set up
|
|
12
|
-
*/
|
|
13
|
-
export declare function setupWorkerBuild(filePaths: string[]): Promise<void>;
|
|
14
|
-
/**
|
|
15
|
-
* Teardown function to clean up the worker build.
|
|
16
|
-
*
|
|
17
|
-
* Closes all build contexts and deletes the compiled JavaScript files.
|
|
18
|
-
*
|
|
19
|
-
* @returns A promise that resolves when the worker build is teared down
|
|
20
|
-
* @throws If the build contexts cannot be disposed
|
|
21
|
-
* @throws If the compiled JavaScript files cannot be deleted
|
|
22
|
-
*/
|
|
23
|
-
export declare function teardownWorkerBuild(): Promise<void>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|