@kosmojs/lib 0.1.8 → 0.2.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/package.json +8 -12
- package/pkg/ast.d.ts +5 -4
- package/pkg/generators.d.ts +1 -2
- package/pkg/generic.d.ts +3 -0
- package/pkg/index.d.ts +1 -1
- package/pkg/index.js +361 -179
- package/pkg/index.js.map +1 -1
- package/pkg/paths.d.ts +1 -1
- package/pkg/routes/base.d.ts +2 -2
- package/pkg/vite.d.ts +58 -1
- package/pkg/typebox.d.ts +0 -2
- /package/pkg/{routes/templates.d.ts → templates.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@kosmojs/lib",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"author": "Slee Woo",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"files": [
|
|
8
8
|
"pkg/*"
|
|
9
9
|
],
|
|
10
|
-
"imports": {
|
|
11
|
-
"#templates/*": "./src/templates/*"
|
|
12
|
-
},
|
|
13
10
|
"exports": {
|
|
14
11
|
".": {
|
|
15
12
|
"types": "./pkg/index.d.ts",
|
|
@@ -20,19 +17,18 @@
|
|
|
20
17
|
"@topcli/spinner": "^4.2.1",
|
|
21
18
|
"crc": "^4.3.2",
|
|
22
19
|
"handlebars": "^4.7.9",
|
|
23
|
-
"
|
|
20
|
+
"mrmime": "^2.0.1",
|
|
24
21
|
"path-to-regexp": "^8.4.2",
|
|
25
|
-
"picomatch": "^4.0.
|
|
26
|
-
"tfusion": "^0.0
|
|
27
|
-
"tinyglobby": "^0.2.
|
|
22
|
+
"picomatch": "^4.0.5",
|
|
23
|
+
"tfusion": "^0.2.0",
|
|
24
|
+
"tinyglobby": "^0.2.17",
|
|
28
25
|
"ts-morph": "^28.0.0",
|
|
29
|
-
"@kosmojs/core": "^0.
|
|
26
|
+
"@kosmojs/core": "^0.2.0"
|
|
30
27
|
},
|
|
31
28
|
"devDependencies": {
|
|
32
|
-
"@types/mime-types": "^3.0.1",
|
|
33
29
|
"@types/picomatch": "^4.0.3",
|
|
34
|
-
"vite": "^8.
|
|
35
|
-
"@kosmojs/lib": "^0.
|
|
30
|
+
"vite": "^8.1.5",
|
|
31
|
+
"@kosmojs/lib": "^0.2.0"
|
|
36
32
|
},
|
|
37
33
|
"scripts": {
|
|
38
34
|
"build": "wsbuild src/index.ts",
|
package/pkg/ast.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import flattener from "tfusion";
|
|
2
2
|
import { type CallExpression, Project, type ProjectOptions, type SourceFile } from "ts-morph";
|
|
3
|
+
import type { ResolvedTypeSignature } from "@kosmojs/core";
|
|
3
4
|
import { type ApiRoute, type SourceFolder, type TypeDeclaration, type ValidationDefinition } from "@kosmojs/core";
|
|
4
5
|
import { type HTTPMethod } from "@kosmojs/core/api";
|
|
5
6
|
type PathResolver = (path: string) => string;
|
|
@@ -28,14 +29,14 @@ export declare const astFactory: () => {
|
|
|
28
29
|
index: number;
|
|
29
30
|
text: string;
|
|
30
31
|
}[] | undefined;
|
|
31
|
-
methods: ("
|
|
32
|
+
methods: ("DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT")[];
|
|
32
33
|
validationDefinitions: ValidationDefinition[];
|
|
33
34
|
referencedFiles: string[] | undefined;
|
|
34
35
|
}>;
|
|
35
|
-
typeResolverFactory: (
|
|
36
|
+
typeResolverFactory: (sourceFolder: SourceFolder) => {
|
|
36
37
|
getSourceFile: (fileFullpath: string) => SourceFile;
|
|
37
38
|
refreshSourceFile: (fileFullpath: string) => Promise<void>;
|
|
38
|
-
literalTypesResolver: (literalTypes: string, options: Parameters<typeof flattener>[2]) =>
|
|
39
|
+
literalTypesResolver: (literalTypes: string, options: Parameters<typeof flattener>[2]) => Array<ResolvedTypeSignature>;
|
|
39
40
|
};
|
|
40
41
|
};
|
|
41
42
|
export {};
|
package/pkg/generators.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { DefineGenerator, DefineGeneratorFactory
|
|
1
|
+
import type { DefineGenerator, DefineGeneratorFactory } from "@kosmojs/core";
|
|
2
2
|
export declare const defineGenerator: DefineGenerator;
|
|
3
3
|
export declare const defineGeneratorFactory: DefineGeneratorFactory;
|
|
4
|
-
export declare const createTemplateResolver: <T>(customTemplates: GeneratorCustomTemplates<T> | undefined, defaultTemplate: string) => (pattern: string, entry: T) => any;
|
package/pkg/generic.d.ts
ADDED
package/pkg/index.d.ts
CHANGED