Skip to content

Switch app init template to hosted app when HOSTED_APPS env var is set#7096

Merged
isaacroldan merged 1 commit into
mainfrom
hosted-app-template-switch
Apr 1, 2026
Merged

Switch app init template to hosted app when HOSTED_APPS env var is set#7096
isaacroldan merged 1 commit into
mainfrom
hosted-app-template-switch

Conversation

@alfonso-noriega

@alfonso-noriega alfonso-noriega commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

🚨 NOTE: do not merge before the repository https://github.com/Shopify/shopify-app-template-extension-only is available 🚨

WHY are these changes introduced?

When HOSTED_APPS=1 is set, shopify app init should present a hosted app template option instead of the standard extension-only template.

This is an internal-only flag (not user-facing) that allows the team to demo and test the hosted app experience end-to-end before it's generally available.

WHAT is this pull request doing?

  • When HOSTED_APPS=1, the "Build an extension-only app" option in shopify app init is replaced with "Build an extension-only app (Shopify-hosted Preact app home and extensions, no back-end)" and points to the new shopify-app-template-extension-only repo
  • Without the env var, behaviour is unchanged
  • Adds hostedApps: 'HOSTED_APPS' to the cli-kit environmentVariables constants
  • Adds isHostedAppsMode() helper to @shopify/cli-kit/node/context/local, following the same pattern as isVerbose, isDevelopment, etc.

How to test your changes?

HOSTED_APPS=1 shopify app init

The second option should read Build an extension-only app (Shopify-hosted Preact app home and extensions, no back-end) and scaffold from shopify-app-template-extension-only.

Without the env var, the prompt is unchanged.

Measuring impact

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

@alfonso-noriega alfonso-noriega requested a review from a team as a code owner March 25, 2026 13:52
@github-actions

Copy link
Copy Markdown
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

Caution

DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions

github-actions Bot commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 82.29% 14905/18113
🟡 Branches 74.83% 7362/9838
🟢 Functions 81.37% 3777/4642
🟢 Lines 82.67% 14089/17042

Test suite run success

3932 tests passing in 1514 suites.

Report generated by 🧪jest coverage report action from 6d80d2c

@alfonso-noriega alfonso-noriega force-pushed the hosted-app-template-switch branch from e53b299 to 65a9531 Compare March 25, 2026 13:58
@alfonso-noriega alfonso-noriega changed the title Add client steps implementation to support existing functionalities Switch app init template to hosted app when HOSTED_APPS env var is set Mar 25, 2026
@alfonso-noriega alfonso-noriega force-pushed the hosted-app-template-switch branch 2 times, most recently from 8c59c1a to 18a32e8 Compare March 25, 2026 14:31
Comment thread packages/app/src/cli/prompts/init/init.ts Outdated
@alfonso-noriega alfonso-noriega force-pushed the hosted-app-template-switch branch from 18a32e8 to c886a2a Compare March 25, 2026 15:36
Comment thread packages/app/src/cli/prompts/init/init.ts Outdated
@alfonso-noriega alfonso-noriega force-pushed the hosted-app-template-switch branch from c886a2a to 9e4f684 Compare March 25, 2026 16:13
@alfonso-noriega alfonso-noriega force-pushed the hosted-app-template-switch branch from 9e4f684 to 6d80d2c Compare March 25, 2026 16:18
@isaacroldan isaacroldan force-pushed the hosted-app-template-switch branch from 6d80d2c to c5fbc4f Compare April 1, 2026 11:27
When HOSTED_APPS=1, the "Build an extension-only app" option in
shopify app init is replaced with a hosted app label and points to
the shopify-app-template-extension-only repo.

Adds isHostedAppsMode() helper to @shopify/cli-kit/node/context/local
following the same pattern as isVerbose, isDevelopment, etc.

Co-authored-by: Richard Powell <byrichardpowell@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@isaacroldan isaacroldan force-pushed the hosted-app-template-switch branch from c5fbc4f to ceb1843 Compare April 1, 2026 11:32
@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Differences in type declarations

