Skip to content

Commit

Permalink
chore: move daterangepicker and moment to be managed in client/
Browse files Browse the repository at this point in the history
This commit includes:
- Removed the libs from the old scripts/yarn workflow
- Removed js.cookie.js.license file.
- Removed the old scripts of moment and daterangepicker from base.html
- And they are now included automatically by main.js

Related: WeblateOrg#12172
  • Loading branch information
meel-hd committed Nov 7, 2024
1 parent 9137fca commit b1cd3b8
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 7,304 deletions.
4 changes: 3 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
"dependencies": {
"@sentry/browser": "8.37.1",
"@tarekraafat/autocomplete.js": "10.2.9",
"autosize": "^6.0.1",
"autosize": "6.0.1",
"daterangepicker": "3.1.0",
"jquery": "3.7.1",
"moment": "2.30.1",
"tributejs": "5.1.3"
},
"devDependencies": {
Expand Down
4 changes: 4 additions & 0 deletions client/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
*/

// Imports
import datarangepicker from "daterangepicker";
import jQuery from "jquery";
import moment from "moment";

// Definitions in global scope
window.$ = jQuery;
window.jQuery = jQuery;
window.moment = moment;
window.daterangepicker = datarangepicker;
15 changes: 14 additions & 1 deletion client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,14 @@ cross-spawn@^7.0.3:
shebang-command "^2.0.0"
which "^2.0.1"

daterangepicker@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/daterangepicker/-/daterangepicker-3.1.0.tgz#718d606614331df3e774c9aba82ccd8838d45da1"
integrity sha512-DxWXvvPq4srWLCqFugqSV+6CBt/CvQ0dnpXhQ3gl0autcIDAruG1PuGG3gC7yPRNytAD1oU1AcUOzaYhOawhTw==
dependencies:
jquery ">=1.10"
moment "^2.9.0"

electron-to-chromium@^1.5.41:
version "1.5.51"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.51.tgz#bb99216fed4892d131a8585a8593b00739310163"
Expand Down Expand Up @@ -556,7 +564,7 @@ jest-worker@^27.4.5:
merge-stream "^2.0.0"
supports-color "^8.0.0"

[email protected]:
[email protected], jquery@>=1.10:
version "3.7.1"
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.7.1.tgz#083ef98927c9a6a74d05a6af02806566d16274de"
integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==
Expand Down Expand Up @@ -610,6 +618,11 @@ mime-types@^2.1.27:
dependencies:
mime-db "1.52.0"

moment@^2.30.1, moment@^2.9.0:
version "2.30.1"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae"
integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==

needle@^3.2.0:
version "3.3.1"
resolved "https://registry.yarnpkg.com/needle/-/needle-3.3.1.tgz#63f75aec580c2e77e209f3f324e2cdf3d29bd049"
Expand Down
5 changes: 0 additions & 5 deletions scripts/yarn-update
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ cp node_modules/multi.js/src/multi.css ../../weblate/static/vendor/
# Slugify
cp node_modules/slugify/slugify.js ../../weblate/static/vendor/slugify.js

# Date Range Picker
cp node_modules/daterangepicker/daterangepicker.js ../../weblate/static/vendor/
# Skip the copying of the default CSS file to avoid the Weblate style customization being overwritten
# cp node_modules/daterangepicker/daterangepicker.css ../../weblate/static/vendor/

# Moment.js
cp node_modules/moment/moment.js ../../weblate/static/vendor/

Expand Down
1 change: 0 additions & 1 deletion scripts/yarn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"main": "index.js",
"license": "GPL-3.0+",
"dependencies": {
"daterangepicker": "^3.1.0",
"mousetrap": "1.6.5",
"mousetrap-global-bind": "1.1.0",
"multi.js": "0.5.3",
Expand Down
18 changes: 0 additions & 18 deletions scripts/yarn/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,6 @@
# yarn lockfile v1


daterangepicker@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/daterangepicker/-/daterangepicker-3.1.0.tgz#718d606614331df3e774c9aba82ccd8838d45da1"
integrity sha512-DxWXvvPq4srWLCqFugqSV+6CBt/CvQ0dnpXhQ3gl0autcIDAruG1PuGG3gC7yPRNytAD1oU1AcUOzaYhOawhTw==
dependencies:
jquery ">=1.10"
moment "^2.9.0"

jquery@>=1.10:
version "3.7.1"
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.7.1.tgz#083ef98927c9a6a74d05a6af02806566d16274de"
integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==

moment@^2.9.0:
version "2.30.1"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae"
integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==

[email protected]:
version "1.1.0"
resolved "https://registry.yarnpkg.com/mousetrap-global-bind/-/mousetrap-global-bind-1.1.0.tgz#cd7de9222bd0646fa2e010d54c84a74c26a88edd"
Expand Down
2 changes: 1 addition & 1 deletion weblate/static/js/vendor/main.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions weblate/static/js/vendor/main.js.license
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Copyright (c) JS Foundation and other contributors
Copyright Dan Grossman <[email protected]> (http://www.dangrossman.info)
Copyright OpenJS Foundation and other contributors, https://openjsf.org/

SPDX-License-Identifier: MIT
Loading

0 comments on commit b1cd3b8

Please sign in to comment.