83 Commits

Author SHA1 Message Date
Andrew Nicols
58bd2ed8e4
MDL-79003 js: Bump stylelint and components
Stylelint 15 deprecates a heap of rules which will be removed in 16.

We can't use 16 because it's ESM and requires a big restructure of our
build process.

We can temporarily silence the deprecations and then when we update our
build tooling we can make use of @stylistic/stylelint-plugin to add the
rules back.

This commit:
- bumps stylelint and related dependencies accordingly
- fixes issues identified with newer sniffs
- temporarily silences deprecation warnings
2024-01-30 14:08:51 +08:00
Andrew Nicols
a6216bb890
MDL-79003 js: Standard package bump - glob 2024-01-30 14:08:20 +08:00
Andrew Nicols
94b14df11d
MDL-79003 js: Standard package bump - async 2024-01-30 14:07:09 +08:00
Andrew Nicols
0dc60026c8
MDL-79003 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.
2024-01-30 14:07:08 +08:00
Andrew Nicols
63a1ec81c4
MDL-79003 js: Standard package bump - grunt 2024-01-30 14:07:08 +08:00
Andrew Nicols
150fc0837a
MDL-79003 js: Standard package bump - watchman 2024-01-30 14:07:08 +08:00
Andrew Nicols
72958879c6
MDL-79003 js: Standard package bump - ajv 2024-01-30 14:07:08 +08:00
Andrew Nicols
d8d560b7fe
MDL-79003 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.

This commit also includes a fix for broken docs.
2024-01-30 14:07:06 +08:00
Andrew Nicols
917dd49db2
MDL-79003 core: Bump eslint 2024-01-30 14:04:40 +08:00
Ruslan Kabalin
8092eb95c4
MDL-79003 eslint: Upgrade eslint and babel
This commit is a backport of MDL-74301 which should have been backported
at the time.

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"
2024-01-30 13:33:40 +08:00
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
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
91eb06347e MDL-77559 js: Revert "MDL-75012 js: Audit fix"
This reverts commit 8960a6ee91dc5d1ec1c8392255c17a7fd6741215.
2023-03-09 08:21:03 +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
8960a6ee91 MDL-75012 js: Audit fix 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
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)
28bdb57380 MDL-72440 js: reconcile npm installed stuff
When npm-shrinkwrap.json was regenerated few days ago by MDL-72014
running audit-fix on it, it seems that some checksums in the "lodash"
package were missing.

Now they are properly set and that's leading to npm-shrinkwrap.json
changes when people runs npm install (note npm ci is the recommended
way to install all the dev dependencies).

So, just reconcile the file to include the new checksums.
2021-08-31 11:17:07 +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
b3b7b3daca MDL-61460 core: Rebuild npm-shrinkwrap for new dependencies 2021-07-08 23:30:34 +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
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