create-amoxi-app 0.5.0 → 0.6.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-amoxi-app",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Create an Amoxi app: npx create-amoxi-app@latest my-app",
5
5
  "keywords": [
6
6
  "amoxi",
@@ -11,9 +11,10 @@ export class NoteController {
11
11
  return this.notes.list();
12
12
  }
13
13
 
14
- // Invalid bodies are rejected with a 400 listing every problem before this runs.
14
+ // Body<NewNote> is the JSON request body, validated against the NewNote type: invalid
15
+ // bodies are rejected with a 400 listing every problem before this runs.
15
16
  @Post()
16
- create(@Body() body: NewNote): HttpResponse<Note> {
17
+ create(body: Body<NewNote>): HttpResponse<Note> {
17
18
  return HttpResponse.created(this.notes.add(body));
18
19
  }
19
20
  }
@@ -7,7 +7,7 @@ export class NoteService {
7
7
  private readonly notes: Note[] = [];
8
8
  private nextId = 1;
9
9
 
10
- constructor(@Value('${notes.max:100}') private readonly max: number) {}
10
+ constructor(private readonly max: Value<number, 'notes.max', 100>) {}
11
11
 
12
12
  @PostConstruct()
13
13
  seed(): void {
@@ -9,8 +9,6 @@
9
9
  "esModuleInterop": true,
10
10
  "skipLibCheck": true,
11
11
  "forceConsistentCasingInFileNames": true,
12
- "experimentalDecorators": true,
13
- "emitDecoratorMetadata": false,
14
12
  "jsx": "react-jsx",
15
13
  "jsxImportSource": "amoxi",
16
14
  "sourceMap": true,
@@ -11,9 +11,10 @@ export class NoteController {
11
11
  return this.notes.list();
12
12
  }
13
13
 
14
- // Invalid bodies are rejected with a 400 listing every problem before this runs.
14
+ // Body<NewNote> is the JSON request body, validated against the NewNote type: invalid
15
+ // bodies are rejected with a 400 listing every problem before this runs.
15
16
  @Post()
16
- create(@Body() body: NewNote): HttpResponse<Note> {
17
+ create(body: Body<NewNote>): HttpResponse<Note> {
17
18
  return HttpResponse.created(this.notes.add(body));
18
19
  }
19
20
  }
@@ -7,7 +7,7 @@ export class NoteService {
7
7
  private readonly notes: Note[] = [];
8
8
  private nextId = 1;
9
9
 
10
- constructor(@Value('${notes.max:100}') private readonly max: number) {}
10
+ constructor(private readonly max: Value<number, 'notes.max', 100>) {}
11
11
 
12
12
  @PostConstruct()
13
13
  seed(): void {