Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion bin/get-graphql-schemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ const schemas = [
owner: 'shop',
repo: 'world',
pathToFile: 'areas/platforms/organizations/db/graphql/organizations_schema.graphql',
localPaths: ['./packages/app/src/cli/api/graphql/business-platform-organizations/organizations_schema.graphql'],
localPaths: [
'./packages/app/src/cli/api/graphql/business-platform-organizations/organizations_schema.graphql',
'./packages/store/src/cli/api/graphql/business-platform-organizations/organizations_schema.graphql',
],
},
{
owner: 'shop',
Expand Down
1 change: 1 addition & 0 deletions graphql.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,6 @@ export default {
functions: projectFactory('functions', 'functions_cli_schema.graphql', 'app'),
adminAsApp: projectFactory('admin', 'admin_schema.graphql'),
organizationsDestinations: projectFactory('business-platform-destinations', 'destinations_schema.graphql', 'organizations'),
storeOrganizations: projectFactory('business-platform-organizations', 'organizations_schema.graphql', 'store'),
},
}
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,24 @@
]
}
},
"packages/store": {
"entry": [
"**/{commands,hooks}/**/*.ts!",
"**/index.ts!"
],
"project": "**/*.ts!",
"ignore": [
"**/graphql/**/generated/*.ts"
],
"ignoreDependencies": [
"@graphql-typed-document-node/core"
],
"vite": {
"config": [
"vite.config.ts"
]
}
},
"packages/cli": {
"entry": [
"**/{commands,hooks}/**/*.ts!",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ export type ShopFilterField =
| 'COLLABORATOR_RELATIONSHIP_STATUS'
/** The GID of the counterpart organization. Requires `store_type=client_transfer` or `store_type=collaborator`. */
| 'COUNTERPART_ORGANIZATION_ID'
/** The GID of the owning organization of the shop. */
| 'OWNER_ORGANIZATION_ID'
/**
* The plan of the shop. Values: `basic`, `grow`, `plus`, `frozen`, `advanced`,
* `inactive`, `cancelled`, `client_transfer`, `plus_client_transfer`,
Expand Down
23 changes: 23 additions & 0 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
* [`shopify plugins update`](#shopify-plugins-update)
* [`shopify search [query]`](#shopify-search-query)
* [`shopify store auth`](#shopify-store-auth)
* [`shopify store create dev`](#shopify-store-create-dev)
* [`shopify store execute`](#shopify-store-execute)
* [`shopify theme check`](#shopify-theme-check)
* [`shopify theme console`](#shopify-theme-console)
Expand Down Expand Up @@ -2139,6 +2140,28 @@ EXAMPLES
$ shopify store auth --store shop.myshopify.com --scopes read_products,write_products --json
```

## `shopify store create dev`

Create a new development store.

```
USAGE
$ shopify store create dev --name <value> [-j] [--no-color] [--organization <value>] [--verbose]

FLAGS
-j, --json [env: SHOPIFY_FLAG_JSON] Output the result as JSON. Automatically disables color output.
--name=<value> (required) [env: SHOPIFY_FLAG_STORE_NAME] Name for the new development store.
--no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output.
--organization=<value> [env: SHOPIFY_FLAG_ORGANIZATION] The organization to create the store in (numeric ID).
Auto-selects if you belong to a single org.
--verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output.

DESCRIPTION
Create a new development store.

Creates a new app development store in your organization.
```

## `shopify store execute`

Execute GraphQL queries and mutations on a store.
Expand Down
63 changes: 63 additions & 0 deletions packages/cli/oclif.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5862,6 +5862,69 @@
"strict": true,
"summary": "Authenticate an app against a store for store commands."
},
"store:create:dev": {
"aliases": [
],
"args": {
},
"customPluginName": "@shopify/store",
"description": "Creates a new app development store in your organization.",
"descriptionWithMarkdown": "Creates a new app development store in your organization.",
"enableJsonFlag": false,
"flags": {
"json": {
"allowNo": false,
"char": "j",
"description": "Output the result as JSON. Automatically disables color output.",
"env": "SHOPIFY_FLAG_JSON",
"hidden": false,
"name": "json",
"type": "boolean"
},
"name": {
"description": "Name for the new development store.",
"env": "SHOPIFY_FLAG_STORE_NAME",
"hasDynamicHelp": false,
"multiple": false,
"name": "name",
"required": true,
"type": "option"
},
"no-color": {
"allowNo": false,
"description": "Disable color output.",
"env": "SHOPIFY_FLAG_NO_COLOR",
"hidden": false,
"name": "no-color",
"type": "boolean"
},
"organization": {
"description": "The organization to create the store in (numeric ID). Auto-selects if you belong to a single org.",
"env": "SHOPIFY_FLAG_ORGANIZATION",
"hasDynamicHelp": false,
"multiple": false,
"name": "organization",
"type": "option"
},
"verbose": {
"allowNo": false,
"description": "Increase the verbosity of the output.",
"env": "SHOPIFY_FLAG_VERBOSE",
"hidden": false,
"name": "verbose",
"type": "boolean"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [
],
"id": "store:create:dev",
"pluginAlias": "@shopify/cli",
"pluginName": "@shopify/cli",
"pluginType": "core",
"strict": true,
"summary": "Create a new development store."
},
"store:execute": {
"aliases": [
],
Expand Down
4 changes: 3 additions & 1 deletion packages/store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@
]
},
"dependencies": {
"@graphql-typed-document-node/core": "3.2.0",
"@oclif/core": "4.5.3",
"@shopify/cli-kit": "3.93.0"
"@shopify/cli-kit": "3.93.0",
"@shopify/organizations": "3.93.0"
},
"devDependencies": {
"@vitest/coverage-istanbul": "^3.1.4"
Expand Down
33 changes: 33 additions & 0 deletions packages/store/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,39 @@
"command": "pnpm tsc --noEmit",
"cwd": "packages/store"
}
},
"graphql-codegen": {
"executor": "nx:noop",
"dependsOn": ["graphql-codegen:formatting"]
},
"graphql-codegen:formatting": {
"executor": "nx:run-commands",
"dependsOn": ["graphql-codegen:postfix"],
"outputs": ["{projectRoot}/src/cli/api/graphql/business-platform-organizations/generated/**/*.ts"],
"options": {
"commands": ["pnpm eslint 'src/cli/api/graphql/business-platform-organizations/generated/**/*.{ts,tsx}' --fix"],
"cwd": "packages/store"
}
},
"graphql-codegen:postfix": {
"executor": "nx:run-commands",
"dependsOn": ["graphql-codegen:generate:store-organizations"],
"outputs": ["{projectRoot}/src/cli/api/graphql/business-platform-organizations/generated/**/*.ts"],
"options": {
"commands": [
"find ./packages/store/src/cli/api/graphql/business-platform-organizations/generated/ -type f -name '*.ts' -exec sh -c 'sed -i \"\" \"s|import \\* as Types from '\\''./types'\\'';|import \\* as Types from '\\''./types.js'\\'';|g; s|export const \\([A-Za-z0-9_]*\\)Document =|export const \\1 =|g\" \"$0\"' {} \\;"
],
"cwd": "{workspaceRoot}"
}
},
"graphql-codegen:generate:store-organizations": {
"executor": "nx:run-commands",
"inputs": ["{workspaceRoot}/graphql.config.ts", "{projectRoot}/src/cli/api/graphql/business-platform-organizations/**/*.graphql"],
"outputs": ["{projectRoot}/src/cli/api/graphql/business-platform-organizations/generated/**/*.ts"],
"options": {
"commands": ["pnpm exec graphql-codegen --project=storeOrganizations"],
"cwd": "{workspaceRoot}"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/* eslint-disable @typescript-eslint/consistent-type-definitions */
import * as Types from './types.js'

import {TypedDocumentNode as DocumentNode} from '@graphql-typed-document-node/core'

export type CreateAppDevelopmentStoreMutationVariables = Types.Exact<{
shopName: Types.Scalars['String']['input']
priceLookupKey: Types.Scalars['String']['input']
prepopulateTestData?: Types.InputMaybe<Types.Scalars['Boolean']['input']>
}>

export type CreateAppDevelopmentStoreMutation = {
createAppDevelopmentStore: {
shopAdminUrl?: string | null
shopDomain?: string | null
userErrors?: {code?: string | null; field: string[]; message: string}[] | null
}
}

export const CreateAppDevelopmentStore = {
kind: 'Document',
definitions: [
{
kind: 'OperationDefinition',
operation: 'mutation',
name: {kind: 'Name', value: 'CreateAppDevelopmentStore'},
variableDefinitions: [
{
kind: 'VariableDefinition',
variable: {kind: 'Variable', name: {kind: 'Name', value: 'shopName'}},
type: {kind: 'NonNullType', type: {kind: 'NamedType', name: {kind: 'Name', value: 'String'}}},
},
{
kind: 'VariableDefinition',
variable: {kind: 'Variable', name: {kind: 'Name', value: 'priceLookupKey'}},
type: {kind: 'NonNullType', type: {kind: 'NamedType', name: {kind: 'Name', value: 'String'}}},
},
{
kind: 'VariableDefinition',
variable: {kind: 'Variable', name: {kind: 'Name', value: 'prepopulateTestData'}},
type: {kind: 'NamedType', name: {kind: 'Name', value: 'Boolean'}},
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: {kind: 'Name', value: 'createAppDevelopmentStore'},
arguments: [
{
kind: 'Argument',
name: {kind: 'Name', value: 'shopName'},
value: {kind: 'Variable', name: {kind: 'Name', value: 'shopName'}},
},
{
kind: 'Argument',
name: {kind: 'Name', value: 'priceLookupKey'},
value: {kind: 'Variable', name: {kind: 'Name', value: 'priceLookupKey'}},
},
{
kind: 'Argument',
name: {kind: 'Name', value: 'prepopulateTestData'},
value: {kind: 'Variable', name: {kind: 'Name', value: 'prepopulateTestData'}},
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{kind: 'Field', name: {kind: 'Name', value: 'shopAdminUrl'}},
{kind: 'Field', name: {kind: 'Name', value: 'shopDomain'}},
{
kind: 'Field',
name: {kind: 'Name', value: 'userErrors'},
selectionSet: {
kind: 'SelectionSet',
selections: [
{kind: 'Field', name: {kind: 'Name', value: 'code'}},
{kind: 'Field', name: {kind: 'Name', value: 'field'}},
{kind: 'Field', name: {kind: 'Name', value: 'message'}},
{kind: 'Field', name: {kind: 'Name', value: '__typename'}},
],
},
},
{kind: 'Field', name: {kind: 'Name', value: '__typename'}},
],
},
},
],
},
},
],
} as unknown as DocumentNode<CreateAppDevelopmentStoreMutation, CreateAppDevelopmentStoreMutationVariables>
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/* eslint-disable @typescript-eslint/consistent-type-definitions */
import * as Types from './types.js'

import {TypedDocumentNode as DocumentNode} from '@graphql-typed-document-node/core'

export type PollStoreCreationQueryVariables = Types.Exact<{
shopDomain: Types.Scalars['String']['input']
}>

export type PollStoreCreationQuery = {
organization?: {id: string; storeCreation?: {status: Types.StoreCreationStatus} | null} | null
}

export const PollStoreCreation = {
kind: 'Document',
definitions: [
{
kind: 'OperationDefinition',
operation: 'query',
name: {kind: 'Name', value: 'PollStoreCreation'},
variableDefinitions: [
{
kind: 'VariableDefinition',
variable: {kind: 'Variable', name: {kind: 'Name', value: 'shopDomain'}},
type: {kind: 'NonNullType', type: {kind: 'NamedType', name: {kind: 'Name', value: 'String'}}},
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: {kind: 'Name', value: 'organization'},
selectionSet: {
kind: 'SelectionSet',
selections: [
{kind: 'Field', name: {kind: 'Name', value: 'id'}},
{
kind: 'Field',
name: {kind: 'Name', value: 'storeCreation'},
arguments: [
{
kind: 'Argument',
name: {kind: 'Name', value: 'shopDomain'},
value: {kind: 'Variable', name: {kind: 'Name', value: 'shopDomain'}},
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{kind: 'Field', name: {kind: 'Name', value: 'status'}},
{kind: 'Field', name: {kind: 'Name', value: '__typename'}},
],
},
},
{kind: 'Field', name: {kind: 'Name', value: '__typename'}},
],
},
},
],
},
},
],
} as unknown as DocumentNode<PollStoreCreationQuery, PollStoreCreationQueryVariables>
Loading
Loading