Skip to content

Commit

Permalink
Update non-SPA dependencies: bootstrap, datatables-bootstrap4, jszip,…
Browse files Browse the repository at this point in the history
… moment

Fix the viteStaticCopy configuration, swapped vite static copy plugin for rollup-copy because the latter can copy outside of the build directory.
Updated a bunch of frontend deps
Retired bootstrap-tagsinput because it had a CVE with no fix.
  • Loading branch information
mosen committed Jan 16, 2024
1 parent 4309630 commit 5db3a8a
Show file tree
Hide file tree
Showing 14 changed files with 267 additions and 288 deletions.
359 changes: 167 additions & 192 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"bootstrap": "^4.6.2",
"bootstrap-4-autocomplete": "^1.3.2",
"bootstrap-markdown": "^2.10.0",
"bootstrap-tagsinput": "^0.7.1",
"bootstrap-vue": "^2.23.1",
"bootstrap4-tagsinput": "^4.1.3",
"click-outside-vue3": "^4.0.1",
Expand Down Expand Up @@ -75,12 +74,12 @@
"laravel-vite-plugin": "^0.8.1",
"lodash": "^4.17.19",
"postcss": "^8.4.14",
"rollup-plugin-copy": "^3.5.0",
"tailwindcss": "^3.1.0",
"tslib": "^2.5.0",
"typescript": "^5.1.6",
"vite": "^4.4.0",
"vite-plugin-simple-gql": "^0.5.0",
"vite-plugin-static-copy": "^0.17.0",
"vue-tsc": "^1.8.19"
}
}
2 changes: 1 addition & 1 deletion public/assets/css/dataTables.bootstrap4.min.css

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions public/assets/js/bootstrap-tagsinput.min.js

This file was deleted.

6 changes: 3 additions & 3 deletions public/assets/js/bootstrap.min.js

Large diffs are not rendered by default.

66 changes: 42 additions & 24 deletions public/assets/js/dataTables.bootstrap4.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
* ©2011-2017 SpryMedia Ltd - datatables.net/license
*/

