-
Notifications
You must be signed in to change notification settings - Fork 265
Add non-interactive app dev prompt bypasses #7632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ea16242
Add non-interactive app dev prompt bypasses
gonzaloriestra 9cdbb8f
Remove transfer-disabled store conversion prompt
gonzaloriestra c64f190
Add changeset for app dev prompt updates
gonzaloriestra c94ee62
Refresh generated dev docs
gonzaloriestra fb770af
Fix app dev localhost flag dependency
gonzaloriestra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@shopify/app': patch | ||
| --- | ||
|
|
||
| Add non-interactive `app dev` options: `--store-password` and `--install-mkcert`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 0 additions & 30 deletions
30
packages/app/src/cli/api/graphql/convert_dev_to_transfer_disabled_store.ts
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| import Dev from './dev.js' | ||
| import {dev} from '../../services/dev.js' | ||
| import {linkedAppContext} from '../../services/app-context.js' | ||
| import {storeContext} from '../../services/store-context.js' | ||
| import {getTunnelMode} from '../../services/dev/tunnel-mode.js' | ||
| import {checkFolderIsValidApp} from '../../models/app/loader.js' | ||
| import { | ||
| testAppLinked, | ||
| testDeveloperPlatformClient, | ||
| testOrganization, | ||
| testOrganizationApp, | ||
| testOrganizationStore, | ||
| testProject, | ||
| } from '../../models/app/app.test-data.js' | ||
| import {inTemporaryDirectory} from '@shopify/cli-kit/node/fs' | ||
| import {addPublicMetadata} from '@shopify/cli-kit/node/metadata' | ||
| import {beforeEach, describe, expect, test, vi} from 'vitest' | ||
|
|
||
| vi.mock('../../services/dev.js') | ||
| vi.mock('../../services/app-context.js') | ||
| vi.mock('../../services/store-context.js') | ||
| vi.mock('../../services/dev/tunnel-mode.js') | ||
| vi.mock('../../models/app/loader.js') | ||
| vi.mock('@shopify/cli-kit/node/metadata') | ||
|
|
||
| describe('app dev command', () => { | ||
| beforeEach(() => { | ||
| vi.mocked(dev).mockReset() | ||
| vi.mocked(linkedAppContext).mockReset() | ||
| vi.mocked(storeContext).mockReset() | ||
| vi.mocked(getTunnelMode).mockReset() | ||
| vi.mocked(checkFolderIsValidApp).mockReset() | ||
| vi.mocked(addPublicMetadata).mockReset() | ||
| }) | ||
|
|
||
| test('does not require --use-localhost when --install-mkcert is not passed', async () => { | ||
| await inTemporaryDirectory(async (tmp) => { | ||
| const app = testAppLinked({directory: tmp}) | ||
| const appContextResult = { | ||
| app, | ||
| remoteApp: testOrganizationApp(), | ||
| organization: testOrganization(), | ||
| project: testProject(), | ||
| activeConfig: {} as never, | ||
| specifications: [], | ||
| developerPlatformClient: testDeveloperPlatformClient(), | ||
| } as Awaited<ReturnType<typeof linkedAppContext>> | ||
| const store = testOrganizationStore({shopDomain: 'dev-store.myshopify.com'}) | ||
|
|
||
| vi.mocked(linkedAppContext).mockResolvedValue(appContextResult) | ||
| vi.mocked(storeContext).mockResolvedValue(store) | ||
| vi.mocked(getTunnelMode).mockResolvedValue({mode: 'auto'}) | ||
|
|
||
| await Dev.run(['--path', tmp, '--store', store.shopDomain], import.meta.url) | ||
|
|
||
| expect(getTunnelMode).toHaveBeenCalledWith({ | ||
| useLocalhost: false, | ||
| tunnelUrl: undefined, | ||
| localhostPort: undefined, | ||
| }) | ||
| expect(dev).toHaveBeenCalledWith(expect.objectContaining({installMkcert: false, tunnel: {mode: 'auto'}})) | ||
| }) | ||
| }) | ||
|
|
||
| test('requires --use-localhost when --install-mkcert is passed', async () => { | ||
| await inTemporaryDirectory(async (tmp) => { | ||
| await expect(Dev.run(['--path', tmp, '--install-mkcert'], import.meta.url)).rejects.toThrow() | ||
|
|
||
| expect(dev).not.toHaveBeenCalled() | ||
| }) | ||
| }) | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.