Skip to content

Commit 2a60aef

Browse files
authored
Merge pull request #6587 from Shopify/11-06-make_new_package_for_app_execute
make new package for app execute
2 parents 70fd1c3 + 53131b7 commit 2a60aef

File tree

3 files changed

+109
-0
lines changed

3 files changed

+109
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import {appFlags} from '../../flags.js'
2+
import AppUnlinkedCommand, {AppUnlinkedCommandOutput} from '../../utilities/app-unlinked-command.js'
3+
import {AppInterface} from '../../models/app/app.js'
4+
import {globalFlags} from '@shopify/cli-kit/node/cli'
5+
import {renderSuccess} from '@shopify/cli-kit/node/ui'
6+
7+
export default class Execute extends AppUnlinkedCommand {
8+
static summary = 'Execute app operations.'
9+
10+
static description = 'Execute app operations.'
11+
12+
static hidden = true
13+
14+
static flags = {
15+
...globalFlags,
16+
...appFlags,
17+
}
18+
19+
async run(): Promise<AppUnlinkedCommandOutput> {
20+
await this.parse(Execute)
21+
22+
renderSuccess({
23+
headline: 'Execute command ran successfully!',
24+
body: 'Placeholder command. Add execution logic here.',
25+
})
26+
27+
return {app: undefined as unknown as AppInterface}
28+
}
29+
}

packages/app/src/cli/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Logs from './commands/app/logs.js'
88
import Sources from './commands/app/app-logs/sources.js'
99
import EnvPull from './commands/app/env/pull.js'
1010
import EnvShow from './commands/app/env/show.js'
11+
import Execute from './commands/app/execute.js'
1112
import FunctionBuild from './commands/app/function/build.js'
1213
import FunctionReplay from './commands/app/function/replay.js'
1314
import FunctionRun from './commands/app/function/run.js'
@@ -48,6 +49,7 @@ export const commands: {[key: string]: typeof AppLinkedCommand | typeof AppUnlin
4849
'app:config:use': ConfigUse,
4950
'app:env:pull': EnvPull,
5051
'app:env:show': EnvShow,
52+
'app:execute': Execute,
5153
'app:generate:schema': GenerateSchema,
5254
'app:function:build': FunctionBuild,
5355
'app:function:replay': FunctionReplay,

packages/cli/oclif.manifest.json

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,84 @@
808808
"strict": true,
809809
"summary": "Display app and extensions environment variables."
810810
},
811+
"app:execute": {
812+
"aliases": [
813+
],
814+
"args": {
815+
},
816+
"customPluginName": "@shopify/app",
817+
"description": "Execute app operations.",
818+
"flags": {
819+
"client-id": {
820+
"description": "The Client ID of your app.",
821+
"env": "SHOPIFY_FLAG_CLIENT_ID",
822+
"exclusive": [
823+
"config"
824+
],
825+
"hasDynamicHelp": false,
826+
"hidden": false,
827+
"multiple": false,
828+
"name": "client-id",
829+
"type": "option"
830+
},
831+
"config": {
832+
"char": "c",
833+
"description": "The name of the app configuration.",
834+
"env": "SHOPIFY_FLAG_APP_CONFIG",
835+
"hasDynamicHelp": false,
836+
"hidden": false,
837+
"multiple": false,
838+
"name": "config",
839+
"type": "option"
840+
},
841+
"no-color": {
842+
"allowNo": false,
843+
"description": "Disable color output.",
844+
"env": "SHOPIFY_FLAG_NO_COLOR",
845+
"hidden": false,
846+
"name": "no-color",
847+
"type": "boolean"
848+
},
849+
"path": {
850+
"description": "The path to your app directory.",
851+
"env": "SHOPIFY_FLAG_PATH",
852+
"hasDynamicHelp": false,
853+
"multiple": false,
854+
"name": "path",
855+
"noCacheDefault": true,
856+
"type": "option"
857+
},
858+
"reset": {
859+
"allowNo": false,
860+
"description": "Reset all your settings.",
861+
"env": "SHOPIFY_FLAG_RESET",
862+
"exclusive": [
863+
"config"
864+
],
865+
"hidden": false,
866+
"name": "reset",
867+
"type": "boolean"
868+
},
869+
"verbose": {
870+
"allowNo": false,
871+
"description": "Increase the verbosity of the output.",
872+
"env": "SHOPIFY_FLAG_VERBOSE",
873+
"hidden": false,
874+
"name": "verbose",
875+
"type": "boolean"
876+
}
877+
},
878+
"hasDynamicHelp": false,
879+
"hidden": true,
880+
"hiddenAliases": [
881+
],
882+
"id": "app:execute",
883+
"pluginAlias": "@shopify/cli",
884+
"pluginName": "@shopify/cli",
885+
"pluginType": "core",
886+
"strict": true,
887+
"summary": "Execute app operations."
888+
},
811889
"app:function:build": {
812890
"aliases": [
813891
],

0 commit comments

Comments
 (0)