Skip to content

Commit

Permalink
Update node and webpack versions; remove gulp
Browse files Browse the repository at this point in the history
  • Loading branch information
fdintino committed Dec 19, 2021
1 parent e93779d commit c919310
Show file tree
Hide file tree
Showing 18 changed files with 5,269 additions and 14,669 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"sourceType": "unambiguous",
"plugins": ["@babel/plugin-transform-runtime"],
"presets": [
["@babel/env", {
"loose": true,
"useBuiltIns": "usage",
"corejs": 2,
"targets": {
"browsers": ["last 2 versions", "safari >= 7", "ie 9"],
"node": "8"
Expand Down
125 changes: 0 additions & 125 deletions gulp/browserify.js

This file was deleted.

35 changes: 0 additions & 35 deletions gulp/sass.js

This file was deleted.

17 changes: 0 additions & 17 deletions gulp/watchtask.js

This file was deleted.

44 changes: 0 additions & 44 deletions gulpfile.babel.js

This file was deleted.

4 changes: 2 additions & 2 deletions nested_admin/static/nested_admin/src/nested-admin/grp$.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const $ = require('jquery');
import $ from 'jquery';

/**
* For grappelli 2.14, converts a django.jQuery instance to a grp.jQuery
Expand All @@ -20,4 +20,4 @@ function grp$($sel) {
return $grpSel;
}

module.exports = grp$;
export default grp$;
12 changes: 7 additions & 5 deletions nested_admin/static/nested_admin/src/nested-admin/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const $ = require('jquery');
const grappelli = require('grappelli');
const DJNesting = require('./utils');
DJNesting.DjangoFormset = require('./jquery.djangoformset');
import $ from 'jquery';
import * as grappelli from 'grappelli';
import DJNesting from './utils';
import DjangoFormset from './jquery.djangoformset';

DJNesting.DjangoFormset = DjangoFormset;

$(document).ready(function() {
// Remove the border on any empty fieldsets
Expand Down Expand Up @@ -37,4 +39,4 @@ $(document).ready(function() {
});
});

module.exports = DJNesting;
export default DJNesting;
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
'use strict';
import $ from 'jquery';

const $ = require('jquery');
const regexQuote = require('./regexquote');
const DJNesting = require('./utils');
const grappelli = require('grappelli');
const grp = require('grp');
const grp$ = require('./grp$');
import regexQuote from './regexquote';
import DJNesting from './utils';
import * as grappelli from 'grappelli';
import grp from 'grp';
import grp$ from './grp$';
// const grp = require('grp');
// const grp$ = require('./grp$');

var pluginName = 'djangoFormset';

Expand Down Expand Up @@ -583,4 +584,4 @@ $.fn[pluginName] = function() {
}
};

module.exports = DjangoFormset;
export default DjangoFormset;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const $ = require('jquery');
import $ from 'jquery';

var prefixCache = {};

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = window.django.jQuery;
export default window.django.jQuery;
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
'use strict';

const $ = require('jquery');
import $ from "jquery";
/*!
* jQuery UI Sortable @VERSION
* http://jqueryui.com
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict';

const $ = require('jquery');
require('./jquery.ui.djnsortable');
import $ from 'jquery';
import './jquery.ui.djnsortable';

/*
* jQuery UI Nested Sortable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module.exports = function regexQuote(str) {
function regexQuote(str) {
return (str+'').replace(/([\.\?\*\+\^\$\[\]\\\(\)\{\}\|\-])/g, '\\$1');
};
}

export default regexQuote;
10 changes: 4 additions & 6 deletions nested_admin/static/nested_admin/src/nested-admin/sortable.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

const $ = require('jquery');
const regexQuote = require('./regexquote');
require('./jquery.ui.nestedsortable');
import $ from 'jquery';
import regexQuote from './regexquote';
import './jquery.ui.nestedsortable';

function updatePositions(prefix) {
var position = 0, // the value of the position formfield
Expand Down Expand Up @@ -230,4 +228,4 @@ function createSortable($group) {
});
}

module.exports = {updatePositions, createSortable};
export {updatePositions, createSortable};
15 changes: 6 additions & 9 deletions nested_admin/static/nested_admin/src/nested-admin/utils.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
'use strict';

/* globals SelectFilter, DateTimeShortcuts */

const $ = require('jquery');
require('./jquery.djnutils.js');
const {createSortable, updatePositions} = require('./sortable');
const regexQuote = require('./regexquote');
const grp$ = require('./grp$');
import $ from 'jquery';
import './jquery.djnutils';
import { createSortable, updatePositions } from "./sortable";
import regexQuote from "./regexquote";
import grp$ from "./grp$";

var DJNesting = (typeof window.DJNesting != 'undefined')
? window.DJNesting : {};
Expand Down Expand Up @@ -282,4 +279,4 @@ grpFuncs.forEach((funcName) => {
}(0));
});

module.exports = DJNesting;
export default DJNesting;
Loading

0 comments on commit c919310

Please sign in to comment.