-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4425b2e
commit 055a856
Showing
26 changed files
with
691 additions
and
669 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* @adonisjs/lucid-slugify | ||
* | ||
* (c) AdonisJS | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
import { assert } from '@japa/assert' | ||
import { fileSystem } from '@japa/file-system' | ||
import { configure, processCLIArgs, run } from '@japa/runner' | ||
|
||
processCLIArgs(process.argv.splice(2)) | ||
|
||
configure({ | ||
files: ['tests/**/*.spec.ts'], | ||
plugins: [assert(), fileSystem()], | ||
}) | ||
|
||
run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* @adonisjs/lucid-slugify | ||
* | ||
* (c) AdonisJS | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
import type Configure from '@adonisjs/core/commands/configure' | ||
|
||
export async function configure(command: Configure) { | ||
const codemods = await command.createCodemods() | ||
|
||
/** | ||
* Publish provider | ||
*/ | ||
await codemods.updateRcFile((rcFile) => { | ||
rcFile.addProvider('@adonisjs/lucid-slugify/slugify_provider') | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
/* | ||
* @adonisjs/lucid-slugify | ||
* | ||
* (c) Harminder Virk <[email protected]> | ||
* (c) AdonisJS | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
/// <reference path="./slugify.ts" /> | ||
/// <reference path="./container.ts" /> | ||
export { configure } from './configure.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* @adonisjs/lucid-slugify | ||
* | ||
* (c) AdonisJS | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
/// <reference types="@adonisjs/lucid/database_provider" /> | ||
|
||
import type { ApplicationService } from '@adonisjs/core/types' | ||
|
||
import { SlugifyDecorator } from '../src/types.js' | ||
import type { SlugifyManager } from '../src/slugify_manager.js' | ||
|
||
declare module '@adonisjs/core/types' { | ||
export interface ContainerBindings { | ||
'slugify.manager': SlugifyManager | ||
'slugify.decorator': SlugifyDecorator | ||
} | ||
} | ||
|
||
export default class SlugifyProvider { | ||
constructor(protected app: ApplicationService) {} | ||
|
||
register() { | ||
this.app.container.singleton('slugify.manager', async () => { | ||
const db = await this.app.container.make('lucid.db') | ||
const { SlugifyManager } = await import('../src/slugify_manager.js') | ||
|
||
return new SlugifyManager(db) | ||
}) | ||
|
||
this.app.container.singleton('slugify.decorator', async (resolver) => { | ||
const { Slugify } = await import('../src/decorators/slugify.js') | ||
const slugify = new Slugify(await resolver.make('slugify.manager')) | ||
|
||
return slugify.slugifyDecorator.bind(slugify) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* @adonisjs/lucid-slugify | ||
* | ||
* (c) AdonisJS | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
import app from '@adonisjs/core/services/app' | ||
import { SlugifyManager } from '../src/slugify_manager.js' | ||
|
||
let slugifyManager: SlugifyManager | ||
|
||
await app.booted(async () => { | ||
slugifyManager = await app.container.make('slugify.manager') | ||
}) | ||
|
||
export { slugifyManager as default } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* @adonisjs/lucid-slugify | ||
* | ||
* (c) AdonisJS | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
import app from '@adonisjs/core/services/app' | ||
import { SlugifyDecorator } from '../src/types.js' | ||
|
||
let slugify: SlugifyDecorator | ||
|
||
await app.booted(async () => { | ||
slugify = await app.container.make('slugify.decorator') | ||
}) | ||
|
||
export { slugify as default } |
Oops, something went wrong.