Skip to content

Dev to Main #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: test
on:
- push
- pull_request
- workflow_call

jobs:
Expand Down
1 change: 1 addition & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
export { configure } from './configure.js'
export { stubsRoot } from './stubs/main.js'
export { defineConfig } from './src/define_config/index.js'
export { Datatables } from './src/datatables.js'
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
],
"exports": {
".": "./build/index.js",
"./datatables": "./build/src/datatables.js",
"./datatables_provider": "./build/providers/datatables_provider.js",
"./services/main": "./build/services/main.js",
"./engines/lucid_datatable": "./build/src/engines/lucid_datatable.js",
Expand Down
4 changes: 2 additions & 2 deletions providers/datatables_provider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ApplicationService } from '@adonisjs/core/types'
import Datatables from '../src/datatables.js'
import { Datatables } from '../src/datatables.js'
import { DbQueryEventNode } from '@adonisjs/lucid/types/database'

declare module '@adonisjs/core/types' {
Expand All @@ -15,7 +15,7 @@ export default class DatatablesProvider {
* Register bindings to the container
*/
register() {
this.app.container.bind('datatables', () => {
this.app.container.singleton('datatables', () => {
const engines: Record<string, any> = this.app.config.get(`datatables.engines`)

return new Datatables(engines)
Expand Down
2 changes: 1 addition & 1 deletion services/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import app from '@adonisjs/core/services/app'
import Datatables from '../src/datatables.js'
import { Datatables } from '../src/datatables.js'

let datatables: Datatables

Expand Down
2 changes: 1 addition & 1 deletion src/datatables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { DatabaseQueryBuilderContract, Dictionary } from '@adonisjs/lucid/types/
import { LucidModel, ModelQueryBuilderContract } from '@adonisjs/lucid/types/model'
import { DataTableAbstract } from './datatable_abstract.js'

export default class Datatables {
export class Datatables {
constructor(protected engines: Record<string, any>) {}

of<T extends DataTableAbstract>(...source: any): T {
Expand Down
Loading