0.0.84 • Published 8 months ago

@gatship/gs-components-3 v0.0.84

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

gs-components-3

Vue 3 component library

NB: If you are cloning this repository, please follow the guidelines for cloning at the bottom.

Recommended IDE Setup

VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).

Type Support for .vue Imports in TS

TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:

  1. Disable the built-in TypeScript Extension
    1. Run Extensions: Show Built-in Extensions from VSCode's command palette
    2. Find TypeScript and JavaScript Language Features, right click and select Disable (Workspace)
  2. Reload the VSCode window by running Developer: Reload Window from the command palette.

Customize configuration

See Vite Configuration Reference.

Adding the plugin to a new project

  1. Init a project with vuetify and gs-components: Open your terminal and navigate to the folder where you want to create your new project. Then write the following commands in your terminal, this will scaffold a new vue project using vuetify + vite. Make sure that you opt in for Typescript since the gs-components package requires it.
1. npm create vuetify
2. cd -your-project-name-
3. npm i @gatship/gs-components-3
4. npm i -D sass
5. npm i iso-3166-1
6. code .
  1. Follow "Adding the plugin exsisting project" steps.

Adding the plugin exsisting project

  1. Create the plugin with options in seperate file:

src/plugins/gs-components.ts

import { createGatComponents } from '@gatship/gs-components-3';

export default createGatComponents(/* global config options */);
  1. Add plugin to the project.

src/plugins/index.ts

// Plugins
import { loadFonts } from './webfontloader';
import vuetify from './vuetify';
import router from '../router';
import pinia from '../store';
import gatComponents from './gs-components';
// Types
import type { App } from 'vue';

export function registerPlugins(app: App) {
  loadFonts();
  // load all your plugins here
  app.use(vuetify).use(router).use(pinia).use(gatComponents); // .use(router) etc.
}
  1. Load the plugins in main.ts

src/main.ts

// Components
import App from './App.vue';

// Composables
import { createApp } from 'vue';

// Plugins
import { registerPlugins } from '@/plugins';

const app = createApp(App);

registerPlugins(app);

app.mount('#app');
  1. Edit the vite.config.ts file (optimizeDeps -> numeral, iso-3166-1): For some reason the commonJs libraries numeralJS & iso-3166- will not be correctly initialized by vite on project-startup. Therefore we need to tell vite to always initialize the numeral & iso-3166-1 libraries.
export default defineConfig({
  // Add this property to your vite config.
  optimizeDeps: {
    include: ['numeral', 'iso-3166-1'],
  },
  // ... plugins etc.
});
  1. npm run dev (if you just cloned this repository, follow the 'Cloning this repository' guide): The gs-components plugin should now be installed to your project. The browser console will print out 'gat-components loaded' on project-init. Happy coding!

Cloning this repository

This repository is using the submodule gs-components-3 (https://dev.azure.com/gatship/gs-components/_git/gs-components-3) This means that when you are cloning this repository you need to make sure that the submodule is initialized, updated and set to main/origin.

Run these commands in your terminal at the root of the gs-components3-docs project:

  1. git submodule init
  2. git submodule update
  3. cd submodule_dir
  4. git checkout master
  5. cd ../
0.0.84

8 months ago

0.0.80

1 year ago

0.0.81

1 year ago

0.0.82

1 year ago

0.0.83

1 year ago

0.0.73

1 year ago

0.0.74

1 year ago

0.0.75

1 year ago

0.0.76

1 year ago

0.0.77

1 year ago

0.0.78

1 year ago

0.0.79

1 year ago

0.0.70

1 year ago

0.0.71

1 year ago

0.0.72

1 year ago

0.0.62

1 year ago

0.0.63

1 year ago

0.0.64

1 year ago

0.0.65

1 year ago

0.0.66

1 year ago

0.0.67

1 year ago

0.0.68

1 year ago

0.0.69

1 year ago

0.0.60

1 year ago

0.0.61

1 year ago

0.0.59

1 year ago

0.0.54

1 year ago

0.0.55

1 year ago

0.0.56

1 year ago

0.0.57

1 year ago

0.0.58

1 year ago

0.0.47

1 year ago

0.0.51

1 year ago

0.0.52

1 year ago

0.0.53

1 year ago

0.0.50

1 year ago

0.0.48

1 year ago

0.0.49

1 year ago

0.0.46

1 year ago

0.0.40

1 year ago

0.0.41

1 year ago

0.0.42

1 year ago

0.0.43

1 year ago

0.0.44

1 year ago

0.0.45

1 year ago

0.0.20

1 year ago

0.0.21

1 year ago

0.0.22

1 year ago

0.0.23

1 year ago

0.0.24

1 year ago

0.0.25

1 year ago

0.0.37

1 year ago

0.0.38

1 year ago

0.0.39

1 year ago

0.0.19

1 year ago

0.0.30

1 year ago

0.0.31

1 year ago

0.0.32

1 year ago

0.0.33

1 year ago

0.0.34

1 year ago

0.0.35

1 year ago

0.0.36

1 year ago

0.0.26

1 year ago

0.0.27

1 year ago

0.0.28

1 year ago

0.0.29

1 year ago

0.0.10

1 year ago

0.0.11

1 year ago

0.0.12

1 year ago

0.0.13

1 year ago

0.0.14

1 year ago

0.0.15

1 year ago

0.0.9

1 year ago

0.0.16

1 year ago

0.0.17

1 year ago

0.0.18

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago