Skip to content

Commit

Permalink
chore(core): update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Sukaato committed Aug 13, 2024
1 parent b692e17 commit 2025a13
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 93 deletions.
9 changes: 9 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true,
"defaultBranch": "main"
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
Expand All @@ -19,6 +25,9 @@
"recommended": true,
"suspicious": {
"noExplicitAny": "off"
},
"complexity": {
"noForEach": "off"
}
}
},
Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 0 additions & 34 deletions packages/core/.prettierrc

This file was deleted.

14 changes: 10 additions & 4 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@
"collection:main": "dist/collection/index.js",
"collection": "dist/collection/collection-manifest.json",
"types": "dist/types/index.d.ts",
"files": ["components/", "css", "dist/", "hydrate/", "loader/"],
"files": [
"components/",
"css",
"dist/",
"hydrate/",
"loader/"
],
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -60,15 +66,15 @@
},
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@cheese-grinder/stencil-component-config": "^0.2.3-beta.1",
"@cheese-grinder/stencil-component-config": "^0.3.0-beta.2",
"@cheese-grinder/stencil-custom-readme": "^0.1.5",
"@cheese-grinder/stencil-sass-alias": "~0.2.4",
"@stencil/sass": "^3.0.12",
"@stencil/vue-output-target": "^0.8.9",
"@types/node": "~22.1.0",
"@types/node": "~22.2.0",
"clean-css-cli": "^5.6.3",
"rimraf": "^6.0.1",
"sass": "^1.77.8",
"typescript": "^5.4.5"
"typescript": "^5.5.4"
}
}
46 changes: 23 additions & 23 deletions packages/core/src/components-config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@
* This is an autogenerated file created by the Cheese-grinder stencil Plugin.
* It contains typing information for all configurable components that exist in this project.
*/
import type { BadgeAs, BadgeColor } from './components/badge/badge.type';
import type { AutoCapitalize, Color, EnterKeyHint, Size } from './interface.d';
import type { ButtonColor, ButtonExpand, ButtonShape } from './components/button/button.type';
import type { CheckboxPlacement } from './components/checkbox/checkbox.type';
import type { DividerColor, DividerOrientation, DividerPlacement } from './components/divider/divider.type';
import type { TriggerAction } from './utils/trigger';
import type { DrawerSide } from './components/drawer/drawer.type';
import type { DropdownAlign, DropdownSide } from './components/dropdown/dropdown.type';
import type { IndicatorPosition, IndicatorSide } from './components/indicator/indicator.type';
import type { InputColor } from './components/input/input.type';
import type { InputFileColor } from './components/input-file/input-file.type';
import type { JoinOrientation } from './components/join/join.type';
import type { ListOrientation } from './components/list/list.type';
import type { LoadingType } from './components/loading/loading.type';
import type { MaskType } from './components/mask/mask.type';
import type { RadioGroupCompareFn } from './components/radio-group/radio-group.type';
import type { RangeColor } from './components/range/range.type';
import type { SelectColor, SelectCompareFn } from './components/select/select.type';
import type { SwapType } from './components/swap/swap.type';
import type { TextareaColor, Wrap } from './components/textarea/textarea.type';
import type { ToggleColor } from './components/toggle/toggle.type';
import type { TooltipPosition } from './components/tooltip/tooltip.type';
import type { BadgeAs, BadgeColor } from "./components/badge/badge.type";
import type { AutoCapitalize, Color, EnterKeyHint, Size } from "./interface.d";
import type { ButtonColor, ButtonExpand, ButtonShape } from "./components/button/button.type";
import type { CheckboxPlacement } from "./components/checkbox/checkbox.type";
import type { DividerColor, DividerOrientation, DividerPlacement } from "./components/divider/divider.type";
import type { TriggerAction } from "./utils/trigger";
import type { DrawerSide } from "./components/drawer/drawer.type";
import type { DropdownAlign, DropdownSide } from "./components/dropdown/dropdown.type";
import type { IndicatorPosition, IndicatorSide } from "./components/indicator/indicator.type";
import type { InputColor } from "./components/input/input.type";
import type { InputFileColor } from "./components/input-file/input-file.type";
import type { JoinOrientation } from "./components/join/join.type";
import type { ListOrientation } from "./components/list/list.type";
import type { LoadingType } from "./components/loading/loading.type";
import type { MaskType } from "./components/mask/mask.type";
import type { RadioGroupCompareFn } from "./components/radio-group/radio-group.type";
import type { RangeColor } from "./components/range/range.type";
import type { SelectColor, SelectCompareFn } from "./components/select/select.type";
import type { SwapType } from "./components/swap/swap.type";
import type { TextareaColor, Wrap } from "./components/textarea/textarea.type";
import type { ToggleColor } from "./components/toggle/toggle.type";
import type { TooltipPosition } from "./components/tooltip/tooltip.type";

