1.9.1 • Published 8 months ago

@3squared/forge-ui v1.9.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Welcome to Forge UI!

alt

Adding a new component

Adding a new component in the /src directory

  1. Decide which category your new component should come under in /src/components. (Forms, Layout, General etc)

  2. Create a new folder in the relevant category with a descriptive name. For example if we wanted to create a location picker for the form:

src/
   components/
      forms/
         location-picker/
  1. Inside your new folder create a Vue SFC (Single File Component) with a relevant name. Here is a template to get you started that will mean tree shaking will be supported out the box.
location-picker/
   LocationPicker.vue
<template>
  <h1>Hello, world!</h1>
</template>

<script lang="ts">
import Vue from 'vue';

export const MyComponent = /*#__PURE__*/ Vue.extend({
  name: 'MyComponent'
});
export default MyComponent;
</script>
  1. Develop your component with all the features you require, creating a subfolder of components or helpers if you need.

  2. You now need to register your component in the main entry file.

Go to index.ts and import, export and optionally register your new component.

// Import it
import ForgeLocationPicker from './src/components/forms/location-picker/LocationPicker.vue';

...

// Optionally register it
const ForgeUI = {
  install(Vue: VueConstructor) {
    ...
    registerComponent(ForgeLocationPicker);
    ...
  }
};

...

// Export it
export {
   ...
   ForgeLocationPicker
   ...
}

Tips For Tree Shaking

Most of the leg work for making tree shaking work is already in place - there are just two things you need to make sure you do:

  • In your Vue SFC make sure you include the PURE annotation via
    export const MyComponent = /*#__PURE__*/ Vue.extend({..
  • When you install a new dependency, make sure to externalize it via the external section in rollup.config.js.

Documenting your new component

Please consult docs/README.md on how you should document your new component and add examples to test it's functionality!

Publishing a new version

To publish a new version of Forge UI Framework please open a PR targeting the main branch and the GitHub Action will take care of the rest!

1.9.1

8 months ago

1.8.2

9 months ago

1.9.0

8 months ago

1.8.1

9 months ago

1.8.0

10 months ago

1.7.1

10 months ago

1.7.0

10 months ago

1.8.3

9 months ago

1.6.0

10 months ago

1.5.0

1 year ago

1.4.0

1 year ago

1.3.5

1 year ago

1.3.4

1 year ago

1.3.3

1 year ago

1.3.2

1 year ago

1.3.4-preview.0

1 year ago

1.2.0

1 year ago

1.1.5

2 years ago

1.1.4

2 years ago

1.3.1

1 year ago

1.3.0-beta.0

1 year ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago