Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-theme-directory-warning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/theme': patch
---

Fix warning when running theme commands in valid theme directories

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for changeset here, since it is already included in the other branch, we don't want to show it again in the next minor.

16 changes: 16 additions & 0 deletions packages/theme/src/cli/utilities/theme-fs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,22 @@ describe('theme-fs', () => {
expect(result).toBeFalsy()
})
})

test(`returns true for a valid theme directory`, async () => {
await inTemporaryDirectory(async (tmpDir) => {
// Given
const root = tmpDir
await mkdir(joinPath(root, 'config'))
await mkdir(joinPath(root, 'layout'))
await mkdir(joinPath(root, 'templates'))

Comment thread
karreiro marked this conversation as resolved.
// When
const result = await hasRequiredThemeDirectories(root)

// Then
expect(result).toBeTruthy()
})
})
})

describe('listing functionality', () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/theme/src/cli/utilities/theme-fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,7 @@ export async function hasRequiredThemeDirectories(path: string) {
}),
)

const requiredDirectories = ['config', 'layout', 'sections', 'templates']

const requiredDirectories = ['config', 'layout', 'templates']
return requiredDirectories.every((dir) => directories.has(dir))
Comment thread
karreiro marked this conversation as resolved.
}

Expand Down
Loading