Skip to content

Commit 20372b4

Browse files
committed
reorganising sections and matching shopify app info format more closely
1 parent f5000f0 commit 20372b4

File tree

5 files changed

+49
-49
lines changed

5 files changed

+49
-49
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ const data: ReferenceEntityTemplateSchema = {
88
- The function handle
99
- The function name
1010
- The function API version
11-
- The function runner path
11+
- The targeting configuration
1212
- The schema path
1313
- The WASM path
14-
- The targeting configuration`,
14+
- The function runner path`,
1515
overviewPreviewDescription: `Print basic information about your function.`,
1616
type: 'command',
1717
isVisualComponent: false,

docs-shopify.dev/generated/generated_docs_data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@
10001000
},
10011001
{
10021002
"name": "app function info",
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",
1003+
"description": "The information returned includes the following:\n\n - The function handle\n - The function name\n - The function API version\n - The targeting configuration\n - The schema path\n - The WASM path\n - The function runner path",
10041004
"overviewPreviewDescription": "Print basic information about your function.",
10051005
"type": "command",
10061006
"isVisualComponent": false,

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

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {appFlags} from '../../../flags.js'
55
import AppUnlinkedCommand, {AppUnlinkedCommandOutput} from '../../../utilities/app-unlinked-command.js'
66
import {globalFlags, jsonFlag} from '@shopify/cli-kit/node/cli'
77
import {outputContent, outputResult, outputToken} from '@shopify/cli-kit/node/output'
8-
import {renderInfo} from '@shopify/cli-kit/node/ui'
8+
import {InlineToken, renderInfo} from '@shopify/cli-kit/node/ui'
99

1010
export default class FunctionInfo extends AppUnlinkedCommand {
1111
static summary = 'Print basic information about your function.'
@@ -15,10 +15,10 @@ export default class FunctionInfo extends AppUnlinkedCommand {
1515
- The function handle
1616
- The function name
1717
- The function API version
18-
- The function runner path
18+
- The targeting configuration
1919
- The schema path
2020
- The WASM path
21-
- The targeting configuration`
21+
- The function runner path`
2222

2323
static description = this.descriptionWithoutMarkdown()
2424

@@ -66,72 +66,72 @@ export default class FunctionInfo extends AppUnlinkedCommand {
6666
handle: ourFunction.configuration.handle,
6767
name: ourFunction.name,
6868
apiVersion: ourFunction.configuration.api_version,
69-
functionRunnerPath: functionRunner.path,
69+
targeting,
7070
schemaPath,
7171
wasmPath: ourFunction.outputPath,
72-
targeting,
72+
functionRunnerPath: functionRunner.path,
7373
},
7474
null,
7575
2,
7676
),
7777
)
7878
} else {
79-
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-
},
92-
{
93-
title: 'FUNCTION RUNNER',
94-
body: {
95-
list: {
96-
items: [outputContent`Path: ${functionRunner.path}`.value],
97-
},
98-
},
99-
},
79+
const configData: InlineToken[][] = [
80+
['Handle', ourFunction.configuration.handle ?? 'N/A'],
81+
['Name', ourFunction.name ?? 'N/A'],
82+
['API Version', ourFunction.configuration.api_version ?? 'N/A'],
83+
]
84+
85+
const sections: {title: string; body: {tabularData: InlineToken[][]; firstColumnSubdued?: boolean}}[] = [
10086
{
101-
title: 'BUILD',
87+
title: 'CONFIGURATION\n',
10288
body: {
103-
list: {
104-
items: [
105-
outputContent`Schema Path: ${outputToken.path(schemaPath ?? 'N/A')}`.value,
106-
outputContent`Wasm Path: ${outputToken.path(ourFunction.outputPath)}`.value,
107-
],
108-
},
89+
tabularData: configData,
90+
firstColumnSubdued: true,
10991
},
11092
},
11193
]
11294

11395
if (Object.keys(targeting).length > 0) {
114-
const targetingItems = Object.entries(targeting).map(([target, config]) => {
115-
const parts = [outputContent`${outputToken.cyan(target)}`.value]
96+
const targetingData: InlineToken[][] = []
97+
Object.entries(targeting).forEach(([target, config]) => {
98+
targetingData.push([outputContent`${outputToken.cyan(target)}`.value, ''])
11699
if (config.inputQueryPath) {
117-
parts.push(outputContent` Input Query Path: ${outputToken.path(config.inputQueryPath)}`.value)
100+
targetingData.push([{subdued: ' Input Query Path'}, {filePath: config.inputQueryPath}])
118101
}
119102
if (config.export) {
120-
parts.push(outputContent` Export: ${config.export}`.value)
103+
targetingData.push([{subdued: ' Export'}, config.export])
121104
}
122-
return parts.join('\n')
123105
})
124106

125107
sections.push({
126-
title: 'TARGETING',
108+
title: '\nTARGETING\n',
127109
body: {
128-
list: {
129-
items: targetingItems,
130-
},
110+
tabularData: targetingData,
131111
},
132112
})
133113
}
134114

115+
sections.push(
116+
{
117+
title: '\nBUILD\n',
118+
body: {
119+
tabularData: [
120+
['Schema Path', {filePath: schemaPath ?? 'N/A'}],
121+
['Wasm Path', {filePath: ourFunction.outputPath}],
122+
],
123+
firstColumnSubdued: true,
124+
},
125+
},
126+
{
127+
title: '\nFUNCTION RUNNER\n',
128+
body: {
129+
tabularData: [['Path', {filePath: functionRunner.path}]],
130+
firstColumnSubdued: true,
131+
},
132+
},
133+
)
134+
135135
renderInfo({
136136
customSections: sections,
137137
})

packages/cli/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,10 @@ DESCRIPTION
373373
- The function handle
374374
- The function name
375375
- The function API version
376-
- The function runner path
376+
- The targeting configuration
377377
- The schema path
378378
- The WASM path
379-
- The targeting configuration
379+
- The function runner path
380380
```
381381

382382
## `shopify app function replay`

packages/cli/oclif.manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,8 @@
893893
"args": {
894894
},
895895
"customPluginName": "@shopify/app",
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",
896+
"description": "The information returned includes the following:\n\n - The function handle\n - The function name\n - The function API version\n - The targeting configuration\n - The schema path\n - The WASM path\n - The function runner path",
897+
"descriptionWithMarkdown": "The information returned includes the following:\n\n - The function handle\n - The function name\n - The function API version\n - The targeting configuration\n - The schema path\n - The WASM path\n - The function runner path",
898898
"flags": {
899899
"client-id": {
900900
"description": "The Client ID of your app.",

0 commit comments

Comments
 (0)