Skip to content

Commit

Permalink
chore: up deps.
Browse files Browse the repository at this point in the history
  • Loading branch information
chizukicn committed Jul 9, 2023
1 parent fec2faa commit a831812
Show file tree
Hide file tree
Showing 14 changed files with 1,527 additions and 1,837 deletions.
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": ["@curev"]
"extends": ["@curev"],
"rules": {
"unicorn/prefer-spread":"off"
}
}
20 changes: 9 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,16 @@
]
},
"devDependencies": {
"@curev/eslint-config": "^0.0.7",
"@types/node": "^18.16.1",
"bumpp": "^9.1.0",
"eslint": "^8.39.0",
"esno": "^0.16.3",
"husky": "^8.0.3",
"lint-staged": "^13.2.2",
"prettier": "^2.8.8",
"rimraf": "^3.0.2",
"@curev/eslint-config": "^0.1.9",
"@types/node": "^20.4.1",
"bumpp": "^9.1.1",
"eslint": "^8.44.0",
"lint-staged": "^13.2.3",
"prettier": "^3.0.0",
"rimraf": "^5.0.1",
"simple-git-hooks": "^2.8.1",
"typescript": "^4.9.5",
"typescript": "^5.1.6",
"unbuild": "^1.2.1",
"vitest": "^0.24.5"
"vitest": "^0.33.0"
}
}
2 changes: 1 addition & 1 deletion packages/hoci/build.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fs from "fs";
import fs from "node:fs";
import { defineBuildConfig } from "unbuild";

