@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
@@ -0,0 +1,3 @@
1
+ {
2
+ "version": "2.0.1"
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uscreen.de/create-fastify-app",
3
- "version": "2.0.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": "^11.0.0",
19
- "fs-extra": "^11.1.0",
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.2",
26
- "strip-ansi": "^7.0.1"
25
+ "c8": "^10.1.3",
26
+ "strip-ansi": "^7.1.2"
27
27
  },
28
28
  "scripts": {
29
29
  "lint": "eslint --fix",
@@ -5,8 +5,8 @@
5
5
 
6
6
  ## Usage
7
7
 
8
- - `make start`: start app on local dev
9
- - `make test`: test app
8
+ - `pnpm run dev`: start app on local dev
9
+ - `pnpm run test`: test app
10
10
 
11
11
  ## Configure
12
12
 
@@ -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((fastify, opts, next) => {
5
+ export default fp((app, opts, next) => {
6
6
  /**
7
7
  * add schemas
8
8
  */
9
- fastify.register(schemas)
9
+ app.register(schemas)
10
10
 
11
11
  /**
12
12
  * register app
13
13
  */
14
- fastify.register(fastifyApp, opts)
14
+ app.register(fastifyApp, opts)
15
15
 
16
16
  next()
17
17
  })
@@ -1,8 +1,8 @@
1
1
  import fp from 'fastify-plugin'
2
2
 
3
3
  export default fp(
4
- (fastify, opts, next) => {
5
- fastify.decorate('noop', () => {
4
+ (app, opts, next) => {
5
+ app.decorate('noop', () => {
6
6
  return 'Hello Universe'
7
7
  })
8
8
 
@@ -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((fastify, opts, next) => {
8
+ export default fp((app, opts, next) => {
9
9
  const addSchema = (schema) => {
10
- fastify.addSchema(schema)
10
+ app.addSchema(schema)
11
11
  return schema
12
12
  }
13
13
 
@@ -1,18 +1,18 @@
1
- export default (fastify, opts, next) => {
2
- fastify.get(
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 'fastify.getSchema()'
8
- // 200: fastify.getSchema('noopNplugin')
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: fastify.noop(),
15
+ plugin: app.noop(),
16
16
  property: 'should be stripped from response'
17
17
  }
18
18
  }