Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix build #2026

Merged
merged 3 commits into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/ui/build/rollup/configs/cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ export function createCJSConfig ({ input, outDir = 'dist/', minify = false, decl
],

plugins: [
typescriptPlugin({ check: false }),
vuePlugin({ template: { optimizeSSR: ssr }, preprocessStyles: true }),
commonjsPlugin(),
nodeResolvePlugin({ browser: !ssr }),
postcssPlugin({
plugins: [postcssImport()],
}),
typescriptPlugin({ check: false }),
m0ksem marked this conversation as resolved.
Show resolved Hide resolved
],
})

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/build/rollup/configs/esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export function createESMConfig ({
],

plugins: [
typescriptPlugin({ check: false }),
vuePlugin({
target: ssr ? 'node' : 'browser',
preprocessStyles: true,
Expand All @@ -54,6 +53,7 @@ export function createESMConfig ({
inject: false,
}),
nodeResolvePlugin(),
typescriptPlugin({ check: false }),
],
})

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/build/rollup/configs/iife.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export function createIIFEConfig ({ input, outDir = 'dist/', minify = false, dec
external: ['vue'],

plugins: [
typescriptPlugin({ check: false }),
vuePlugin({ target: 'browser', preprocessStyles: true }),
commonjsPlugin(),
nodeResolve({ browser: true }),
Expand All @@ -42,6 +41,7 @@ export function createIIFEConfig ({ input, outDir = 'dist/', minify = false, dec
extract: true,
plugins: [postcssImport()],
}),
typescriptPlugin({ check: false }),
],
})

Expand Down
6 changes: 3 additions & 3 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@
"ts-jest": "^26.5.4",
"ts-loader": "^8.0.14",
"tsx": "^3.5.0",
"typescript": "^4.1.3",
"typescript": "4.7.4",
"vue": "^3.0.4",
"vue-book": "0.2.0-alpha.0",
"vue-jest": "^5.0.0-alpha.7",
"vue-loader": "^16.3.0",
"vue-tsc": "^0.34.11",
"vue-tsc": "^0.38.2",
"vuelidate": "^0.7.5",
"webpack": "^5.4.1",
"webpack-bundle-analyzer": "^4.1.0",
Expand Down Expand Up @@ -160,4 +160,4 @@
"./css": "./dist/vuestic-ui.css",
"./dist/": "./dist/"
}
}
}
6 changes: 3 additions & 3 deletions packages/ui/src/composables/useBem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ type ClassesObject<Key extends string> = Record<Key, boolean>

type ComputedClasses<Key extends string> = ClassesObject<Key> & {
// TODO: How to remove it from spread?
get asObject(): ComputedRef<ClassesObject<Key>>
get asArray(): ComputedRef<Key[]>
get asString(): ComputedRef<string>
readonly asObject: ComputedRef<ClassesObject<Key>>
readonly asArray: ComputedRef<Key[]>
readonly asString: ComputedRef<string>
}

