-
Notifications
You must be signed in to change notification settings - Fork 156
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
Experimental https localhost flag #5479
base: main
Are you sure you want to change the base?
Conversation
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success2099 tests passing in 929 suites. Report generated by 🧪jest coverage report action from 5388ac9 |
7043c2e
to
7bd4cf2
Compare
0857b24
to
14d19ee
Compare
To do this we: 1. Add a --use-localhost flag that uses mkcert for https://localhost 2. Remove the no-tunnel and no-tunnel-http flags in favor of just use-localhost. 3. Make the run method of the dev command a little easier to read
1. Add changeset 2. Add a Banner explaining the limitations & asking for feedback 3. Make it clear its the use-localhost flag that requires mkcert download
14d19ee
to
5388ac9
Compare
@shauns @nickwesselman This is now ready for review & sheperding over the finish line whilst I am away. |
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 declarationspackages/cli-kit/dist/public/node/testing/test-with-temp-dir.d.tsimport { TestAPI } from 'vitest';
interface TempDirFixture {
tempDir: string;
}
/**
* Vitest fixture providing the test with a temporary directory to work in.
*/
export declare const testWithTempDir: TestAPI<TempDirFixture>;
export {};
Existing type declarationspackages/cli-kit/dist/public/node/github.d.ts@@ -47,4 +47,5 @@ export interface GithubRepositoryReference {
* @param reference - A GitHub repository URL (e.g. https://github.com/Shopify/cli/blob/main/package.json)
*/
export declare function parseGitHubRepositoryReference(reference: string): GithubRepositoryReference;
+export declare function downloadGitHubRelease(repo: string, version: string, assetName: string, targetPath: string): Promise<void>;
export {};
\ No newline at end of file
|
/snapit |
🫰✨ Thanks @byrichardpowell! Your snapshot has been published to npm. Test the snapshot by installing your package globally: pnpm i -g @shopify/[email protected] Tip If you get an Caution After installing, validate the version by running just |
const certPath = joinPath(appDirectory, '.shopify', 'localhost.pem') | ||
|
||
outputInfo(outputContent`🔐 Checking ${mkcertSnippet} root certificate. You may be prompted for your password.`) | ||
await exec(mkcertPath, ['-install', '-key-file', keyPath, '-cert-file', certPath, 'localhost']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling out some DX notes:
- this is where the most visible changes occur -- during mkcert install command
- we might want to review the error case here. if mkcert fails, is that a bug or user/env error. and what feedback are we presenting in that case.
I implemented some DX suggestions here: |
important
Do not release these changes until https://github.com/shop/world/pull/9621 has shipped.
WHY are these changes introduced?
To allow partners to develop apps without the use of a tunnel. Tunnels have proven extremely flakey and are the cause of a lot of friction for 3P developers building apps. Here is the Vault project: https://vault.shopify.io/gsd/projects/42691-Shopify-CLI-Self-signed-certificates-for-app-development
Instead developers can serve their app from https://localhost/ using a self-signed cert by using a
--use-localhost
flag. This is the CLI PR, here is the shopify/web PR: https://github.com/shop/world/pull/9621WHAT is this pull request doing?
Add a new flag to
shopify app dev
which is--use-localhost
. When this flag is enabled, the user is warned of the flags limitations as prompted to provide feedback:Then the user prompted to install a cert using mkcert:
From that point the app is served from
https://localhost
How to test your changes?
See this PR on admin-web
Post-release steps
None for now. We will add documentation for this flag once we make the flag public, after a grace period of data and feedback collection.
Measuring impact
How do we know this change was effective? Please choose one:
Checklist