Skip to content
Merged
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
9 changes: 9 additions & 0 deletions packages/development-edition-engine-twig/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules/
.DS_Store
patternlab.json
.sass-cache/*
/sass-cache
Thumbs.db
.idea/
public
dependencyGraph.json
5 changes: 5 additions & 0 deletions packages/development-edition-engine-twig/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

25 changes: 25 additions & 0 deletions packages/development-edition-engine-twig/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
![Pattern Lab Logo](/patternlab.png "Pattern Lab Logo")

# Pattern Lab Node - Development Edition Engine Twig

_here be dragons_

This Development Edition is a variant of [Edition Node](https://github.com/pattern-lab/patternlab-node/tree/master/packages/edition-node) for convience purposes only, loaded with the Twig Engine. The goals of this Development Edition are two-fold:

* Develop the [Twig Engine](https://github.com/pattern-lab/patternlab-node/tree/master/packages/engine-twig)
* Build and test against Twig pattern tree

> Development Editions of Pattern Lab provide the ability to work on and commit changes to select packages within the overall Pattern Lab [ecosystem](http://patternlab.io/docs/advanced-ecosystem-overview.html). This Edition is NOT stable.


## Working on Pattern Lab's UI Locally

### Step 1: Install Dependencies
Run the following in the root of the Pattern Lab repo:

```
yarn run setup
```

### Step 2
Finally, go back into this folder, `cd packages/development-edition-engine-twig`, and start up the local dev server which watches UIKit and the local Pattern Lab instance for changes, live reloads, etc by running `yarn dev`
43 changes: 43 additions & 0 deletions packages/development-edition-engine-twig/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "@pattern-lab/development-edition-engine-twig",
"private": true,
"version": "0.0.1",
"description": "The tree of components we use to test, develop and validate the twig engine (not engine-twig-php)",
"scripts": {
"postbootstrap": "patternlab install --starterkits @pattern-lab/starterkit-twig-demo",
"pl:build": "patternlab build --config ./patternlab-config.json",
"pl:help": "patternlab --help",
"pl:install": "patternlab install --config ./patternlab-config.json",
"pl:serve": "patternlab serve --config ./patternlab-config.json",
"pl:version": "patternlab --version",
"dev": "node ./node_modules/@pattern-lab/uikit-workshop/build-tools.js"
},
"keywords": [
"Pattern Lab",
"Atomic Web Design",
"Node",
"Twig",
"Edition"
],
"author": "Ringo De Smet",
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/pattern-lab/patternlab-node.git"
},
"engines": {
"node": ">=10.0"
},
"dependencies": {
"@pattern-lab/cli": "^5.7.0",
"@pattern-lab/core": "^5.7.0",
"@pattern-lab/engine-twig": "^5.0.0",
"@pattern-lab/starterkit-twig-demo": "^5.0.0",
"@pattern-lab/uikit-workshop": "^5.7.1"
},
"workspaces": {
"nohoist": [
"**/@pattern-lab/starterkit-twig-demo"
]
}
}
114 changes: 114 additions & 0 deletions packages/development-edition-engine-twig/patternlab-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"cacheBust": true,
"cleanPublic": true,
"defaultPattern": "pages-homepage",
"defaultShowPatternInfo": false,
"ishControlsHide": {
"s": false,
"m": false,
"l": false,
"full": false,
"random": false,
"disco": false,
"hay": true,
"mqs": false,
"find": false,
"views-all": false,
"views-annotations": false,
"views-code": false,
"views-new": false,
"tools-all": false,
"tools-docs": false
},
"ishViewportRange": {
"s": [
240,
500
],
"m": [
500,
800
],
"l": [
800,
2600
]
},
"logLevel": "info",
"outputFileSuffixes": {
"rendered": ".rendered",
"rawTemplate": "",
"markupOnly": ".markup-only"
},
"paths": {
"source": {
"root": "source/",
"patterns": "source/_patterns/",
"data": "source/_data/",
"meta": "source/_meta/",
"annotations": "source/_annotations/",
"styleguide": "dist/",
"patternlabFiles": {
"general-header": "views/partials/general-header.mustache",
"general-footer": "views/partials/general-footer.mustache",
"patternSection": "views/partials/patternSection.mustache",
"patternSectionSubtype": "views/partials/patternSectionSubtype.mustache",
"viewall": "views/viewall.mustache"
},
"js": "source/js",
"images": "source/images",
"fonts": "source/fonts",
"css": "source/css"
},
"public": {
"root": "public/",
"patterns": "public/patterns/",
"data": "public/styleguide/data/",
"annotations": "public/annotations/",
"styleguide": "public/styleguide/",
"js": "public/js",
"images": "public/images",
"fonts": "public/fonts",
"css": "public/css"
}
},
"patternExtension": "twig",
"patternStateCascade": [
"inprogress",
"inreview",
"complete"
],
"patternExportDirectory": "pattern_exports",
"patternExportPatternPartials": [],
"serverOptions": {
"wait": 1000
},
"starterkitSubDir": "dist",
"styleGuideExcludes": [],
"theme": {
"color": "dark",
"density": "compact",
"layout": "horizontal"
},
"uikits": [
{
"name": "uikit-workshop",
"outputDir": "",
"enabled": true,
"excludedPatternStates": [],
"excludedTags": []
}
],
"engines": {
"twig": {
"namespaces": {
"atoms": "source/_patterns/00-atoms/",
"molecules": "source/_patterns/01-molecules/",
"organisms": "source/_patterns/02-organisms/",
"templates": "source/_patterns/03-templates/",
"pages": "source/_patterns/04-pages/",
"macros": "source/_macros/"
}
}
}
}
2 changes: 2 additions & 0 deletions packages/development-edition-engine-twig/source/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
10 changes: 7 additions & 3 deletions packages/engine-twig/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
## The Twig PatternEngine for Pattern Lab / Node

To install the Twig engine in your edition, `npm install @pattern-lab/engine-twig` should do the trick.
To install the Twig engine in your edition, `npm install @pattern-lab/engine-twig` should do the trick. This pattern engine uses the [`twing`](https://www.npmjs.com/package/twing) library.

## Supported features

Level of support is more or less full. Partial calls and lineage hunting are supported. Twig does not support the mustache-specific syntax extensions, style modifiers and pattern parameters, because their use cases are addressed by the core Twig feature set.
Level of support for Twig constructs is on the level that the `twing` library supports. The following partial resolution schemes (`includes`, `extends`, `import`) are supported:

We are looking for help with the following issues:
* relative file paths: standard by `twing` libary
* namespaces: standard by `twing` library, `engine-twig` only passes the configuration from `patternlab-config.json`
* Patternlab pattern names: integration between Patternlab and `twing` implemented by a custom [`loader`](https://nightlycommit.github.io/twing/api.html#create-your-own-loader)

Now that this engine uses a better Twig Javascript library, the following issues are resolved:

* [Pattern Lab does not support twig extends](https://github.com/pattern-lab/patternlab-node/issues/554)
* [Verify maturity of Twig engine](https://github.com/pattern-lab/patternlab-node/issues/285)
Expand Down
Loading