@sanity/cli 3.91.1-next.33.f33154ba73 → 3.91.1-next.34.844b3d4b3a
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/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sanity/cli",
|
3
|
-
"version": "3.91.1-next.
|
3
|
+
"version": "3.91.1-next.34.844b3d4b3a",
|
4
4
|
"description": "Sanity CLI tool for managing Sanity installations, managing plugins, schemas and datasets",
|
5
5
|
"keywords": [
|
6
6
|
"sanity",
|
@@ -59,11 +59,11 @@
|
|
59
59
|
"dependencies": {
|
60
60
|
"@babel/traverse": "^7.23.5",
|
61
61
|
"@sanity/client": "^7.5.0",
|
62
|
-
"@sanity/codegen": "3.91.1-next.
|
62
|
+
"@sanity/codegen": "3.91.1-next.34.844b3d4b3a",
|
63
63
|
"@sanity/runtime-cli": "^7.6.5",
|
64
64
|
"@sanity/telemetry": "^0.8.0",
|
65
65
|
"@sanity/template-validator": "^2.4.3",
|
66
|
-
"@sanity/util": "3.91.1-next.
|
66
|
+
"@sanity/util": "3.91.1-next.34.844b3d4b3a",
|
67
67
|
"chalk": "^4.1.2",
|
68
68
|
"debug": "^4.3.4",
|
69
69
|
"decompress": "^4.2.0",
|
@@ -83,7 +83,7 @@
|
|
83
83
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
84
84
|
"@sanity/eslint-config-studio": "^4.0.0",
|
85
85
|
"@sanity/generate-help-url": "^3.0.0",
|
86
|
-
"@sanity/types": "3.91.1-next.
|
86
|
+
"@sanity/types": "3.91.1-next.34.844b3d4b3a",
|
87
87
|
"@types/babel__traverse": "^7.20.5",
|
88
88
|
"@types/configstore": "^5.0.1",
|
89
89
|
"@types/cpx": "^1.5.2",
|
@@ -135,5 +135,5 @@
|
|
135
135
|
"engines": {
|
136
136
|
"node": ">=18"
|
137
137
|
},
|
138
|
-
"gitHead": "
|
138
|
+
"gitHead": "844b3d4b3a0cbfe1020b0815d67100a62f1841e1"
|
139
139
|
}
|
@@ -5,6 +5,7 @@ import {type CliCommandDefinition} from '../../types'
|
|
5
5
|
const helpText = `
|
6
6
|
Options
|
7
7
|
--port <port> Port to start emulator on
|
8
|
+
--open Open dev server in a new browser tab
|
8
9
|
|
9
10
|
Examples
|
10
11
|
# Start dev server on default port
|
@@ -12,13 +13,18 @@ Examples
|
|
12
13
|
|
13
14
|
# Start dev server on specific port
|
14
15
|
sanity functions dev --port 3333
|
16
|
+
|
17
|
+
# Start dev server and open a new browser tab
|
18
|
+
sanity functions dev --open
|
15
19
|
`
|
16
20
|
|
17
21
|
export interface FunctionsDevFlags {
|
22
|
+
open?: boolean
|
18
23
|
port?: number
|
19
24
|
}
|
20
25
|
|
21
26
|
const defaultFlags: FunctionsDevFlags = {
|
27
|
+
open: false,
|
22
28
|
port: 8080,
|
23
29
|
}
|
24
30
|
|
@@ -26,11 +32,12 @@ const devFunctionsCommand: CliCommandDefinition<FunctionsDevFlags> = {
|
|
26
32
|
name: 'dev',
|
27
33
|
group: 'functions',
|
28
34
|
helpText,
|
29
|
-
signature: '[--port <port>]',
|
35
|
+
signature: '[--port <port> --open]',
|
30
36
|
description: 'Start the Sanity Function emulator',
|
31
37
|
async action(args, context) {
|
32
38
|
const {apiClient, output} = context
|
33
39
|
const flags = {...defaultFlags, ...args.extOptions}
|
40
|
+
const {open: shouldOpen} = flags
|
34
41
|
|
35
42
|
const client = apiClient({requireUser: true, requireProject: false})
|
36
43
|
const {token} = client.config()
|
@@ -57,7 +64,9 @@ const devFunctionsCommand: CliCommandDefinition<FunctionsDevFlags> = {
|
|
57
64
|
|
58
65
|
if (!success) throw new Error(error)
|
59
66
|
|
60
|
-
|
67
|
+
if (shouldOpen) {
|
68
|
+
open(`http://localhost:${flags.port}`)
|
69
|
+
}
|
61
70
|
},
|
62
71
|
}
|
63
72
|
|
@@ -6,10 +6,11 @@ Arguments
|
|
6
6
|
|
7
7
|
Options
|
8
8
|
--limit <limit> The number of log entries to retrieve [default 50]
|
9
|
-
--json
|
10
|
-
--utc
|
11
|
-
--delete
|
12
|
-
--force
|
9
|
+
--json If set return json
|
10
|
+
--utc Use UTC dates in logs
|
11
|
+
--delete Delete all logs for the Function
|
12
|
+
--force Force delete all logs for the Function
|
13
|
+
--watch Watch for new logs (streaming mode)
|
13
14
|
|
14
15
|
Examples
|
15
16
|
# Retrieve logs for Sanity Function
|
@@ -19,10 +20,13 @@ Examples
|
|
19
20
|
sanity functions logs echo --limit 2
|
20
21
|
|
21
22
|
# Retrieve logs for Sanity Function in json format
|
22
|
-
sanity functions logs
|
23
|
+
sanity functions logs echo --json
|
23
24
|
|
24
25
|
# Delete all logs for Sanity Function
|
25
|
-
sanity functions logs
|
26
|
+
sanity functions logs echo --delete
|
27
|
+
|
28
|
+
# Watch for new logs (streaming mode)
|
29
|
+
sanity functions logs echo --watch
|
26
30
|
`
|
27
31
|
|
28
32
|
export interface FunctionsLogsFlags {
|
@@ -53,7 +53,8 @@ const testFunctionsCommand: CliCommandDefinition<FunctionsTestFlags> = {
|
|
53
53
|
requireUser: true,
|
54
54
|
requireProject: false,
|
55
55
|
})
|
56
|
-
const {token} = client.config()
|
56
|
+
const {dataset, projectId, token} = client.config()
|
57
|
+
const actualDataset = dataset === '~dummy-placeholder-dataset-' ? undefined : dataset
|
57
58
|
|
58
59
|
if (!token) throw new Error('No API token found. Please run `sanity login`.')
|
59
60
|
|
@@ -80,8 +81,8 @@ const testFunctionsCommand: CliCommandDefinition<FunctionsTestFlags> = {
|
|
80
81
|
'file': flags.file,
|
81
82
|
'timeout': flags.timeout,
|
82
83
|
'api': flags.api,
|
83
|
-
'dataset': flags.dataset,
|
84
|
-
'project-id': flags['project-id'],
|
84
|
+
'dataset': flags.dataset || actualDataset,
|
85
|
+
'project-id': flags['project-id'] || projectId,
|
85
86
|
},
|
86
87
|
})
|
87
88
|
|