Skip to content
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

patternengines needs to support @scoped/modules #735

Closed
bmuenzenmeyer opened this issue Oct 20, 2017 · 0 comments
Closed

patternengines needs to support @scoped/modules #735

bmuenzenmeyer opened this issue Oct 20, 2017 · 0 comments

Comments

@bmuenzenmeyer
Copy link
Member

bmuenzenmeyer commented Oct 20, 2017

I am using Pattern Lab Node v3.0.0-alpha.3 on Windows, with Node v8.60, using direct consumption.

Expected Behavior
  • patternlab.build() runs
Actual Behavior

patternlab.build() is broken

pattern_engines.js needs to be able to find patternengines defined in any of the following locations within node_modules/:

  • patternengine-node-mustache
  • @pattern-lab/patternengine-node-mustache
  • @third-party/patternengine-node-language

Perhaps a better approach than diveSync would be an a small existing utility that can look for directories that match a regex. https://www.npmjs.com/package/require-glob or even just https://www.npmjs.com/package/glob would likely work?

Additional thoughts

  • the first entry in enginesDirectories[the core] can removed, since core will not have engines anymore
  • pattern_engines is currently failing because diveSync is not smart enough to see @pattern-lab/ (or any scoped packages, for that matter) and also check in there.
  • the engineMatcher regex may need to also change
  • unit tests should be able to help cover this scenario
  • DO NOT SIGNIFICANTLY REFACTOR THIS CODE. Scope of change is limited to supporting searching within scoped packages
Steps to Reproduce

clone https://github.com/bmuenzenmeyer/patternlab-node-3.0-demo-vanilla
npm install
node index.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant