@kosmojs/dev 0.4.4 → 0.5.2

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 CHANGED
@@ -1,16 +1,52 @@
1
1
  # @kosmojs/dev
2
2
 
3
- TODO: Add package description
3
+ Wires KosmoJS into Vite and runs the generators that produce `lib/`.
4
4
 
5
5
  ## Installation
6
6
 
7
+ Added to your project automatically by `npm create kosmo`.
8
+
9
+ To add it by hand:
10
+
7
11
  ```sh
8
12
  npm install -D @kosmojs/dev
9
13
  ```
10
14
 
15
+ ## What it does
16
+
17
+ Watches each source folder and regenerates its `lib/` directory as routes,
18
+ middleware and validation types change - the typed fetch clients, the route tables,
19
+ the framework entry points, the `_/` aliases.
20
+
21
+ It also hosts the generators. Every framework integration ships as a separate
22
+ package under [`generators/`](https://github.com/kosmojs/kosmo/tree/main/generators),
23
+ and they arrive as dependencies of this package rather than of your project,
24
+ so a project's `package.json` stays short no matter how many stacks it uses.
25
+
26
+ Which generators run is decided by `kosmo.config.ts`:
27
+
28
+ ```ts
29
+ export default defineConfig({
30
+ frontend: { stack: "react", base: "/" },
31
+ backend: { stack: "hono", base: "/api" },
32
+ });
33
+ ```
34
+
35
+ ## Notes
36
+
37
+ `lib/` is generated output. It is gitignored, safe to delete, and rebuilt on the next run -
38
+ never edit it or import from it by relative path.
39
+
40
+ There is no `vite.config.ts` in a KosmoJS project.
41
+ Vite's `UserConfig` goes in the `viteConfig` key of the `frontend` and `backend` blocks,
42
+ and the stack plugin is supplied by the generator, so adding it yourself to `viteConfig.plugins` runs the transform twice.
43
+
11
44
  ## Documentation
12
45
 
13
- See [kosmojs.dev](https://kosmojs.dev)
46
+ - [Configuration](https://kosmojs.dev/essentials/config.html)
47
+ - [Why code generation](https://kosmojs.dev/essentials/why-codegen.html)
48
+
49
+ Full documentation at [kosmojs.dev](https://kosmojs.dev).
14
50
 
15
51
  ## License
16
52
 
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@kosmojs/dev",
4
- "version": "0.4.4",
4
+ "version": "0.5.2",
5
+ "description": "Vite integration and code-generation host for KosmoJS projects",
5
6
  "cacheVersion": "001",
6
7
  "author": "Slee Woo",
7
8
  "license": "MIT",
@@ -25,36 +26,36 @@
25
26
  "./package.json": "./package.json"
26
27
  },
27
28
  "dependencies": {
28
- "@kosmojs/core": "^0.4.4",
29
- "@kosmojs/lib": "^0.4.4",
29
+ "@kosmojs/core": "^0.5.2",
30
+ "@kosmojs/lib": "^0.5.2",
30
31
  "@mdx-js/rollup": "^3.1.1",
31
32
  "@sveltejs/vite-plugin-svelte": "^7.3.0",
32
- "@vitejs/plugin-react": "^6.1.0",
33
+ "@vitejs/plugin-react": "^6.1.1",
33
34
  "@vitejs/plugin-vue": "^6.0.8",
34
35
  "chokidar": "^5.0.0",
35
36
  "crc": "^4.3.2",
36
37
  "path-to-regexp": "^8.4.2",
37
38
  "semver": "^7.8.5",
38
- "typebox": "^1.3.18",
39
+ "typebox": "^1.3.30",
39
40
  "vite": "^8.2.2",
40
41
  "vite-plugin-solid": "^2.11.14",
41
42
  "yaml": "^2.9.0"
42
43
  },
43
44
  "devDependencies": {
44
- "@kosmojs/core-generator": "^0.3.0",
45
- "@kosmojs/fetch-generator": "^0.3.0",
46
- "@kosmojs/h3-generator": "^0.3.0",
47
- "@kosmojs/hono-generator": "^0.3.0",
48
- "@kosmojs/koa-generator": "^0.3.0",
49
- "@kosmojs/mdx-generator": "^0.3.0",
50
- "@kosmojs/openapi-generator": "^0.3.0",
51
- "@kosmojs/react-generator": "^0.3.0",
52
- "@kosmojs/solid-generator": "^0.3.0",
53
- "@kosmojs/ssg-generator": "^0.3.0",
54
- "@kosmojs/ssr-generator": "^0.3.0",
55
- "@kosmojs/svelte-generator": "^0.3.0",
56
- "@kosmojs/typebox-generator": "^0.3.0",
57
- "@kosmojs/vue-generator": "^0.3.0"
45
+ "@kosmojs/core-generator": "^0.0.0",
46
+ "@kosmojs/fetch-generator": "^0.0.0",
47
+ "@kosmojs/h3-generator": "^0.0.0",
48
+ "@kosmojs/hono-generator": "^0.0.0",
49
+ "@kosmojs/koa-generator": "^0.0.0",
50
+ "@kosmojs/mdx-generator": "^0.0.0",
51
+ "@kosmojs/openapi-generator": "^0.0.0",
52
+ "@kosmojs/react-generator": "^0.0.0",
53
+ "@kosmojs/solid-generator": "^0.0.0",
54
+ "@kosmojs/ssg-generator": "^0.0.0",
55
+ "@kosmojs/ssr-generator": "^0.0.0",
56
+ "@kosmojs/svelte-generator": "^0.0.0",
57
+ "@kosmojs/typebox-generator": "^0.0.0",
58
+ "@kosmojs/vue-generator": "^0.0.0"
58
59
  },
59
60
  "scripts": {
60
61
  "build": "wsbuild src/index.ts src/chassis.ts"