75 Commits

Author SHA1 Message Date
Ruslan Kabalin
6ae753406b MDL-74301 eslint: Upgrade eslint and babel
This patch includes changes:
* Upgrade "@babel/core" to latest point release
* Remove plugins already included into current "@babel/preset-env":
  - "@babel/plugin-proposal-class-properties"
  - "@babel/plugin-proposal-json-strings"
  - "@babel/plugin-syntax-dynamic-import"
  - "@babel/plugin-syntax-import-meta"
* Upgrade "eslint" to latest version
* Replace "eslint-plugin-babel" (depreacted in 2019) with "@babel/eslint-parser" and "@babel/eslint-plugin"
2023-07-03 15:21:53 +01:00
Eloy Lafuente (stronk7)
5d9eae8042 MDL-73610 nodejs: Small updates to required packages
The main goal of this issue is to avoid scanners (Dependabot
and friends), reporting about security issues with the current
xmldom 0.6.0 package.

Note that this doesn't affect prod at all, because it's a dev
dependency, hardly exploitable. So it's not a security fix, just
a security_benefit, if something.

So here, we are updating from xmldom 0.6.0 to @xmldom/xmldom 0.8.7
(note that the package was renamed in 0.7.0, so it's the very same)

Also, when proceeding with the changes, it was detected that we
are incorrectly declaring @babel/eslint-parser as a normal dependency
instead of a development one, so we are also fixing that little detail.

The commands executed to get the changes above applied have been:

- nvm use
- npm install @xmldom/xmldom@^0.8.7 --save-dev
- npm uninstall xmldom
- npm install @babel/eslint-parser@^7.17.0 --save-dev

(we haven't run a complete re-install because we only want to modify
the minimum possible at this stage).
2023-04-06 14:59:33 +02:00
Andrew Nicols
cadd534db5 Merge branch 'MDL-76802-master' of https://github.com/sarjona/moodle 2023-03-14 21:40:45 +08:00
Sara Arjona
f0a20c0a76 MDL-76802 core: Create a grunt task to get upgradable libs
A new grunt task, upgradablelibs, has been added in order to get the
list of libraries that have a newer version in their repositories.

Co-author: Andrew Lyons <andrew@moodle.com>
2023-03-13 11:53:23 +01:00
Petr Skoda
98bcff8d8e MDL-73144 core: switch to Dart sass 2023-03-10 16:25:17 +01:00
Andrew Nicols
a9f2cb6926 MDL-77559 js: Revert "MDL-75012 core: Bump NodeJS version requirements"
This reverts commit 6d0fdd8fd8c26b50fae894839a63880f8ca6009c.
2023-03-09 08:22:08 +08:00
Andrew Nicols
3c2be0bf6d MDL-77559 js: Revert "MDL-75012 js: Bump standard dependencies"
This reverts commit f70d9a3eef11b25c1683332c94c89bd7aaf91aab.
2023-03-09 08:21:55 +08:00
Andrew Nicols
7081e0beb0 MDL-77559 js: Revert "MDL-75012 js: Remove grunt-contrib-uglify"
This reverts commit abb687759651b59ced572ec77d99fa468cf63d6d.
2023-03-09 08:21:36 +08:00
Andrew Nicols
ab981109ef MDL-77559 js: Revert "MDL-75012 js: Bump stylelint and components"
This reverts commit 1c73373b3d2aa417d1aae0699f7e61e1b75d3a5d.
2023-03-09 08:21:22 +08:00
Andrew Nicols
faea97bd56 MDL-77559 js: Revert "MDL-75012 js: Update browserslist"
This reverts commit 19f5ffb28ab4af3fcb05bc9e7afb2c196bef93ff.
2023-03-09 08:21:19 +08:00
Andrew Nicols
b90a48dd46 MDL-77559 js: Revert "MDL-75012 js: Bump node-sass"
This reverts commit 7c3db6d4583bee040391f55b5719dbb8f14380f3.
2023-03-09 08:21:15 +08:00
Andrew Nicols
9d7929cc15 MDL-77559 js: Revert "MDL-75012 js: Use our own jsdoc wrapper"
This reverts commit 5d0631b6a16d012b41c94c4f7c512989e17433dd.
2023-03-09 08:21:07 +08:00
Andrew Nicols
73bc2604f0 MDL-77559 js: Revert "MDL-75012 js: Bump shifter to new version"
This reverts commit b3f7721cdd18dc0598c6b1fb79dedc8fb18d2ba3.
2023-03-09 08:21:03 +08:00
Andrew Nicols
551c058b08 MDL-77559 js: Revert "MDL-75012 js: Put shifter on a diet"
This reverts commit 784098fe9e6dec5a39317d91ea08c771ff893b76.
2023-03-09 08:20:57 +08:00
Andrew Nicols
103892b3f0 MDL-77559 js: Revert "MDL-75012 js: Remove unused babel-preset-minify dependency"
This reverts commit ed3c951001a1c57db9eb8e498f64523bb1d9c1d5.
2023-03-09 08:20:49 +08:00
Andrew Nicols
63cab4a560 MDL-77559 js: Revert "MDL-75012 js: Bump Babel dependencies"
This reverts commit ee0e2bcc8f55e719b32b905fc31b44a317c0ad60.
2023-03-09 08:20:45 +08:00
Andrew Nicols
ee0e2bcc8f MDL-75012 js: Bump Babel dependencies
Please note that whilst some dependencies have higher versions
available, these are not compatible at this time.
2023-03-02 11:55:32 +08:00
Andrew Nicols
ed3c951001 MDL-75012 js: Remove unused babel-preset-minify dependency 2023-03-02 11:55:31 +08:00
Andrew Nicols
784098fe9e MDL-75012 js: Put shifter on a diet
This commit switches to a new custom version of Shifter which sees it
put on a massive diet.

Many of the standard Shifter features are totally unused by Moodle, but
they add dependency spaghetti. Some of those dependencies will start to
cause us issues as they have not been updated for a very long time, are
no longer maintained, and are no longer compatible with anything
resembling a recent version of NodeJS.
2023-02-28 10:22:45 +08:00
Andrew Nicols
b3f7721cdd MDL-75012 js: Bump shifter to new version
This resolves an issue identified in 77083 which identified that GitHub
hashes shouldn't be treated as repeatable.

Whilst GitHub have reverted this change, it's still worth making this
change.
2023-02-28 10:19:51 +08:00
Andrew Nicols
5d0631b6a1 MDL-75012 js: Use our own jsdoc wrapper
grunt-jsdoc is abandoned and only works with an older version of jsdoc.

This is a very simple wrapper around jsdoc itself.
2023-02-28 10:19:51 +08:00
Andrew Nicols
7c3db6d458 MDL-75012 js: Bump node-sass 2023-02-28 10:19:51 +08:00
Andrew Nicols
19f5ffb28a MDL-75012 js: Update browserslist
To avoid build changes we exclude older versions of Android browser
2023-02-28 10:19:51 +08:00
Andrew Nicols
1c73373b3d MDL-75012 js: Bump stylelint and components 2023-02-28 10:19:50 +08:00
Andrew Nicols
abb6877596 MDL-75012 js: Remove grunt-contrib-uglify
We stopped using this when we updated our processes to support ESMs in
MDL-62497. Removal of the dependency was missed at the time.
2023-02-28 10:19:50 +08:00
Andrew Nicols
f70d9a3eef MDL-75012 js: Bump standard dependencies
This change bumps dependencies which have no impact upon the build
process
2023-02-28 10:19:50 +08:00
Andrew Nicols
6d0fdd8fd8 MDL-75012 core: Bump NodeJS version requirements 2023-02-28 10:19:50 +08:00
Andrew Nicols
38fff2d83f MDL-74511 core: Add phpcs config generator 2022-04-18 15:38:14 +08:00
Andrew Nicols
0a4047ab31 MDL-73915 js: Switch amd minification to terser
Unfortunately the babel minify-mangle plugin seems to be abandoned and
in certain circumstances can be very buggy. The only safe options are to
disable it, or to switch to a different minification library.

Not minifying our javascript is not ideal, so this commit updates the
javascript tasks to use a rollup, combined with babel, and terser.

Babel still converts code from ES/UMD/AMD to AMD modules with the
relevant browser support, whilst terser minifies the code.

The rollup bundler handles tracking and creation of sourcemaps, and
supports better parallelisation of the tasks.

Since the upgrade to Node LTS/Gallium requires an upgrade to @babel/core
and eslint, which change the built files anyway, this seems like the
ideal time to make this change.
2022-02-23 08:55:09 +08:00
Andrew Nicols
aa7f7957ea MDL-73915 js: Upgrade babel and eslint 2022-02-23 08:53:54 +08:00
Andrew Nicols
4ce17e604c MDL-73915 js: Upgrade packages 2022-02-23 08:51:54 +08:00
Andrew Nicols
ef74e31086 MDL-73915 js: Switch to nodejs lts/gallium 2022-02-23 08:51:54 +08:00
Andrew Nicols
1d1b3d1842 MDL-73915 js: Upgrade node-sass 2022-02-23 08:51:53 +08:00
Bas Brands
cdb651d46a MDL-71691 core_course: section styling 2021-12-08 13:14:05 +01:00
Andrew Nicols
4c1e0dcb19 MDL-72013 js: Add eslint-jsdoc plugin 2021-10-21 13:28:04 +08:00
Eloy Lafuente (stronk7)
43f39046b3 MDL-72623 nodejs: Bump from v14.15.0 to v14.18.0
Without modifying any installed package or dependency
because, after trying to do so, the updated stuff is huge
and leads to some JS validation / minimisation problems.
2021-10-13 09:49:48 +02:00
Eloy Lafuente (stronk7)
4162b92af9 MDL-72014 nodejs: audit fix to solve some security reports
Simply run npm audit fix that updates these main packages:

- xmldom 0.6.0
- grunt 1.4.1
- gherkin-lint 4.2.2

(and also a bunch of dependencies)
2021-08-20 13:49:46 +02:00
Andrew Nicols
fa073102d3 MDL-61460 Grunt: Add Component Library tasks
This new task handles building of component library documentation,
including the markdown to HTML, an index of the generated content used
for searching, and the CSS for the component library.
2021-07-08 09:51:02 +08:00
Andrew Nicols
1a62c82fef MDL-71113 js: Add jsdoc configuration and Grunt 2021-06-18 09:38:04 +08:00
Andrew Nicols
3354f1f93a MDL-69815 core: Bump Node to v14.15.0 (LTS/Fermium) 2020-10-28 09:34:31 +08:00
Andrew Nicols
4ad0f38a82 MDL-66109 js: Upgrade to latest version of Shifter
This change bumps the version of Shifter that we use to the final
release - version 1.2.0.

I strongly doubt that there will be more releases, and this release was
over two years ago.

This version uses a newer version of Istanbul, and fixes to use that
specific version of Istanbul. As a result I have forked Shifter and
applied the Moodle Circular Dependency fixes there instead.

This version also inludes an upgrade to uglify from 1.3.x to 2.4.x. This
major upgrade includes a some changes to the built YUI module code.
2020-05-11 11:07:49 +08:00
Andrew Nicols
5b4debd2b0 MDL-66109 js: Upgrade Node dependencies
This change updates most libraries used in our Grunt build stack and
applies necessary changes to Grunt and Gherkin-lint configuration to
ensure that they continue to work.

The grunt-sass plugin has been updated to support alternative
'implementations' of sass compilers, and the chosen sass compiler must
now be specified in the grunt configuration. We continue to use the
`node-sass` package for this.

Our gherkin-lintrc included two rules which were renamed from
'no-unamed-*' to 'no-unnamed-*'. This change occurred in version 2.0.0
of Gherkin-lint and has no other effect.
2020-05-11 10:53:35 +08:00
Andrew Nicols
a508dfb43a MDL-66109 js: Fix circular dependency in Shifter dependency
Shifter is using an ancient and no-longer supported of Istanbul. That
version contains a circular dependency whereby it fetches the version
from the index that included the file in the first place.  This throws a
warning on newer versions of Node.

The fix here is simple and intended to be the bare minimum to remove
these warnings anad resolve the issue.

We have forked the istanbul project and created a v0.1.37_moodle branch
at the root version of the Istanbul version that Shifter uses (v0.1.37
tag). The circular dependency is then addressed and a new tag created.

I have then forked Shifter, pointing its package.json at the tar.gz
download of that new tag and pushed a new branch and tag for that fix.

Following this our own package.json is updated to point to the tar.gz
version of the new Shifter tag.
2020-05-11 10:53:35 +08:00
Andrew Nicols
1591dc5786 MDL-66109 js: Upgrade to latest stable version of NodeJS
Version 14.0.0 has just been released as stable, and will make its way
to an LTS release which will be supported until 30th April 2023.

At time of writing it is the "Current stable" release and will remain in
this phase until 20th October 2020, at whciih point it will transition
to LTS status.
2020-05-11 10:53:35 +08:00
Andrew Nicols
78b0a0c201 MDL-66653 javascript: Support ES6 dynamic imports 2019-09-11 14:06:32 +08:00
Andrew Nicols
ad2574f770 MDL-66265 javascript: Bump jshint version 2019-09-04 06:48:11 +08:00
Ryan Wyllie
38d4f754ca MDL-62497 javascript: add watchman support to grunt watch command 2019-07-19 14:12:49 +08:00
Ryan Wyllie
c53f86d408 MDL-62497 javascript: add babel transpiling to Grunt for ES6 support 2019-07-19 14:12:48 +08:00
Mathew May
cf89ac3d1a MDL-64506 Grunt: Remove old Bootstrapbase tasks 2019-04-03 19:34:20 +08:00
Bas Brands
af9edb2e6a MDL-59261 theme_boost: compiled css fallback 2018-07-03 14:14:52 +08:00