export default defineBuildConfig({
Expand Down
3 changes: 2 additions & 1 deletion packages/hoci/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
"author": "chizuki",
"license": "MIT",
"dependencies": {
"@vueuse/core": "^9.12.0",
"@vueuse/core": "^10.2.1",
"maybe-types": "^0.0.3"
},
"peerDependencies": {
"@vueuse/core": ">=10",
"vue": "^3.2.31"
}
}
6 changes: 3 additions & 3 deletions packages/hoci/src/components/selection/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { MaybeRef } from "@vueuse/core";
import type { InjectionKey, Ref } from "vue";
import type { ActivateEvent, ClassType, ElementLike } from "../../types";
import { type MaybeRef } from "@vueuse/core";
import { type InjectionKey, type Ref } from "vue";
import { type ActivateEvent, type ClassType, type ElementLike } from "../../types";

export type InitFunction = (option: Option) => () => void;

Expand Down
18 changes: 8 additions & 10 deletions packages/hoci/src/components/selection/item.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { resolveRef } from "@vueuse/core";
import type { PropType } from "vue";
import { toRef } from "@vueuse/core";
import { type PropType } from "vue";
import {
capitalize,
computed,
Expand All @@ -11,7 +11,7 @@ import {
watch
} from "vue";
import { defineHookComponent, defineHookProps } from "../../shared";
import type { ActivateEvent, ElementLike } from "../../types";
import { type ActivateEvent, type ElementLike } from "../../types";
import { valuePropType } from "../../constants";
import {
ActivateEventSymbol,
Expand All @@ -33,7 +33,7 @@ export const selectionItemProps = defineHookProps({
},
label: {
type: [Function, String] as PropType<
string | ((val: any) => string) | ElementLike | null
string | ((val: any) => string) | ElementLike | null
>
},
keepAlive: {
Expand All @@ -54,7 +54,7 @@ export const useSelectionItem = defineHookComponent({
const isActive = inject(IsActiveSymbol, () => false);
const changeActive = inject(ChangeActiveSymbol, () => {});

const parentLabel = resolveRef(inject(ItemLabelSymbol));
const parentLabel = toRef(inject(ItemLabelSymbol));

const activate = () => {
changeActive(props.value);
Expand All @@ -66,10 +66,8 @@ export const useSelectionItem = defineHookComponent({
activate
}, () => {
let label = props.label ?? parentLabel.value;
if (label) {
if (typeof label == "function") {
label = label(props.value)!;
}
if (label && typeof label == "function") {
label = label(props.value)!;
}
return Array.isArray(label) ? label : [label];
});
Expand Down Expand Up @@ -107,7 +105,7 @@ export const useSelectionItem = defineHookComponent({
);
});

const activateEvent = resolveRef(() => {
const activateEvent = toRef(() => {
const event = inject(ActivateEventSymbol);
return props.activateEvent ?? event?.value ?? "click";
});
Expand Down
8 changes: 4 additions & 4 deletions packages/hoci/src/components/selection/list.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { isDefined, syncRef } from "@vueuse/core";
import type { PropType } from "vue";
import { type PropType } from "vue";
import {
computed,
defineComponent,
Expand All @@ -8,15 +8,15 @@ import {
reactive,
renderSlot
} from "vue";
import type { ActivateEvent, ElementLike } from "../../types";
import { type ActivateEvent, type ElementLike } from "../../types";
import { classPropType, labelPropType, valuePropType } from "../../constants";
import {
defineHookComponent,
defineHookEmits,
defineHookProps,
normalizeClass
} from "../../shared";
import type { Option } from "./constants";
import { type Option } from "./constants";
import {
ActivateEventSymbol,
ActiveClassSymbol,
Expand Down Expand Up @@ -169,7 +169,7 @@ export const useSelectionList = defineHookComponent({
} else {
if (props.multiple) {
const limit
= typeof props.multiple === "number" ? props.multiple : Infinity;
= typeof props.multiple === "number" ? props.multiple : Number.POSITIVE_INFINITY;
if (actives.length < limit) {
actives.push(value);
emitChange();
Expand Down
4 changes: 2 additions & 2 deletions packages/hoci/src/components/switch.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { PropType } from "vue";
import { type PropType } from "vue";
import { capitalize, computed, defineComponent, h, renderSlot } from "vue";
import { useVModel } from "@vueuse/core";
import {
defineHookComponent,
defineHookEmits,
defineHookProps
} from "../shared";
import type { ActivateEvent } from "../types";
import { type ActivateEvent } from "../types";
import { classPropType } from "../constants";

export const switchProps = defineHookProps({
Expand Down
6 changes: 3 additions & 3 deletions packages/hoci/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PropType } from "vue";
import { type PropType } from "vue";

export const valuePropType = [
String,
Expand All @@ -9,9 +9,9 @@ export const valuePropType = [
] as PropType<any>;

export const classPropType = [String, Array, Object] as PropType<
string | string[] | Record<string, boolean>
string | string[] | Record<string, boolean>
>;

export const labelPropType = [String, Function] as PropType<
string | ((val?: any) => string) | null
string | ((val?: any) => string) | null
>;
20 changes: 10 additions & 10 deletions packages/hoci/src/shared.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import type { MaybeFunction } from "maybe-types";
import type {
ComponentObjectPropsOptions,
ComponentPropsOptions,
EmitsOptions,
ExtractDefaultPropTypes,
ExtractPropTypes,
PropType,
SetupContext
import { type MaybeFunction } from "maybe-types";
import {
type ComponentObjectPropsOptions,
type ComponentPropsOptions,
type EmitsOptions,
type ExtractDefaultPropTypes,
type ExtractPropTypes,
type PropType,
type SetupContext
} from "vue";
import { reactiveComputed } from "@vueuse/core";
import type { ClassType } from "./types";
import { type ClassType } from "./types";

export interface HookComponentOptions<
R,
Expand Down
24 changes: 6 additions & 18 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,17 @@
"version": "0.0.1",
"description": "",
"dependencies": {
"axios": "^0.27.2",
"dayjs": "^1.11.4",
"element-plus": "^2.2.18",
"hoci": "workspace:*",
"jquery": "^3.6.0",
"query-string": "^7.1.1",
"vue": "^3.2.31",
"vue-router": "^4.1.2"
"vue": "^3.2.31"
},
"devDependencies": {
"@types/jquery": "^3.5.14",
"@types/node": "^18.13.0",
"@vitejs/plugin-vue": "^4.0.0",
"@vitejs/plugin-vue-jsx": "^3.0.0",
"compression": "^1.7.4",
"rollup-plugin-visualizer": "^5.8.3",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.0.1",
"sass": "^1.55.0",
"typescript": "^4.8.4",
"unplugin-vue-components": "^0.23.0",
"vite": "^4.1.1",
"vite-plugin-inspect": "^0.7.15",
"vite-plugin-windicss": "^1.8.10",
"windicss": "^3.5.6"
"typescript": "^5.1.6",
"unocss": "^0.53.5",
"vite": "^4.4.2"
},
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion playground/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createApp } from "vue";
import "windi.css";
import "uno.css";
import App from "./app.vue";

createApp(App)
Expand Down
15 changes: 2 additions & 13 deletions playground/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import path from "path";
import vue from "@vitejs/plugin-vue";
import jsx from "@vitejs/plugin-vue-jsx";
import visualizer from "rollup-plugin-visualizer";
import uncomponents from "unplugin-vue-components/vite";

import type { Plugin } from "vite";
import { defineConfig } from "vite";
import windicss from "vite-plugin-windicss";
import unocss from "unocss/vite";

export default defineConfig({
server: {
Expand All @@ -25,14 +22,6 @@ export default defineConfig({
plugins: [
vue(),
jsx(),
windicss(),
visualizer({
open: false,
gzipSize: true,
brotliSize: true
}) as Plugin,
uncomponents({
resolvers: []
})
unocss()
]
});
Loading

0 comments on commit a831812

Please sign in to comment.