Conversation
db9717d to
c5cf362
Compare
7e01abd to
acc94a4
Compare
603ab33 to
4ef8ece
Compare
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/private/node/session.d.ts@@ -63,14 +63,14 @@ export interface OAuthSession {
}
type AuthMethod = 'partners_token' | 'device_auth' | 'theme_access_token' | 'custom_app_token' | 'none';
/**
- * Retrieves a stable user identifier for analytics, or if none applies.
+ * Retrieves the user ID from the current session or returns 'unknown' if not found.
*
- * Evaluation order:
- * 1. If an app automation token or theme token is used, returns a deterministic UUID
- * derived from that secret.
- * 2. Otherwise, if was called (e.g. after OAuth), returns that value.
- * 3. Otherwise, if a persisted CLI session id is available, returns it.
- * 4. Otherwise returns .
+ * This function performs the following steps:
+ * 1. Checks for a cached user ID in memory (obtained in the current run).
+ * 2. Attempts to fetch it from the local storage (from a previous auth session).
+ * 3. Checks if a custom token was used (either as a theme password or partners token).
+ * 4. If a custom token is present in the environment, generates a UUID and uses it as userId.
+ * 5. If after all this we don't have a userId, then reports as 'unknown'.
*
* @returns A Promise that resolves to the user ID as a string.
*/
packages/cli-kit/dist/public/node/ui.d.ts@@ -328,6 +328,7 @@ interface RenderTasksOptions {
/**
* Runs async tasks and displays their progress to the console.
* @example
+ * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
* Installing dependencies ...
*/
export declare function renderTasks<TContext>(tasks: Task<TContext>[], { renderOptions, noProgressBar }?: RenderTasksOptions): Promise<TContext>;
@@ -345,6 +346,7 @@ export interface RenderSingleTaskOptions<T> {
* @param options.renderOptions - Optional render configuration
* @returns The result of the task
* @example
+ * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
* Loading app ...
*/
export declare function renderSingleTask<T>({ title, task, onAbort, renderOptions, }: RenderSingleTaskOptions<T>): Promise<T>;
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
4ef8ece to
8810eb4
Compare
acc94a4 to
81fd9c2
Compare
8810eb4 to
d5fe541
Compare
81fd9c2 to
9a6b6b8
Compare
d5fe541 to
ee242f3
Compare
Move existing store:auth and store:execute commands and their services into a dedicated @shopify/store package, following the same pattern as @shopify/theme. This prepares the store namespace for new commands like store create dev. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… utilities Creates a standalone package for organization fetching and selection, calling the Business Platform Destinations API directly. Includes GraphQL codegen pipeline, fetchOrganizations (with GID decoding), selectOrganizationPrompt (auto-select for single org, duplicate name disambiguation), and selectOrg helper. Wires packages/app to use @Shopify/organizations for org fetching in AppManagementClient.organizations() and for the org selection prompt, eliminating duplicated Destinations API and prompt logic. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ee242f3 to
81d4182
Compare
There was a problem hiding this comment.
Pull request overview
This PR extracts shared organization lookup/selection logic into a new internal @shopify/organizations package so @shopify/app and @shopify/store can reuse the same Business Platform organization utilities.
Changes:
- Adds a new
@shopify/organizationspackage with organization fetch, selection, prompt, model, tests, and GraphQL codegen inputs. - Refactors
@shopify/appto consume the shared package for organization selection and App Management org listing. - Wires the new package into workspace build/test/configuration, schema sync, Vite aliases, and package dependencies.
Reviewed changes
Copilot reviewed 33 out of 38 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
vite.config.ts |
Adds the new package test project entries. |
pnpm-lock.yaml |
Records workspace dependency/link changes for the new package. |
packages/organizations/vite.config.ts |
Adds package-local Vitest config. |
packages/organizations/tsconfig.json |
Defines package TypeScript compilation settings. |
packages/organizations/tsconfig.build.json |
Defines build-time TS exclusions/references. |
packages/organizations/src/index.ts |
Exports the new package public API. |
packages/organizations/src/cli/services/select.ts |
Adds org selection helper logic. |
packages/organizations/src/cli/services/select.test.ts |
Tests selection helper behavior. |
packages/organizations/src/cli/services/fetch.ts |
Adds Business Platform org-fetching helper. |
packages/organizations/src/cli/services/fetch.test.ts |
Tests org fetch behavior and request wiring. |
packages/organizations/src/cli/prompts/organization.ts |
Adds reusable org selection prompt. |
packages/organizations/src/cli/prompts/organization.test.ts |
Tests prompt behavior and duplicate-name labeling. |
packages/organizations/src/cli/models/organization.ts |
Defines shared org model shape. |
packages/organizations/src/cli/api/graphql/business-platform-destinations/queries/organizations.graphql |
Adds the org list query source. |
packages/organizations/src/cli/api/graphql/business-platform-destinations/generated/types.d.ts |
Generated GraphQL scalar/types output for the package. |
packages/organizations/src/cli/api/graphql/business-platform-destinations/generated/organizations.ts |
Generated typed document for the org list query. |
packages/organizations/src/cli/api/graphql/business-platform-destinations/destinations_schema.graphql |
Adds local schema copy for codegen. |
packages/organizations/project.json |
Adds Nx targets, including GraphQL codegen flow. |
packages/organizations/package.json |
Declares the new package metadata/dependencies. |
packages/cli/tsconfig.json |
Updates CLI project references. |
packages/cli/package.json |
Adds CLI topic metadata for store creation help text. |
packages/app/tsconfig.json |
Adds app reference to the new package. |
packages/app/src/cli/utilities/developer-platform-client/app-management-client.ts |
Refactors app org listing to call shared org fetch logic. |
packages/app/src/cli/utilities/developer-platform-client/app-management-client.test.ts |
Updates tests to mock the shared package. |
packages/app/src/cli/services/info.test.ts |
Updates prompt mocking to the shared package. |
packages/app/src/cli/services/context.ts |
Swaps app org prompt import to shared package. |
packages/app/src/cli/services/context.test.ts |
Updates context tests for shared prompt import. |
packages/app/src/cli/services/app/env/show.test.ts |
Updates env-show tests for shared prompt import. |
packages/app/src/cli/services/app/config/link-service.test.ts |
Updates link tests for shared prompt import. |
packages/app/src/cli/prompts/dev.ts |
Removes duplicated org prompt implementation from app package. |
packages/app/src/cli/prompts/dev.test.ts |
Removes tests for the deleted local org prompt. |
packages/app/src/cli/models/organization.ts |
Reuses shared base org type in app models. |
packages/app/package.json |
Adds app dependency on @shopify/organizations. |
package.json |
Registers the new package in root project tooling config. |
graphql.config.ts |
Adds GraphQL codegen project for organization destinations. |
configurations/vite.config.ts |
Adds Vite aliasing for new workspace packages. |
bin/get-graphql-schemas.js |
Syncs the destinations schema into the new package too. |
.changeset/config.json |
Adds the new package to the fixed-version group. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const token = await ensureAuthenticatedBusinessPlatform() | ||
| const unauthorizedHandler = { | ||
| type: 'token_refresh' as const, | ||
| handler: async () => { | ||
| const newToken = await ensureAuthenticatedBusinessPlatform() | ||
| return {token: newToken} | ||
| }, | ||
| } | ||
|
|
||
| const result = await businessPlatformRequestDoc({ | ||
| query: ListOrganizations, | ||
| token, | ||
| unauthorizedHandler, |

Summary
@shopify/organizationspackage with org listing and selection utilitiesfetchOrganizations(with base64 GID decoding),selectOrganizationPrompt(auto-selects single org), andselectOrghelper@shopify/storeStack: PR 2 of 3 — depends on #7330, #7332 adds
store create devTest plan
pnpm nx build organizationspassespnpm nx type-check organizationspassescd packages/organizations && pnpm vitest run— 10/10 tests passcd packages/store && pnpm vitest run— no regressions🤖 Generated with Claude Code