A library of Svelte component maintained by Memorable Words.
https://github.com/rollup/rollup-plugin-svelte#pkgsvelte
Tip: if you are a developer of the component library, then you can install it once as devDependencies to app with npm i -D <path-to-svelte-components>
, all change will appear immediately if you use livereload in app.
Import component library into your app in App.svelte
:
<script>
import { ByeBye, Hello } from "memorablewords-svelte-components";
export let name
</script>
<Hello {name} />
<ByeBye {name} />
The Memorable Words app was set up to use this library.
# Install the dependencies
npm install
# Run a local server
npm run dev
The local server:
- builds components on change
- serves from the
public/
directory at http://localhost:5000 - handles livereload
# Install the dependencies
npm install
# Run the local server (required on port 5000)
npm run dev
# Run the test suite
npm test
For changing the view of the test page use public/global.css and public/index.html
-
Add your component's code to src/ as directory, e.g.: src/HelloComponent/ (or add your component directly to src/).
-
Export the new component to apps in src/index.js
-
src/test.js and src/App.svelte are for testing purposes:
- add component to the src/App.svelte
- add component's properties to src/test.js
- Create your test cases to your component:
- add tests to test/ directory
Do you like what you see? You can make your own using this repository template!
svelte
https://svelte.devnightwatch
for testing: https://nightwatchjs.orgeslint
andprettier
for formatting and lintingrollupjs
for bundling: https://rollupjs.org