0.3.8-alpha.2 • Published 6 years ago

padl v0.3.8-alpha.2

Weekly downloads
1,796
License
MIT
Repository
github
Last release
6 years ago

PaDL - Pattern Design Library System

Installation

npm i -g padl

About

This is a project that allows you to easily create pattern libraries, with pure webcomponents using polymer (or lit). It bundles all of your components together with the needed polyfills so that you only require one js file.

Why use?

Padl does a few things that makes developing webcomponents easier:

  1. šŸŽ‰ Generates all the files that you need, when creating a pattern library and when creating a new component.
  2. šŸ‘©ā€šŸ’» Creates a kickass development environment, using storybook.
  3. šŸš€ Bundles and tree shakes all the needed files together.

Example structure

If we create a hello-world pattern library with a primary-button web component:

ā”œā”€ā”¬ hello-world
  ā”œā”€ā”¬ src
  | └─┬ primary-button
  |   ā”œā”€ā”€ component.js
  |   ā”œā”€ā”€ story.js
  |   └── styles.less
  ā”œā”€ā”¬ test
  | ā”œā”€ā”¬ primary-button
  | | ā”œā”€ā”€ primary-button_test.js
  | | └── primary-button_test.html
  | └── index.html
  └─┬ dist
    ā”œā”€ā”€ hello-world.min.js
    └── components.min.js

To create this example:

 npm i -g padl
 padl new hello-world
 cd hello-world && npm i
 padl g primary-button
 padl build

Integration

As seen in the example, hello-world.min.js file is created.

This will add all the polyfills, components, lit-element and can inline your global styles. This is in an effort to reduce the amount of blocking, while keeping the file as small as possible.

Note:

Our browser coverage is last 2 browsers + IE11. For this reason we aren't moving forward with ES modules, however with this setup it will allow us to start to look into how to implement.

How to

Create a new pattern library

  padl new [name]

Options

  • type: polymer, lit (default: polymer)

     padl new [name] --type lit

    After creating a new pattern library you can:

     cd [name] && npm i

Create a new component

Inside your pattern library

 padl g [component-name]

This will create a polymer or lit component (based on your .padl type). It will also generate the story.js, styles.less and the test files.

Delete a component

Inside your pattern library

 padl d [component-name]

Build your library

Inside your pattern library

 padl build

In your dist folder will find the components.min.js

Serve a component

Inside your pattern library

 padl serve

This will generate a storybook of all your component stories at localhost:9001

Options

  • port: 8080 (default: 9001)

     padl serve --port 8080

Config file

  • type polymer/lit (String, Default: polymer, prefilled on setup)
  • watch (Object)
    • watchGlob (Array)
    • commands (Array)
  • static (Array)
  • globalStyle
    • input (String)
    • output (String)
    • watch (String|Array|Glob)
{
  "type": "lit",
  "watch": {
    "watchGlob": ["styles/**", "dist/*"],
    "commands": ["npm run less:watch"]
  },
  "static": ["./styles/fonts"],
  "globalStyle": {
    "inline": true,
    "input": "./styles/base/all.less",
    "output": "./dist/styles.min.css",
    "watch": "./styles/**"
  }
}

Test your components

Inside your pattern library

 padl test

Options

  • persistent (default: false)
  • headless (default: false)
Persistent
 padl test --persistent
 padl test -p
Headless

For headless testing to work you need a config file in your project root called wct.headless.config.json.

An example of how this file could be:

{
  "plugins": {
    "local": {
      "browsers": ["chrome", "firefox"],
      "browserOptions": {
        "chrome": [
          "headless"
        ],
        "firefox": [
          "-headless"
        ]
      }
    }
  }
}
 padl test --headless
 padl test -h

Dependencies

This uses a variety of other resources:

  • Lit Element
  • Storybook
2.0.1-alpha.8

4 years ago

2.0.1-alpha.9

4 years ago

2.0.1-alpha.7

4 years ago

2.0.1-alpha.6

4 years ago

2.0.1-alpha.3

4 years ago

2.0.1-alpha.4

4 years ago

2.0.1-alpha.5

4 years ago

2.0.0

4 years ago

2.0.1-alpha.1

