@travetto/scaffold 6.0.0-rc.3 → 6.0.1

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
@@ -25,7 +25,7 @@ $ npx @travetto/scaffold@<version-or-tag>
25
25
  The generator will ask about enabling the following features:
26
26
 
27
27
  ## Web Application
28
- The [Web API](https://github.com/travetto/travetto/tree/main/module/web#readme "Declarative api for Web Applications with support for the dependency injection.") provides the necessary integration for exposing web apis. When selecting the `web` feature, you will need to specify which backend you want to include with your application, the default being [express](https://expressjs.com). Currently you can select from:
28
+ The [Web API](https://github.com/travetto/travetto/tree/main/module/web#readme "Declarative support for creating Web Applications") provides the necessary integration for exposing web apis. When selecting the `web` feature, you will need to specify which backend you want to include with your application, the default being [express](https://expressjs.com). Currently you can select from:
29
29
  * [express](https://expressjs.com)
30
30
  * [koa](https://koajs.com/)
31
31
  * [fastify](https://www.fastify.io/)
@@ -2,7 +2,7 @@
2
2
  // @ts-check
3
3
 
4
4
  async function getScaffoldCwd() {
5
- if (process.env.npm_lifecycle_script === 'trv-scaffold') { // Is npx run
5
+ if (process.env.npm_lifecycle_script?.includes('trv-scaffold')) { // Is npx run
6
6
  const { delimiter } = await import('node:path');
7
7
  const parts = process.env.PATH?.split(delimiter) ?? [];
8
8
  const loc = parts.find(p => p.includes('npx') && p.includes('.bin'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/scaffold",
3
- "version": "6.0.0-rc.3",
3
+ "version": "6.0.1",
4
4
  "description": "App Scaffold for the Travetto framework",
5
5
  "keywords": [
6
6
  "generator",
@@ -27,14 +27,14 @@
27
27
  "trv-scaffold": "bin/trv-scaffold.js"
28
28
  },
29
29
  "dependencies": {
30
- "@travetto/cli": "^6.0.0-rc.3",
31
- "@travetto/runtime": "^6.0.0-rc.2",
30
+ "@travetto/cli": "^6.0.1",
31
+ "@travetto/runtime": "^6.0.1",
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",
37
- "@types/mustache": "^4.2.5"
36
+ "@travetto/model": "^6.0.1",
37
+ "@types/mustache": "^4.2.6"
38
38
  },
39
39
  "travetto": {
40
40
  "displayName": "App Scaffold"
@@ -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,7 +1,7 @@
1
1
  # {{#modules.web}}
2
2
  web:
3
- ssl:
4
- active: false
3
+ http:
4
+ tls: false
5
5
  context:
6
6
  active: true
7
7
  cors:
@@ -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
  }
@@ -57,7 +57,6 @@ export class Context {
57
57
  const proc = spawn(cmd, args, {
58
58
  cwd: this.destination(),
59
59
  stdio: [0, 'pipe', 'pipe'],
60
- shell: false,
61
60
  env: { PATH: process.env.PATH },
62
61
  });
63
62
 
@@ -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
- }