@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.
Files changed (107) hide show
  1. package/README.md +31 -31
  2. package/dist/index.d.ts +517 -9
  3. package/dist/index.js +4 -2
  4. package/dist/index.js.map +1 -1
  5. package/dist/test/constants.js +19 -6
  6. package/dist/test/constants.js.map +1 -1
  7. package/dist/test/createTestClient.js +2 -0
  8. package/dist/test/createTestClient.js.map +1 -1
  9. package/dist/test/createTestToken.js +8 -1
  10. package/dist/test/createTestToken.js.map +1 -1
  11. package/dist/test/mockApi.js +5 -3
  12. package/dist/test/mockApi.js.map +1 -1
  13. package/dist/test/mockSanityCommand.js +16 -0
  14. package/dist/test/mockSanityCommand.js.map +1 -1
  15. package/dist/test/mockTelemetry.js +22 -0
  16. package/dist/test/mockTelemetry.js.map +1 -0
  17. package/dist/test/{setupExamples.js → setupFixtures.js} +43 -35
  18. package/dist/test/setupFixtures.js.map +1 -0
  19. package/dist/test/snapshotSerializer.js +12 -0
  20. package/dist/test/snapshotSerializer.js.map +1 -0
  21. package/dist/test/testCommand.js +6 -1
  22. package/dist/test/testCommand.js.map +1 -1
  23. package/dist/test/{testExample.js → testFixture.js} +46 -27
  24. package/dist/test/testFixture.js.map +1 -0
  25. package/dist/test/testHook.js +23 -7
  26. package/dist/test/testHook.js.map +1 -1
  27. package/dist/utils/paths.js +43 -7
  28. package/dist/utils/paths.js.map +1 -1
  29. package/dist/vitest.d.ts +104 -8
  30. package/dist/vitest.js +3 -2
  31. package/dist/vitest.js.map +1 -1
  32. package/dist/vitestWorker.js +4 -0
  33. package/dist/vitestWorker.js.map +1 -1
  34. package/{examples → fixtures}/basic-app/package.json +5 -6
  35. package/{examples → fixtures}/basic-studio/package.json +5 -6
  36. package/{examples → fixtures}/multi-workspace-studio/package.json +5 -6
  37. package/fixtures/prebuilt-app/README.md +3 -0
  38. package/fixtures/prebuilt-app/dist/favicon.ico +0 -0
  39. package/fixtures/prebuilt-app/dist/index.html +102 -0
  40. package/fixtures/prebuilt-app/dist/static/sanity-CtOxKsdo.css +24 -0
  41. package/fixtures/prebuilt-app/dist/static/sanity-D4a4eOYZ.js +17 -0
  42. package/fixtures/prebuilt-app/package.json +26 -0
  43. package/fixtures/prebuilt-app/sanity.cli.ts +12 -0
  44. package/fixtures/prebuilt-app/src/App.css +20 -0
  45. package/fixtures/prebuilt-app/src/App.tsx +24 -0
  46. package/fixtures/prebuilt-app/tsconfig.json +17 -0
  47. package/fixtures/prebuilt-studio/README.md +3 -0
  48. package/fixtures/prebuilt-studio/dist/favicon.ico +0 -0
  49. package/fixtures/prebuilt-studio/dist/index.html +113 -0
  50. package/fixtures/prebuilt-studio/dist/static/sanity-DxH-rpFr.js +9 -0
  51. package/fixtures/prebuilt-studio/package.json +25 -0
  52. package/fixtures/prebuilt-studio/sanity.cli.ts +11 -0
  53. package/fixtures/prebuilt-studio/sanity.config.ts +11 -0
  54. package/fixtures/prebuilt-studio/tsconfig.json +17 -0
  55. package/{examples → fixtures}/worst-case-studio/package.json +7 -8
  56. package/package.json +21 -19
  57. package/dist/test/captureOutput.d.ts +0 -33
  58. package/dist/test/constants.d.ts +0 -2
  59. package/dist/test/createTestClient.d.ts +0 -44
  60. package/dist/test/createTestToken.d.ts +0 -1
  61. package/dist/test/mockApi.d.ts +0 -34
  62. package/dist/test/mockSanityCommand.d.ts +0 -45
  63. package/dist/test/setupExamples.d.ts +0 -60
  64. package/dist/test/setupExamples.js.map +0 -1
  65. package/dist/test/testCommand.d.ts +0 -21
  66. package/dist/test/testExample.d.ts +0 -46
  67. package/dist/test/testExample.js.map +0 -1
  68. package/dist/test/testHook.d.ts +0 -8
  69. package/dist/utils/fileExists.d.ts +0 -9
  70. package/dist/utils/paths.d.ts +0 -22
  71. package/dist/vitestWorker.d.ts +0 -23
  72. /package/{examples → fixtures}/basic-app/sanity.cli.ts +0 -0
  73. /package/{examples → fixtures}/basic-app/src/App.css +0 -0
  74. /package/{examples → fixtures}/basic-app/src/App.tsx +0 -0
  75. /package/{examples → fixtures}/basic-app/src/ExampleComponent.css +0 -0
  76. /package/{examples → fixtures}/basic-app/src/ExampleComponent.tsx +0 -0
  77. /package/{examples → fixtures}/basic-app/tsconfig.json +0 -0
  78. /package/{examples → fixtures}/basic-studio/sanity.cli.ts +0 -0
  79. /package/{examples → fixtures}/basic-studio/sanity.config.ts +0 -0
  80. /package/{examples → fixtures}/basic-studio/schemaTypes/author.ts +0 -0
  81. /package/{examples → fixtures}/basic-studio/schemaTypes/blockContent.ts +0 -0
  82. /package/{examples → fixtures}/basic-studio/schemaTypes/category.ts +0 -0
  83. /package/{examples → fixtures}/basic-studio/schemaTypes/index.ts +0 -0
  84. /package/{examples → fixtures}/basic-studio/schemaTypes/post.ts +0 -0
  85. /package/{examples → fixtures}/basic-studio/tsconfig.json +0 -0
  86. /package/{examples → fixtures}/multi-workspace-studio/sanity.cli.ts +0 -0
  87. /package/{examples → fixtures}/multi-workspace-studio/sanity.config.ts +0 -0
  88. /package/{examples → fixtures}/multi-workspace-studio/schemaTypes/author.ts +0 -0
  89. /package/{examples → fixtures}/multi-workspace-studio/schemaTypes/blockContent.ts +0 -0
  90. /package/{examples → fixtures}/multi-workspace-studio/schemaTypes/category.ts +0 -0
  91. /package/{examples → fixtures}/multi-workspace-studio/schemaTypes/index.ts +0 -0
  92. /package/{examples → fixtures}/multi-workspace-studio/schemaTypes/post.ts +0 -0
  93. /package/{examples → fixtures}/multi-workspace-studio/tsconfig.json +0 -0
  94. /package/{examples → fixtures}/worst-case-studio/README.md +0 -0
  95. /package/{examples → fixtures}/worst-case-studio/sanity.cli.ts +0 -0
  96. /package/{examples → fixtures}/worst-case-studio/sanity.config.tsx +0 -0
  97. /package/{examples → fixtures}/worst-case-studio/src/defines.ts +0 -0
  98. /package/{examples → fixtures}/worst-case-studio/src/descriptionIcon.svg +0 -0
  99. /package/{examples → fixtures}/worst-case-studio/src/descriptionInput.module.css +0 -0
  100. /package/{examples → fixtures}/worst-case-studio/src/descriptionInput.tsx +0 -0
  101. /package/{examples → fixtures}/worst-case-studio/src/schemaTypes/author.ts +0 -0
  102. /package/{examples → fixtures}/worst-case-studio/src/schemaTypes/blockContent.ts +0 -0
  103. /package/{examples → fixtures}/worst-case-studio/src/schemaTypes/category.ts +0 -0
  104. /package/{examples → fixtures}/worst-case-studio/src/schemaTypes/index.ts +0 -0
  105. /package/{examples → fixtures}/worst-case-studio/src/schemaTypes/post.ts +0 -0
  106. /package/{examples → fixtures}/worst-case-studio/src/typings.d.ts +0 -0
  107. /package/{examples → fixtures}/worst-case-studio/tsconfig.json +0 -0
@@ -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>;
@@ -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;
@@ -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