@webdevandsausages/event-terminal
v0.6.1
Published
A component for display a WD&S event and executing, checking, or cancelling event resgistration
Downloads
6
Readme
@webdevandsauages/event-terminal
This is component is intended for use in webdevandsausages.org and is not suitable for other projects. The original boilerplate is from svelte component template.
Table of Contents
Getting Started usin the component
npm i @webdevandsauages/event-terminal --save
Include in your project
<script>
import {Terminal} from '@webdevandsausages/event-terminal'
</script>
<style>
.terminal-wrapper {
margin: 20px 10%;
}
@media (max-width: 650px) {
.terminal-wrapper {
margin: 20px 2%;
}
}
</style>
<div class="terminal-wrapper">
/* it is possible to pass in the event here and the component will not fetch it itself */
{#if process.browser}
<Terminal event={null} />
{/if}
</div>
Developing
- Start Rollup:
npm run dev
Edit a component file in
src/components
, save it, and reload the page to see your changes.Make sure your component is exported in
src/components/components.module.js
.Make sure your component is imported and nested in
src/App.svelte
.Navigate to localhost:3000 to see your components live.
In development the express dev server will proxy
/api
requests tolocalhost:5000
Consuming Components
Your package.json has a "svelte"
field pointing to src/components/components.module.js
, which allows Svelte apps to import the source code directly, if they are using a bundler plugin like rollup-plugin-svelte or svelte-loader (where resolve.mainFields
in your webpack config includes "svelte"
). This is recommended.
For everyone else, npm run build
will bundle your component's source code into a plain JavaScript module (index.mjs
) and a UMD script (index.js
), in the dist
folder.
This will happen automatically when you publish your component to npm, courtesy of the prepublishOnly
hook in package.json.
Backward Compatibility
This template uses svelte-preprocess in order to integrate PostCSS auto-prefixing capabilities into the build process.
Browserlist
PostCSS
uses browserlist under the hood, in order to "know" what css to prefix.
The browserlist
configuration is located inside the package.json
.
Preprocessors
This template comes with the svelte-preprocess by default, which simplifies the use of preprocessors in components.