@razaman2/reactive-view 0.1.0-beta.16 → 0.1.0-beta.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ export default function (component: never, options?: Partial<{
2
+ id: string;
3
+ app: HTMLElement;
4
+ container: string;
5
+ }>): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@razaman2/reactive-view",
3
- "version": "0.1.0-beta.16",
3
+ "version": "0.1.0-beta.18",
4
4
  "description": "This library enables you to build vue apps in an object oriented way. It provides a convenient approach to extend and override ui components. It provides a built in eventing system along with component data management.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -14,8 +14,11 @@
14
14
  },
15
15
  "scripts": {
16
16
  "prepublishOnly": "npm run build",
17
- "build": "tsup src/index.ts --format cjs,esm --dts",
18
- "lint": "tsc",
17
+ "build": "vue-tsc -p tsconfig.build.json && vite build",
18
+ "lint": "eslint \"src/**/*.ts\" \"tests/**/*.ts\"",
19
+ "lint:fix": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" --fix",
20
+ "format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"",
21
+ "typecheck": "tsc",
19
22
  "test": "vitest run",
20
23
  "test:watch": "vitest",
21
24
  "pr": "sh pr.sh"
@@ -43,17 +46,31 @@
43
46
  "@razaman2/object-manager": "^3.4.7",
44
47
  "date-fns": "^4.1.0",
45
48
  "date-fns-tz": "^3.2.0",
46
- "tailwind-merge": "^3.5.0",
47
- "uuid": "^13.0.0"
49
+ "tailwind-merge": "^3.5.0"
48
50
  },
49
51
  "peerDependencies": {
50
52
  "vue": ">=3.0.0"
51
53
  },
52
54
  "devDependencies": {
53
- "@types/uuid": "^11.0.0",
54
- "tsup": "^8.5.1",
55
+ "@eslint/js": "^10.0.1",
56
+ "@stylistic/eslint-plugin": "^5.10.0",
57
+ "@typescript-eslint/eslint-plugin": "^8.59.2",
58
+ "@typescript-eslint/parser": "^8.59.2",
59
+ "@vitejs/plugin-vue": "^6.0.6",
60
+ "@vitejs/plugin-vue-jsx": "^5.1.5",
61
+ "@vue/server-renderer": "^3.5.34",
62
+ "@vue/test-utils": "^2.4.10",
63
+ "eslint": "^10.3.0",
64
+ "eslint-config-prettier": "^10.1.8",
65
+ "eslint-plugin-prettier": "^5.5.5",
66
+ "eslint-plugin-vue": "^10.9.1",
67
+ "jsdom": "^29.1.1",
68
+ "prettier": "^3.8.3",
55
69
  "typescript": "^5.9.3",
56
- "vitest": "^4.1.2"
70
+ "typescript-eslint": "^8.59.2",
71
+ "vite": "^8.0.11",
72
+ "vitest": "^4.1.5",
73
+ "vue-tsc": "^3.2.8"
57
74
  },
