Skip to content

Commit 0eacba5

Browse files
committed
feat (package.json): dependencies update
1 parent 1ef8e04 commit 0eacba5

File tree

6 files changed

+56
-55
lines changed

6 files changed

+56
-55
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20.18.0
1+
22.14.0

build/OneLoop.js

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ var getElements = (element, context) => typeof element === 'string' ?
381381
:
382382
element.length >= 0 ? element : [element];
383383

384-
const instances = [];
384+
const instances$2 = [];
385385

386386
class ThrottledEvent extends MainLoopEntry {
387387
constructor(target, eventType, name) {
@@ -418,10 +418,10 @@ class ThrottledEvent extends MainLoopEntry {
418418
}
419419

420420
destroy() {
421-
const index = instances.indexOf(this);
421+
const index = instances$2.indexOf(this);
422422

423423
if (index > -1) {
424-
instances.splice(index, 1);
424+
instances$2.splice(index, 1);
425425
}
426426

427427
this._target.removeEventListener(this._eventType, this._onEvent);
@@ -477,25 +477,25 @@ class ThrottledEvent extends MainLoopEntry {
477477

478478
name = name || '';
479479

480-
for (let i = 0; i < instances.length; i++) {
481-
let instance = instances[i];
480+
for (let i = 0; i < instances$2.length; i++) {
481+
let instance = instances$2[i];
482482
if (instance._eventType === eventType && instance._target === target && instance._name === name) {
483-
found = instances[i];
483+
found = instances$2[i];
484484
break
485485
}
486486
}
487487

488488
if (!found) {
489489
found = new ThrottledEvent(target, eventType, name);
490-
instances.push(found);
490+
instances$2.push(found);
491491
}
492492

493493
return found
494494
}
495495

496496
static destroy() {
497-
while (instances[0]) {
498-
instances[0].destroy();
497+
while (instances$2[0]) {
498+
instances$2[0].destroy();
499499
}
500500
}
501501
}
@@ -722,7 +722,7 @@ function getMinOrMax(v) {
722722
const
723723
instances$1 = [];
724724
let autoRefreshTimer = null,
725-
resize = null,
725+
resize$1 = null,
726726
scroll = null;
727727

728728
class ScrollObserver extends MainLoopEntry {
@@ -737,10 +737,10 @@ class ScrollObserver extends MainLoopEntry {
737737
this._needsUpdate = true;
738738
this._lastSize = getDocumentScrollSize();
739739

740-
resize = resize || new ThrottledEvent(window, 'resize');
740+
resize$1 = resize$1 || new ThrottledEvent(window, 'resize');
741741
scroll = scroll || new ThrottledEvent(window, 'scroll');
742742

743-
resize.add('resize', this._onResize);
743+
resize$1.add('resize', this._onResize);
744744
scroll.add('scrollstart', this._onScroll);
745745

746746
instances$1.push(this);
@@ -757,11 +757,11 @@ class ScrollObserver extends MainLoopEntry {
757757

758758
if (instances$1.length === 0) {
759759
ScrollObserver.stopAutoRefresh();
760-
resize.destroy();
760+
resize$1.destroy();
761761
scroll.destroy();
762-
resize = scroll = null;
762+
resize$1 = scroll = null;
763763
} else {
764-
resize.remove('resize', this._onResize);
764+
resize$1.remove('resize', this._onResize);
765765
scroll.remove('scrollstart', this._onScroll);
766766
}
767767
}
@@ -904,10 +904,10 @@ ScrollObserver.autoRefreshDelay = 1000;
904904
/* eslint-disable no-empty-character-class */
905905

906906
const
907-
instances$2 = [],
907+
instances = [],
908908
specialCharRegExp = /(((?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|[\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|[\ud83c[\ude32-\ude3a]|[\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])((\u200D(\u2640|\u2642)\uFE0F)|[]))|&([a-zA-Z]{2,6}|#[0-9]{2,5});|<|>)/g,
909909
whiteCharRegExp = /(\s)/;
910-
let resize$1 = null;
910+
let resize = null;
911911

912912
class SplittedText {
913913
constructor(element, options) {
@@ -917,35 +917,35 @@ class SplittedText {
917917
this._element = element;
918918
this._onResize = this.split.bind(this);
919919

920-
if (!resize$1) {
921-
resize$1 = new ThrottledEvent(window, 'resize');
920+
if (!resize) {
921+
resize = new ThrottledEvent(window, 'resize');
922922
}
923923

924924
if (this.autoSplit) {
925925
this.split();
926926
}
927927

928-
instances$2.push(this);
928+
instances.push(this);
929929
}
930930

931931
destroy() {
932-
const index = instances$2.indexOf(this);
932+
const index = instances.indexOf(this);
933933

934934
if (index > -1) {
935935
this.restore();
936936

937-
instances$2.splice(index, 1);
937+
instances.splice(index, 1);
938938

939-
if (!instances$2.length) {
940-
resize$1.destroy();
941-
resize$1 = null;
939+
if (!instances.length) {
940+
resize.destroy();
941+
resize = null;
942942
}
943943
}
944944
}
945945

946946
restore() {
947947
this._element.innerHTML = this._originalInnerHTML;
948-
resize$1.remove('resize', this._onResize);
948+
resize.remove('resize', this._onResize);
949949

950950
return this
951951
}
@@ -973,7 +973,7 @@ class SplittedText {
973973
html = '',
974974
lastOffsetTop = children[0].offsetTop;
975975

976-
resize$1.add('resize', this._onResize);
976+
resize.add('resize', this._onResize);
977977

978978
for (let i = 0; i < children.length; i++) {
979979
const
@@ -1117,8 +1117,8 @@ function wrapByWord(element, wrapper) {
11171117
// static
11181118
// ----
11191119
SplittedText.destroy = function() {
1120-
while (instances$2[0]) {
1121-
instances$2[0].destroy();
1120+
while (instances[0]) {
1121+
instances[0].destroy();
11221122
}
11231123
};
11241124

build/OneLoop.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "oneloop.js",
3-
"version": "5.2.1",
3+
"version": "5.2.2",
44
"description": "Javascript animation library. Provide scroll observer, tween, throttled event, splitted text, vector2, easings in a bundle of about 5kb gzipped",
55
"type": "module",
66
"main": "./build/OneLoop.min.js",
@@ -35,11 +35,11 @@
3535
"splitted-text",
3636
"throttled-event"
3737
],
38-
"dependencies": {
39-
"concurrently": "5.3.0",
38+
"devDependencies": {
39+
"concurrently": "^9.1.2",
4040
"eslint": "8.36.0",
4141
"http-server": "^14.1.1",
42-
"rollup": "1.32.1",
43-
"rollup-plugin-uglify": "6.0.4"
42+
"rollup": "^4.40.2",
43+
"rollup-plugin-esbuild-minify": "^1.3.0"
4444
}
4545
}

rollup.config.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
import rollupInsertInformations from './rollup/rollup-insert-informations';
2-
import rollupInsertConstants from './rollup/rollup-insert-constants';
3-
import rollupManglePrivateProperties from './rollup/rollup-mangle-private-properties';
4-
import { uglify } from "rollup-plugin-uglify";
1+
import rollupInsertInformations from './rollup/rollup-insert-informations.js'
2+
import rollupInsertConstants from './rollup/rollup-insert-constants.js'
3+
import rollupManglePrivateProperties from './rollup/rollup-mangle-private-properties.js'
4+
import { minify } from 'rollup-plugin-esbuild-minify'
55

6-
const plugins = [];
7-
let fileName = 'OneLoop';
6+
const plugins = []
7+
let fileName = 'OneLoop'
88

9+
/* eslint-disable-next-line no-undef */
910
if (process.env.BUILD === 'production') {
10-
fileName += '.min';
11-
plugins.push(rollupInsertConstants);
12-
plugins.push(rollupManglePrivateProperties);
13-
plugins.push(uglify({
14-
toplevel: true
15-
}));
11+
fileName += '.min'
12+
plugins.push(rollupInsertConstants)
13+
plugins.push(rollupManglePrivateProperties)
14+
plugins.push(minify())
1615
}
1716

18-
plugins.push(rollupInsertInformations);
17+
plugins.push(rollupInsertInformations)
1918

2019
export default {
2120
input: 'src/main.js',
@@ -24,4 +23,4 @@ export default {
2423
file: 'build/' + fileName + '.js',
2524
format: 'es'
2625
}
27-
};
26+
}

rollup/rollup-insert-informations.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
import { version, author, license, repository } from '../package.json'
1+
import { readFileSync } from 'fs'
2+
3+
const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'))
24

35
export default {
46
name: 'rollup-insert-informations',
57
renderChunk: function(code) {
68
return `/**
79
* @license
810
* Copyright 2022 OneLoop.js
9-
* Author: ${ author }
10-
* Repository: ${ repository.url }
11-
* Version: ${ version }
12-
* SPDX-License-Identifier: ${ license }
11+
* Author: ${ pkg.author }
12+
* Repository: ${ pkg.repository.url }
13+
* Version: ${ pkg.version }
14+
* SPDX-License-Identifier: ${ pkg.license }
1315
*
1416
* Credit for easing functions goes to : https://github.com/ai/easings.net/blob/master/src/easings/easingsFunctions.ts
1517
* Credit for Emoji regexp goes to : https://medium.com/reactnative/emojis-in-javascript-f693d0eb79fb

0 commit comments

Comments
 (0)