Skip to content

Commit 1d60512

Browse files
committed
feat(core): add newer installation instructions to README
1 parent 05ca5c4 commit 1d60512

File tree

1 file changed

+38
-8
lines changed

1 file changed

+38
-8
lines changed

README.md

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,45 @@ Refer to the [core usage guidelines](https://github.com/pattern-lab/patternlab-n
2222

2323
### Installation
2424

25-
Installation is still in flux due to the monorepo transition. Bear with us as we figure this out. Our intent is to ship the Pattern Lab Node CLI soon which will help new and existing users.
25+
As of Pattern Lab Node 3.0.0, installation of [Editions](http://patternlab.io/docs/advanced-ecosystem-overview.html) is accomplished via the command line interface.
26+
27+
_0 to 60mph_
28+
29+
The below assume a new directory and project is required.
30+
31+
1. Open a terminal window and following along below:
32+
```bash
33+
mkdir new-project
34+
cd new-project
35+
npm init -y && npx -p @pattern-lab/cli -c 'patternlab init'
36+
```
37+
> If you get an error stating that `npx` is not installed, ensure you are on `npm 5.2.0` or later by running `npm -v` or install it globally with `npm install -g npx`. [Learn more about npx.](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b)
38+
1. Follow the on-screen prompts to choose your Edition and a Starterkit should you want one.
39+
1. Open `package.json` and add the following to your `scripts` object
40+
```diff
41+
"scripts": {
42+
+ "patternlab": "patternlab"
43+
},
44+
```
45+
This tells `npm` to look in the local `node_modules/.bin` directory for the `patternlab` CLI.
46+
1. In your terminal, run `npm run patternlab <command>`, where `<command>` is a documented method on the CLI, such as `build`, `serve`, or `help`.
47+
48+
49+
_Established npm projects_
50+
51+
1. Run the following command from a terminal:
52+
```bash
53+
npm install @pattern-lab/cli --save-dev
54+
```
55+
1. Open `package.json` and add the following to your `scripts` object
56+
```diff
57+
"scripts": {
58+
+ "patternlab": "patternlab"
59+
},
60+
```
61+
This tells `npm` to look in the local `node_modules/.bin` directory for the `patternlab` CLI.
62+
1. In your terminal, run `npm run patternlab init`. Follow the on-screen prompts to choose your Edition and a Starterkit should you want one.
2663

27-
_In the meantime..._
28-
29-
if you already have an Edition tracking 3.X alphas, you can update using the [standard instructions](https://github.com/pattern-lab/patternlab-node/wiki/Upgrading#3x-instructions).
30-
31-
if you don't mind pulling down everything and playing with it locally, clone this repo and follow the instructions for [developing locally](https://github.com/pattern-lab/patternlab-node/blob/master/.github/CONTRIBUTING.md#developing-locally).
32-
33-
if you don't yet have a 3.X compatible Edition and want to try something a bit messier (and unsupported for now), you could attempt this [workaround](https://github.com/pattern-lab/patternlab-node/issues/813).
3464

3565
## Ecosystem
3666

0 commit comments

Comments
 (0)