Skip to content

Commit

Permalink
Merge pull request #7 from dl-tokene/feature/update-kits
Browse files Browse the repository at this point in the history
Feature/update kits
  • Loading branch information
lukachi authored May 7, 2023
2 parents ae9afd7 + 4394467 commit eb721e9
Show file tree
Hide file tree
Showing 41 changed files with 928 additions and 210 deletions.
20 changes: 18 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.0.0-rc.4] - 2023-05-07
### Added
- `toolkit` - increase gas estimates
- `root` - `toasts` package

### Changed
- `toolkit` - build options
- `ui-kit` - build options

### Fixed
- `ui-kit` - components depended on vue-router

### Removed
- `ui-kit` - toasts components
- `toolkit` - notification types

## [0.0.0-rc.3] - 2023-05-04
### Added
- `root` - `styles` package
Expand All @@ -14,7 +30,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `toolkit` - imports
- `root` - typescript version


## [0.0.0-rc.2] - 2023-04-27
### Added
- `toolkit` - parsing config helpers, composables, eth helpers, localization for validators
Expand All @@ -34,7 +49,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Initial release
- `root` - `toolkit` package

[Unreleased]: https://github.com/dl-tokene/webkit/compare/0.0.0-rc.3...HEAD
[Unreleased]: https://github.com/dl-tokene/webkit/compare/0.0.0-rc.4...HEAD
[0.0.0-rc.4]: https://github.com/dl-tokene/webkit/compare/0.0.0-rc.3...0.0.0-rc.4
[0.0.0-rc.3]: https://github.com/dl-tokene/webkit/compare/0.0.0-rc.2...0.0.0-rc.3
[0.0.0-rc.2]: https://github.com/dl-tokene/webkit/compare/0.0.0-rc.1...0.0.0-rc.2
[0.0.0-rc.1]: https://github.com/dl-tokene/webkit/compare/0.0.0-rc.0...0.0.0-rc.1
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Here are the packages in the namespace:
| [@tokene/vue-web3-provider](https://dl-tokene.github.io/webkit/modules/_tokene_vue_web3_provider.html) | The Vue reactive wrapper of [@distributedlab/w3p](https://github.com/distributed-lab/web-kit/tree/main/packages/w3p) | [![npm version](https://img.shields.io/npm/v/@tokene/toolkit.svg)](https://www.npmjs.com/package/@tokene/vue-web3-provider) |
| [@tokene/styles](https://dl-tokene.github.io/webkit/modules/_tokene_styles.html) | The global styles for every TokenE project and common function, mixins and variables | [![npm version](https://img.shields.io/npm/v/@tokene/styles.svg)](https://www.npmjs.com/package/@tokene/styles) |
| [@tokene/ui-kit](https://dl-tokene.github.io/webkit/modules/_tokene_ui_kit.html) | The global ui-kit for every TokenE project | [![npm version](https://img.shields.io/npm/v/@tokene/ui-kit.svg)](https://www.npmjs.com/package/@tokene/ui-kit) |
| [@tokene/toasts](https://dl-tokene.github.io/webkit/modules/_tokene_toasts.html) | Vue based toasts | [![npm version](https://img.shields.io/npm/v/@tokene/toasts.svg)](https://www.npmjs.com/package/@tokene/toasts) |

## Using in the projects made by create-react-app

Expand Down
2 changes: 1 addition & 1 deletion packages/styles/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tokene/styles",
"version": "0.0.0-rc.3",
"version": "0.0.0-rc.4",
"description": "Default styles for every single frontend module of TokenE",
"repository": {
"type": "git",
Expand Down
9 changes: 9 additions & 0 deletions packages/toasts/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
build/*.js
dist/**/*.d.ts
dist/*.js
config/*.js
**/*.config.js
playground
*.schema.js
index.html
*.md
163 changes: 163 additions & 0 deletions packages/toasts/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
parser: 'vue-eslint-parser',
overrides: [
{
files: ['src/**/*.{ts,vue}'],
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 'latest',
sourceType: 'module',
project: './packages/toasts/tsconfig.json',
},
},
],
settings: {
'vue-i18n': {
localeDir: 'src/localization/**/*.(json|json5)',
},
},
extends: [
'eslint:recommended',
'plugin:vue/vue3-recommended',
'@vue/typescript/recommended',
'@vue/eslint-config-typescript/recommended',
'plugin:vue-i18n/recommended',
'@vue/prettier',
'@vue/eslint-config-prettier',
],
plugins: ['promise'],
globals: {
defineProps: 'readonly',
defineEmits: 'readonly',
defineExpose: 'readonly',
withDefaults: 'readonly',
},
rules: {
'prettier/prettier': [
'warn',
{
vueIndentScriptAndStyle: false,
printWidth: 80,
trailingComma: 'all',
endOfLine: 'auto',
tabWidth: 2,
semi: false,
singleQuote: true,
bracketSpacing: true,
bracketSameLine: false,
arrowParens: 'avoid',
},
],
'vue-i18n/no-v-html': 'off',
'vue-i18n/no-dynamic-keys': 'warn',
'vue-i18n/no-missing-keys': 'warn',
'vue-i18n/no-unused-keys': [
'error',
{
extensions: ['.js', '.ts', '.vue'],
},
],
'vue-i18n/no-raw-text': [
'error',
{
ignoreText: ['—', '|', '×'],
},
],
'arrow-parens': 0,
'no-debugger': 1,
'no-warning-comments': [
1,
{
terms: ['hardcoded'],
location: 'anywhere',
},
],
'no-return-await': 0,
'object-curly-spacing': ['error', 'always'],
'no-var': 'error',
'comma-dangle': [1, 'always-multiline'],
'linebreak-style': ['error', 'unix'],
'generator-star-spacing': 0,
'no-tabs': 2,
'max-len': [
1,
{
code: 80,
comments: 80,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],
'no-console': [
1,
{
allow: ['warn', 'error'],
},
],
quotes: [2, 'single', { avoidEscape: false }],
'no-multiple-empty-lines': [2, { max: 1, maxEOF: 0, maxBOF: 0 }],
semi: [2, 'never'],
'vue/multi-word-component-names': 0,
'vue/component-definition-name-casing': ['error', 'kebab-case'],
'vue/valid-v-for': 2,
'vue/attributes-order': 0,
'vue/order-in-components': 1,
'vue/html-closing-bracket-newline': 0,
'vue/attribute-hyphenation': 1,
'vue/component-name-in-template-casing': [2, 'kebab-case'],
'vue/html-end-tags': 2,
'vue/html-quotes': 1,
'vue/multiline-html-element-content-newline': 1,
'vue/mustache-interpolation-spacing': 1,
'vue/no-async-in-computed-properties': 2,
'vue/no-use-v-if-with-v-for': 1,
'vue/no-dupe-keys': 2,
'vue/no-duplicate-attributes': 2,
'vue/no-multi-spaces': 1,
'vue/no-reserved-keys': 2,
'vue/no-shared-component-data': 2,
'vue/no-side-effects-in-computed-properties': 2,
'vue/no-spaces-around-equal-signs-in-attribute': 2,
'vue/no-template-key': 2,
'vue/no-textarea-mustache': 2,
'vue/no-unused-components': 1,
'vue/no-unused-vars': 1,
'vue/no-v-html': 1,
'vue/prop-name-casing': 2,
'vue/require-default-prop': 2,
'vue/require-prop-types': 2,
'vue/require-valid-default-prop': 2,
'vue/this-in-template': 2,
'vue/v-bind-style': 2,
'vue/v-on-style': 2,
'vue/valid-template-root': 2,
'vue/valid-v-bind': 2,
'vue/valid-v-else-if': 2,
'vue/valid-v-else': 2,
'vue/valid-v-model': 2,
'vue/valid-v-on': 2,
'vue/singleline-html-element-content-newline': [
1,
{
ignoreWhenNoAttributes: true,
ignoreWhenEmpty: true,
ignores: ['pre', 'textarea', 'span'],
},
],
'promise/always-return': 'error',
'promise/no-return-wrap': 'error',
'promise/param-names': 'error',
'promise/catch-or-return': 'error',
'promise/no-nesting': 'warn',
'promise/no-callback-in-promise': 'warn',
'promise/prefer-await-to-then': 'warn',
'@typescript-eslint/no-non-null-assertion': 'off',
},
}
5 changes: 5 additions & 0 deletions packages/toasts/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
src/**/*.test.ts
jest.config.js
tsconfig.json
tsconfig.build.json
postbuild.js
64 changes: 64 additions & 0 deletions packages/toasts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# @tokene/toasts
These packages aim to provide developers with a set of commonly used components for building TokenE web applications.

![version (scoped package)](https://badgen.net/npm/v/@tokene/toasts)
![types](https://badgen.net/npm/types/@tokene/toasts)
![tree-shaking](https://badgen.net/bundlephobia/tree-shaking/@tokene/toasts)
![checks](https://badgen.net/github/checks/dl-tokene/webkit/main)

## Getting Started

### Installing

```
yarn add @tokene/toasts
```

### Setup

```ts
import { ToastPlugin } from '@tokene/toasts'
import '@tokene/toasts/dist/index.css'

app.use(ToastPlugin)
```

### usage

```ts
const { showTxToast, removeToast } = useNotifications()

lastToastId.value = showTxToast('pending', txLink!)

removeToast(lastToastId.value!)
showTxToast('success', txLink!)
```

### Or

```ts
import { ToolkitBus } from '@tokene/toolkit'
import { useNotifications, type NotificationPayload } from '@tokene/toasts'

const { showToast } = useNotifications()

ToolkitBus.on(Bus.eventList.success, payload =>
showToast('success', payload as NotificationPayload),
)
ToolkitBus.on(Bus.eventList.warning, payload =>
showToast('error', payload as NotificationPayload),
)
ToolkitBus.on(Bus.eventList.error, payload =>
showToast('warning', payload as NotificationPayload),
)
ToolkitBus.on(Bus.eventList.info, payload =>
showToast('info', payload as NotificationPayload),
)
ToolkitBus.on(Bus.eventList.default, payload =>
showToast('default', payload as NotificationPayload),
)
```

## License

This project is licensed under the MIT License - see the [LICENSE.md](../../LICENSE) file for details
3 changes: 3 additions & 0 deletions packages/toasts/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('../../jest.config.base.js'),
};
Loading

0 comments on commit eb721e9

Please sign in to comment.