项目作者: memorablewords

项目描述 :
A library of Svelte components.
高级语言: HTML
项目地址: git://github.com/memorablewords/svelte-components.git
创建时间: 2020-09-02T06:46:11Z
项目社区:https://github.com/memorablewords/svelte-components

开源协议:MIT License

下载


Svelte Components

Build Status
Dependabot Status

A library of Svelte component maintained by Memorable Words.

Usage

Using components

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 :

  1. <script>
  2. import { ByeBye, Hello } from "memorablewords-svelte-components";
  3. export let name
  4. </script>
  5. <Hello {name} ></Hello>
  6. <ByeBye {name} ></ByeBye>

Example

The Memorable Words app was set up to use this library.

Development

Browsing the library

  1. # Install the dependencies
  2. npm install
  3. # Run a local server
  4. npm run dev

The local server:

Running the test suite

  1. # Install the dependencies
  2. npm install
  3. # Run the local server (required on port 5000)
  4. npm run dev
  5. # Run the test suite
  6. npm test

For changing the view of the test page use public/global.css and public/index.html

Adding components

  1. Add your component’s code to src/ as directory, e.g.: src/HelloComponent/ (or add your component directly to src/).

  2. Export the new component to apps in src/index.js

  3. src/test.js and src/App.svelte are for testing purposes:

  1. Create your test cases to your component:
  • add tests to test/ directory

References

Do you like what you see? You can make your own using this repository template!