-
Notifications
You must be signed in to change notification settings - Fork 224
Fix how app name is set from the AppLoader #6561
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
gonzaloriestra
merged 1 commit into
main
from
11-03-fix_how_app_name_is_set_from_the_apploader
Nov 4, 2025
Merged
Changes from all commits
Commits
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,6 @@ | ||
| --- | ||
| '@shopify/cli-kit': minor | ||
| '@shopify/app': minor | ||
| --- | ||
|
|
||
| Use the handle to set the app version name, and the TOML name as a fallback |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,7 +42,6 @@ import {readAndParseDotEnv, DotEnvFile} from '@shopify/cli-kit/node/dot-env' | |
| import { | ||
| getDependencies, | ||
| getPackageManager, | ||
| getPackageName, | ||
| usesWorkspaces as appUsesWorkspaces, | ||
| } from '@shopify/cli-kit/node/node-package-manager' | ||
| import {resolveFramework} from '@shopify/cli-kit/node/framework' | ||
|
|
@@ -343,7 +342,10 @@ class AppLoader<TConfig extends AppConfiguration, TModuleSpec extends ExtensionS | |
| const packageJSONPath = joinPath(directory, 'package.json') | ||
|
|
||
| // These don't need to be processed again if the app is being reloaded | ||
| const name = this.previousApp?.name ?? (await loadAppName(directory)) | ||
| // name is required by BrandingSchema, so it must be present in the configuration | ||
| const configName = (configuration as CurrentAppConfiguration).name | ||
| const configHandle: string | undefined = (configuration as CurrentAppConfiguration).handle | ||
| const name: string = this.previousApp?.name ?? configHandle ?? configName ?? '' | ||
| const nodeDependencies = this.previousApp?.nodeDependencies ?? (await getDependencies(packageJSONPath)) | ||
| const packageManager = this.previousApp?.packageManager ?? (await getPackageManager(directory)) | ||
| const usesWorkspaces = this.previousApp?.usesWorkspaces ?? (await appUsesWorkspaces(directory)) | ||
|
|
@@ -1108,11 +1110,6 @@ export async function loadHiddenConfig( | |
| } | ||
| } | ||
|
|
||
| export async function loadAppName(appDirectory: string): Promise<string> { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We will always have at least a name, so we don't need this fallback. Thus, this is dead code |
||
| const packageJSONPath = joinPath(appDirectory, 'package.json') | ||
| return (await getPackageName(packageJSONPath)) ?? basename(appDirectory) | ||
| } | ||
|
|
||
| async function getProjectType(webs: Web[]): Promise<'node' | 'php' | 'ruby' | 'frontend' | undefined> { | ||
| const backendWebs = webs.filter((web) => isWebType(web, WebType.Backend)) | ||
| const frontendWebs = webs.filter((web) => isWebType(web, WebType.Frontend)) | ||
|
|
||
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
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.
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.
Many changes in the test files are like this one:
nameis now required in test fixtures to be able to load the app