Skip to content

Commit

Permalink
feat: init dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
lukicenturi committed Mar 28, 2023
1 parent 67c46c3 commit 4d54e5b
Show file tree
Hide file tree
Showing 17 changed files with 9,398 additions and 1,407 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,7 @@ dist
.yarn/install-state.gz
.pnp.*

.eslintrc-auto-import.json
auto-imports.d.ts

.DS_Store
17 changes: 17 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { StorybookConfig } from '@storybook/vue-vite';
const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions'
],
framework: {
name: '@storybook/vue-vite',
options: {}
},
docs: {
autodocs: 'tag'
}
};
export default config;
3 changes: 3 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<script>
window.global = window;
</script>
16 changes: 16 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import '../src/style.css'
import type { Preview } from '@storybook/vue';

const preview: Preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/
}
}
}
};

export default preview;
60 changes: 59 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,62 @@ A vue component library and design system for rotki

## License

[AGPL-3.0](./LICENSE) License &copy; 2023- [Rotki Solutions GmbH](https://github.com/rotki)
[AGPL-3.0](./LICENSE) License &copy; 2023- [Rotki Solutions GmbH](https://github.com/rotki)


### @rotki/ui-library

To install the dependencies you need to run on the root of the repository

```
pnpm install
```

### Compiles and minifies for production
The following command when executed from the project root will build the `@rotki/ui-library` bundle.
```
pnpm run build
```

### Lint check
```
pnpm run lint
```

### Lints and fixes files
```
pnpm run lint:fix
```

# Storybook
In order to run the storybook, you can run:

```
pnpm run storybook
```

# How to test the usage locally.
After you build the bundle, in the `package.json` on your main project, you can add this to the dependencies:

```
"@rotki/ui-library": "file:...path_of_this_directory",
```

Don't forget to import the `style.css` file from `@rotki/ui-library`

```
import '@rotki/ui-library/dist/style.css';
```

And then you can use the component
```
<script setup lang="ts">
import { Button as RotkiButton } from '@rotki/ui-library';
</script>
<template>
<v-container>
<rotki-button label="This is button" outlined />
</v-container>
</template>
```
55 changes: 51 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,61 @@
],
"license": "AGPL-3.0",
"author": "Rotki Solutions GmbH <info@rotki.com>",
"main": "index.js",
"files": [
"dist"
],
"main": "dist/index.umd.js",
"module": "dist/index.es.js",
"types": "dist/types/index.d.ts",
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
"build": "vite build && pnpm run build:types && pnpm run build:tailwind",
"build-storybook": "storybook build",
"build:tailwind": "tailwindcss -o dist/style.css --minify",
"build:types": "vue-tsc -p tsconfig.build.json --declaration --emitDeclarationOnly --outDir dist/types",
"dev": "vite",
"lint": "eslint --cache . && pnpm run -r lint:style",
"lint:fix": "eslint --cache . --fix",
"storybook": "storybook dev -p 6006",
"typecheck": "vue-tsc --noEmit"
},
"peerDependencies": {
"vue": ">=2.7.14"
},
"dependencies": {
"@vueuse/core": "9.13.0",
"@vueuse/shared": "9.13.0",
"vue-demi": "0.13.11"
},
"devDependencies": {
"@babel/core": "7.21.3",
"@babel/types": "7.21.3",
"@rotki/eslint-config": "1.0.3",
"@storybook/addon-essentials": "7.0.0-rc.8",
"@storybook/addon-interactions": "7.0.0-rc.8",
"@storybook/addon-links": "7.0.0-rc.8",
"@storybook/blocks": "7.0.0-rc.8",
"@storybook/testing-library": "0.0.14-next.1",
"@storybook/vue": "7.0.0-rc.8",
"@storybook/vue-vite": "7.0.0-rc.8",
"@types/node": "16.18.12",
"@vitejs/plugin-vue2": "2.2.0",
"@vue/tsconfig": "0.1.3",
"autoprefixer": "10.4.14",
"babel-loader": "8.3.0",
"css-loader": "6.7.3",
"eslint": "8.36.0",
"typescript": "5.0.2"
"postcss": "8.4.21",
"react": "18.2.0",
"react-dom": "18.2.0",
"sass": "1.60.0",
"storybook": "7.0.0-rc.8",
"tailwindcss": "3.2.7",
"typescript": "5.0.2",
"unplugin-auto-import": "0.14.4",
"vite": "4.1.4",
"vue": "2.7.14",
"vue-loader": "^15.10.1",
"vue-tsc": "1.2.0",
"webpack": "5.0.0"
}
}
Loading

0 comments on commit 4d54e5b

Please sign in to comment.