You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pattern Lab only loads the pattern engines from the config (#1256)
* PatternLab loads the pattern engines from the config first, before fallback to scanning node_modules
* chore: wording and headline structure
* chore: wording
* docs: further clarification through logging
* fix: configuration
* docs: let's get rid of that old mustache engine
* refactor: we should only include the outdated mustache engine interally, but not publicly facing any more
* chore: adapted that entry from the other places
* chore: let's not mention mustache any more
* docs: wording
* docs: added a link
* chore: added relevant comment
* Update patternlab-config.json
* Restore packages/core/test/files/_handlebars-test-patterns/atoms/global/helloworld-withdata.hbs
* Update advanced-config-options.md
* Update pattern_engines.js
* Update packages/docs/src/docs/advanced-config-options.md
Co-authored-by: Josef Bredreck <slime.games@outlook.de>
Co-authored-by: Maximilian Franzke <787658+mfranzke@users.noreply.github.com>
Co-authored-by: Josef Bredreck <13408112+JosefBredereck@users.noreply.github.com>
`Engine ${name} not configured correctly. Please configure your engines in patternlab-config.json as documented in https://patternlab.io/docs/editing-the-configuration-options/#heading-engines`
140
+
);
122
141
}
123
142
}catch(err){
124
143
errorMessage=err.message;
125
144
}finally{
126
145
// report on the status of the engine, one way or another!
Copy file name to clipboardExpand all lines: packages/docs/src/docs/advanced-config-options.md
+32-1
Original file line number
Diff line number
Diff line change
@@ -180,6 +180,37 @@ Sets the panel name and language for the code tab on the styleguide. Since this
180
180
181
181
**default**: `mustache`
182
182
183
+
## engines
184
+
185
+
An engine is a wrapper around a templating library like Handlebars, Twig or others. An [engine package](docs/template-language-and-patternengines/)
186
+
is the bridge between Pattern Lab and the standalone NPM package supporting the templating language.
187
+
188
+
`engines` accepts an map of Engine objects. The mandatory properties for each Pattern Lab engine are:
189
+
190
+
-`package`: the NodeJS package name. Add the package of the engine as a dependency in `package.json` before you configure it here.
191
+
-`fileExtensions`: list of pattern file extensions which will be handled by this pattern engine.
192
+
193
+
Other engine specific configuration options can be added and will be passed to the pattern engine at loading time. See the NPM package documentation for the properties each pattern engine supports.
194
+
195
+
**default**:
196
+
197
+
```javascript
198
+
"engines": {
199
+
"handlebars": {
200
+
"package":"@pattern-lab/engine-handlebars",
201
+
"extensions": [
202
+
"handlebars",
203
+
"hbs"
204
+
],
205
+
"extend":"helpers/*.js"
206
+
...
207
+
}
208
+
}
209
+
```
210
+
211
+
Configuring the engines in the config file was introduced in v5.14. The fallback lookup mode by scanning the
212
+
`node_modules` folder is **deprecated** and will be removed in Pattern Lab v7.
213
+
183
214
## patternStateCascade
184
215
185
216
See the [Pattern State Documentation](/docs/using-pattern-states/)
@@ -402,7 +433,7 @@ Important details:
402
433
- the [default `paths.source` object paths](https://github.com/pattern-lab/patternlab-node/pull/840/commits/a4961bd5d696a05fb516cdd951163b0f918d5e19) within `patternlab-config.json` are now relative to the current UIKit. See the [structure of uikit-workshop](https://github.com/pattern-lab/patternlab-node/tree/master/packages/uikit-workshop) for more info
403
434
- the [default `paths.public` object paths](https://github.com/pattern-lab/patternlab-node/pull/840/commits/812bab3659f504043e8b61b1dc1cdac71f248449) within `patternlab-config.json` are now relative to the current UIKit's `outputDir`. Absolute paths will no longer work. Someone could test putting an absolute path in a UIKit `outputDir` property and see what happens I suppose.
404
435
-`dependencyGraph.json` has moved to the project root rather than `public/` as we should only retain one
405
-
- The lookup of the uikit by `name` is deprecated and the user will be notified of it. If the `package` property isn't defined, there is a default fallback lookup strategy where the value of `name` is tried as:
436
+
- The lookup of the uikit by `name` is **deprecated** and will be removed in v7. The user will be notified of it. If the `package` property isn't defined, there is a default fallback lookup strategy where the value of `name` is tried as:
0 commit comments