4 years ago

2.0.1-alpha.2

4 years ago

2.0.0-alpha.7

4 years ago

2.0.0-alpha.4

4 years ago

2.0.0-alpha.5

4 years ago

2.0.0-alpha.6

4 years ago

1.0.3

4 years ago

1.0.3-0

4 years ago

2.0.0-alpha.3

4 years ago

2.0.0-alpha.2

5 years ago

2.0.0-alpha.1

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0-aa.8

5 years ago

1.0.0-aa.7

5 years ago

1.0.0

5 years ago

1.0.0-alpha.20

5 years ago

1.0.0-aa.6

5 years ago

1.0.0-aa.5

5 years ago

1.0.0-aa.4

5 years ago

1.0.0-aa.2

5 years ago

1.0.0-aa.3

5 years ago

1.0.0-aa.1

5 years ago

1.0.0-alpha.19

5 years ago

1.0.0-alpha.18

5 years ago

1.0.0-alpha.17

6 years ago

1.0.0-alpha.16

6 years ago

1.0.0-alpha.15

6 years ago

1.0.0-alpha.14

6 years ago

1.0.0-alpha.12

6 years ago

1.0.0-alpha.11

6 years ago

1.0.0-alpha.13

6 years ago

1.0.0-alpha.10

6 years ago

1.0.0-alpha.9

6 years ago

1.0.0-alpha.8

6 years ago

1.0.0-alpha.7

6 years ago

1.0.0-alpha.6

6 years ago

1.0.0-alpha.5

6 years ago

1.0.0-alpha.4

6 years ago

1.0.0-alpha.3

6 years ago

1.0.0-alpha.2

6 years ago

1.0.0-alpha.1

6 years ago

0.3.8-alpha.4

6 years ago

0.3.8-alpha.3

6 years ago

0.3.8-alpha.2

6 years ago

0.3.8-alpha.1

6 years ago

0.3.7

6 years ago

0.3.7-beta.1

6 years ago

0.3.7-alpha.8

6 years ago

0.3.7-alpha.7

6 years ago

0.3.7-alpha.6

6 years ago

0.3.7-alpha.5

7 years ago

0.3.7-alpha.4

7 years ago

0.3.7-alpha.3

7 years ago

0.3.7-alpha.2

7 years ago

0.3.7-alpha.1

7 years ago

0.3.6

7 years ago

0.3.6-alpha.5

7 years ago

0.3.6-alpha.4

7 years ago

0.3.6-alpha.3

7 years ago

0.3.6-alpha.2

7 years ago

0.3.6-alpha.1

7 years ago

0.3.5

7 years ago

0.3.5-alpha.1

7 years ago

0.3.4

7 years ago

0.3.4-beta.1

7 years ago

0.3.4-alpha.18

7 years ago

0.3.4-alpha.17

7 years ago

0.3.4-alpha.16

7 years ago

0.3.4-alpha.15

7 years ago

0.3.4-alpha.14

7 years ago

0.3.4-alpha.13

7 years ago

0.3.4-alpha.12

7 years ago

0.3.4-alpha.11

7 years ago

0.3.4-alpha.10

7 years ago

0.3.4-alpha.9

7 years ago

0.3.4-alpha.8

7 years ago

0.3.4-alpha.7

7 years ago

0.3.4-alpha.6

7 years ago

0.3.4-alpha.5

7 years ago

0.3.4-alpha.4

7 years ago

0.3.4-alpha.3

7 years ago

0.3.4-alpha.2

7 years ago

0.3.4-alpha.1

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.3.0-alpha.2

7 years ago

0.3.0-alpha.1

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.1-alpha.3

7 years ago

0.2.1-alpha.2

7 years ago

0.2.1-alpha.1

7 years ago

0.2.0

7 years ago

0.1.5-alpha.9

7 years ago

0.1.5-alpha.8

7 years ago

0.1.5-alpha.7

7 years ago

0.1.5-alpha.6

7 years ago

0.1.5-alpha.5

7 years ago

0.1.5-alpha.4

7 years ago

0.1.5-alpha.3

7 years ago

0.1.5-alpha.2

7 years ago

0.1.5-alpha.1

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago