Skip to content

Commit

Permalink
build: fix the build script
Browse files Browse the repository at this point in the history
Refs: //github.com/storybookjs/storybook/pull/16629,//github.com/storybookjs/storybook/pull/16630,//github.com/vuejs/core/issues/1033,//github.com/storybookjs/storybook/issues/12505,//github.com/XavierChevalier/ewokify-app/runs/4326759026?check_suite_focus=true
  • Loading branch information
XavierChevalier committed Nov 26, 2021
1 parent 6b26ea4 commit 0284be7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"license": "UNLICENSED",
"scripts": {
"dev": "vite",
"prebuild": "rimraf ./node_modules/@types/react",
"build": "vue-tsc --noEmit && vite build",
"serve": "vite preview",
"lint": "eslint --fix --ext .ts,vue --ignore-path .gitignore . && yarn prettier -w -u .",
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/AppIcon.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('AppIcon', () => {
const componentTestsGenerator = new ComponentTestsGenerator(AppIcon)
componentTestsGenerator.itShouldBeDefined()

const icon = {
const icon: MdiExtra = {
viewBox: '0 0 452.000000 452.000000',
transform: 'translate(0.000000,452.000000)',
path: 'M2006 4129 c-434 -56 -842',
Expand Down
15 changes: 9 additions & 6 deletions src/app/components/AppIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,31 @@
</script>

<script setup lang="ts">
import { PropType } from 'vue'
import { MdiExtra } from '@/assets/images/icons/MdiExtra'
import { computed, PropType } from 'vue'
import { MdiExtra, MdiExtraObject } from '@/assets/images/icons/MdiExtra'
import { isPropertyValid } from '@/app/tools/component-properties/PropertyValidator'
defineProps({
const props = defineProps({
path: {
type: [String, Object] as PropType<MdiExtra>,
required: true,
validator: isPropertyValid(MdiExtra),
},
})
const pathObject = computed<MdiExtraObject>(() =>
typeof props.path === 'object' ? props.path : { path: props.path }
)
</script>

<template>
<svg
class="inline-block align-middle"
:class="sizeClass"
:viewBox="path.viewBox || '0 0 24 24'"
:viewBox="pathObject.viewBox || '0 0 24 24'"
>
<path
:transform="path.transform"
:d="path.path || path"
:transform="pathObject.transform"
:d="pathObject.path"
style="fill: currentColor"
/>
</svg>
Expand Down
5 changes: 4 additions & 1 deletion src/assets/images/icons/MdiExtra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ type MdiExtraString = string
type MdiExtraObjectOnly = Exclude<InferType<typeof MdiExtra>, MdiExtraString>
// Make 'viewBox' and 'transform' property optional
// @see https://github.com/jquense/yup/issues/1210
type MdiExtraObject = PartialBy<MdiExtraObjectOnly, 'viewBox' | 'transform'>
export type MdiExtraObject = PartialBy<
MdiExtraObjectOnly,
'viewBox' | 'transform'
>
export type MdiExtra = MdiExtraString | MdiExtraObject

export const mdiSpeechOutline: MdiExtra = {
Expand Down

0 comments on commit 0284be7

Please sign in to comment.