@travetto/scaffold 6.0.0-rc.2 → 6.0.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/README.md CHANGED
@@ -29,6 +29,7 @@ The [Web API](https://github.com/travetto/travetto/tree/main/module/web#readme "
29
29
  * [express](https://expressjs.com)
30
30
  * [koa](https://koajs.com/)
31
31
  * [fastify](https://www.fastify.io/)
32
+
32
33
  The code will establish some basic endpoints, specifically, `GET / ` as the root endpoint. This will return the contents of your `package.json` as an identification operation.
33
34
 
34
35
  ### Additional Web Features
@@ -51,6 +52,7 @@ The [Data Modeling Support](https://github.com/travetto/travetto/tree/main/modul
51
52
  * [SQL](https://en.wikipedia.org/wiki/SQL)
52
53
  * [DynamoDB](https://aws.amazon.com/dynamodb/)
53
54
  * [Firestore](https://firebase.google.com/docs/firestore)
55
+
54
56
  A default model is constructed, a [Todo](https://github.com/travetto/travetto/tree/main/module/scaffold/doc/model.ts#L4) class:
55
57
 
56
58
  **Code: Todo Model**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/scaffold",
3
- "version": "6.0.0-rc.2",
3
+ "version": "6.0.0",
4
4
  "description": "App Scaffold for the Travetto framework",
5
5
  "keywords": [
6
6
  "generator",
@@ -27,13 +27,13 @@
27
27
  "trv-scaffold": "bin/trv-scaffold.js"
28
28
  },
29
29
  "dependencies": {
30
- "@travetto/cli": "^6.0.0-rc.2",
31
- "@travetto/runtime": "^6.0.0-rc.2",
30
+ "@travetto/cli": "^6.0.0",
31
+ "@travetto/runtime": "^6.0.0",
32
32
  "enquirer": "^2.4.1",
33
33
  "mustache": "^4.2.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@travetto/model": "^6.0.0-rc.2",
36
+ "@travetto/model": "^6.0.0",
37
37
  "@types/mustache": "^4.2.5"
38
38
  },
39
39
  "travetto": {
@@ -34,11 +34,6 @@
34
34
  "@travetto/auth-web"
35
35
  ]
36
36
  },
37
- "src/web/primary.ts": {
38
- "requires": [
39
- "@travetto/web"
40
- ]
41
- },
42
37
  "test/model/todo.ts": {
43
38
  "requires": [
44
39
  "@travetto/model",
@@ -1,6 +1,6 @@
1
1
  # {{#modules.web}}
2
2
  web:
3
- ssl:
3
+ http.ssl:
4
4
  active: false
5
5
  context:
6
6
  active: true
@@ -1,4 +1,4 @@
1
- import { Controller, Get, Post, Redirect, ContextParam } from '@travetto/web';
1
+ import { Controller, Get, Post, WebResponse, ContextParam } from '@travetto/web';
2
2
  import { Login, Authenticated, Logout } from '@travetto/auth-web';
3
3
  import { Principal } from '@travetto/auth';
4
4
 
@@ -15,8 +15,8 @@ export class ApiController {
15
15
 
16
16
  @Post('/login')
17
17
  @Login(BasicAuthSymbol)
18
- async getAll(): Promise<Redirect> {
19
- return new Redirect('/auth/self', 301);
18
+ async getAll(): Promise<WebResponse> {
19
+ return WebResponse.redirect('/auth/self');
20
20
  }
21
21
 
22
22
  @Get('/self')
@@ -27,7 +27,7 @@ export class ApiController {
27
27
 
28
28
  @Get('/logout')
29
29
  @Logout()
30
- async logout(): Promise<Redirect> {
31
- return new Redirect('/auth/self', 301);
30
+ async logout(): Promise<WebResponse> {
31
+ return WebResponse.redirect('/auth/self');
32
32
  }
33
33
  }
@@ -25,15 +25,12 @@ export const FEATURES: Feature[] = [
25
25
  {
26
26
  title: 'Web Framework',
27
27
  package: '@travetto/web',
28
- choices: [
29
- { title: 'Node', package: '@travetto/web-node' },
30
- { title: 'AWS Lambda', package: '@travetto/web-aws-lambda' },
31
- ],
32
28
  addons: [
29
+ { title: 'Web Node', package: '@travetto/web-node' },
30
+ { title: 'Web Http Server', package: '@travetto/web-http-server' },
33
31
  { title: 'OpenAPI', package: '@travetto/openapi' },
34
32
  { title: 'Logging', package: '@travetto/log' }
35
- ],
36
- default: 'Express.js'
33
+ ]
37
34
  },
38
35
  { title: 'Test Framework', package: '@travetto/test' },
39
36
  { title: 'ESLint Support', package: '@travetto/eslint' },
@@ -1,10 +0,0 @@
1
- import { Controller, Get, QueryParam } from '@travetto/web';
2
-
3
- @Controller('/')
4
- export class SimpleController {
5
-
6
- @Get('/')
7
- async hello(@QueryParam() name = 'world'): Promise<{ hello: string }> {
8
- return { hello: name };
9
- }
10
- }