Skip to content

Commit 95ab890

Browse files
authored
Remove HTTPS setup script and rename dev command (#3966)
Assisted-By: devx/485dfcc0-8160-4274-ae2a-5c0b86649940
1 parent 78b94c5 commit 95ab890

26 files changed

Lines changed: 45 additions & 57 deletions

File tree

.changeset/quick-plums-develop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@shopify/hydrogen": patch
3+
---
4+
5+
Rename local HTTPS development scripts from `https:dev` to `dev:https` and rely on the Vite plugin to provision certificates automatically.

.docs/dependencies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ When changing `@shopify/hydrogen/vite` local HTTPS behaviour, update these toget
99
- `templates/react-router/README.md`
1010
- `templates/react-router/package.json`
1111
- `templates/react-router/vite.config.ts`
12-
- framework example `https:dev` scripts and configs under `examples/*`
12+
- framework example `dev:https` scripts and configs under `examples/*`
1313

1414
`scripts/preview-template-dist.ts` copies `packages/hydrogen/skills` into template `.agents/skills` when preparing the dist branch, so template source directories should not duplicate those generated skill copies.

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ When designing or adjusting APIs for the `hydrogen` package, closely follow the
1717
## Local HTTPS for Examples
1818

1919
- Account-enabled framework examples use `https://local.tryhydrogen.dev:5173` for Customer Account OAuth callback testing.
20-
- Vite-based examples consume Hydrogen's default certificates. Certificates are provisioned automatically on `https:dev` startup, or run `pnpm https:setup` once from the repository root (`npx hydrogen certs install` in a consumer project). Both download a pinned, checksum-verified mkcert release, trust the local certificate authority, and create the certificates under `~/.shopify/hydrogen/certs/`.
20+
- Vite-based examples consume Hydrogen's default certificates. Certificates are provisioned automatically on `dev:https` startup. This downloads a pinned, checksum-verified mkcert release, trusts the local certificate authority, and creates the certificates under `~/.shopify/hydrogen/certs/`. Nuxt and SolidStart may need one restart after first-run provisioning so their outer dev servers can load the certificate files.
2121
- The Next.js example provisions its own certificate. The Hydrogen example uses the Shopify CLI tunnel flow.
22-
- After setup, run the relevant example with `pnpm --filter @shopify/hydrogen-example-<name> https:dev` when that example provides the script.
22+
- Run the relevant example with `pnpm --filter @shopify/hydrogen-example-<name> dev:https` when that example provides the script.

examples/README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,11 @@ From the repository root:
2929
- `pnpm dev` — run all workspace examples and templates in parallel.
3030
- `pnpm dev:hub` — run the examples with automatically allocated ports and open the browser hub with status, previews, and logs.
3131
- `pnpm --filter @shopify/hydrogen-example-<name> dev` — run one example.
32-
- `pnpm https:setup` then `pnpm --filter @shopify/hydrogen-example-<name> https:dev` — run an account-enabled example on `https://local.tryhydrogen.dev:5173` when it provides an `https:dev` script. The Hydrogen example uses `--customer-account-push` instead of local certificates.
32+
- `pnpm --filter @shopify/hydrogen-example-<name> dev:https` — run an account-enabled example on `https://local.tryhydrogen.dev:5173` when it provides a `dev:https` script. The Hydrogen example uses `--customer-account-push` instead of local certificates.
3333

34-
Local HTTPS certificates are provisioned automatically the first time an `https:dev` script starts, or explicitly with:
34+
The local HTTPS plugin provisions certificates automatically the first time a `dev:https` script starts. It downloads a pinned, checksum-verified [mkcert](https://github.com/FiloSottile/mkcert) release, installs the local certificate authority (this may prompt for your password), and creates trusted `local.tryhydrogen.dev` certificates under `~/.shopify/hydrogen/certs/` so Customer Account OAuth can redirect to `https://local.tryhydrogen.dev:5173/account/authorize`.
3535

36-
```sh
37-
pnpm https:setup
38-
```
39-
40-
Both download a pinned, checksum-verified [mkcert](https://github.com/FiloSottile/mkcert) release, install the local certificate authority (this may prompt for your password), and create trusted `local.tryhydrogen.dev` certificates under `~/.shopify/hydrogen/certs/` so Customer Account OAuth can redirect to `https://local.tryhydrogen.dev:5173/account/authorize`.
36+
Nuxt and SolidStart may need the command restarted once after first-run provisioning so their outer dev servers can load the certificate files.
4137

4238
The Next.js template provisions its own development certificate and does not use the Hydrogen certificates.
4339

examples/astro/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ The account flow uses `createCustomerSession` and `createCustomerAccountServerHa
4040
Customer Account OAuth requires a public HTTPS origin. To test locally without a tunnel, register `https://local.tryhydrogen.dev:5173/account/authorize` as the callback URI and run:
4141

4242
```sh
43-
pnpm https:setup
44-
pnpm --filter @shopify/hydrogen-example-astro https:dev
43+
pnpm --filter @shopify/hydrogen-example-astro dev:https
4544
```
4645

4746
## Run

examples/astro/astro.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import tailwindcss from "@tailwindcss/vite";
55
import { defineConfig } from "astro/config";
66

77
const enabled =
8-
process.env.VITE_LOCAL_HTTPS === "1" || process.env.npm_lifecycle_event === "https:dev";
8+
process.env.VITE_LOCAL_HTTPS === "1" || process.env.npm_lifecycle_event === "dev:https";
99
const httpsOptions = { enabled };
1010

1111
export default defineConfig({

examples/astro/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"dev": "astro dev",
8-
"https:dev": "astro dev",
8+
"dev:https": "astro dev",
99
"build": "astro build",
1010
"start": "node ./dist/server/entry.mjs",
1111
"typecheck": "astro check"

examples/hydrogen/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ Follow step 1 and 2 of <https://shopify.dev/docs/custom-storefronts/building-wit
4949
For local account testing, use the Customer Account push flow:
5050

5151
```bash
52-
pnpm --dir examples/hydrogen https:dev
52+
pnpm --dir examples/hydrogen dev:https
5353
```

examples/hydrogen/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"scripts": {
88
"build": "shopify hydrogen build --no-lockfile-check",
99
"dev": "react-router dev",
10-
"https:dev": "shopify hydrogen dev --customer-account-push",
10+
"dev:https": "shopify hydrogen dev --customer-account-push",
1111
"preview": "shopify hydrogen preview --build",
1212
"typecheck": "react-router typegen && tsc --noEmit",
1313
"e2e": "playwright test",

examples/nuxt/nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { NuxtConfig } from "nuxt/schema";
55
type VitePlugin = NonNullable<NonNullable<NuxtConfig["vite"]>["plugins"]>[number];
66

77
const enabled =
8-
process.env.VITE_LOCAL_HTTPS === "1" || process.env.npm_lifecycle_event === "https:dev";
8+
process.env.VITE_LOCAL_HTTPS === "1" || process.env.npm_lifecycle_event === "dev:https";
99
const httpsOptions = { enabled };
1010
const httpsPlugin = localHttps(httpsOptions);
1111

0 commit comments

Comments
 (0)