84 Commits

Author SHA1 Message Date
Andrew Nicols
484da7c0e8
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 12:19:53 +08:00
Andrew Nicols
32a39926a9
MDL-79003 js: Standard package bump - glob 2024-01-30 12:19:52 +08:00
Andrew Nicols
5094828180
MDL-79003 js: Standard package bump - async 2024-01-30 12:19:52 +08:00
Andrew Nicols
62242b66c7
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 12:19:52 +08:00
Andrew Nicols
d7c7e8afaf
MDL-79003 js: Standard package bump - grunt 2024-01-30 12:19:52 +08:00
Andrew Nicols
00ffcd3a5b
MDL-79003 js: Standard package bump - watchman 2024-01-30 12:19:51 +08:00
Andrew Nicols
ea380da041
MDL-79003 js: Standard package bump - ajv 2024-01-30 12:19:51 +08:00
Andrew Nicols
f457725b3a
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 12:19:51 +08:00
Andrew Nicols
f9bd195365
MDL-79003 core: Bump eslint 2024-01-30 12:19:51 +08:00
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
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
4b7fbb189b MDL-77559 js: Revert "MDL-75012 js: Audit fix"
This reverts commit 472fc27ab94c134037039e4ecd95d7b9210afb2e.
2023-03-09 08:21:12 +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
472fc27ab9 MDL-75012 js: Audit fix 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
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