-
Notifications
You must be signed in to change notification settings - Fork 406
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
Loading uikit resources via the Node resolver #1246
Conversation
https://deploy-preview-1246--patternlab-handlebars-preview.netlify.app/?p=all @sghoweri @JosefBredereck can you review again? The tests succeed and the preview works now. |
} else { | ||
// For backwards compatibility, name to package calculation is: | ||
// 1. name -> name | ||
// 2. name -> uikit-name | ||
// 3. name -> @pattern-lab/name | ||
// 4. name -> @pattern-lab/uikit-name | ||
for (const packageName of [ |
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.
Good fallback
} else { | ||
logger.warning( | ||
`Please update the configuration of UIKit ${uikitConfig.name} with property 'package: ${uikitConfig.package}' in patternlab-config.json. Lookup by 'name' is deprecated and will be removed in the future.` | ||
); | ||
} // [3] |
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.
Very good message as info for the user
const resolveFileInPackage = (packageName, ...pathElements) => { | ||
return require.resolve(path.join(packageName, ...pathElements)); | ||
}; |
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.
I checked the spread syntax. It is available since Node V8.x
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.
All in all clean and good changes (☞゚ヮ゚)☞
This is a retry of #1225 which got reverted because of last-minute issues.
Summary of changes:
require.resolve()
)