Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit 768a72f

Browse files
committed
Merge branch 'dev'
2 parents c5aa290 + a39f4ad commit 768a72f

File tree

7 files changed

+94
-33
lines changed

7 files changed

+94
-33
lines changed

README.md

Lines changed: 65 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,91 @@
1-
# Pattern Lab Standard Edition for Twig [BETA]
1+
# Pattern Lab Standard Edition for Twig [DEVELOPER PREVIEW]
22

3-
The Standard Edition for Twig gives developers and designers a clean base from which to develop Twig-based patterns.
3+
The Standard Edition for Twig gives developers and designers a clean and stable base from which to develop a Twig-based pattern library.
44

5-
## Installing the Standard Edition for Twig
5+
## Packaged Components
66

7-
### 1. Install Composer
7+
The Standard Edition for Twig comes with the following components:
88

9-
Pattern Lab uses [Composer](https://getcomposer.org/) to manage project dependencies. To install Composer type the following two lines in the command line:
9+
* `pattern-lab/core`: [GitHub](https://github.com/pattern-lab/patternlab-php-core), [Packagist](https://packagist.org/packages/pattern-lab/core)
10+
* `pattern-lab/patternengine-twig`: [documentation](https://github.com/pattern-lab/patternengine-php-twig#twig-patternengine-for-pattern-lab-php), [GitHub](https://github.com/pattern-lab/patternengine-php-twig), [Packagist](https://packagist.org/packages/pattern-lab/patternengine-twig)
11+
* `pattern-lab/styleguidekit-assets-default`: [GitHub](https://github.com/pattern-lab/styleguidekit-assets-default), [Packagist](https://packagist.org/packages/pattern-lab/styleguidekit-assets-default)
12+
* `pattern-lab/styleguidekit-twig-default`: [GitHub](https://github.com/pattern-lab/styleguidekit-twig-default), [Packagist](https://packagist.org/packages/pattern-lab/styleguidekit-twig-default)
13+
* `pattern-lab/unified-asset-installer`: [GitHub](https://github.com/pattern-lab/unified-asset-installer), [Packagist](https://packagist.org/packages/pattern-lab/unified-asset-installer)
1014

11-
curl -sS https://getcomposer.org/installer | php -- --install-dir=bin
15+
## Installing
1216

13-
Then close and re-open your command line terminal.
17+
There are two methods for downloading and installing the Standard Edition for Twig:
1418

15-
### 2. Install the Standard Edition
19+
* [Download a pre-built project](#download-a-pre-built-package)
20+
* [Use Composer to create a project](#use-composer-to-create-a-project)
1621

17-
Use Composer's `create-project` feature to install the Standard Edition into a location of your choosing. Type:
22+
### Download a pre-built project
23+
24+
The fastest way to get started with the Standard Edition for Twig is to [download the pre-built version](https://github.com/pattern-lab/edition-php-twig-standard/releases) from the [releases page](https://github.com/pattern-lab/edition-php-twig-standard/releases). The pre-built project comes with the [Base StarterKit for Twig](https://github.com/pattern-lab/starterkit-twig-base) installed by default.
25+
26+
**Please note:** Pattern Lab uses [Composer](https://getcomposer.org/) to manage project dependencies. To upgrade the Standard Edition for Twig or to install plug-ins you'll need to [install Composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx). We recommend that you [install it globally](https://getcomposer.org/doc/00-intro.md#globally).
27+
28+
### Use Composer to create a project
29+
30+
Pattern Lab uses [Composer](https://getcomposer.org/) to manage project dependencies.
31+
32+
#### Install Composer
33+
34+
Please follow the directions for [installing Composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx) on the Composer website. We recommend you [install it globally](https://getcomposer.org/doc/00-intro.md#globally).
35+
36+
#### Install the Standard Edition for Twig
37+
38+
Use Composer's [`create-project` command](https://getcomposer.org/doc/03-cli.md#create-project) to install the Standard Edition for Twig into a location of your choosing. In Terminal type:
1839

1940
cd install/location/
2041
composer create-project pattern-lab/edition-twig-standard your-project-name && cd $_
2142

22-
This will create a directory called `your-project-name`.
23-
24-
### 3. Install a StarterKit
43+
This will install the Standard Edition for Twig into a directory called `your-project-name` in `install/location/`. During the set-up process you will be asked to install an appropriate StarterKit. You will be automatically dropped into the project directory after the process is finished.
2544

26-
To install a near-empty StarterKit project as a starting point you can run:
45+
## Updating Pattern Lab
2746

28-
php core/console --starterkit --init
47+
To update Pattern Lab please refer to each component's GitHub repository. The components are listed at the top of the README.
2948

30-
### 4. Generate Pattern Lab
49+
## Helpful Commands
3150

32-
To generate Pattern Lab for the first time and make sure everything was installed correctly type:
51+
These are some helpful commands you can use on the command line for working with Pattern Lab.
3352

34-
php core/console --generate
53+
### List all of the available commands
3554

3655
To list all available commands type:
3756

3857
php core/console --help
3958

40-
### 5. Start the server to see your Pattern Lab web site
59+
To list the options for a particular command type:
60+
61+
php core/console --help --[command]
62+
63+
### Generate Pattern Lab
4164

42-
You can use PHP's built-in web server to review your Pattern Lab project in a browser. In a new terminal window type:
65+
To generate the front-end for Pattern Lab type:
66+
67+
php core/console --generate
68+
69+
### Watch for changes and re-generate Pattern Lab
70+
71+
To watch for changes and re-generate the front-end for Pattern Lab type:
72+
73+
php core/console --watch
74+
75+
### Start a server to view Pattern Lab
76+
77+
You can use PHP's built-in web server to review your Pattern Lab project in a browser. In a seperate window type:
4378

4479
php core/console --server
4580

46-
And then visit [http://localhost:8080](http://localhost:8080)
81+
Then open [http://localhost:8080](http://localhost:8080) in your browser.
82+
83+
### Install a StarterKit
84+
85+
To install a near-empty StarterKit as a starting point for your project type:
86+
87+
php core/console --starterkit --init
88+
89+
To install a specific StarterKit from GitHub type:
90+
91+
php core/console --starterkit --install <starterkit-vendor/starterkit-name>

composer.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pattern-lab/edition-twig-standard",
3-
"description": "The Twig-based Standard Edition of Pattern Lab. Installs all Twig-related assets except for a StarterKit.",
3+
"description": "Standard Edition of Pattern Lab for Twig. Installs all Twig-related assets except for a StarterKit.",
44
"keywords": ["pattern lab"],
55
"homepage": "http://patternlab.io",
66
"license": "MIT",
@@ -32,17 +32,28 @@
3232
"pattern-lab/styleguidekit-twig-default": "~0.5"
3333
},
3434
"scripts": {
35-
"pre-install-cmd": [
36-
"PatternLab\\Installer::preInstallCmd"
35+
"post-create-project-cmd": [
36+
"PatternLab\\Installer::postCreateProjectCmd"
3737
],
3838
"post-package-install": [
3939
"PatternLab\\Installer::postPackageInstall"
4040
],
4141
"post-package-update": [
4242
"PatternLab\\Installer::postPackageUpdate"
4343
],
44+
"pre-install-cmd": [
45+
"PatternLab\\Installer::preInstallCmd"
46+
],
4447
"pre-package-uninstall": [
4548
"PatternLab\\Installer::prePackageUninstall"
4649
]
50+
},
51+
"extra": {
52+
"patternlab": {
53+
"starterKitSuggestions": [
54+
"pattern-lab/starterkit-twig-base",
55+
"pattern-lab/starterkit-twig-demo"
56+
]
57+
}
4758
}
4859
}

core/bin/composer.phar

-941 KB
Binary file not shown.

core/scripts/README

Lines changed: 0 additions & 1 deletion
This file was deleted.

core/scripts/installPatternLab.command

Lines changed: 0 additions & 5 deletions
This file was deleted.

core/scripts/updateComposer.command

Lines changed: 0 additions & 4 deletions
This file was deleted.

core/src/PatternLab/Installer.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@
1818

1919
class Installer {
2020

21+
/**
22+
* Run the PL tasks when a package is installed
23+
* @param {Object} a script event object from composer
24+
*/
25+
public static function postCreateProjectCmd(Event $event) {
26+
27+
// make sure pattern lab has been loaded
28+
if (class_exists("\PatternLab\Config")) {
29+
30+
InstallerUtil::postCreateProjectCmd($event);
31+
32+
}
33+
34+
}
35+
2136
/**
2237
* Run the PL tasks when a package is installed
2338
* @param {Object} a script event object from composer

0 commit comments

Comments
 (0)