@kosmojs/lib 0.0.26 → 0.0.27

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@kosmojs/lib",
4
- "version": "0.0.26",
4
+ "version": "0.0.27",
5
5
  "author": "Slee Woo",
6
6
  "license": "MIT",
7
7
  "publishConfig": {
@@ -10,6 +10,9 @@
10
10
  "files": [
11
11
  "pkg/*"
12
12
  ],
13
+ "imports": {
14
+ "#templates/*": "./src/templates/*"
15
+ },
13
16
  "exports": {
14
17
  ".": {
15
18
  "types": "./pkg/index.d.ts",
@@ -19,18 +22,18 @@
19
22
  "dependencies": {
20
23
  "@topcli/spinner": "^4.2.1",
21
24
  "crc": "^4.3.2",
22
- "handlebars": "^4.7.8",
25
+ "handlebars": "^4.7.9",
23
26
  "mime-types": "^3.0.2",
24
- "path-to-regexp": "^8.3.0",
27
+ "path-to-regexp": "^8.4.2",
25
28
  "picomatch": "^4.0.4",
26
29
  "tfusion": "^0.0.23",
27
- "ts-morph": "^27.0.2",
28
- "@kosmojs/api": "^0.0.26"
30
+ "tinyglobby": "^0.2.16",
31
+ "ts-morph": "^27.0.2"
29
32
  },
30
33
  "devDependencies": {
31
34
  "@types/mime-types": "^3.0.1",
32
- "@types/picomatch": "^4.0.2",
33
- "vite": "^8.0.2"
35
+ "@types/picomatch": "^4.0.3",
36
+ "@kosmojs/core": "^0.0.27"
34
37
  },
35
38
  "scripts": {
36
39
  "build": "esbuilder src/index.ts",
package/pkg/ast.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { flattener } from "tfusion";
2
2
  import { type CallExpression, Project, type ProjectOptions, type SourceFile } from "ts-morph";
3
- import { type HTTPMethod } from "@kosmojs/api";
4
- import type { ApiRoute, SourceFolder, TypeDeclaration, ValidationDefinition } from "./types";
3
+ import { type ApiRoute, type SourceFolder, type TypeDeclaration, type ValidationDefinition } from "@kosmojs/core";
4
+ import { type HTTPMethod } from "@kosmojs/core/api";
5
5
  type PathResolver = (path: string) => string;
6
6
  export declare const astFactory: () => {
7
7
  createProject: (opts?: ProjectOptions) => Project;
@@ -1,58 +1,3 @@
1
- import type { DefineGenerator, DefineGeneratorFactory, GeneratorMeta } from "./types";
2
- export declare const GENERATOR_META: unique symbol;
3
- /**
4
- * Define a generator with metadata stored internally.
5
- *
6
- * Metadata is attached to both the generator module and its instances,
7
- * accessible via `getGeneratorMeta()`
8
- *
9
- * **User-facing API:**
10
- * ```ts
11
- * import { defineConfig, ssrGenerator } from "@kosmojs/dev";
12
- *
13
- * export default defineConfig({
14
- * generators: [ssrGenerator()], // Clean instantiation
15
- * });
16
- * ```
17
- *
18
- * **Internal dev plugin usage:**
19
- * ```ts
20
- * import { getGeneratorMeta } from "@kosmojs/lib";
21
- *
22
- * // Read module metadata before instantiation
23
- * const meta = getGeneratorMeta(ssrGenerator);
24
- * console.log(meta?.slot); // "ssr"
25
- *
26
- * // Read instance metadata after instantiation
27
- * for (const generator of config.generators) {
28
- * const meta = getGeneratorMeta(generator);
29
- * if (meta?.dependencies) {
30
- * // Check/install dependencies
31
- * }
32
- * }
33
- * ```
34
- *
35
- * @example Define a generator
36
- * ```ts
37
- * import { defineGenerator } from "@kosmojs/lib";
38
- *
39
- * export default defineGenerator(
40
- * () => {
41
- * return async (sourceFolder) => {
42
- * // Generator logic
43
- * };
44
- * },
45
- * {
46
- * name: "Example",
47
- * slot: "example",
48
- * dependencies: {
49
- * "some-package": "^1.0.0"
50
- * }
51
- * }
52
- * );
53
- * ```
54
- * */
1
+ import type { DefineGenerator, DefineGeneratorFactory } from "@kosmojs/core";
55
2
  export declare const defineGenerator: DefineGenerator;
56
- export declare const isGenerator: (fn: Function) => fn is Function & Record<typeof GENERATOR_META, unknown>;
57
- export declare const getGeneratorMeta: (fn: Function) => GeneratorMeta | undefined;
58
3
  export declare const defineGeneratorFactory: DefineGeneratorFactory;
package/pkg/index.d.ts CHANGED
@@ -5,5 +5,6 @@ export * from "./paths";
5
5
  export * from "./render";
6
6
  export * from "./routes";
7
7
  export * from "./spinner";
8
+ export * from "./tsconfig";
8
9
  export * from "./typebox";
9
- export * from "./types";
10
+ export * from "./vite";