73 Commits

Author SHA1 Message Date
Andrew Nicols
a9b4b297ac Merge branch 'MDL-77606' of https://github.com/skodak/moodle into MOODLE_401_STABLE 2023-04-17 10:34:55 +08:00
Petr Skoda
2cc1182b16 MDL-77606 core: switch to Dart sass
Backport of MDL-73144.
2023-04-17 10:33:50 +08:00
Eloy Lafuente (stronk7)
127174088a 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:43 +02:00
Andrew Nicols
04787fbbc9 MDL-77559 js: Revert "MDL-75012 core: Bump NodeJS version requirements"
This reverts commit 3416ee9890bdb9e7ea3d4ada44839770a763a00c.
2023-03-09 08:21:36 +08:00
Andrew Nicols
8c13a1b817 MDL-77559 js: Revert "MDL-75012 js: Bump standard dependencies"
This reverts commit 456446215e89386c851a5dcfa8243a9cfb53f899.
2023-03-09 08:21:22 +08:00
Andrew Nicols
fefd6f2bd8 MDL-77559 js: Revert "MDL-75012 js: Remove grunt-contrib-uglify"
This reverts commit ca4614c2991c2cc2eed0a788f3bfd37b3d686dac.
2023-03-09 08:21:19 +08:00
Andrew Nicols
d209e2cc57 MDL-77559 js: Revert "MDL-75012 js: Bump stylelint and components"
This reverts commit 644e9da8bb8418c1223ed394528f48bf2d9dea9c.
2023-03-09 08:21:15 +08:00
Andrew Nicols
a96fcc22ca MDL-77559 js: Revert "MDL-75012 js: Update browserslist"
This reverts commit bf81d5f0ba5aedf74ce8cd4eb05bad372ac996de.
2023-03-09 08:21:12 +08:00
Andrew Nicols
230f8247e8 MDL-77559 js: Revert "MDL-75012 js: Bump node-sass"
This reverts commit 0a0266ae5ee2b9a6cd13aec05593245eb85bfa0a.
2023-03-09 08:21:07 +08:00
Andrew Nicols
63ecbc57d6 MDL-77559 js: Revert "MDL-75012 js: Use our own jsdoc wrapper"
This reverts commit 89f7402fc28a402e3380066c854f319d5896e97a.
2023-03-09 08:20:57 +08:00
Andrew Nicols
f483380e01 MDL-77559 js: Revert "MDL-75012 js: Bump shifter to new version"
This reverts commit c2c1727dd5929c6b1479b866812037702281f543.
2023-03-09 08:20:53 +08:00
Andrew Nicols
0da20453f7 MDL-77559 js: Revert "MDL-75012 js: Put shifter on a diet"
This reverts commit 73181c13103d5364da6b25c3b7751b4c74ab7383.
2023-03-09 08:20:49 +08:00
Andrew Nicols
c90a6263bc MDL-77559 js: Revert "MDL-75012 js: Remove unused babel-preset-minify dependency"
This reverts commit 364458e36a082cd6b497a10a786d313fc0a745f8.
2023-03-09 08:20:45 +08:00
Andrew Nicols
df1dc82fee MDL-77559 js: Revert "MDL-75012 js: Bump Babel dependencies"
This reverts commit b963401b8fa83b616fe1784a04c03d8d52d0d5f0.
2023-03-09 08:20:42 +08:00
Andrew Nicols
b963401b8f 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 12:15:25 +08:00
Andrew Nicols
364458e36a MDL-75012 js: Remove unused babel-preset-minify dependency 2023-03-02 12:15:25 +08:00
Andrew Nicols
73181c1310 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
c2c1727dd5 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
89f7402fc2 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
0a0266ae5e MDL-75012 js: Bump node-sass 2023-02-28 10:19:51 +08:00
Andrew Nicols
bf81d5f0ba 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
644e9da8bb MDL-75012 js: Bump stylelint and components 2023-02-28 10:19:50 +08:00
Andrew Nicols
ca4614c299 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
456446215e 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
3416ee9890 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
Matteo Scaramuccia
22d032301b MDL-61893 JavaScript: Accept any node version but Carbon (LTS) 2018-05-18 00:36:43 +02:00
Damyon Wiese
66242b95e0 MDL-60503 npm: Lock required node 8.9.x (LTS) 2017-11-01 14:52:16 +08:00