@qiu_qiu/vue-auto-component-framework 1.0.0
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.
- package/README.md +72 -0
- package/dist/core/AppCreator.d.ts +33 -0
- package/dist/core/AppCreator.d.ts.map +1 -0
- package/dist/core/AppCreator.js +100 -0
- package/dist/core/ComponentRegistry.d.ts +44 -0
- package/dist/core/ComponentRegistry.d.ts.map +1 -0
- package/dist/core/ComponentRegistry.js +110 -0
- package/dist/core/ComponentScanner.d.ts +50 -0
- package/dist/core/ComponentScanner.d.ts.map +1 -0
- package/dist/core/ComponentScanner.js +203 -0
- package/dist/core/ErrorHandler.d.ts +51 -0
- package/dist/core/ErrorHandler.d.ts.map +1 -0
- package/dist/core/ErrorHandler.js +124 -0
- package/dist/core/FileScanner.d.ts +26 -0
- package/dist/core/FileScanner.d.ts.map +1 -0
- package/dist/core/FileScanner.js +102 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -0
- package/dist/layout/LayoutManager.d.ts +56 -0
- package/dist/layout/LayoutManager.d.ts.map +1 -0
- package/dist/layout/LayoutManager.js +146 -0
- package/dist/layout/index.d.ts +4 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.js +2 -0
- package/dist/types/index.d.ts +140 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +78 -0
- package/package.json +47 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AAEjD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+DAA+D;IAC/D,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,2BAA2B;IAC3B,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,wCAAwC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IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACzC,8BAA8B;IAC9B,QAAQ,IAAI,MAAM,EAAE,CAAA;IACpB,sCAAsC;IACtC,KAAK,IAAI,IAAI,CAAA;CACd;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,yDAAyD;IACzD,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;CACvE"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework error types
|
|
3
|
+
*/
|
|
4
|
+
export var FrameworkErrorType;
|
|
5
|
+
(function (FrameworkErrorType) {
|
|
6
|
+
FrameworkErrorType["COMPONENT_SCAN_ERROR"] = "COMPONENT_SCAN_ERROR";
|
|
7
|
+
FrameworkErrorType["COMPONENT_REGISTER_ERROR"] = "COMPONENT_REGISTER_ERROR";
|
|
8
|
+
FrameworkErrorType["LAYOUT_INIT_ERROR"] = "LAYOUT_INIT_ERROR";
|
|
9
|
+
FrameworkErrorType["APP_CREATE_ERROR"] = "APP_CREATE_ERROR";
|
|
10
|
+
FrameworkErrorType["FILE_NOT_FOUND"] = "FILE_NOT_FOUND";
|
|
11
|
+
FrameworkErrorType["INVALID_COMPONENT"] = "INVALID_COMPONENT";
|
|
12
|
+
FrameworkErrorType["NAME_CONFLICT"] = "NAME_CONFLICT";
|
|
13
|
+
FrameworkErrorType["IMPORT_ERROR"] = "IMPORT_ERROR";
|
|
14
|
+
})(FrameworkErrorType || (FrameworkErrorType = {}));
|
|
15
|
+
/**
|
|
16
|
+
* Framework error class with detailed error information
|
|
17
|
+
*/
|
|
18
|
+
export class FrameworkError extends Error {
|
|
19
|
+
constructor(type, message, context = {}, cause) {
|
|
20
|
+
super(message);
|
|
21
|
+
this.type = type;
|
|
22
|
+
this.cause = cause;
|
|
23
|
+
this.name = 'FrameworkError';
|
|
24
|
+
this.timestamp = new Date();
|
|
25
|
+
this.context = {
|
|
26
|
+
...context,
|
|
27
|
+
timestamp: this.timestamp,
|
|
28
|
+
originalStack: cause?.stack
|
|
29
|
+
};
|
|
30
|
+
// Maintain proper stack trace
|
|
31
|
+
if (Error.captureStackTrace) {
|
|
32
|
+
Error.captureStackTrace(this, FrameworkError);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Generate detailed error information for debugging
|
|
37
|
+
*/
|
|
38
|
+
getDetailedInfo() {
|
|
39
|
+
const details = [
|
|
40
|
+
`Framework Error: ${this.type}`,
|
|
41
|
+
`Message: ${this.message}`,
|
|
42
|
+
`Timestamp: ${this.timestamp.toISOString()}`
|
|
43
|
+
];
|
|
44
|
+
if (this.context.filePath) {
|
|
45
|
+
details.push(`File Path: ${this.context.filePath}`);
|
|
46
|
+
}
|
|
47
|
+
if (this.context.componentName) {
|
|
48
|
+
details.push(`Component Name: ${this.context.componentName}`);
|
|
49
|
+
}
|
|
50
|
+
if (this.context.context) {
|
|
51
|
+
details.push(`Context: ${JSON.stringify(this.context.context, null, 2)}`);
|
|
52
|
+
}
|
|
53
|
+
if (this.cause) {
|
|
54
|
+
details.push(`Caused by: ${this.cause.message}`);
|
|
55
|
+
if (this.context.originalStack) {
|
|
56
|
+
details.push(`Original Stack: ${this.context.originalStack}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return details.join('\n');
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Convert error to JSON for logging
|
|
63
|
+
*/
|
|
64
|
+
toJSON() {
|
|
65
|
+
return {
|
|
66
|
+
name: this.name,
|
|
67
|
+
type: this.type,
|
|
68
|
+
message: this.message,
|
|
69
|
+
timestamp: this.timestamp.toISOString(),
|
|
70
|
+
context: this.context,
|
|
71
|
+
cause: this.cause ? {
|
|
72
|
+
name: this.cause.name,
|
|
73
|
+
message: this.cause.message,
|
|
74
|
+
stack: this.cause.stack
|
|
75
|
+
} : undefined
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@qiu_qiu/vue-auto-component-framework",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A Vue3 TypeScript framework with automatic component registration and layout system",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"dev": "tsc --watch",
|
|
10
|
+
"test": "vitest --run",
|
|
11
|
+
"test:watch": "vitest",
|
|
12
|
+
"lint": "eslint src --ext .ts,.vue",
|
|
13
|
+
"type-check": "tsc --project tsconfig.check.json --noEmit"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"vue",
|
|
17
|
+
"typescript",
|
|
18
|
+
"framework",
|
|
19
|
+
"components",
|
|
20
|
+
"layout"
|
|
21
|
+
],
|
|
22
|
+
"author": "",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"vue": "^3.0.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/node": "^20.0.0",
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
30
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
31
|
+
"@vitejs/plugin-vue": "^4.0.0",
|
|
32
|
+
"@vue/test-utils": "^2.4.0",
|
|
33
|
+
"eslint": "^8.0.0",
|
|
34
|
+
"fast-check": "^3.15.0",
|
|
35
|
+
"jsdom": "^27.4.0",
|
|
36
|
+
"typescript": "^5.0.0",
|
|
37
|
+
"vite": "^5.0.0",
|
|
38
|
+
"vitest": "^1.0.0",
|
|
39
|
+
"vue": "^3.3.0"
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"dist"
|
|
43
|
+
],
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
}
|
|
47
|
+
}
|