Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Commit beb4787

Browse files
authored
Merge pull request #1622 from l-lin/ng-add-bs5
Upgrade ng-add deps
2 parents 957fd68 + 082c982 commit beb4787

File tree

3 files changed

+26
-11
lines changed

3 files changed

+26
-11
lines changed

schematics/src/ng-add/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ function addPackageJsonDependencies(options: IADTSchematicsOptions) {
1818
const styleDeps = ADT_SUPPORTED_STYLES.find(e => e.style == options.style);
1919

2020
const dependencies = [
21-
{ version: '^3.4.1', name: 'jquery', isDev: false },
22-
{ version: '^1.10.20', name: 'datatables.net', isDev: false },
23-
{ version: '^3.3.33', name: '@types/jquery', isDev: true },
24-
{ version: '^1.10.18', name: '@types/datatables.net', isDev: true }
21+
{ version: '^3.6.0', name: 'jquery', isDev: false },
22+
{ version: '^1.11.3', name: 'datatables.net', isDev: false },
23+
{ version: '^3.5.9', name: '@types/jquery', isDev: true },
24+
{ version: '^1.10.21', name: '@types/datatables.net', isDev: true }
2525
];
2626

2727
if (styleDeps) {
@@ -58,8 +58,8 @@ function updateAngularJsonFile(options: IADTSchematicsOptions) {
5858
const styleDeps = ADT_SUPPORTED_STYLES.find(e => e.style == options.style);
5959

6060
const assets = [
61-
{ path: 'node_modules/jquery/dist/jquery.js', target: 'scripts', fancyName: 'jQuery Core' },
62-
{ path: 'node_modules/datatables.net/js/jquery.dataTables.js', target: 'scripts', fancyName: 'DataTables.net Core JS' },
61+
{ path: 'node_modules/jquery/dist/jquery.min.js', target: 'scripts', fancyName: 'jQuery Core' },
62+
{ path: 'node_modules/datatables.net/js/jquery.dataTables.min.js', target: 'scripts', fancyName: 'DataTables.net Core JS' },
6363
];
6464

6565
if (styleDeps) {

schematics/src/ng-add/models/style-options.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@ export enum ADTStyleOptions {
22
DT="dt",
33
BS3="bs3",
44
BS4="bs4",
5+
BS5="bs5",
56
}
67

78
export const ADT_SUPPORTED_STYLES = [
89
{
910
style: ADTStyleOptions.DT,
1011
packageJson: [
11-
{ version: '^1.10.20', name: 'datatables.net-dt', isDev: false },
12+
{ version: '^1.11.3', name: 'datatables.net-dt', isDev: false },
1213
],
1314
angularJson: [
14-
{ path: 'node_modules/datatables.net-dt/css/jquery.dataTables.css', target: 'styles', fancyName: 'DataTables.net Core CSS' },
15+
{ path: 'node_modules/datatables.net-dt/css/jquery.dataTables.min.css', target: 'styles', fancyName: 'DataTables.net Core CSS' },
1516
]
1617
},
1718
{
1819
style: ADTStyleOptions.BS3,
1920
packageJson: [
20-
{ version: '^1.10.20', name: 'datatables.net-bs', isDev: false },
21+
{ version: '^1.11.3', name: 'datatables.net-bs', isDev: false },
2122
],
2223
angularJson: [
2324
{ path: 'node_modules/datatables.net-bs/css/dataTables.bootstrap.min.css', target: 'styles', fancyName: 'DataTables.net Bootstrap 3 CSS' },
@@ -27,11 +28,21 @@ export const ADT_SUPPORTED_STYLES = [
2728
{
2829
style: ADTStyleOptions.BS4,
2930
packageJson: [
30-
{ version: '^1.10.20', name: 'datatables.net-bs4', isDev: false },
31+
{ version: '^1.11.3', name: 'datatables.net-bs4', isDev: false },
3132
],
3233
angularJson: [
3334
{ path: 'node_modules/datatables.net-bs4/css/dataTables.bootstrap4.min.css', target: 'styles', fancyName: 'DataTables.net Bootstrap 4 CSS' },
3435
{ path: 'node_modules/datatables.net-bs4/js/dataTables.bootstrap4.min.js', target: 'scripts', fancyName: 'DataTables.net Bootstrap 4 JS' },
3536
]
3637
},
38+
{
39+
style: ADTStyleOptions.BS5,
40+
packageJson: [
41+
{ version: '^1.11.3', name: 'datatables.net-bs5', isDev: false },
42+
],
43+
angularJson: [
44+
{ path: 'node_modules/datatables.net-bs5/css/dataTables.bootstrap5.min.css', target: 'styles', fancyName: 'DataTables.net Bootstrap 5 CSS' },
45+
{ path: 'node_modules/datatables.net-bs5/js/dataTables.bootstrap5.min.js', target: 'scripts', fancyName: 'DataTables.net Bootstrap 5 JS' },
46+
]
47+
},
3748
]

schematics/src/ng-add/schema.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"description": "The styling library to use for Datatables.",
1717
"type": "string",
1818
"default": "dt",
19-
"enum": ["dt", "bs3", "bs4"],
19+
"enum": ["dt", "bs3", "bs4", "bs5"],
2020
"x-prompt": {
2121
"message": "Which styling library would you like to use for DataTables?",
2222
"type": "list",
@@ -29,6 +29,10 @@
2929
{
3030
"value": "bs4",
3131
"label": "Bootstrap 4"
32+
},
33+
{
34+
"value": "bs5",
35+
"label": "Bootstrap 5"
3236
}
3337
]
3438
}

0 commit comments

Comments
 (0)