Skip to content

Commit

Permalink
refactor: organize stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Dec 24, 2023
1 parent 07f8702 commit 40bef08
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
9 changes: 5 additions & 4 deletions configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,26 @@
*/

import type Configure from '@adonisjs/core/commands/configure'
import { stubsRoot } from './stubs/main.js'

/**
* Configures the package
*/
export async function configure(command: Configure) {
const codemods = await command.createCodemods()

/**
* Publish config file
*/
await command.publishStub('config.stub')
await codemods.makeUsingStub(stubsRoot, 'config/i18n.stub', {})

/**
* Publish middleware file
*/
await command.publishStub('detect_user_locale.stub', {
await codemods.makeUsingStub(stubsRoot, 'make/middleware/detect_user_locale.stub', {
entity: command.app.generators.createEntity('detect_user_locale'),
})

const codemods = await command.createCodemods()

/**
* Register middleware
*/
Expand Down
1 change: 0 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@

export { I18n } from './src/i18n.js'
export { configure } from './configure.js'
export { stubsRoot } from './stubs/main.js'
export { I18nManager } from './src/i18n_manager.js'
export { defineConfig, formatters, loaders } from './src/define_config.js'
File renamed without changes.
File renamed without changes.

0 comments on commit 40bef08

Please sign in to comment.