@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 +1 -1
- package/bin/trv-scaffold.js +1 -1
- package/package.json +5 -5
- package/resources/templates/todo/listing.json +0 -5
- package/resources/templates/todo/resources/application.yml +2 -2
- package/resources/templates/todo/src/web/auth.ts +5 -5
- package/support/bin/context.ts +0 -1
- package/support/bin/features.ts +3 -6
- package/resources/templates/todo/src/web/primary.ts +0 -10
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
|
|
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/)
|
package/bin/trv-scaffold.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// @ts-check
|
|
3
3
|
|
|
4
4
|
async function getScaffoldCwd() {
|
|
5
|
-
if (process.env.npm_lifecycle_script
|
|
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.
|
|
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.
|
|
31
|
-
"@travetto/runtime": "^6.0.
|
|
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.
|
|
37
|
-
"@types/mustache": "^4.2.
|
|
36
|
+
"@travetto/model": "^6.0.1",
|
|
37
|
+
"@types/mustache": "^4.2.6"
|
|
38
38
|
},
|
|
39
39
|
"travetto": {
|
|
40
40
|
"displayName": "App Scaffold"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Controller, Get, Post,
|
|
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<
|
|
19
|
-
return
|
|
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<
|
|
31
|
-
return
|
|
30
|
+
async logout(): Promise<WebResponse> {
|
|
31
|
+
return WebResponse.redirect('/auth/self');
|
|
32
32
|
}
|
|
33
33
|
}
|
package/support/bin/context.ts
CHANGED
package/support/bin/features.ts
CHANGED
|
@@ -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' },
|