@uscreen.de/create-fastify-app 2.0.0 → 2.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/manifest.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uscreen.de/create-fastify-app",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "cli to create a new @uscreen.de/fastify-app",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
"create-fastify-app": "./bin/cli.js"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"commander": "^
|
|
19
|
-
"fs-extra": "^11.
|
|
18
|
+
"commander": "^14.0.1",
|
|
19
|
+
"fs-extra": "^11.3.2",
|
|
20
20
|
"read-pkg-up": "^11.0.0",
|
|
21
21
|
"write-pkg": "^7.0.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@uscreen.de/eslint-config-prettystandard-node": "^0.2.12",
|
|
25
|
-
"c8": "^10.1.
|
|
26
|
-
"strip-ansi": "^7.
|
|
25
|
+
"c8": "^10.1.3",
|
|
26
|
+
"strip-ansi": "^7.1.2"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"lint": "eslint --fix",
|
package/skeleton/README.md
CHANGED
package/skeleton/app/app.js
CHANGED
|
@@ -2,16 +2,16 @@ import fastifyApp from '@uscreen.de/fastify-app'
|
|
|
2
2
|
import fp from 'fastify-plugin'
|
|
3
3
|
import schemas from './schemas.js'
|
|
4
4
|
|
|
5
|
-
export default fp((
|
|
5
|
+
export default fp((app, opts, next) => {
|
|
6
6
|
/**
|
|
7
7
|
* add schemas
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
app.register(schemas)
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* register app
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
app.register(fastifyApp, opts)
|
|
15
15
|
|
|
16
16
|
next()
|
|
17
17
|
})
|
package/skeleton/app/schemas.js
CHANGED
|
@@ -5,9 +5,9 @@ import S from 'fluent-json-schema'
|
|
|
5
5
|
* Usage of the Globaly Shared Schema feature
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
export default fp((
|
|
8
|
+
export default fp((app, opts, next) => {
|
|
9
9
|
const addSchema = (schema) => {
|
|
10
|
-
|
|
10
|
+
app.addSchema(schema)
|
|
11
11
|
return schema
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export default (
|
|
2
|
-
|
|
1
|
+
export default (app, opts, next) => {
|
|
2
|
+
app.get(
|
|
3
3
|
'/noop',
|
|
4
4
|
{
|
|
5
5
|
schema: {
|
|
6
6
|
response: {
|
|
7
|
-
200: { $ref: 'noopNplugin#' } // fastest and json-schema spec compatiple way, or use '
|
|
8
|
-
// 200:
|
|
7
|
+
200: { $ref: 'noopNplugin#' } // fastest and json-schema spec compatiple way, or use 'app.getSchema()'
|
|
8
|
+
// 200: app.getSchema('noopNplugin')
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
async (/* req, res */) => {
|
|
13
13
|
return {
|
|
14
14
|
noop: 'Hello world',
|
|
15
|
-
plugin:
|
|
15
|
+
plugin: app.noop(),
|
|
16
16
|
property: 'should be stripped from response'
|
|
17
17
|
}
|
|
18
18
|
}
|