@sanity/runtime-cli 17.2.0 → 17.3.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 +35 -26
- package/dist/actions/blueprints/assets.js +15 -24
- package/dist/actions/blueprints/pre-deploy.d.ts +29 -0
- package/dist/actions/blueprints/pre-deploy.js +164 -0
- package/dist/commands/functions/env/add.d.ts +3 -0
- package/dist/commands/functions/env/add.js +6 -2
- package/dist/commands/functions/env/list.d.ts +3 -0
- package/dist/commands/functions/env/list.js +9 -3
- package/dist/commands/functions/env/remove.d.ts +3 -0
- package/dist/commands/functions/env/remove.js +9 -3
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/cores/blueprints/deploy.js +16 -64
- package/dist/utils/functions/child-process-wrapper.js +13 -171
- package/dist/utils/functions/child-runtime/console.d.ts +1 -0
- package/dist/utils/functions/child-runtime/console.js +50 -0
- package/dist/utils/functions/child-runtime/invoke.d.ts +4 -0
- package/dist/utils/functions/child-runtime/invoke.js +47 -0
- package/dist/utils/functions/child-runtime/resources.d.ts +4 -0
- package/dist/utils/functions/child-runtime/resources.js +59 -0
- package/dist/utils/studios/prepare-asset.d.ts +6 -0
- package/dist/utils/studios/prepare-asset.js +139 -0
- package/dist/utils/types.d.ts +4 -7
- package/dist/utils/types.js +2 -3
- package/oclif.manifest.json +932 -932
- package/package.json +10 -4
package/dist/utils/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BlueprintCorsOriginResource, type BlueprintDatasetResource, type BlueprintDocumentFunctionResource, type BlueprintDocumentWebhookResource, type BlueprintMediaLibraryAssetFunctionResource, type BlueprintProjectResource, type BlueprintResource, type BlueprintRobotResource, type BlueprintRoleResource, type BlueprintScheduledFunctionResource, type BlueprintSyncTagInvalidateFunctionResource } from '@sanity/blueprints';
|
|
1
|
+
import { type BlueprintCorsOriginResource, type BlueprintDatasetResource, type BlueprintDocumentFunctionResource, type BlueprintDocumentWebhookResource, type BlueprintMediaLibraryAssetFunctionResource, type BlueprintProjectResource, type BlueprintResource, type BlueprintRobotResource, type BlueprintRoleResource, type BlueprintScheduledFunctionResource, type BlueprintStudioResource, type BlueprintSyncTagInvalidateFunctionResource } from '@sanity/blueprints';
|
|
2
2
|
export type ScopeType = 'organization' | 'project';
|
|
3
3
|
/** Result utility type */
|
|
4
4
|
export type Result<T, E = string> = {
|
|
@@ -16,12 +16,8 @@ export interface ActionResponse {
|
|
|
16
16
|
/** @internal */
|
|
17
17
|
export type FunctionGroqResource = BlueprintDocumentFunctionResource | BlueprintMediaLibraryAssetFunctionResource;
|
|
18
18
|
export type FunctionResource = FunctionGroqResource | BlueprintScheduledFunctionResource | BlueprintSyncTagInvalidateFunctionResource;
|
|
19
|
-
export interface StudioResource extends BlueprintResource {
|
|
20
|
-
type: 'sanity.studio';
|
|
21
|
-
src: string;
|
|
22
|
-
}
|
|
23
19
|
/** Resource types that carry a deployable asset (have src: string) */
|
|
24
|
-
export type AssetResource = FunctionResource |
|
|
20
|
+
export type AssetResource = FunctionResource | BlueprintStudioResource;
|
|
25
21
|
/** @internal */
|
|
26
22
|
export interface AuthParams {
|
|
27
23
|
token: string;
|
|
@@ -46,7 +42,7 @@ export declare function isProjectResource(r: unknown): r is BlueprintProjectReso
|
|
|
46
42
|
export declare function isRobotResource(r: unknown): r is BlueprintRobotResource;
|
|
47
43
|
export declare function isRoleResource(r: unknown): r is BlueprintRoleResource;
|
|
48
44
|
export declare function isDatasetResource(r: unknown): r is BlueprintDatasetResource;
|
|
49
|
-
export declare function isStudioResource(r: BlueprintResource): r is
|
|
45
|
+
export declare function isStudioResource(r: BlueprintResource): r is BlueprintStudioResource;
|
|
50
46
|
export declare function isAssetResource(r: BlueprintResource): r is AssetResource;
|
|
51
47
|
export declare function isWebhookResource(r: unknown): r is BlueprintDocumentWebhookResource;
|
|
52
48
|
interface StackBase {
|
|
@@ -84,6 +80,7 @@ export interface StackMutation {
|
|
|
84
80
|
resources?: BlueprintResource[];
|
|
85
81
|
};
|
|
86
82
|
userMessage?: string;
|
|
83
|
+
preDeploy?: boolean;
|
|
87
84
|
}
|
|
88
85
|
/** @internal */
|
|
89
86
|
export interface BuildPayloadOptions {
|
package/dist/utils/types.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { validateCorsOrigin, validateDataset, validateDocumentWebhook, validateProject, validateRobot, validateRole, } from '@sanity/blueprints';
|
|
2
|
-
import { SANITY_FUNCTION_PREFIX } from '../constants.js';
|
|
2
|
+
import { SANITY_FUNCTION_PREFIX, SANITY_STUDIO } from '../constants.js';
|
|
3
3
|
export function isLocalFunctionResource(r) {
|
|
4
4
|
return r.type.startsWith(SANITY_FUNCTION_PREFIX);
|
|
5
5
|
}
|
|
@@ -22,9 +22,8 @@ export function isRoleResource(r) {
|
|
|
22
22
|
export function isDatasetResource(r) {
|
|
23
23
|
return validateDataset(r).length === 0;
|
|
24
24
|
}
|
|
25
|
-
// TODO: update to use blueprints helpers once available
|
|
26
25
|
export function isStudioResource(r) {
|
|
27
|
-
return r.type ===
|
|
26
|
+
return r.type === SANITY_STUDIO;
|
|
28
27
|
}
|
|
29
28
|
export function isAssetResource(r) {
|
|
30
29
|
return isLocalFunctionResource(r) || isStudioResource(r);
|