@sanity/runtime-cli 17.1.0 → 17.2.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 (61) hide show
  1. package/README.md +23 -22
  2. package/dist/actions/blueprints/assets.d.ts +2 -1
  3. package/dist/actions/blueprints/assets.js +2 -2
  4. package/dist/actions/blueprints/blueprint.d.ts +1 -1
  5. package/dist/actions/blueprints/wait-for-operation.js +4 -0
  6. package/dist/actions/sanity/examples.d.ts +4 -4
  7. package/dist/baseCommands.d.ts +4 -4
  8. package/dist/commands/blueprints/add.d.ts +1 -1
  9. package/dist/commands/blueprints/config.d.ts +1 -1
  10. package/dist/commands/blueprints/deploy.d.ts +1 -1
  11. package/dist/commands/blueprints/destroy.d.ts +1 -1
  12. package/dist/commands/blueprints/doctor.d.ts +0 -1
  13. package/dist/commands/blueprints/doctor.js +3 -7
  14. package/dist/commands/blueprints/info.d.ts +1 -1
  15. package/dist/commands/blueprints/logs.d.ts +1 -1
  16. package/dist/commands/blueprints/mint-deploy-token.d.ts +1 -1
  17. package/dist/commands/blueprints/plan.d.ts +1 -1
  18. package/dist/commands/blueprints/promote.d.ts +1 -1
  19. package/dist/commands/blueprints/stacks.d.ts +1 -1
  20. package/dist/commands/functions/add.d.ts +1 -1
  21. package/dist/commands/functions/build.d.ts +1 -1
  22. package/dist/commands/functions/dev.d.ts +1 -1
  23. package/dist/commands/functions/env/add.d.ts +1 -1
  24. package/dist/commands/functions/env/list.d.ts +1 -1
  25. package/dist/commands/functions/env/remove.d.ts +1 -1
  26. package/dist/commands/functions/logs.d.ts +1 -1
  27. package/dist/commands/functions/test.d.ts +1 -1
  28. package/dist/cores/blueprints/deploy.js +5 -4
  29. package/dist/cores/blueprints/doctor.js +15 -12
  30. package/dist/cores/functions/build.js +3 -2
  31. package/dist/cores/functions/test.js +4 -2
  32. package/dist/server/app.js +8 -2
  33. package/dist/server/static/favicon-dark.svg +1 -0
  34. package/dist/server/static/favicon.svg +1 -0
  35. package/dist/server/static/index.html +1 -1
  36. package/dist/server/static/vendor/vendor.bundle.js +5 -0
  37. package/dist/utils/functions/find-entry-point.d.ts +1 -1
  38. package/dist/utils/functions/find-entry-point.js +10 -12
  39. package/dist/utils/functions/invoke/local.js +1 -1
  40. package/dist/utils/functions/invoke/prepare.d.ts +1 -1
  41. package/dist/utils/functions/invoke/prepare.js +19 -8
  42. package/dist/utils/functions/package-json.d.ts +1 -2
  43. package/dist/utils/functions/package-json.js +4 -6
  44. package/dist/utils/functions/prepare-asset.d.ts +2 -2
  45. package/dist/utils/functions/prepare-asset.js +18 -7
  46. package/dist/utils/functions/resolve-dependencies.d.ts +4 -1
  47. package/dist/utils/functions/resolve-dependencies.js +5 -6
  48. package/dist/utils/functions/resource-to-arc.d.ts +1 -1
  49. package/dist/utils/functions/resource-to-arc.js +4 -5
  50. package/dist/utils/functions/should-transpile.d.ts +7 -1
  51. package/dist/utils/functions/should-transpile.js +10 -10
  52. package/dist/utils/functions/transpile/function.d.ts +4 -1
  53. package/dist/utils/functions/transpile/function.js +9 -14
  54. package/dist/utils/functions/transpile/verify-handler.js +1 -1
  55. package/dist/utils/logger.d.ts +7 -5
  56. package/dist/utils/logger.js +33 -1
  57. package/dist/utils/progress.d.ts +5 -0
  58. package/dist/utils/progress.js +40 -0
  59. package/dist/utils/types.d.ts +5 -1
  60. package/oclif.manifest.json +896 -895
  61. package/package.json +23 -22
@@ -0,0 +1,5 @@
1
+ export declare function showProgress(percent: number): void;
2
+ export declare function showBusy(): void;
3
+ export declare function showError(): void;
4
+ export declare function showPaused(percent: number): void;
5
+ export declare function clearProgress(): void;
@@ -0,0 +1,40 @@
1
+ import { stderr } from 'node:process';
2
+ import { onExit } from 'signal-exit';
3
+ const ST = '\x1b\\';
4
+ const STATES = {
5
+ clear: 0,
6
+ normal: 1,
7
+ error: 2,
8
+ paused: 4,
9
+ busy: 3,
10
+ };
11
+ let exitHookRegistered = false;
12
+ function write(state, value = 0) {
13
+ if (!stderr.isTTY)
14
+ return;
15
+ if (!exitHookRegistered) {
16
+ exitHookRegistered = true;
17
+ function clear() {
18
+ stderr.write(`\x1b]9;4;0;0${ST}`);
19
+ }
20
+ // arc/utils SIGINT handler clobbers our signal-exit; luckily it then calls process.exit()
21
+ process.once('exit', clear); // triggered by arc/utils SIGINT handler
22
+ onExit(clear); // triggered by all other exit paths
23
+ }
24
+ stderr.write(`\x1b]9;4;${STATES[state]};${Math.round(value)}${ST}`);
25
+ }
26
+ export function showProgress(percent) {
27
+ write('normal', Math.max(0, Math.min(100, percent)));
28
+ }
29
+ export function showBusy() {
30
+ write('busy');
31
+ }
32
+ export function showError() {
33
+ write('error', 100);
34
+ }
35
+ export function showPaused(percent) {
36
+ write('paused', Math.max(0, Math.min(100, percent)));
37
+ }
38
+ export function clearProgress() {
39
+ write('clear');
40
+ }
@@ -126,6 +126,8 @@ export interface InvokeGroqContextOptions {
126
126
  functionResourceId: string;
127
127
  /** All resources declared by the blueprint, used to populate `context.resources` at invoke time. */
128
128
  resources?: BlueprintResource[];
129
+ /** The directory where the blueprint manifest is located. */
130
+ blueprintFileDir: string;
129
131
  }
130
132
  /** @internal */
131
133
  export interface InvokeScheduleContextOptions {
@@ -134,6 +136,8 @@ export interface InvokeScheduleContextOptions {
134
136
  };
135
137
  /** All resources declared by the blueprint, used to populate `context.resources` at invoke time. */
136
138
  resources?: BlueprintResource[];
139
+ /** The directory where the blueprint manifest is located. */
140
+ blueprintFileDir: string;
137
141
  }
138
142
  export type InvokeContextOptions = InvokeGroqContextOptions | InvokeScheduleContextOptions;
139
143
  export declare function isGroqContextOptions(context: InvokeContextOptions): context is InvokeGroqContextOptions;
@@ -265,7 +269,7 @@ export declare interface FetchConfig {
265
269
  apiHost?: string;
266
270
  apiVersion?: string;
267
271
  }
268
- export declare const INSTALLER_OPTIONS: readonly ["npm", "pnpm", "yarn"];
272
+ export declare const INSTALLER_OPTIONS: readonly ['npm', 'pnpm', 'yarn'];
269
273
  export type InstallerType = 'npm' | 'pnpm' | 'yarn';
270
274
  export type AssetPrepResult = {
271
275
  success: true;