Skip to content

Commit 01a720b

Browse files
authored
Merge pull request #7330 from Shopify/ariel/extract-store-package
Extract @shopify/store package from @shopify/cli
2 parents ee4d4b5 + 136e5cf commit 01a720b

49 files changed

Lines changed: 193 additions & 35 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"fixed": [[
77
"@shopify/cli",
88
"@shopify/app",
9+
"@shopify/store",
910
"@shopify/create-app",
1011
"@shopify/cli-kit",
1112
"@shopify/theme",

packages/cli/oclif.manifest.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5799,6 +5799,7 @@
57995799
],
58005800
"args": {
58015801
},
5802+
"customPluginName": "@shopify/store",
58025803
"description": "Authenticates the app against the specified store for store commands and stores an online access token for later reuse.\n\nRe-run this command if the stored token is missing, expires, or no longer has the scopes you need.",
58035804
"descriptionWithMarkdown": "Authenticates the app against the specified store for store commands and stores an online access token for later reuse.\n\nRe-run this command if the stored token is missing, expires, or no longer has the scopes you need.",
58045805
"examples": [
@@ -5866,6 +5867,7 @@
58665867
],
58675868
"args": {
58685869
},
5870+
"customPluginName": "@shopify/store",
58695871
"description": "Executes an Admin API GraphQL query or mutation on the specified store using previously stored app authentication.\n\nRun `shopify store auth` first to create stored auth for the store.\n\nMutations are disabled by default. Re-run with `--allow-mutations` if you intend to modify store data.",
58705872
"descriptionWithMarkdown": "Executes an Admin API GraphQL query or mutation on the specified store using previously stored app authentication.\n\nRun `shopify store auth` first to create stored auth for the store.\n\nMutations are disabled by default. Re-run with `--allow-mutations` if you intend to modify store data.",
58715873
"examples": [

packages/cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"@oclif/plugin-commands": "4.1.33",
6262
"@oclif/plugin-plugins": "5.4.47",
6363
"@shopify/app": "3.93.0",
64+
"@shopify/store": "3.93.0",
6465
"@shopify/cli-kit": "3.93.0",
6566
"@shopify/plugin-cloudflare": "3.93.0",
6667
"@shopify/plugin-did-you-mean": "3.93.0",

packages/cli/src/index.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ import HelpCommand from './cli/commands/help.js'
1515
import List from './cli/commands/notifications/list.js'
1616
import Generate from './cli/commands/notifications/generate.js'
1717
import ClearCache from './cli/commands/cache/clear.js'
18-
import StoreAuth from './cli/commands/store/auth.js'
19-
import StoreExecute from './cli/commands/store/execute.js'
2018
import AutoupgradeOff from './cli/commands/config/autoupgrade/off.js'
2119
import AutoupgradeOn from './cli/commands/config/autoupgrade/on.js'
2220
import AutoupgradeStatus from './cli/commands/config/autoupgrade/status.js'
2321
import {createGlobalProxyAgent} from 'global-agent'
22+
import StoreCommands from '@shopify/store'
2423
import ThemeCommands from '@shopify/theme'
2524
import {COMMANDS as HydrogenCommands, HOOKS as HydrogenHooks} from '@shopify/cli-hydrogen'
2625
import {commands as AppCommands} from '@shopify/app'
@@ -112,6 +111,12 @@ hydrogenCommands.forEach((command) => {
112111
;(HydrogenCommands[command] as any).customPluginName = '@shopify/cli-hydrogen'
113112
})
114113

114+
const storeCommands = Object.keys(StoreCommands) as (keyof typeof StoreCommands)[]
115+
storeCommands.forEach((command) => {
116+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
117+
;(StoreCommands[command] as any).customPluginName = '@shopify/store'
118+
})
119+
115120
const pluginCommandsCommands = Object.keys(PluginCommandsCommands) as (keyof typeof PluginCommandsCommands)[]
116121
pluginCommandsCommands.forEach((command) => {
117122
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -138,6 +143,7 @@ export const COMMANDS: any = {
138143
...DidYouMeanCommands,
139144
...PluginCommandsCommands,
140145
...HydrogenCommands,
146+
...StoreCommands,
141147
search: Search,
142148
upgrade: Upgrade,
143149
version: VersionCommand,
@@ -155,8 +161,6 @@ export const COMMANDS: any = {
155161
'notifications:list': List,
156162
'notifications:generate': Generate,
157163
'cache:clear': ClearCache,
158-
'store:auth': StoreAuth,
159-
'store:execute': StoreExecute,
160164
'config:autoupgrade:off': AutoupgradeOff,
161165
'config:autoupgrade:on': AutoupgradeOn,
162166
'config:autoupgrade:status': AutoupgradeStatus,

packages/e2e/data/snapshots/commands.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@
4141
│ └─ logout
4242
├─ commands
4343
├─ config
44-
│ └─ autocorrect
44+
│ ├─ autocorrect
45+
│ │ ├─ off
46+
│ │ ├─ on
47+
│ │ └─ status
48+
│ └─ autoupgrade
4549
│ ├─ off
4650
│ ├─ on
4751
│ └─ status

packages/store/package.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"name": "@shopify/store",
3+
"version": "3.93.0",
4+
"packageManager": "pnpm@10.11.1",
5+
"private": true,
6+
"description": "Utilities for working with Shopify stores",
7+
"homepage": "https://github.com/shopify/cli#readme",
8+
"bugs": {
9+
"url": "https://community.shopify.dev/c/shopify-cli-libraries/14"
10+
},
11+
"repository": {
12+
"type": "git",
13+
"url": "https://github.com/Shopify/cli.git",
14+
"directory": "packages/store"
15+
},
16+
"license": "MIT",
17+
"type": "module",
18+
"exports": {
19+
".": {
20+
"import": "./dist/index.js",
21+
"types": "./dist/index.d.ts"
22+
}
23+
},
24+
"files": [
25+
"/dist",
26+
"/oclif.manifest.json"
27+
],
28+
"scripts": {
29+
"build": "nx build",
30+
"clean": "nx clean",
31+
"lint": "nx lint",
32+
"lint:fix": "nx lint:fix",
33+
"prepack": "NODE_ENV=production pnpm nx build && cp ../../README.md README.md",
34+
"vitest": "vitest",
35+
"type-check": "nx type-check"
36+
},
37+
"eslintConfig": {
38+
"extends": [
39+
"../../.eslintrc.cjs"
40+
]
41+
},
42+
"dependencies": {
43+
"@oclif/core": "4.5.3",
44+
"@shopify/cli-kit": "3.93.0"
45+
},
46+
"devDependencies": {
47+
"@vitest/coverage-istanbul": "^3.1.4"
48+
},
49+
"engines": {
50+
"node": ">=20.10.0"
51+
},
52+
"os": [
53+
"darwin",
54+
"linux",
55+
"win32"
56+
],
57+
"publishConfig": {
58+
"@shopify:registry": "https://registry.npmjs.org",
59+
"access": "public"
60+
},
61+
"engine-strict": true
62+
}

packages/store/project.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "store",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "packages/store/src",
5+
"projectType": "library",
6+
"tags": ["scope:feature"],
7+
"targets": {
8+
"clean": {
9+
"executor": "nx:run-commands",
10+
"options": {
11+
"command": "pnpm rimraf dist/",
12+
"cwd": "packages/store"
13+
}
14+
},
15+
"build": {
16+
"executor": "nx:run-commands",
17+
"outputs": ["{workspaceRoot}/dist"],
18+
"inputs": ["{projectRoot}/src/**/*", "{projectRoot}/package.json"],
19+
"options": {
20+
"command": "pnpm tsc -b ./tsconfig.build.json",
21+
"cwd": "packages/store"
22+
}
23+
},
24+
"lint": {
25+
"executor": "nx:run-commands",
26+
"options": {
27+
"command": "pnpm eslint \"src/**/*.ts\"",
28+
"cwd": "packages/store"
29+
}
30+
},
31+
"lint:fix": {
32+
"executor": "nx:run-commands",
33+
"options": {
34+
"command": "pnpm eslint 'src/**/*.ts' --fix",
35+
"cwd": "packages/store"
36+
}
37+
},
38+
"type-check": {
39+
"executor": "nx:run-commands",
40+
"options": {
41+
"command": "pnpm tsc --noEmit",
42+
"cwd": "packages/store"
43+
}
44+
}
45+
}
46+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)