@adonisjs/core 6.11.0 → 6.12.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.
@@ -11,7 +11,7 @@ export default class Add extends BaseCommand {
11
11
  static options: CommandOptions;
12
12
  name: string;
13
13
  verbose?: boolean;
14
- packageManager?: 'npm' | 'pnpm' | 'yarn' | 'yarn@berry';
14
+ packageManager?: 'npm' | 'pnpm' | 'bun' | 'yarn' | 'yarn@berry';
15
15
  dev?: boolean;
16
16
  force?: boolean;
17
17
  /**
@@ -32,7 +32,7 @@ export default class Add extends BaseCommand {
32
32
  if (['npm', 'pnpm', 'yarn', 'yarn@berry'].includes(pkgManager)) {
33
33
  return pkgManager;
34
34
  }
35
- throw new Error('Invalid package manager. Must be one of npm, pnpm or yarn');
35
+ throw new Error('Invalid package manager. Must be one of npm, pnpm, bun or yarn');
36
36
  }
37
37
  /**
38
38
  * Configure the package by delegating the work to the `node ace configure` command
@@ -79,6 +79,10 @@ export default class Configure extends BaseCommand {
79
79
  flags: this.parsed.flags,
80
80
  entity: this.app.generators.createEntity('health'),
81
81
  });
82
+ await codemods.makeUsingStub(stubsRoot, 'make/health/controller.stub', {
83
+ flags: this.parsed.flags,
84
+ entity: this.app.generators.createEntity('health_checks'),
85
+ });
82
86
  }
83
87
  /**
84
88
  * Creates codemods as per configure command options
@@ -0,0 +1,21 @@
1
+ {{#var controllerName = generators.controllerName(entity.name, false)}}
2
+ {{#var controllerFileName = generators.controllerFileName(entity.name, false)}}
3
+ {{{
4
+ exports({
5
+ to: app.httpControllersPath(entity.path, controllerFileName)
6
+ })
7
+ }}}
8
+ import { healthChecks } from '#start/health'
9
+ import type { HttpContext } from '@adonisjs/core/http'
10
+
11
+ export default class {{ controllerName }} {
12
+ async handle({ response }: HttpContext) {
13
+ const report = await healthChecks.run()
14
+
15
+ if (report.isHealthy) {
16
+ return response.ok(report)
17
+ }
18
+
19
+ return response.serviceUnavailable(report)
20
+ }
21
+ }
@@ -4,13 +4,9 @@
4
4
  to: app.startPath(entity.path, preloadFileName)
5
5
  })
6
6
  }}}
7
- import {
8
- HealthChecks,
9
- DiskSpaceHealthCheck,
10
- MemoryHeapHealthCheck,
11
- } from '@adonisjs/core/health'
7
+ import { HealthChecks, DiskSpaceCheck, MemoryHeapCheck } from '@adonisjs/core/health'
12
8
 
13
9
  export const healthChecks = new HealthChecks().register([
14
- new DiskSpaceHealthCheck(),
15
- new MemoryHeapHealthCheck(),
10
+ new DiskSpaceCheck(),
11
+ new MemoryHeapCheck(),
16
12
  ])
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adonisjs/core",
3
3
  "description": "Core of AdonisJS",
4
- "version": "6.11.0",
4
+ "version": "6.12.0",
5
5
  "engines": {
6
6
  "node": ">=20.6.0"
7
7
  },
@@ -91,8 +91,8 @@
91
91
  "@japa/expect-type": "^2.0.2",
92
92
  "@japa/file-system": "^2.3.0",
93
93
  "@japa/runner": "^3.1.4",
94
- "@swc/core": "^1.6.0",
95
- "@types/node": "^20.14.2",
94
+ "@swc/core": "^1.6.1",
95
+ "@types/node": "^20.14.5",
96
96
  "@types/pretty-hrtime": "^1.0.3",
97
97
  "@types/sinon": "^17.0.3",
98
98
  "@types/supertest": "^6.0.2",
@@ -119,7 +119,7 @@
119
119
  "typescript": "^5.4.5"
120
120
  },
121
121
  "dependencies": {
122
- "@adonisjs/ace": "^13.0.1",
122
+ "@adonisjs/ace": "^13.1.0",
123
123
  "@adonisjs/application": "^8.3.1",
124
124
  "@adonisjs/bodyparser": "^10.0.2",
125
125
  "@adonisjs/config": "^5.0.2",
@@ -128,7 +128,7 @@
128
128
  "@adonisjs/events": "^9.0.2",
129
129
  "@adonisjs/fold": "^10.1.2",
130
130
  "@adonisjs/hash": "^9.0.3",
131
- "@adonisjs/health": "^1.1.0",
131
+ "@adonisjs/health": "^2.0.0",
132
132
  "@adonisjs/http-server": "^7.2.3",
133
133
  "@adonisjs/logger": "^6.0.3",
134
134
  "@adonisjs/repl": "^4.0.1",
@@ -220,5 +220,6 @@
220
220
  "factories/**",
221
221
  ".yalc/**"
222
222
  ]
223
- }
223
+ },
224
+ "packageManager": "pnpm@9.2.0+sha512.98a80fd11c2e7096747762304106432b3ddc67dcf54b5a8c01c93f68a2cd5e05e6821849522a06fb76284d41a2660d5e334f2ee3bbf29183bf2e739b1dafa771"
224
225
  }