Giter VIP home page Giter VIP logo

shoyify's Introduction

shoyify

A vue 3 component library implementing shoyo.

Not a serious project. Learning How component libraries work and how to create one.

Usage

shoyify will be released on npm after basic components are added. To test right now

git clone https://github.com/soulsam480/shoyify

In your Vue 3 Project

  • Import whole library as a Vue 3 plugin without tree shaking
import shoyify from "../../shoyify";

const app = createApp()

// Tell Vue to use shoyify as a plugin
app.use(shoyify);
app.mount('#app)
  • Import Individual components a Vue 3 plugin with tree shaking
import {ShoyoButton} from "../../shoyify";

const app = createApp()

// Tell Vue to use the component as a plugin
app.use(ShoyoButton);
app.mount('#app)
  • Import individual components directly inside.vue files
<script lang="ts">
import { ShoyoButton } from "../../shoyify";
import { defineComponent, ref } from "vue";

export default defineComponent({
  components: {
    ShoyoButton,
  },
  setup() {
    const main = ref<string>("Button");
    return { main };
  },
});
</script>

Roadmap

  • Export Global Plugin
  • Add tree Shaking to Individual components
  • Add typescript types
  • Add props typings see issue #1
  • Add basic components
  • More todos......

Inspired from Shubhadip/vue3-component-library and Vue Tailwind

shoyify's People

Contributors

soulsam480 avatar

Stargazers

Ritwik Satpathy avatar

Watchers

 avatar

shoyify's Issues

Component props intellisense in typescript

So after a lot of trial and error, I was finally able to configure the typings for component props. But there are some caveats.

How it works:
When a component is imported from shoyify and registered locally, the typings will work and IntelliSense too.
ex.

<script lang="ts">
import { ShoyoButton } from "../../shoyify";
import { defineComponent, ref } from "vue";

export default defineComponent({
  components: {
    ShoyoButton,
  },
  setup() {
    const main = ref<string>("Button");
    return { main };
  },
});
</script>

In the template tag, the component prop typings will show up from the declaration files.

Caveats:
When shoyify is registered as a plugin or individual components are registered globally, the typings won't show up.
eg.

import shoyify from "../../shoyify";

const app = createApp()

// Tell Vue to use shoyify as a plugin
app.use(shoyify);
app.mount('#app)

or

import {ShoyoButton} from "../../shoyify";

const app = createApp()

// Tell Vue to use the component as a plugin
app.use(ShoyoButton);
app.mount('#app)

Both of the above implementations won't provide IntelliSense inside template tags.

So the only way for now to get prop IntelliSense is to register components locally.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.