Skip to content

Commit f5000f0

Browse files
committed
Better description, more configs in function info
1 parent 68d4128 commit f5000f0

File tree

6 files changed

+58
-17
lines changed

6 files changed

+58
-17
lines changed

.changeset/hungry-ravens-sip.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
'@shopify/app': minor
33
---
44

5-
Added shopify app function info command to display function run arguments.
5+
Added a `function info` command to display function information.

docs-shopify.dev/commands/app-function-info.doc.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
33

44
const data: ReferenceEntityTemplateSchema = {
55
name: 'app function info',
6-
description: `Returns information about the function.`,
7-
overviewPreviewDescription: `Get information about the function.`,
6+
description: `The information returned includes the following:
7+
8+
- The function handle
9+
- The function name
10+
- The function API version
11+
- The function runner path
12+
- The schema path
13+
- The WASM path
14+
- The targeting configuration`,
15+
overviewPreviewDescription: `Print basic information about your function.`,
816
type: 'command',
917
isVisualComponent: false,
1018
defaultExample: {

docs-shopify.dev/generated/generated_docs_data.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,8 +1000,8 @@
10001000
},
10011001
{
10021002
"name": "app function info",
1003-
"description": "Returns information about the function.",
1004-
"overviewPreviewDescription": "Get information about the function.",
1003+
"description": "The information returned includes the following:\n\n - The function handle\n - The function name\n - The function API version\n - The function runner path\n - The schema path\n - The WASM path\n - The targeting configuration",
1004+
"overviewPreviewDescription": "Print basic information about your function.",
10051005
"type": "command",
10061006
"isVisualComponent": false,
10071007
"defaultExample": {

packages/app/src/cli/commands/app/function/info.ts

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,19 @@ import {outputContent, outputResult, outputToken} from '@shopify/cli-kit/node/ou
88
import {renderInfo} from '@shopify/cli-kit/node/ui'
99

1010
export default class FunctionInfo extends AppUnlinkedCommand {
11-
static summary = 'Get information about the function.'
11+
static summary = 'Print basic information about your function.'
1212

13-
static description = 'Returns information about the function.'
13+
static descriptionWithMarkdown = `The information returned includes the following:
14+
15+
- The function handle
16+
- The function name
17+
- The function API version
18+
- The function runner path
19+
- The schema path
20+
- The WASM path
21+
- The targeting configuration`
22+
23+
static description = this.descriptionWithoutMarkdown()
1424

1525
static flags = {
1626
...globalFlags,
@@ -53,32 +63,47 @@ export default class FunctionInfo extends AppUnlinkedCommand {
5363
outputResult(
5464
JSON.stringify(
5565
{
66+
handle: ourFunction.configuration.handle,
67+
name: ourFunction.name,
68+
apiVersion: ourFunction.configuration.api_version,
5669
functionRunnerPath: functionRunner.path,
57-
targeting,
5870
schemaPath,
5971
wasmPath: ourFunction.outputPath,
72+
targeting,
6073
},
6174
null,
6275
2,
6376
),
6477
)
6578
} else {
6679
const sections: {title: string; body: {list: {items: string[]}}}[] = [
80+
{
81+
title: 'CONFIGURATION',
82+
body: {
83+
list: {
84+
items: [
85+
outputContent`Handle: ${ourFunction.configuration.handle ?? 'N/A'}`.value,
86+
outputContent`Name: ${ourFunction.name ?? 'N/A'}`.value,
87+
outputContent`API Version: ${ourFunction.configuration.api_version ?? 'N/A'}`.value,
88+
],
89+
},
90+
},
91+
},
6792
{
6893
title: 'FUNCTION RUNNER',
6994
body: {
7095
list: {
71-
items: [outputContent`Path: ${outputToken.path(functionRunner.path)}`.value],
96+
items: [outputContent`Path: ${functionRunner.path}`.value],
7297
},
7398
},
7499
},
75100
{
76-
title: 'FUNCTION BUILD',
101+
title: 'BUILD',
77102
body: {
78103
list: {
79104
items: [
80105
outputContent`Schema Path: ${outputToken.path(schemaPath ?? 'N/A')}`.value,
81-
outputContent`WASM Path: ${outputToken.path(ourFunction.outputPath)}`.value,
106+
outputContent`Wasm Path: ${outputToken.path(ourFunction.outputPath)}`.value,
82107
],
83108
},
84109
},
@@ -108,7 +133,6 @@ export default class FunctionInfo extends AppUnlinkedCommand {
108133
}
109134

110135
renderInfo({
111-
headline: 'FUNCTION INFORMATION.',
112136
customSections: sections,
113137
})
114138
}

packages/cli/README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ DESCRIPTION
349349

350350
## `shopify app function info`
351351

352-
Get information about the function.
352+
Print basic information about your function.
353353

354354
```
355355
USAGE
@@ -366,9 +366,17 @@ FLAGS
366366
--verbose Increase the verbosity of the output.
367367
368368
DESCRIPTION
369-
Get information about the function.
369+
Print basic information about your function.
370370
371-
Returns information about the function.
371+
The information returned includes the following:
372+
373+
- The function handle
374+
- The function name
375+
- The function API version
376+
- The function runner path
377+
- The schema path
378+
- The WASM path
379+
- The targeting configuration
372380
```
373381

374382
## `shopify app function replay`

packages/cli/oclif.manifest.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,8 @@
893893
"args": {
894894
},
895895
"customPluginName": "@shopify/app",
896-
"description": "Returns information about the function.",
896+
"description": "The information returned includes the following:\n\n - The function handle\n - The function name\n - The function API version\n - The function runner path\n - The schema path\n - The WASM path\n - The targeting configuration",
897+
"descriptionWithMarkdown": "The information returned includes the following:\n\n - The function handle\n - The function name\n - The function API version\n - The function runner path\n - The schema path\n - The WASM path\n - The targeting configuration",
897898
"flags": {
898899
"client-id": {
899900
"description": "The Client ID of your app.",
@@ -972,7 +973,7 @@
972973
"pluginName": "@shopify/cli",
973974
"pluginType": "core",
974975
"strict": true,
975-
"summary": "Get information about the function."
976+
"summary": "Print basic information about your function."
976977
},
977978
"app:function:replay": {
978979
"aliases": [

0 commit comments

Comments
 (0)