Skip to content

Commit 30646fd

Browse files
authored
Merge pull request #20 from adityadarma/dev
feat: add release rule
2 parents 1edcbca + b377d06 commit 30646fd

File tree

7 files changed

+21
-11
lines changed

7 files changed

+21
-11
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ jobs:
3030
uses: actions/checkout@v3
3131
with:
3232
token: ${{ secrets.GITHUB_TOKEN }}
33-
# Setup .npmrc file to publish to npm
3433
- name: Setup Node.JS
3534
uses: actions/setup-node@v4
3635
with:

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
matrix:
1313
os: [ubuntu-latest, windows-latest]
1414
node-version:
15-
- 20.10.0
15+
- 20.x
1616
- 21.x
1717
steps:
1818
- uses: actions/checkout@v4

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# @adityadarma/adonis-datatables
22

3-
<br />
4-
53
[![gh-workflow-image]][gh-workflow-url] [![npm-image]][npm-url] [![npm-downloads]][npm-downloads] ![][typescript-image] [![license-image]][license-url]
64

75
Adonis datatable is an inspiration from laravel datatable. It is heavily inspired by the PHP library [Laravel Datatables](https://yajrabox.com/docs/laravel-datatables) and even share some code.

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99

1010
export { configure } from './configure.js'
1111
export { stubsRoot } from './stubs/main.js'
12-
export { defineConfig } from './src/define_config.js'
12+
export { defineConfig } from './src/define_config/index.js'

package.json

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"tagName": "v${version}"
103103
},
104104
"github": {
105-
"release": false
105+
"release": true
106106
},
107107
"npm": {
108108
"publish": true,
@@ -112,7 +112,21 @@
112112
"@release-it/conventional-changelog": {
113113
"preset": {
114114
"name": "angular"
115-
}
115+
},
116+
"releaseRules": [
117+
{
118+
"type": "breaking",
119+
"release": "major"
120+
},
121+
{
122+
"type": "feat",
123+
"release": "minor"
124+
},
125+
{
126+
"type": "fix",
127+
"release": "patch"
128+
}
129+
]
116130
}
117131
}
118132
},

src/datatables.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Exception } from '@adonisjs/core/exceptions'
22
import LucidDataTable from './engines/lucid_datatable.js'
33
import DatabaseDataTable from './engines/database_datatable.js'
44
import ObjectDataTable from './engines/object_datatable.js'
5-
import { Collection } from 'collect.js'
65
import { DatabaseQueryBuilderContract, Dictionary } from '@adonisjs/lucid/types/querybuilder'
76
import { LucidModel, ModelQueryBuilderContract } from '@adonisjs/lucid/types/model'
87
import { DataTableAbstract } from './datatable_abstract.js'
@@ -34,7 +33,7 @@ export default class Datatables {
3433
return DatabaseDataTable.create(source)
3534
}
3635

37-
static object(source: Record<string, any>[] | Collection<Record<string, any>>) {
38-
return ObjectDataTable.create(source as Collection<Record<string, any>>)
36+
static object(source: Record<string, any>[]) {
37+
return ObjectDataTable.create(source)
3938
}
4039
}

src/define_config.ts renamed to src/define_config/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Config } from './types/index.js'
1+
import { Config } from '../types/index.js'
22

33
export function defineConfig(config: Config): Config {
44
return config

0 commit comments

Comments
 (0)