Skip to content

Commit

Permalink
chore: add missing peer dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Nov 27, 2023
1 parent c4be116 commit 80a289e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,19 @@
"negotiator": "^0.6.3",
"yaml": "^2.3.4"
},
"peerDependencies": {
"@adonisjs/core": "^6.1.5-32",
"edge.js": "^6.0.0",
"@vinejs/vine": "^1.7.0"
},
"peerDependenciesMeta": {
"edge.js": {
"optional": true
},
"@vinejs/vine": {
"optional": true
}
},
"author": "virk,adonisjs",
"license": "MIT",
"homepage": "https://github.com/adonisjs/antl#readme",
Expand Down
12 changes: 3 additions & 9 deletions providers/i18n_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* file that was distributed with this source code.
*/

import type { Edge } from 'edge.js'
import { configProvider } from '@adonisjs/core'
import { RuntimeException } from '@poppinss/utils'

Expand Down Expand Up @@ -35,15 +34,10 @@ export default class I18nProvider {
* Registers edge plugin when edge is installed
*/
protected async registerEdgePlugin(i18nManager: I18nManager) {
let edge: Edge | null = null
try {
const edgeExports = await import('edge.js')
edge = edgeExports.default
} catch {}

if (edge) {
if (this.app.usingEdgeJS) {
const edge = await import('edge.js')
const { edgePluginI18n } = await import('../src/plugins/edge.js')
edge.use(edgePluginI18n(i18nManager))
edge.default.use(edgePluginI18n(i18nManager))
}
}

Expand Down

0 comments on commit 80a289e

Please sign in to comment.