58
75
  "publishConfig": {
59
76
  "access": "public"
package/dist/index.d.mts DELETED
@@ -1,148 +0,0 @@
1
- import * as vue from 'vue';
2
- import { SetupContext, ComponentPublicInstance, UnwrapRef, defineComponent } from 'vue';
3
-
4
- type ComponentExtension = {
5
- parent?: ComponentExtension;
6
- self?: Record<string | symbol, any>;
7
- access?: () => ComponentExtension;
8
- value?: ComponentExtension;
9
- };
10
- type PropOptions = {
11
- exclude: string | Array<string>;
12
- include: Record<string, any>;
13
- };
14
- type SubscriptionItem = {
15
- name: string;
16
- handler: Function;
17
- data?: any;
18
- };
19
- type PropType = {
20
- default: any;
21
- required: boolean;
22
- validator: ((value: any) => boolean);
23
- type: any | Array<any>;
24
- };
25
- type PropExclusions = Array<string> | string;
26
-
27
- declare class Subscription {
28
- private subscriptions;
29
- private data;
30
- static create(): Subscription;
31
- subscribe(name: string, handler: Function, data?: any): Subscription;
32
- replace(name: string, handler: Function, data?: any): Subscription;
33
- unsubscribe(subscription?: string): Subscription;
34
- unsubscribe(subscriptions?: Array<string>): Subscription;
35
- size(): number;
36
- hasSubscription(name: string): boolean;
37
- private remove;
38
- private find;
39
- private isNameAvailable;
40
- registrations(): Array<SubscriptionItem>;
41
- get(name: string): SubscriptionItem;
42
- }
43
-
44
- declare const setup: {
45
- type: FunctionConstructor;
46
- default: (parent?: {}, self?: {}) => {};
47
- ReactiveView: boolean;
48
- };
49
- declare const _default: {
50
- props: {
51
- setup: {};
52
- beta: (BooleanConstructor | StringConstructor)[];
53
- ReactiveView: {
54
- type: BooleanConstructor;
55
- default: boolean;
56
- };
57
- instance: {
58
- default: vue.Ref<any, any>;
59
- };
60
- notifications: ObjectConstructor;
61
- subscriptions: ObjectConstructor;
62
- beforeSetData: FunctionConstructor;
63
- data: {
64
- default: {};
65
- };
66
- defaultData: {};
67
- getDefaultData: {
68
- type: FunctionConstructor;
69
- default: (data: any) => any;
70
- };
71
- model: {};
72
- defer: {};
73
- logging: {
74
- validator: (logging: boolean) => boolean;
75
- };
76
- modelName: {
77
- type: StringConstructor;
78
- default: string;
79
- };
80
- debug: {
81
- type: BooleanConstructor;
82
- default: boolean;
83
- };
84
- state: {
85
- default: {};
86
- };
87
- };
88
- setup(props: Record<string, any>, context: SetupContext): (vue: ComponentPublicInstance) => any;
89
- };
90
-
91
- declare function safeRequest(request: {
92
- try: () => Promise<any> | any;
93
- catch?: ((error: any) => Promise<any> | any) | false;
94
- finally?: () => Promise<any> | any;
95
- complete?: () => Promise<any> | any;
96
- loading?: {
97
- status: boolean;
98
- message?: string;
99
- };
100
- message?: string;
101
- alternative?: boolean;
102
- }): Promise<any>;
103
- declare function getProps(props: Record<string, any>, exclude: PropExclusions): Record<string, any>;
104
- declare function getProps(props: Record<string, any>, options: PropOptions): Record<string, any>;
105
- declare function getReactiveViewComponent(component: any, options?: Record<string, any>): vue.VNode<vue.RendererNode, vue.RendererElement, {
106
- [key: string]: any;
107
- }>;
108
- declare function getDate(timestamp: {
109
- toDate: () => Date;
110
- } | Date, format?: string): string;
111
- declare function getDate(timestamp: {
112
- toDate: () => Date;
113
- } | Date, options?: {
114
- format?: string;
115
- timezone?: string;
116
- }): string;
117
- declare function access(view?: ComponentExtension | UnwrapRef<any> | (() => ComponentExtension), alternative?: any): any;
118
- declare function useSubscription(): {
119
- addSubscription(name: string, handler?: () => boolean, data?: any): void;
120
- replaceSubscription(name: string, handler?: () => boolean, data?: any): void;
121
- removeSubscriptions(): void;
122
- removeSubscription(name: string): void;
123
- hasSubscription(name: string): boolean;
124
- subscriptions: any[];
125
- subscription: Subscription;
126
- };
127
- declare const Prop: ({ default: value, type, validator, required }?: Partial<PropType>) => {
128
- required: boolean | undefined;
129
- validator: (value: any) => boolean;
130
- default?: any;
131
- };
132
- declare function StyleParser(styles?: Array<string> | Record<string, boolean> | string): {};
133
- declare function MergeStyles(...params: any): any;
134
- declare const extendVnode: (component: Record<string, any>, element: any) => Record<string, (props?: Record<string, any>, slots?: Record<string, any> | ((slots: Record<string, any>) => Record<string, any>)) => any>;
135
- declare function defineReactiveView(): ReturnType<typeof defineComponent>;
136
- declare function defineReactiveView(options: Record<string, any>): ReturnType<typeof defineComponent>;
137
- declare function defineReactiveView(options: Record<string, any>, component: typeof _default): ReturnType<typeof defineComponent>;
138
- declare function showComponent(component: any, options?: {
139
- container?: string;
140
- key?: string;
141
- router?: any;
142
- plugins?: Array<any>;
143
- }): any;
144
- declare const getData: (component: any, path: number | string, alternative: any) => any;
145
- declare const setData: (component: any, data: any, path?: string) => any;
146
- declare const dataPath: (component: any, path: string | number) => any;
147
-
148
- export { MergeStyles, Prop, StyleParser, access, dataPath, _default as default, defineReactiveView, extendVnode, getData, getDate, getProps, getReactiveViewComponent, safeRequest, setData, setup, showComponent, useSubscription };