create-loutre 0.4.0 → 0.5.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-loutre",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Loutre project initializer",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@clack/prompts": "^1.7.0",
21
- "@loutrejs/loutre": "^0.4.0",
21
+ "@loutrejs/loutre": "^0.5.0",
22
22
  "commander": "^15.0.0"
23
23
  },
24
24
  "repository": {
@@ -6,7 +6,8 @@ import {
6
6
  } from '@loutrejs/loutre'
7
7
  import { http } from '@loutrejs/loutre/http'
8
8
  import { z } from 'zod'
9
- const AppContract = contract([
9
+
10
+ const HelloContract = contract([
10
11
  http({
11
12
  hello: {
12
13
  method: 'GET',
@@ -23,9 +24,18 @@ const AppContract = contract([
23
24
  },
24
25
  }),
25
26
  ])
27
+
28
+ const AppContract = contract([
29
+ http({
30
+ app: {
31
+ routes: HelloContract.http,
32
+ },
33
+ }),
34
+ ])
35
+
26
36
  const AppController = implementation({
27
37
  name: 'AppController',
28
- contract: AppContract,
38
+ contract: AppContract.http.app.hello,
29
39
  protocol: http,
30
40
  factory: () => ({
31
41
  async hello(ctx) {
@@ -35,11 +45,13 @@ const AppController = implementation({
35
45
  },
36
46
  }),
37
47
  })
48
+
38
49
  const AppModule = defineModule(() => ({
39
50
  name: 'AppModule',
40
51
  description: 'HTTP Application entry module',
41
52
  implementations: [AppController],
42
53
  }))
54
+
43
55
  export default defineApplication({
44
56
  modules: [AppModule()],
45
57
  })