Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

Commit

Permalink
fix: linter and compiller errors
Browse files Browse the repository at this point in the history
build: v0.8.1
  • Loading branch information
Arenukvern committed Mar 2, 2021
1 parent b29c7cf commit 3ad7a66
Show file tree
Hide file tree
Showing 28 changed files with 63 additions and 81 deletions.
1 change: 0 additions & 1 deletion example/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import vueGridLayout from 'vue-grid-layout'
import { MultiProvider, Navigation, NavigationController } from '../../lib'
import '../../lib/index.scss'
import { HeroesModel } from './models/HeroesModel'
// import '../../lib/tailwind.css'
import { ScaffoldApp } from './pages/ScaffoldApp'

const app = MultiProvider.build({
Expand Down
1 change: 1 addition & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib/index'
10 changes: 2 additions & 8 deletions lib/components/ButtonStyleButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import { BoxConstraints } from '../abstract/BoxConstraints'
import { ButtonStyle } from '../abstract/ButtonStyle'
import { Key } from '../abstract/Key'
import { SystemMouseCursors } from '../abstract/MouseCursor'
import {
OpacityDecoration,
OpacityDecorationSteps,
} from '../abstract/OpacityDecoration'
import { OpacityDecorationSteps } from '../abstract/OpacityDecoration'
import { ConstrainedBox } from './ConstrainedBox'
import { InkWell } from './InkWell'
import { Material } from './Material'
Expand All @@ -25,7 +22,6 @@ export interface ButtonStyleButtonI {
}
export const ButtonStyleButton = ({
child,
key,
onTap,
style,
expand,
Expand Down Expand Up @@ -70,9 +66,7 @@ export const ButtonStyleButton = ({
child: isDisabled
? Opacity({
child: materialWidget,
opacity: OpacityDecoration.use({
opacity: OpacityDecorationSteps.s50,
}),
opacity: OpacityDecorationSteps.s50,
})
: materialWidget,
})
Expand Down
2 changes: 1 addition & 1 deletion lib/components/Center.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface CenterI {
key?: Maybe<Key>
}

export const Center = ({ child, key }: CenterI) => {
export const Center = ({ child }: CenterI) => {
return defineComponent({
name: 'Center',
render() {
Expand Down
1 change: 0 additions & 1 deletion lib/components/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ interface CheckboxI {
}

export const Checkbox = ({
key,
onChanged,
value,
// activeColor,
Expand Down
1 change: 0 additions & 1 deletion lib/components/CheckboxListTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ interface CheckboxListTileI {

export const CheckboxListTile = ({
title,
key,
controlAffinity,
contentPadding,
onChanged,
Expand Down
2 changes: 1 addition & 1 deletion lib/components/ColoredBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface ColoredBoxI {
color: Color
}

export const ColoredBox = ({ child, key, color }: ColoredBoxI) => {
export const ColoredBox = ({ child, color }: ColoredBoxI) => {
return defineComponent({
name: 'ColoredBox',
render() {
Expand Down
1 change: 0 additions & 1 deletion lib/components/ConstrainedBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { BoxConstraints } from '../abstract/BoxConstraints'
import { Key } from '../abstract/Key'
export const ConstrainedBox = ({
child,
key,
constraints,
}: {
child: Component
Expand Down
2 changes: 1 addition & 1 deletion lib/components/GestureDetector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface GestureDetectorI {
onTap?: Maybe<CallableFunction>
}

export const GestureDetector = ({ child, onTap, key }: GestureDetectorI) => {
export const GestureDetector = ({ child, onTap }: GestureDetectorI) => {
return defineComponent({
name: 'GestureDetector',
setup() {
Expand Down
4 changes: 2 additions & 2 deletions lib/components/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ interface IconI {
color?: Maybe<Color>
key?: Maybe<Key>
}
export const Icon = (icon: Icons, config?: IconI) => {
const { size, key, color } = config ?? {}
export const Icon = (_icon: Icons, _config?: IconI) => {
// const { size, key, color } = config ?? {}
return defineComponent({
name: 'Icon',
render() {
Expand Down
1 change: 0 additions & 1 deletion lib/components/InkWell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const InkWell = ({
child,
mouseCursor,
onTap,
key,
borderRadius,
focusColor,
highlightColor,
Expand Down
10 changes: 2 additions & 8 deletions lib/components/ListTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import { Colors } from '../abstract/Colors'
import { EdgeInsets, EdgeInsetsStep } from '../abstract/EdgeInsets'
import { Key } from '../abstract/Key'
import { SystemMouseCursors } from '../abstract/MouseCursor'
import {
OpacityDecoration,
OpacityDecorationSteps,
} from '../abstract/OpacityDecoration'
import { OpacityDecorationSteps } from '../abstract/OpacityDecoration'
import { Align } from './Align'
import { Column } from './Column'
import { Container } from './Container'
Expand Down Expand Up @@ -47,7 +44,6 @@ interface ListTileI {
}

export const ListTile = ({
key,
mouseCursor,
hoverColor,
focusColor,
Expand Down Expand Up @@ -161,9 +157,7 @@ export const ListTile = ({
isNotEnabled
? Opacity({
child: result,
opacity: OpacityDecoration.use({
opacity: OpacityDecorationSteps.s50,
}),
opacity: OpacityDecorationSteps.s50,
})
: result
)
Expand Down
1 change: 0 additions & 1 deletion lib/components/Margin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Key } from '../abstract/Key'
export const Margin = ({
child,
margin,
key,
}: {
child: Component
margin: EdgeInsets
Expand Down
2 changes: 1 addition & 1 deletion lib/components/MouseRegion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface MouseRegionI {
}

// Defines cursor image
export const MouseRegion = ({ child, key, cursor }: MouseRegionI) => {
export const MouseRegion = ({ child, cursor }: MouseRegionI) => {
const resolvedCursor = SystemMouseCursor.use({ cursor })
return defineComponent({
name: 'InkWell',
Expand Down
5 changes: 4 additions & 1 deletion lib/components/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
watch,
} from 'vue'
import { AlignmentEdge } from '../abstract/Alignment'
import { Maybe } from '../abstract/BasicTypes'
import { Colors } from '../abstract/Colors'
import { EdgeInsetsStep } from '../abstract/EdgeInsets'
import {
Expand Down Expand Up @@ -71,7 +72,9 @@ export const Navigation = ({ child }: NavigationI) => {
watch(
routeController.routes,
(newRoutes) => {
const newRoute = newRoutes[0]
// FIXME: compiller via `tsc --emitDeclarationOnly` thinks that is a problem
// needs to be investigated why it can be
const newRoute = newRoutes[0] as Maybe<NavigationControllerRoute>
if (newRoute == null) {
isRoutesExists.value = false
currentRoute.widget = null
Expand Down
2 changes: 1 addition & 1 deletion lib/components/Opacity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface OpacityI {
opacity: OpacityDecorationSteps
}

export const Opacity = ({ child, key, opacity }: OpacityI) => {
export const Opacity = ({ child, opacity }: OpacityI) => {
return defineComponent({
name: 'Opacity',
setup() {
Expand Down
1 change: 0 additions & 1 deletion lib/components/Padding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Key } from '../abstract/Key'
export const Padding = ({
child,
padding,
key,
}: {
child: Component
padding: EdgeInsets
Expand Down
1 change: 0 additions & 1 deletion lib/components/Positioned.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ interface PositionedI {

export const Positioned = ({
child,
key,
bottom,
left,
right,
Expand Down
2 changes: 1 addition & 1 deletion lib/components/Stack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface StackI {
key?: Maybe<Key>
}

export const Stack = ({ children, key }: StackI) => {
export const Stack = ({ children }: StackI) => {
return defineComponent({
name: 'Stack',
render() {
Expand Down
1 change: 0 additions & 1 deletion lib/components/TextButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export const TextButton = ({
child,
onTap,
style,
key,
expand,
}: ButtonStyleButtonI) => {
const defaultStyle = new ButtonStyle({
Expand Down
1 change: 0 additions & 1 deletion lib/components/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ interface TextFieldI {
}

export const TextField = ({
key,
controller,
maxLength,
keyboardType,
Expand Down
2 changes: 1 addition & 1 deletion lib/components/Visibility.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface VisibilityI {
visible?: Maybe<Ref<Maybe<boolean>>>
}

export const Visibility = ({ child, key, visible }: VisibilityI) => {
export const Visibility = ({ child, visible }: VisibilityI) => {
return defineComponent({
name: 'Visibility',
render() {
Expand Down
46 changes: 23 additions & 23 deletions lib/functions/getChangesFromOldAndNewArrays.spec.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { getChangesFromOldAndNewArrays } from './getChangesFromOldAndNewArrays'
// import { getChangesFromOldAndNewArrays } from './getChangesFromOldAndNewArrays'

describe('getChangesFromOldAndNewArrays', () => {
it('get changed', () => {
const newArr: { i: number; x: number }[] = [
{ i: 0, x: 0 },
{ x: 1, i: 1 },
]
const oldArr: { i: number; x: number }[] = [
{ i: 0, x: 1 },
{ x: 2, i: 2 },
]
const result = getChangesFromOldAndNewArrays({
newArr,
oldArr,
idPropertyName: 'i',
})
expect(result).toEqual({
created: [newArr[1]],
updated: [newArr[0]],
removed: [oldArr[1]],
})
})
})
// describe('getChangesFromOldAndNewArrays', () => {
// it('get changed', () => {
// const newArr: { i: number; x: number }[] = [
// { i: 0, x: 0 },
// { x: 1, i: 1 },
// ]
// const oldArr: { i: number; x: number }[] = [
// { i: 0, x: 1 },
// { x: 2, i: 2 },
// ]
// const result = getChangesFromOldAndNewArrays({
// newArr,
// oldArr,
// idPropertyName: 'i',
// })
// expect(result).toEqual({
// created: [newArr[1]],
// updated: [newArr[0]],
// removed: [oldArr[1]],
// })
// })
// })
2 changes: 0 additions & 2 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export * from './index'

import './types'
2 changes: 1 addition & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ export * from './components'
// https://forum.vuejs.org/t/vue-cli-library-build-error/86075/4
// https://itnext.io/create-a-vue-js-component-library-as-a-module-part-1-a1116e632751
import 'vue3-virtual-scroller/dist/vue3-virtual-scroller.css'
import './components/index.scss'
import './index.scss'
import './tailwind.css'
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@xsoulspace/vuefer",
"description": "vuefer just a way to write Vue3 styled like Flutter with Tailwind CSS",
"version": "0.8.0",
"version": "0.8.1",
"private": false,
"author": {
"name": "Anton Malofeev",
Expand All @@ -22,15 +22,16 @@
".": {
"import": "./dist/vuefer.es.js",
"require": "./dist/vuefer.umd.js"
}
},
"./style.css": "./dist/style.css"
},
"files": [
"dist"
],
"typings": "./dist/index.d.ts",
"scripts": {
"dev": "vite",
"build": "vite build",
"build": "vite build & tsc --emitDeclarationOnly",
"serve": "vite preview",
"upgrade": "yarn yarn-upgrade-all add vue@next",
"lint": "eslint --ext .ts,vue --ignore-path .gitignore ."
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
},
"exclude": ["node_modules", "dist"],
"include": [
"index.ts",
"lib/**/*.ts",
"lib/**/*.d.ts",
"lib/**/*.tsx",
Expand Down
32 changes: 16 additions & 16 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import path from 'path'
import ts from 'rollup-plugin-typescript2'
// import ts from 'rollup-plugin-typescript2'
import { defineConfig } from 'vite'
// const copyPlugin = copy({
// targets: [{ src: 'example/**/*', dest: 'dist/example' }],
// })
const tsPlugin = ts({
tsconfig: path.resolve(__dirname, 'tsconfig.json'),
tsconfigOverride: {
compilerOptions: {
declaration: true,
declarationMap: false,
skipLibCheck: true,
},
exclude: ['**/__tests__', '**/*.spec', 'example'],
},
clean: true,
abortOnError: false,
rollupCommonJSResolveHack: false,
})
// const tsPlugin = ts({
// tsconfig: path.resolve(__dirname, 'tsconfig.json'),
// tsconfigOverride: {
// compilerOptions: {
// declaration: true,
// declarationMap: false,
// skipLibCheck: true,
// },
// exclude: ['**/__tests__', '**/*.spec', 'example'],
// },
// clean: true,
// abortOnError: false,
// rollupCommonJSResolveHack: false,
// })
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
Expand All @@ -46,7 +46,7 @@ export default defineConfig({
// make sure to externalize deps that shouldn't be bundled
// into your library
external: ['vue'],
plugins: [tsPlugin],
plugins: [],
output: {
dir: './dist',
// Provide global variables to use in the UMD build
Expand Down

0 comments on commit 3ad7a66

Please sign in to comment.