@sanity/cli-core 3.0.0 → 3.1.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.
Files changed (57) hide show
  1. package/README.md +7 -6
  2. package/dist/NonInteractiveError-CSLT5y93.d.ts +13 -0
  3. package/dist/ProjectRootNotFoundError-RgthN9uy.d.ts +47 -0
  4. package/dist/SanityCommand.d.ts +26 -355
  5. package/dist/SanityCommand.js +5 -0
  6. package/dist/SanityCommand.js.map +1 -1
  7. package/dist/_exports/browser.d.ts +2 -21
  8. package/dist/_exports/config.d.ts +5 -661
  9. package/dist/_exports/debug.d.ts +4 -8
  10. package/dist/_exports/debug.js +3 -3
  11. package/dist/_exports/debug.js.map +1 -1
  12. package/dist/_exports/errors.d.ts +12 -77
  13. package/dist/_exports/index.d.ts +34 -1674
  14. package/dist/_exports/package-manager.d.ts +14 -207
  15. package/dist/_exports/request.d.ts +52 -69
  16. package/dist/_exports/request.js +5 -4
  17. package/dist/_exports/request.js.map +1 -1
  18. package/dist/_exports/schemas.d.ts +2 -235
  19. package/dist/_exports/tasks.d.ts +2 -120
  20. package/dist/_exports/telemetry.d.ts +2 -156
  21. package/dist/_exports/types.d.ts +9 -475
  22. package/dist/_exports/undeploy.d.ts +38 -51
  23. package/dist/_exports/util.d.ts +6 -137
  24. package/dist/_exports/ux.d.ts +31 -102
  25. package/dist/apiClient-DXlF5ZV3.d.ts +65 -0
  26. package/dist/apiClient.d.ts +2 -79
  27. package/dist/apiClient.js +69 -47
  28. package/dist/apiClient.js.map +1 -1
  29. package/dist/cliConfig-CbW8neMv.d.ts +171 -0
  30. package/dist/errors/enrichAuthError.js +48 -0
  31. package/dist/errors/enrichAuthError.js.map +1 -0
  32. package/dist/errors/getErrorMessage.js +3 -1
  33. package/dist/errors/getErrorMessage.js.map +1 -1
  34. package/dist/executionContext.d.ts +21 -20
  35. package/dist/executionContext.js.map +1 -1
  36. package/dist/exitCodes.d.ts +3 -3
  37. package/dist/findStudioConfigPath-DcKlHhyW.d.ts +265 -0
  38. package/dist/getWorkspace-CU32E6Uo.d.ts +54 -0
  39. package/dist/mockBrowserEnvironment-BjFQPb2W.d.ts +19 -0
  40. package/dist/noopTelemetry-BJRIvASI.d.ts +64 -0
  41. package/dist/readPackageJson-Cr_lbjVR.d.ts +67 -0
  42. package/dist/recursivelyResolveProjectRoot-BE54uEP6.d.ts +18 -0
  43. package/dist/request/createRequester.js +39 -50
  44. package/dist/request/createRequester.js.map +1 -1
  45. package/dist/request/nodeReadableFromWeb.js +64 -0
  46. package/dist/request/nodeReadableFromWeb.js.map +1 -0
  47. package/dist/resolveLocalPackage-Dr-TNTyk.d.ts +78 -0
  48. package/dist/safeStructuredClone-CWB0MXmH.d.ts +58 -0
  49. package/dist/schemas-DRCVXpyW.d.ts +140 -0
  50. package/dist/timer-Dwu2TIgB.d.ts +14 -0
  51. package/dist/tsxWorkerTask-CxG3fWbU.d.ts +97 -0
  52. package/dist/types-CwJLTYDj.d.ts +23 -0
  53. package/dist/types-ZNH3prAd.d.ts +91 -0
  54. package/dist/workbenchApp-Dhtbsuhn.d.ts +22 -0
  55. package/package.json +9 -10
  56. package/dist/request/createIsolatedRequester.js +0 -75
  57. package/dist/request/createIsolatedRequester.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/_exports/debug.ts"],"sourcesContent":["import debugIt from 'debug'\n\nimport {getCliExecutionContext} from '../executionContext.js'\n\n/**\n * `debug` instance for the CLI\n *\n * @internal\n */\nexport const debug = debugIt('sanity:cli')\n\nconst defaultLog: (...args: unknown[]) => void = debugIt.log\ndebug.log = (...args: unknown[]) => {\n // DEBUG belongs to the embedding process, not to an individual invocation.\n // Suppress it inside the execution context so it cannot bypass output sinks or expose request details to unrelated host logs.\n if (getCliExecutionContext()) return\n defaultLog(...args)\n}\n\n/**\n * Get a `debug` instance which extends the CLI debug instance with the given namespace,\n * eg namespace would be `sanity:cli:<providedNamespace>`\n *\n * @param namespace - The namespace to extend the CLI debug instance with\n * @returns The extended `debug` instance\n */\nexport const subdebug = (namespace: string) => debug.extend(namespace)\n"],"names":["debugIt","getCliExecutionContext","debug","defaultLog","log","args","subdebug","namespace","extend"],"mappings":"AAAA,OAAOA,aAAa,QAAO;AAE3B,SAAQC,sBAAsB,QAAO,yBAAwB;AAE7D;;;;CAIC,GACD,OAAO,MAAMC,QAAQF,QAAQ,cAAa;AAE1C,MAAMG,aAA2CH,QAAQI,GAAG;AAC5DF,MAAME,GAAG,GAAG,CAAC,GAAGC;IACd,2EAA2E;IAC3E,8HAA8H;IAC9H,IAAIJ,0BAA0B;IAC9BE,cAAcE;AAChB;AAEA;;;;;;CAMC,GACD,OAAO,MAAMC,WAAW,CAACC,YAAsBL,MAAMM,MAAM,CAACD,WAAU"}
1
+ {"version":3,"sources":["../../src/_exports/debug.ts"],"sourcesContent":["import {createDebug} from 'obug'\n\nimport {getCliExecutionContext} from '../executionContext.js'\n\n/**\n * `debug` instance for the CLI\n *\n * @internal\n */\nexport const debug = createDebug('sanity:cli')\n\nconst defaultLog: (...args: unknown[]) => void = debug.log.bind(debug)\ndebug.log = (...args: unknown[]) => {\n // DEBUG belongs to the embedding process, not to an individual invocation.\n // Suppress it inside the execution context so it cannot bypass output sinks or expose request details to unrelated host logs.\n if (getCliExecutionContext()) return\n defaultLog(...args)\n}\n\n/**\n * Get a `debug` instance which extends the CLI debug instance with the given namespace,\n * eg namespace would be `sanity:cli:<providedNamespace>`\n *\n * @param namespace - The namespace to extend the CLI debug instance with\n * @returns The extended `debug` instance\n */\nexport const subdebug = (namespace: string) => debug.extend(namespace)\n"],"names":["createDebug","getCliExecutionContext","debug","defaultLog","log","bind","args","subdebug","namespace","extend"],"mappings":"AAAA,SAAQA,WAAW,QAAO,OAAM;AAEhC,SAAQC,sBAAsB,QAAO,yBAAwB;AAE7D;;;;CAIC,GACD,OAAO,MAAMC,QAAQF,YAAY,cAAa;AAE9C,MAAMG,aAA2CD,MAAME,GAAG,CAACC,IAAI,CAACH;AAChEA,MAAME,GAAG,GAAG,CAAC,GAAGE;IACd,2EAA2E;IAC3E,8HAA8H;IAC9H,IAAIL,0BAA0B;IAC9BE,cAAcG;AAChB;AAEA;;;;;;CAMC,GACD,OAAO,MAAMC,WAAW,CAACC,YAAsBN,MAAMO,MAAM,CAACD,WAAU"}
@@ -1,85 +1,20 @@
1
- import { CLIError } from "@oclif/core/errors";
2
-
1
+ import { t as NonInteractiveError } from "../NonInteractiveError-CSLT5y93.js";
2
+ import { i as isNotFoundError, n as isProjectRootNotFoundError, r as NotFoundError, t as ProjectRootNotFoundError } from "../ProjectRootNotFoundError-RgthN9uy.js";
3
3
  /**
4
- * Get the error message from an error object
5
- *
6
- * @param err - The error object
7
- * @returns The error message
8
- * @internal
9
- */
10
- export declare function getErrorMessage(err: unknown): string;
11
-
12
- /**
13
- * Returns whether or not the given error is a `NotFoundError`
14
- *
15
- * @param err - The error to check
16
- * @returns `true` if the error is a `NotFoundError`, `false` otherwise
17
- * @internal
18
- */
19
- export declare function isNotFoundError(err: unknown): err is NotFoundError;
20
-
21
- /**
22
- * Returns whether or not the given error is a `ProjectRootNotFoundError`
23
- *
24
- * @param err - The error to check
25
- * @returns `true` if the error is a `ProjectRootNotFoundError`, `false` otherwise
26
- * @internal
27
- */
28
- export declare function isProjectRootNotFoundError(
29
- err: unknown,
30
- ): err is ProjectRootNotFoundError;
31
-
32
- /**
33
- * Error thrown when a prompt is attempted in a non-interactive environment
34
- * (e.g., CI, non-TTY, piped stdin). Callers can catch this specific error
35
- * to provide appropriate fallback behavior.
36
- *
37
- * Extends `CLIError` to suppress stack traces in user-facing output.
38
- */
39
- export declare class NonInteractiveError extends CLIError {
40
- constructor(promptName: string);
41
- }
42
-
43
- /**
44
- * Error thrown when a file or directory is not found
45
- *
46
- * `code` is always `ENOENT` to mirror Node.js behavior when a file is not found
47
- *
48
- * @internal
49
- */
50
- export declare class NotFoundError extends Error {
51
- code: string;
52
- path?: string;
53
- constructor(message: string, path?: string);
54
- }
55
-
56
- /**
57
- * Error thrown when a project root directory cannot be found.
58
- *
59
- * This occurs when the CLI is run outside a Sanity project directory
60
- * (one containing `sanity.config.(ts|js)` or `sanity.cli.(ts|js)`).
61
- *
62
- * Extends `CLIError` to suppress stack traces in user-facing output.
4
+ * Coerce an unknown thrown value into an Error instance.
63
5
  *
6
+ * @param value - The thrown value
7
+ * @returns An Error instance (the original if already an Error, otherwise a new one)
64
8
  * @internal
65
9
  */
66
- export declare class ProjectRootNotFoundError extends CLIError {
67
- constructor(
68
- message: string,
69
- options?: {
70
- cause?: Error;
71
- suggestions?: string[];
72
- },
73
- );
74
- }
75
-
10
+ declare function toError(value: unknown): Error;
76
11
  /**
77
- * Coerce an unknown thrown value into an Error instance.
12
+ * Get the error message from an error object
78
13
  *
79
- * @param value - The thrown value
80
- * @returns An Error instance (the original if already an Error, otherwise a new one)
14
+ * @param err - The error object
15
+ * @returns The error message
81
16
  * @internal
82
17
  */
83
- export declare function toError(value: unknown): Error;
84
-
85
- export {};
18
+ declare function getErrorMessage(err: unknown): string;
19
+ export { NonInteractiveError, NotFoundError, ProjectRootNotFoundError, getErrorMessage, isNotFoundError, isProjectRootNotFoundError, toError };
20
+ //# sourceMappingURL=errors.d.ts.map