export namespace Configuration {
interface ComponentsConfig {
Expand Down Expand Up @@ -756,4 +756,4 @@ export namespace Configuration {
open?: boolean;
};
}
}
}
31 changes: 15 additions & 16 deletions packages/core/src/config/components.config.ts
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
import type { Configuration } from 'src/components-config';
import { Configuration } from 'src/components-config';

type Config = Configuration.ComponentsConfig;
type Options = Configuration.ComponentsConfig;

export class ComponentConfig {
private config = new Map<keyof Config, any>();
private config = new Map<keyof Options, any>();

reset(Components: Config): void {
reset(Components: Options): void {
this.config = new Map(Object.entries(Components) as any);
}

set<Tag extends keyof Config>(component: Tag, config: Config[Tag]): void {
set<Tag extends keyof Options>(component: Tag, config: Options[Tag]): void {
this.config.set(component, config);
}

get<Tag extends keyof Config>(component: Tag, fallback: Config[Tag] = {} as Config[Tag]): Config[Tag] {
get<Tag extends keyof Options>(component: Tag, fallback: Options[Tag] = {} as Options[Tag]): Options[Tag] {
return this.config.get(component) ?? fallback;
}

apply(ref: any, tag: string, defaultValue: Record<string, any>): void;
apply<Tag extends keyof Config>(ref: any, tag: Tag, defaultValue: Config[Tag] & Record<string, any>): void {
apply<Tag extends keyof Options>(ref: any, tag: Tag, defaultValue: Options[Tag] & Record<string, any>): void {
const component = this.get(tag);
const uniqueKeys = new Set([...Object.keys(component), ...Object.keys(defaultValue)]);
const uniqueKeys = new Set([...Object.keys(component!), ...Object.keys(defaultValue)]);

[...uniqueKeys].forEach(key => (ref[key] ??= component[key] ?? defaultValue[key]));
[...uniqueKeys].forEach(key => (ref[key] ??= component![key] ?? defaultValue[key]));
}

setProp<Tag extends keyof Config, Prop extends keyof Config[Tag]>(
setProp<Tag extends keyof Options, Prop extends keyof Options[Tag]>(
component: Tag,
prop: Prop,
value: Config[Tag][Prop],
value: Options[Tag][Prop],
): void {
const config = this.get(component);
this.config.set(component, {
Expand All @@ -37,13 +36,13 @@ export class ComponentConfig {
});
}

getProp<Tag extends keyof Config, Prop extends keyof Config[Tag]>(
getProp<Tag extends keyof Options, Prop extends keyof Options[Tag]>(
component: Tag,
prop: Prop,
fallback?: Config[Tag][Prop],
): Config[Tag][Prop] {
fallback?: Options[Tag][Prop],
): Options[Tag][Prop] {
const config = this.get(component);
return config[prop] ?? (fallback as Config[Tag][Prop]);
return config![prop] ?? (fallback as Options[Tag][Prop]);
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/proxies.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable */
/* tslint:disable */
/* auto-generated vue proxies */
import { defineContainer } from './vue-component-lib/utils';
Expand Down

0 comments on commit 2025a13

Please sign in to comment.