/**
* DataTables integration for Bootstrap 4. This requires Bootstrap 4 and
* DataTables 1.10 or newer.
*
* This file sets the defaults and adds options to DataTables to style its
* controls using Bootstrap. See http://datatables.net/manual/styling/bootstrap
* for further information.
*/
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
Expand All @@ -19,20 +11,33 @@
}
else if ( typeof exports === 'object' ) {
// CommonJS
module.exports = function (root, $) {
if ( ! root ) {
root = window;
var jq = require('jquery');
var cjsRequires = function (root, $) {
if ( ! $.fn.dataTable ) {
require('datatables.net')(root, $);
}
};

if ( ! $ || ! $.fn.dataTable ) {
// Require DataTables, which attaches to jQuery, including
// jQuery if needed and have a $ property so we can access the
// jQuery object that is used
$ = require('datatables.net')(root, $).$;
}
if (typeof window === 'undefined') {
module.exports = function (root, $) {
if ( ! root ) {
// CommonJS environments without a window global must pass a
// root. This will give an error otherwise
root = window;
}

return factory( $, root, root.document );
};
if ( ! $ ) {
$ = jq( root );
}

cjsRequires( root, $ );
return factory( $, root, root.document );
};
}
else {
cjsRequires( window, jq );
module.exports = factory( jq, window, window.document );
}
}
else {
// Browser
Expand All @@ -43,6 +48,16 @@
var DataTable = $.fn.dataTable;



/**
* DataTables integration for Bootstrap 4. This requires Bootstrap 4 and
* DataTables 1.10 or newer.
*
* This file sets the defaults and adds options to DataTables to style its
* controls using Bootstrap. See http://datatables.net/manual/styling/bootstrap
* for further information.
*/

/* Set the defaults for DataTables initialisation */
$.extend( true, DataTable.defaults, {
dom:
Expand All @@ -69,7 +84,7 @@ DataTable.ext.renderer.pageButton.bootstrap = function ( settings, host, idx, bu
var classes = settings.oClasses;
var lang = settings.oLanguage.oPaginate;
var aria = settings.oLanguage.oAria.paginate || {};
var btnDisplay, btnClass, counter=0;
var btnDisplay, btnClass;

var attach = function( container, buttons ) {
var i, ien, node, button;
Expand Down Expand Up @@ -128,17 +143,22 @@ DataTable.ext.renderer.pageButton.bootstrap = function ( settings, host, idx, bu
}

if ( btnDisplay ) {
var disabled = btnClass.indexOf('disabled') !== -1;

node = $('<li>', {
'class': classes.sPageButton+' '+btnClass,
'id': idx === 0 && typeof button === 'string' ?
settings.sTableId +'_'+ button :
null
} )
.append( $('<a>', {
'href': '#',
'href': disabled ? null : '#',
'aria-controls': settings.sTableId,
'aria-disabled': disabled ? 'true' : null,
'aria-label': aria[ button ],
'data-dt-idx': counter,
'role': 'link',
'aria-current': btnClass === 'active' ? 'page' : null,
'data-dt-idx': button,
'tabindex': settings.iTabIndex,
'class': 'page-link'
} )
Expand All @@ -149,8 +169,6 @@ DataTable.ext.renderer.pageButton.bootstrap = function ( settings, host, idx, bu
settings.oApi._fnBindAction(
node, {action: button}, clickHandler
);

counter++;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions public/assets/js/jquery.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions public/assets/js/jszip.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/assets/js/moment.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions public/assets/themes/Default/bootstrap.min.css

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions resources/views/clients/detail.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

@push('stylesheets')
<link rel="stylesheet" href="{{ asset('assets/css/bootstrap-markdown.min.css') }}" />
<link rel="stylesheet" href="{{ asset('assets/css/bootstrap-tagsinput.css') }}" />
{{--<link rel="stylesheet" href="{{ asset('assets/css/bootstrap4-tagsinput.css') }}" />--}}
<link rel="stylesheet" href="{{ asset('assets/css/tagsinput.css') }}" />
@endpush

@push('scripts')
<script src="{{ asset('assets/js/bootstrap-markdown.js') }}"></script>
<script src="{{ asset('assets/js/bootstrap-tagsinput.min.js') }}"></script>
{{-- <script src="{{ asset('assets/js/bootstrap4-tagsinput.js') }}">--}}
<script src="{{ asset('assets/js/tagsinput.js') }}"></script>
<script src="{{ asset('assets/js/typeahead.bundle.min.js') }}"></script>
@endpush

Expand Down
3 changes: 0 additions & 3 deletions resources/views/errors/426.blade.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
@extends('layouts.blank')

@push('stylesheets')
<link rel="stylesheet" href="{{ asset('assets/css/bootstrap-tagsinput.css') }}" />
@endpush

@push('scripts')
<script src="{{ asset('assets/js/bootstrap-tagsinput.min.js') }}"></script>
<script src="{{ asset('assets/js/typeahead.bundle.min.js') }}"></script>
@endpush

@section('content')
Expand Down
10 changes: 5 additions & 5 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { resolve } from 'path'
import laravel from 'laravel-vite-plugin';
import gql from 'vite-plugin-simple-gql';
import vue from '@vitejs/plugin-vue';
import { viteStaticCopy } from 'vite-plugin-static-copy';
import copy from 'rollup-plugin-copy'
import basicSsl from '@vitejs/plugin-basic-ssl'
import staticCopyFiles from './vite.copy';
// import * as path from "path";
Expand All @@ -28,10 +28,10 @@ export default defineConfig({
gql(),
basicSsl(),

// This is quite ugly but allows us to keep MunkiReport v5 compatible libraries in the same build tool as v6 and
// preserve the ability to manage their versions through package.json.
// Note that v5 usually didn't have a transpiler. Dependencies were just added to head/body as needed.
viteStaticCopy(staticCopyFiles)
// This is quite ugly but allows us to keep MunkiReport v5 compatible libraries in the same build tool as v6 and
// preserve the ability to manage their versions through package.json.
// Note that v5 usually didn't have a transpiler. Dependencies were just added to head/body as needed.
copy(staticCopyFiles)
],
optimizeDeps: {
exclude: [
Expand Down
Loading

0 comments on commit 5db3a8a

Please sign in to comment.