Skip to content

Commit

Permalink
Merge branch 'MDL-75012-401-5' of https://github.com/andrewnicols/moodle
Browse files Browse the repository at this point in the history
 into MOODLE_401_STABLE
  • Loading branch information
junpataleta committed Mar 2, 2023
2 parents ccec093 + 288620b commit a377bf3
Show file tree
Hide file tree
Showing 716 changed files with 5,162 additions and 18,047 deletions.
22 changes: 9 additions & 13 deletions .grunt/tasks/javascript.js
Expand Up @@ -21,7 +21,7 @@
*/

/**
* Function to generate the destination for the uglify task
* Function to generate the destination for the minification task
* (e.g. build/file.min.js). This function will be passed to
* the rename property of files array when building dynamically:
* http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically
Expand Down Expand Up @@ -61,7 +61,6 @@ module.exports = grunt => {
grunt.registerTask('js', ['amd', 'yui']);

// Register NPM tasks.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-rollup');

Expand Down Expand Up @@ -128,7 +127,7 @@ module.exports = grunt => {
};
};

const terser = require('rollup-plugin-terser').terser;
const terser = require('@rollup/plugin-terser');
grunt.config.merge({
rollup: {
options: {
Expand All @@ -137,6 +136,13 @@ module.exports = grunt => {
sourcemap: true,
treeshake: false,
context: 'window',

// Treat all modules as external and do not try to resolve them.
// https://rollupjs.org/configuration-options/#external
// We do not need to resolve them as each module is transpiled individually and there is no tree shaking
// or combining of dependencies.
external: true,

plugins: [
rateLimit(),
babel({
Expand All @@ -160,16 +166,6 @@ module.exports = grunt => {
],
presets: [
['@babel/preset-env', {
targets: {
browsers: [
">0.3%",
"last 2 versions",
"not ie >= 0",
"not op_mini all",
"not Opera > 0",
"not dead"
]
},
modules: false,
useBuiltIns: false
}]
Expand Down
40 changes: 28 additions & 12 deletions .grunt/tasks/jsdoc.js
Expand Up @@ -20,17 +20,33 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

module.exports = grunt => {
// Project configuration.
grunt.config.merge({
jsdoc: {
dist: {
options: {
configure: ".grunt/jsdoc/jsdoc.conf.js",
},
},
},
});
module.exports = (grunt) => {
const path = require('path');

grunt.registerTask('jsdoc', 'Generate JavaScript documentation using jsdoc', function() {
const done = this.async();
const configuration = path.resolve('.grunt/jsdoc/jsdoc.conf.js');

grunt.loadNpmTasks('grunt-jsdoc');
grunt.util.spawn({
cmd: 'jsdoc',
args: [
'--configure',
configuration,
]
}, function(error, result, code) {
if (result.stdout) {
grunt.log.write(result.stdout);
}

if (result.stderr) {
grunt.log.error(result.stderr);
}
if (error) {
grunt.fail.fatal(`JSDoc failed with error code ${code}`);
} else {
grunt.log.write('JSDoc completed successfully'.green);
}
done();
});
});
};
4 changes: 3 additions & 1 deletion .grunt/tasks/stylelint.js
Expand Up @@ -45,7 +45,9 @@ module.exports = grunt => {
return {
stylelint: {
scss: {
options: {syntax: 'scss'},
options: {
customSyntax: 'postcss-scss',
},
src: files,
},
},
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
@@ -1 +1 @@
lts/gallium
lts/hydrogen
20 changes: 16 additions & 4 deletions .stylelintrc
@@ -1,9 +1,14 @@
{
"customSyntax": "postcss-scss",
"plugins": [
"stylelint-csstree-validator"
],
"rules": {
"csstree/validator": true,
"csstree/validator": {
"syntaxExtensions": [
"sass"
]
},
"at-rule-empty-line-before": [ "always",
{"except": [ "blockless-after-blockless"], ignore: ["after-comment", "inside-block"]}
],
Expand Down Expand Up @@ -45,7 +50,7 @@
"function-name-case": "lower",
"function-parentheses-newline-inside": "always-multi-line",
"function-parentheses-space-inside": "never-single-line",
"function-url-scheme-blacklist": ["data"],
"function-url-scheme-disallowed-list": ["data"],
"function-whitespace-after": "always",
"indentation": 4,
"keyframe-declaration-no-important": true,
Expand Down Expand Up @@ -84,12 +89,19 @@
"selector-type-no-unknown": true,
"string-no-newline": true,
"time-min-milliseconds": 100,
"unit-blacklist": ["pt"],
"unit-disallowed-list": ["pt"],
"unit-case": "lower",
"unit-no-unknown": true,
"value-keyword-case": ["lower", {"ignoreKeywords": ["/(@|$)/"]}],
"value-list-comma-newline-after": "always-multi-line",
"value-list-comma-space-after": "always-single-line",
"value-list-comma-space-before": "never",
}
},
"overrides": [
{
"files": ["**/yui/**/*.css"],
"rules": {
}
}
]
}
2 changes: 1 addition & 1 deletion admin/tool/analytics/amd/build/log_info.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a377bf3

Please sign in to comment.