/**
Expand Down
17 changes: 14 additions & 3 deletions packages/ui/src/services/global-config/global-config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import merge from 'lodash/merge.js'
import cloneDeep from 'lodash/cloneDeep.js'
import { ref, inject, Ref } from 'vue'
import { ref, inject, Ref, getCurrentInstance } from 'vue'
import { GlobalConfig, GlobalConfigUpdater } from './types'
import { getComponentsAllDefaultConfig, getComponentsDefaultConfig } from './config-default'
import { createIconsConfig } from '../icon-config/icon-config-helpers'
import { colorsPresets } from '../color-config/color-theme-presets'
import { getGlobalProperty } from '../../vuestic-plugin/utils'

export type ProvidedGlobalConfig = {
globalConfig: Ref<GlobalConfig>,
Expand Down Expand Up @@ -51,11 +52,21 @@ export function useGlobalConfigSafe () {
return inject<ProvidedGlobalConfig>(GLOBAL_CONFIG)
}

export function useGlobalConfig () {
export function useGlobalConfig (): ProvidedGlobalConfig {
const injected = inject<ProvidedGlobalConfig>(GLOBAL_CONFIG)

if (!injected) {
throw new Error('useGlobalConfig must be used in setup function or Vuestic GlobalConfigPluign is not registered')
// TODO: Hotfix, maybe deal with inject
const vm = getCurrentInstance()
if (!vm) { throw new Error('useGlobalConfig must be called in setup function') }

const config = getGlobalProperty(vm.appContext.app, '$vaConfig')

if (!config) {
throw new Error('Vuestic GlobalConfigPlugin is not registered')
}

return config
}

return injected
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/utils/child-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getComponentProps } from './resolve-component-props'
*/
export const filterComponentProps = <
ChildProps extends Record<string, unknown>,
Props extends Record<keyof ChildProps, unknown>,
Props extends Record<string, unknown>,
Result extends ExtractPropTypes<ChildProps>
>(propsValues: Props, childProps: ChildProps) => {
return computed(() => {
Expand Down
81 changes: 43 additions & 38 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3754,12 +3754,12 @@
resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-2.3.3.tgz#fbf80cc039b82ac21a1acb0f0478de8f61fbf600"
integrity sha512-SmQLDyhz+6lGJhPELsBdzXGc+AcaT8stgkbiTFGpXPe8Tl1tJaBw1A6pxDqDuRsVkD8uscrkx3hA7QDOoKYtyw==

"@volar/code-gen@0.34.17":
version "0.34.17"
resolved "https://registry.yarnpkg.com/@volar/code-gen/-/code-gen-0.34.17.tgz#fd46e369454e6bd9599b511500b4c43acb9730bd"
integrity sha512-rHR7BA71BJ/4S7xUOPMPiB7uk6iU9oTWpEMZxFi5VGC9iJmDncE82WzU5iYpcbOBCVHsOjMh0+5CGMgdO6SaPA==
"@volar/code-gen@0.38.2":
version "0.38.2"
resolved "https://registry.yarnpkg.com/@volar/code-gen/-/code-gen-0.38.2.tgz#1eedaba3a12b9d1954dd99d6745f3f2ede0aca58"
integrity sha512-H81I6d7rZB7teqL+zhK/Xz1v0/kKkUwkB0Aq6b4+BTCqcJeiZkoWxd0gFhrhWTnUoqiM83lhoTGo2vkvx5YagQ==
dependencies:
"@volar/source-map" "0.34.17"
"@volar/source-map" "0.38.2"

"@volar/code-gen@^0.27.24":
version "0.27.24"
Expand Down Expand Up @@ -3788,10 +3788,10 @@
vscode-jsonrpc "^8.0.0-next.2"
vscode-uri "^3.0.2"

"@volar/source-map@0.34.17":
version "0.34.17"
resolved "https://registry.yarnpkg.com/@volar/source-map/-/source-map-0.34.17.tgz#79efc4d088e11f59fc857953185a1f852df70968"
integrity sha512-3yn1IMXJGGWB/G817/VFlFMi8oh5pmE7VzUqvgMZMrppaZpKj6/juvJIEiXNxRsgWc0RxIO8OSp4htdPUg1Raw==
"@volar/source-map@0.38.2":
version "0.38.2"
resolved "https://registry.yarnpkg.com/@volar/source-map/-/source-map-0.38.2.tgz#72ccaaa224646da69097abe8360391acd7f042b9"
integrity sha512-DWcYbYt9SPwk0r4VmXk1F0v4X5+hCqH1JRkAWSeJymQyXCQ2OQDEbY2PF12a7y2qn4FUBD2gOba2TynAqI8ZFQ==

"@volar/source-map@^0.27.24":
version "0.27.24"
Expand All @@ -3808,27 +3808,27 @@
"@volar/shared" "^0.27.24"
vscode-languageserver "^8.0.0-next.2"

"@volar/vue-code-gen@0.34.17":
version "0.34.17"
resolved "https://registry.yarnpkg.com/@volar/vue-code-gen/-/vue-code-gen-0.34.17.tgz#55ca9c21b38c91bf362761b268a77b9f0ecae8bf"
integrity sha512-17pzcK29fyFWUc+C82J3JYSnA+jy3QNrIldb9kPaP9Itbik05ZjEIyEue9FjhgIAuHeYSn4LDM5s6nGjxyfhsQ==
"@volar/vue-code-gen@0.38.2":
version "0.38.2"
resolved "https://registry.yarnpkg.com/@volar/vue-code-gen/-/vue-code-gen-0.38.2.tgz#10b467936cb79edb21e6f91ed25ec3fbe055a4cd"
integrity sha512-whLunD6phSGWBUHZKdTxeglrpzQu26ii8CRVapFdjfyMaVhQ7ESNeIAhkTVyg2ovOPc0PiDYPQEPzfWAADIWog==
dependencies:
"@volar/code-gen" "0.34.17"
"@volar/source-map" "0.34.17"
"@vue/compiler-core" "^3.2.36"
"@vue/compiler-dom" "^3.2.36"
"@vue/shared" "^3.2.36"
"@volar/code-gen" "0.38.2"
"@volar/source-map" "0.38.2"
"@vue/compiler-core" "^3.2.37"
"@vue/compiler-dom" "^3.2.37"
"@vue/shared" "^3.2.37"

"@volar/vue-typescript@0.34.17":
version "0.34.17"
resolved "https://registry.yarnpkg.com/@volar/vue-typescript/-/vue-typescript-0.34.17.tgz#497eb471ebac25ff61af04031b78ec71a34d470b"
integrity sha512-U0YSVIBPRWVPmgJHNa4nrfq88+oS+tmyZNxmnfajIw9A/GOGZQiKXHC0k09SVvbYXlsjgJ6NIjhm9NuAhGRQjg==
"@volar/vue-typescript@0.38.2":
version "0.38.2"
resolved "https://registry.yarnpkg.com/@volar/vue-typescript/-/vue-typescript-0.38.2.tgz#e9bf7d178755fe2619f43dda499ab1e2a6240a5b"
integrity sha512-5IKvSK2m5yUmH6iu/tNScVlvJGuiHawTfSmjxaMs+/tod25WeK37LEdf+pdKtlJ30bYTQmmkAuEfG01QvvBRGQ==
dependencies:
"@volar/code-gen" "0.34.17"
"@volar/source-map" "0.34.17"
"@volar/vue-code-gen" "0.34.17"
"@vue/compiler-sfc" "^3.2.36"
"@vue/reactivity" "^3.2.36"
"@volar/code-gen" "0.38.2"
"@volar/source-map" "0.38.2"
"@volar/vue-code-gen" "0.38.2"
"@vue/compiler-sfc" "^3.2.37"
"@vue/reactivity" "^3.2.37"

"@vscode/emmet-helper@^2.7.0":
version "2.8.4"
Expand Down Expand Up @@ -4251,7 +4251,7 @@
estree-walker "^2.0.2"
source-map "^0.6.1"

"@vue/compiler-core@3.2.37", "@vue/compiler-core@^3.2.36":
"@vue/compiler-core@3.2.37", "@vue/compiler-core@^3.2.37":
version "3.2.37"
resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.2.37.tgz#b3c42e04c0e0f2c496ff1784e543fbefe91e215a"
integrity sha512-81KhEjo7YAOh0vQJoSmAD68wLfYqJvoiD4ulyedzF+OEk/bk6/hx3fTNVfuzugIIaTrOx4PGx6pAiBRe5e9Zmg==
Expand All @@ -4269,7 +4269,7 @@
"@vue/compiler-core" "3.2.33"
"@vue/shared" "3.2.33"

"@vue/compiler-dom@3.2.37", "@vue/compiler-dom@^3.2.36":
"@vue/compiler-dom@3.2.37", "@vue/compiler-dom@^3.2.37":
version "3.2.37"
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.2.37.tgz#10d2427a789e7c707c872da9d678c82a0c6582b5"
integrity sha512-yxJLH167fucHKxaqXpYk7x8z7mMEnXOw3G2q62FTkmsvNxu4FQSu5+3UMb+L7fjKa26DEzhrmCxAgFLLIzVfqQ==
Expand All @@ -4293,7 +4293,7 @@
postcss "^8.1.10"
source-map "^0.6.1"

"@vue/compiler-sfc@^3.2.36":
"@vue/compiler-sfc@^3.2.37":
version "3.2.37"
resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.2.37.tgz#3103af3da2f40286edcd85ea495dcb35bc7f5ff4"
integrity sha512-+7i/2+9LYlpqDv+KTtWhOZH+pa8/HnX/905MdVmAcI/mPQOBwkHHIzrsEsucyOIZQYMkXUiTkmZq5am/NyXKkg==
Expand Down Expand Up @@ -4400,7 +4400,7 @@
dependencies:
"@vue/shared" "3.2.33"

"@vue/reactivity@^3.2.36":
"@vue/reactivity@^3.2.37":
version "3.2.37"
resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.2.37.tgz#5bc3847ac58828e2b78526e08219e0a1089f8848"
integrity sha512-/7WRafBOshOc6m3F7plwzPeCu/RCVv9uMpOwa/5PiY1Zz+WLVRWiy0MYKwmg19KBdGtFWsmZ4cD+LOdVPcs52A==
Expand Down Expand Up @@ -4437,7 +4437,7 @@
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.2.33.tgz#69a8c99ceb37c1b031d5cc4aec2ff1dc77e1161e"
integrity sha512-UBc1Pg1T3yZ97vsA2ueER0F6GbJebLHYlEi4ou1H5YL4KWvMOOWwpYo9/QpWq93wxKG6Wo13IY74Hcn/f7c7Bg==

"@vue/shared@3.2.37", "@vue/shared@^3.2.36":
"@vue/shared@3.2.37", "@vue/shared@^3.2.37":
version "3.2.37"
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.2.37.tgz#8e6adc3f2759af52f0e85863dfb0b711ecc5c702"
integrity sha512-4rSJemR2NQIo9Klm1vabqWjD8rs/ZaJSzMxkMNeJS6lHiUjjUeYFbooN19NgFjztubEKh3WlZUeOLVdbbUWHsw==
Expand Down Expand Up @@ -19529,7 +19529,12 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=

typescript@^4.1.3, typescript@^4.2.4, typescript@^4.3.2, typescript@^4.5.5:
typescript@4.7.4:
version "4.7.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235"
integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==

typescript@^4.2.4, typescript@^4.3.2, typescript@^4.5.5:
version "4.6.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9"
integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==
Expand Down Expand Up @@ -20483,12 +20488,12 @@ vue-tsc@^0.2.2:
dependencies:
vscode-vue-languageservice "^0.27.0"

vue-tsc@^0.34.11:
version "0.34.17"
resolved "https://registry.yarnpkg.com/vue-tsc/-/vue-tsc-0.34.17.tgz#332fc5c31d64bb9b74b0f26050f3ab067a9a7d6f"
integrity sha512-jzUXky44ZLHC4daaJag7FQr3idlPYN719/K1eObGljz5KaS2UnVGTU/XSYCd7d6ampYYg4OsyalbHyJIxV0aEQ==
vue-tsc@^0.38.2:
version "0.38.2"
resolved "https://registry.yarnpkg.com/vue-tsc/-/vue-tsc-0.38.2.tgz#89175a6bb9a8b5724e84ab5d63dc5113041c5bfa"
integrity sha512-+OMmpw9BZC9khul3I1HGtWchv7BCiaM7NvfdilVAiOFkjnivIoaW6jJm6YPQJaEPouePtpkDUWovyzgNxWdDsw==
dependencies:
"@volar/vue-typescript" "0.34.17"
"@volar/vue-typescript" "0.38.2"

vue@^3.0.0, vue@^3.0.4, vue@^3.0.5, vue@^3.2.33:
version "3.2.33"
Expand Down