We 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:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/private/node/constants.d.ts
@@ -34,6 +34,7 @@ export declare const environmentVariables: {
     skipNetworkLevelRetry: string;
     maxRequestTimeForNetworkCalls: string;
     disableImportScanning: string;
+    hostedApps: string;
 };
 export declare const defaultThemeKitAccessDomain = "theme-kit-access.shopifyapps.com";
 export declare const systemEnvironmentVariables: {
packages/cli-kit/dist/public/node/context/local.d.ts
@@ -25,6 +25,13 @@ export declare function isDevelopment(env?: NodeJS.ProcessEnv): boolean;
  * @returns True if SHOPIFY_FLAG_VERBOSE is truthy or the flag --verbose has been passed.
  */
 export declare function isVerbose(env?: NodeJS.ProcessEnv): boolean;
+/**
+ * Returns true if the hosted apps mode is enabled.
+ *
+ * @param env - The environment variables from the environment of the current process.
+ * @returns True if HOSTED_APPS is truthy.
+ */
+export declare function isHostedAppsMode(env?: NodeJS.ProcessEnv): boolean;
 /**
  * Returns true if the environment in which the CLI is running is either
  * a local environment (where dev is present).

@isaacroldan isaacroldan added this pull request to the merge queue Apr 1, 2026
Merged via the queue into main with commit 2fe9c78 Apr 1, 2026
26 checks passed
@isaacroldan isaacroldan deleted the hosted-app-template-switch branch April 1, 2026 12:25
elanalynn added a commit that referenced this pull request Apr 3, 2026
The new shopify-app-template-extension-only template was previously
gated behind the HOSTED_APPS env var (PR #7096). This removes the
env var entirely and makes the hosted app template the default for
the "none" (extension-only) option in `shopify app init`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
MitchLillie added a commit that referenced this pull request Apr 29, 2026
This reverts all changes from the hosted app project (Admin Extensibility → 'hosted app' sub-project).

The hosted app project is being discontinued. This PR removes:
- The admin extension specification (static_root, allowed_domains)
- The HOSTED_APPS environment variable and template switching
- Web build execution during deploy
- Template application_url preservation during app creation
- Admin-specific dev server asset serving

What's preserved:
- Asset upload infrastructure (include_assets client step) - used by other extension types
- admin_link specification - separate extension type for admin links with intents
- Client steps system - general build pipeline infrastructure
- devSessionWatchConfig - general watch path infrastructure

Reverted PRs:
- #7027 - Add admin hosted app local spec
- #7096 - Switch app init template to hosted app when HOSTED_APPS env var is set
- #7208 - Run web build commands during deploy for hosted apps
- #7225 - Preserve template application_url during app creation
- #7227 - notify extension dev server of app assets updates (admin parts only)
- #7312 - Default allowed_domains to empty array when not configured
MitchLillie added a commit that referenced this pull request Apr 29, 2026
This reverts all changes from the hosted app project (Admin Extensibility → 'hosted app' sub-project).

The hosted app project is being discontinued. This PR removes:
- The admin extension specification (static_root, allowed_domains)
- The HOSTED_APPS environment variable and template switching
- Web build execution during deploy
- Template application_url preservation during app creation
- Admin-specific dev server asset serving

What's preserved:
- Asset upload infrastructure (include_assets client step) - used by other extension types
- admin_link specification - separate extension type for admin links with intents
- Client steps system - general build pipeline infrastructure
- devSessionWatchConfig - general watch path infrastructure

Reverted PRs:
- #7027 - Add admin hosted app local spec
- #7096 - Switch app init template to hosted app when HOSTED_APPS env var is set
- #7208 - Run web build commands during deploy for hosted apps
- #7225 - Preserve template application_url during app creation
- #7227 - notify extension dev server of app assets updates (admin parts only)
- #7312 - Default allowed_domains to empty array when not configured
MitchLillie added a commit that referenced this pull request May 7, 2026
This reverts all changes from the hosted app project (Admin Extensibility → 'hosted app' sub-project).

The hosted app project is being discontinued. This PR removes:
- The admin extension specification (static_root, allowed_domains)
- The HOSTED_APPS environment variable and template switching
- Web build execution during deploy
- Template application_url preservation during app creation
- Admin-specific dev server asset serving

What's preserved:
- Asset upload infrastructure (include_assets client step) - used by other extension types
- admin_link specification - separate extension type for admin links with intents
- Client steps system - general build pipeline infrastructure
- devSessionWatchConfig - general watch path infrastructure

Reverted PRs:
- #7027 - Add admin hosted app local spec
- #7096 - Switch app init template to hosted app when HOSTED_APPS env var is set
- #7208 - Run web build commands during deploy for hosted apps
- #7225 - Preserve template application_url during app creation
- #7227 - notify extension dev server of app assets updates (admin parts only)
- #7312 - Default allowed_domains to empty array when not configured
MitchLillie added a commit that referenced this pull request May 7, 2026
This reverts all changes from the hosted app project (Admin Extensibility → 'hosted app' sub-project).

The hosted app project is being discontinued. This PR removes:
- The admin extension specification (static_root, allowed_domains)
- The HOSTED_APPS environment variable and template switching
- Web build execution during deploy
- Template application_url preservation during app creation
- Admin-specific dev server asset serving

What's preserved:
- Asset upload infrastructure (include_assets client step) - used by other extension types
- admin_link specification - separate extension type for admin links with intents
- Client steps system - general build pipeline infrastructure
- devSessionWatchConfig - general watch path infrastructure

Reverted PRs:
- #7027 - Add admin hosted app local spec
- #7096 - Switch app init template to hosted app when HOSTED_APPS env var is set
- #7208 - Run web build commands during deploy for hosted apps
- #7225 - Preserve template application_url during app creation
- #7227 - notify extension dev server of app assets updates (admin parts only)
- #7312 - Default allowed_domains to empty array when not configured
MitchLillie added a commit that referenced this pull request May 7, 2026
This reverts all changes from the hosted app project (Admin Extensibility → 'hosted app' sub-project).

The hosted app project is being discontinued. This PR removes:
- The admin extension specification (static_root, allowed_domains)
- The HOSTED_APPS environment variable and template switching
- Web build execution during deploy
- Template application_url preservation during app creation
- Admin-specific dev server asset serving

What's preserved:
- Asset upload infrastructure (include_assets client step) - used by other extension types
- admin_link specification - separate extension type for admin links with intents
- Client steps system - general build pipeline infrastructure
- devSessionWatchConfig - general watch path infrastructure

Reverted PRs:
- #7027 - Add admin hosted app local spec
- #7096 - Switch app init template to hosted app when HOSTED_APPS env var is set
- #7208 - Run web build commands during deploy for hosted apps
- #7225 - Preserve template application_url during app creation
- #7227 - notify extension dev server of app assets updates (admin parts only)
- #7312 - Default allowed_domains to empty array when not configured
MitchLillie added a commit that referenced this pull request May 7, 2026
This reverts all changes from the hosted app project (Admin Extensibility → 'hosted app' sub-project).

The hosted app project is being discontinued. This PR removes:
- The admin extension specification (static_root, allowed_domains)
- The HOSTED_APPS environment variable and template switching
- Web build execution during deploy
- Template application_url preservation during app creation
- Admin-specific dev server asset serving

What's preserved:
- Asset upload infrastructure (include_assets client step) - used by other extension types
- admin_link specification - separate extension type for admin links with intents
- Client steps system - general build pipeline infrastructure
- devSessionWatchConfig - general watch path infrastructure

Reverted PRs:
- #7027 - Add admin hosted app local spec
- #7096 - Switch app init template to hosted app when HOSTED_APPS env var is set
- #7208 - Run web build commands during deploy for hosted apps
- #7225 - Preserve template application_url during app creation
- #7227 - notify extension dev server of app assets updates (admin parts only)
- #7312 - Default allowed_domains to empty array when not configured
MitchLillie added a commit that referenced this pull request May 8, 2026
This reverts all changes from the hosted app project (Admin Extensibility → 'hosted app' sub-project).

The hosted app project is being discontinued. This PR removes:
- The admin extension specification (static_root, allowed_domains)
- The HOSTED_APPS environment variable and template switching
- Web build execution during deploy
- Template application_url preservation during app creation
- Admin-specific dev server asset serving

What's preserved:
- Asset upload infrastructure (include_assets client step) - used by other extension types
- admin_link specification - separate extension type for admin links with intents
- Client steps system - general build pipeline infrastructure
- devSessionWatchConfig - general watch path infrastructure

Reverted PRs:
- #7027 - Add admin hosted app local spec
- #7096 - Switch app init template to hosted app when HOSTED_APPS env var is set
- #7208 - Run web build commands during deploy for hosted apps
- #7225 - Preserve template application_url during app creation
- #7227 - notify extension dev server of app assets updates (admin parts only)
- #7312 - Default allowed_domains to empty array when not configured
MitchLillie added a commit that referenced this pull request May 8, 2026
This reverts most changes from the hosted app project (Admin Extensibility → "hosted app" sub-project).

The hosted app project is being discontinued. This PR removes:
- The `admin` extension specification (`admin.ts` with `static_root`, `allowed_domains`)
- Web build execution during deploy
- Template `application_url`/`redirect_urls` preservation during app creation
- Admin-specific dev server asset serving (`getAppAssets`, `allowedDomains` in payload)

What is preserved:
- `HOSTED_APPS` environment variable and `isHostedAppsMode()` function
- `buildNoneTemplate()` with conditional template selection (uses extension-only template when `HOSTED_APPS=1`)
- Asset upload infrastructure (`include_assets` client step) - used by other extension types
- `admin_link` specification - separate extension type for admin links with intents
- `assetResolvers` in dev server store - per-extension URL→path mapping
- Client steps system - general build pipeline infrastructure

Reverted PRs:
- #7027 - Add admin hosted app local spec
- #7096 - Switch app init template (partially - kept template switching, removed other hosted app setup)
- #7208 - Run web build commands during deploy for hosted apps
- #7225 - Preserve template application_url during app creation
- #7227 - Notify extension dev server of app assets updates (admin parts only)
- #7312 - Default allowed_domains to empty array when not configured
elanalynn added a commit that referenced this pull request May 15, 2026
The new shopify-app-template-extension-only template was previously
gated behind the HOSTED_APPS env var (PR #7096). This removes the
env var entirely and makes the hosted app template the default for
the "none" (extension-only) option in `shopify app init`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
elanalynn added a commit that referenced this pull request May 15, 2026
The new shopify-app-template-extension-only template was previously
gated behind the HOSTED_APPS env var (PR #7096). This removes the
env var entirely and makes the hosted app template the default for
the "none" (extension-only) option in `shopify app init`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
MitchLillie pushed a commit that referenced this pull request May 26, 2026
The new shopify-app-template-extension-only template was previously
gated behind the HOSTED_APPS env var (PR #7096). This removes the
env var entirely and makes the hosted app template the default for
the "none" (extension-only) option in `shopify app init`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants