This is a starter project for building a standalone Web Component using Stencil and Storybook.
Stencil is a compiler for building fast web apps using Web Components.
Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than run-time tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec.
Stencil components are just Web Components, so they work in any major framework or with no framework at all.
Clone the repo
git clone https://github.com/Edd-Strickland/stencilbook.git
Change into the base directory:
cd stencilbook
Install the modules:
npm install
and run a build for the entire repo:
npm run build:all
After this run storybook:
npm run storybook
Build stencil:
npm run stencil
Start stencil directly in serve/watch mode; Useful for ameneding stencil components directly:
npm run stencil:start
Run storybook and a stencil build with watch and serve, deleting any previous versions built and will serve locally:
npm run storybook:build:all
Serve storybook Locally:
npm run storybook:serve
Reset modules; Deletes and reinstalls node modules:
npm run reset:modules
To run the unit tests for the components, run:
npm test
To run tests in watch mode:
npm run test.watch
To generate new Stencil components automagically:
npm run generate