Skip to content

Commit

Permalink
Merge pull request #196 from Shopify/fd-user-glob-fix
Browse files Browse the repository at this point in the history
Fd user glob fix
  • Loading branch information
frandiox authored Nov 10, 2021
2 parents 0a303c6 + 6682fd7 commit 2b82a45
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion packages/hydrogen/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- ## Unreleased -->
## Unreleased

- fix: add trailing slash to user components glob

## 0.6.2 - 2021-11-10

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const allClientComponents = {
),
};

export default function importDevClientComponent(moduleId: string) {
export default function importClientComponent(moduleId: string) {
const modImport = allClientComponents[moduleId];

if (!modImport) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,12 @@ export default () => {

const importerToRootPath = path.relative(importerPath, config.root);
const [importerToRootNested] =
importerToRootPath.match(/(\.\.\/)+/) || [];
importerToRootPath.match(/(\.\.\/)+(\.\.)?/) || [];
const userPrefix = path.normalize(
path.join(importerPath, importerToRootNested)
path.join(
importerPath,
importerToRootNested.replace(/\/?$/, path.sep)
)
);
const userGlob = path.join(
importerToRootPath,
Expand Down

0 comments on commit 2b82a45

Please sign in to comment.