1.1.24 • Published 2 months ago

sirocco-wc v1.1.24

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Scaffolding Tool for the fusion of lit with tailwind.

DRY development in the speed of light with the zero configuration build tool parcel, playwright, and jest testing. Jenkins plugin ready

This tool helps you to develop with lit, tailwind, playwright, and parcel. It provides not only scaffolding but as well the infrastructure to generate component-specific style definitions. Further, our defaults are ready for being used in a Jenkins plugin.

Why the name?

I was looking for a word that unifies tailwind with lit. A Mediterranean wind that comes from the Sahara and reaches hurricane speeds in North Africa and Southern Europe, is the definition of sirocco and since I wrote it based in Sevilla, I found it fitting. 😁

Sirocco wind

Install

npm i -g sirocco-wc

You should install the tool globally so you can use it to generate node based projects with the init command.

Customize

You can set different environments variable to change the default configuration of this tool, which you can find in bin/config.js:

const defaultComponentType = process.env.SWC_TYPE || 'components';
const prefix = process.env.SWC_PREFIX || 'swc-';
const index = process.env.SWC_INDEX || 'index.ts';
const srcDir = process.env.SWC_SRC || `src/main/ts`
const cssDir = process.env.SWC_CSS || `${srcDir}\/\*\*\/\*.css`

Commands available

Version

sirocco-wc --version

help

sirocco-wc help
COMMANDS — Type 'sirocco-wc help <command>' to get some help about a command

init - Scaffolding your project

sirocco-wc ["init" || "i"]

Scaffolding your project to add the infrastructure needed to develop as described in the README of the template.

This structure allows to quickly develop with lit and tailwind. Further our defaults are ready for being used in a jenkins plugin. It will further direcly migrate to yarn 2 and install some recommended plugins.

...but wait there is still more to the template:

  • yarn2 based
  • typescript based
  • playwright testing integration
  • jest testing integration
  • parcel zero config based compilation and optimisation integration.
  • prettier, lint and husky integration ready
  • npm publish ready

add - Create a new component

.option("-t, --type ", "Component Type", { default: defaultComponentType, })

sirocco-wc ["add"||"a"] newcomponent [-t componentType || 'components']

This will create a new component (or the componentType you have chosen) and link it in the project hierarchy.

For example if you want to create a new view you can do:

sirocco-wc add myview -t views

buildCss - Building style.ts files

sirocco-wc ["buildCss"||"bc"]

Will generate style definitions so they can be imported into your web components. The files are optimized to only include some general tailwind plugins and the classes you may defined in your css or template.

watchCss - Watch changes and rebuild

sirocco-wc ["watchCss"||"wc"]

Will watch css and ts files and invoke the rebuild in case they have changed.

Usage sample

In case you have not yet a node based project installed, you can use the init command, however, be aware that it will override existing files.

mkdir test
cd test
sirocco-wc i

After this you will need to create a first component and then the entry file that you have defined in the init command. You can use yarn :add test to use the prefix that you have choosen in the init command.

sirocco-wc a test
echo "export * from './components/index';" > src/main/ts/index.ts

The last step is to update the index.html that was generated earlier to use your first web component.

  <body>
    <swc-test></swc-test>
  </body>

Once you have the basic structure set up, you can either use the project commands or the sirocco-wc once.

First, you need to run the local dev server.

yarn start

Sample use in package.json

"css:build": "sirocco-wc bc",
"css:watch": "sirocco-wc wc",
":add": "SWC_PREFIX=my-sirocco- sirocco-wc a"
1.1.23

2 months ago

1.1.22

2 months ago

1.1.21

2 months ago

1.1.20

2 months ago

1.1.24

2 months ago

1.1.19

2 months ago

1.1.18

2 months ago

1.1.17

2 months ago

1.1.15-snapshot

4 months ago

1.1.16

4 months ago

1.1.15

6 months ago

1.1.13-modul

10 months ago

1.1.9

11 months ago

1.1.8

11 months ago

1.1.12

10 months ago

1.1.11

10 months ago

1.1.10

10 months ago

1.1.14

10 months ago

1.1.13

10 months ago

1.1.13-module

10 months ago

1.1.13-modu

10 months ago

1.1.13-mod

10 months ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.3-y4

1 year ago

1.0.3-y3

1 year ago

1.0.3-y2

1 year ago

1.0.3

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.38

2 years ago

0.0.37

2 years ago

0.0.36

2 years ago

0.0.35

2 years ago

0.0.34

2 years ago

0.0.32

2 years ago

0.0.31

2 years ago

0.0.30

2 years ago

0.0.29

2 years ago

0.0.28

2 years ago

0.0.27

2 years ago

0.0.26

2 years ago

0.0.25

2 years ago

0.0.24

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago