@swerr/core 0.0.1
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 +3 -0
- package/dist/core/interfaces/swerr-config.d.ts +25 -0
- package/dist/core/interfaces/swerr-config.js +2 -0
- package/dist/core/interfaces/swerr-config.js.map +1 -0
- package/dist/core/utils/log.utils.d.ts +9 -0
- package/dist/core/utils/log.utils.js +46 -0
- package/dist/core/utils/log.utils.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/package.json +37 -0
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface SwerrConfig {
|
|
2
|
+
sourceFile: {
|
|
3
|
+
inputDir?: string;
|
|
4
|
+
meta?: {
|
|
5
|
+
projectName?: string;
|
|
6
|
+
version?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
};
|
|
9
|
+
export?: {
|
|
10
|
+
saveToFile?: boolean;
|
|
11
|
+
fileName?: string;
|
|
12
|
+
outputDir?: string;
|
|
13
|
+
};
|
|
14
|
+
options?: {
|
|
15
|
+
ignoreDirs?: string[];
|
|
16
|
+
whitelistExtensions?: string[];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
converter: ConverterConfig<any>[];
|
|
20
|
+
}
|
|
21
|
+
export interface ConverterConfig<CFG> {
|
|
22
|
+
factory: ConverterFn<CFG>;
|
|
23
|
+
config: CFG;
|
|
24
|
+
}
|
|
25
|
+
export type ConverterFn<CFG> = (config: CFG) => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swerr-config.js","sourceRoot":"","sources":["../../../src/core/interfaces/swerr-config.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class LogUtils {
|
|
2
|
+
private static tick;
|
|
3
|
+
static get prefix(): string;
|
|
4
|
+
static info(message: string): void;
|
|
5
|
+
static warn(message: string): void;
|
|
6
|
+
static error(message: string): void;
|
|
7
|
+
static debug(message: string): void;
|
|
8
|
+
static success(message: string): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import gradient from "gradient-string";
|
|
2
|
+
const COLORS = {
|
|
3
|
+
reset: "\x1b[0m",
|
|
4
|
+
info: "\x1b[36m",
|
|
5
|
+
warn: "\x1b[33m",
|
|
6
|
+
error: "\x1b[31m",
|
|
7
|
+
debug: "\x1b[90m",
|
|
8
|
+
success: "\x1b[32m"
|
|
9
|
+
};
|
|
10
|
+
const PALETTES = [
|
|
11
|
+
['#ff9292', '#9e1818'],
|
|
12
|
+
['#da7a7a', '#7e1212'],
|
|
13
|
+
['#ba6767', '#650e0e'],
|
|
14
|
+
['#da7a7a', '#7e1212'],
|
|
15
|
+
];
|
|
16
|
+
export class LogUtils {
|
|
17
|
+
static get prefix() {
|
|
18
|
+
const text = "swerr ❯❯❯❯";
|
|
19
|
+
let colored = '';
|
|
20
|
+
const len = text.length;
|
|
21
|
+
for (let i = 0; i < len; i++) {
|
|
22
|
+
const palette = PALETTES[(i + LogUtils.tick) % PALETTES.length];
|
|
23
|
+
const grad = gradient(palette);
|
|
24
|
+
colored += grad(text[i]);
|
|
25
|
+
}
|
|
26
|
+
LogUtils.tick++;
|
|
27
|
+
return colored;
|
|
28
|
+
}
|
|
29
|
+
static info(message) {
|
|
30
|
+
console.log(`${this.prefix} ${COLORS.info}[INFO] ${message} ${COLORS.reset}`);
|
|
31
|
+
}
|
|
32
|
+
static warn(message) {
|
|
33
|
+
console.warn(`${this.prefix} ${COLORS.warn}[WARN] ${message} ${COLORS.reset}`);
|
|
34
|
+
}
|
|
35
|
+
static error(message) {
|
|
36
|
+
console.error(`${this.prefix} ${COLORS.error}[ERROR] ${message} ${COLORS.reset}`);
|
|
37
|
+
}
|
|
38
|
+
static debug(message) {
|
|
39
|
+
console.debug(`${this.prefix} ${COLORS.debug}[DEBUG] ${message} ${COLORS.reset}`);
|
|
40
|
+
}
|
|
41
|
+
static success(message) {
|
|
42
|
+
console.log(`${this.prefix} ${COLORS.success}[SUCCESS] ${message} ${COLORS.reset}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
LogUtils.tick = 0;
|
|
46
|
+
//# sourceMappingURL=log.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.utils.js","sourceRoot":"","sources":["../../../src/core/utils/log.utils.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAEvC,MAAM,MAAM,GAAG;IACd,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,UAAU;IACjB,OAAO,EAAE,UAAU;CACnB,CAAC;AAEF,MAAM,QAAQ,GAAG;IAChB,CAAC,SAAS,EAAE,SAAS,CAAC;IACtB,CAAC,SAAS,EAAE,SAAS,CAAC;IACtB,CAAC,SAAS,EAAE,SAAS,CAAC;IACtB,CAAC,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,MAAM,OAAO,QAAQ;IAGpB,MAAM,KAAK,MAAM;QAChB,MAAM,IAAI,GAAG,YAAY,CAAC;QAC1B,IAAI,OAAO,GAAG,EAAE,CAAC;QACjB,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;QAExB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9B,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;YAChE,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC/B,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1B,CAAC;QAED,QAAQ,CAAC,IAAI,EAAE,CAAC;QAChB,OAAO,OAAO,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,OAAe;QAC1B,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,UAAU,OAAO,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,OAAe;QAC1B,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,UAAU,OAAO,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IAChF,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,OAAe;QAC3B,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,WAAW,OAAO,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,OAAe;QAC3B,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,WAAW,OAAO,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,OAAe;QAC7B,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,OAAO,aAAa,OAAO,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IACrF,CAAC;;AAnCc,aAAI,GAAG,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@swerr/core",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Models and Utils for Swerr",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"repository": "https://github.com/Shukaaa/swerr-core",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"default": "./dist/index.js",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"watch": "tsc --watch"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [],
|
|
20
|
+
"author": "Shukaaa",
|
|
21
|
+
"license": "ISC",
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"gradient-string": "^3.0.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/node": "^24.3.2",
|
|
27
|
+
"typescript": "^5.9.2"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"package.json",
|
|
32
|
+
"README.md"
|
|
33
|
+
],
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
}
|
|
37
|
+
}
|