Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-71736

Run `grunt ignorefiles` on all tasks

    XMLWordPrintable

Details

    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_400_STABLE
    • MOODLE_310_STABLE, MOODLE_311_STABLE
    • MDL-71736-311
    • MDL-71736-master
    • Hide
      1. Run nvm use && npm ci to get all the nodejs stuff installed
      2. Ensure that you don't have any of the relevant ignore files hanging around:

        rm .eslintignore .stylelintignore
        

      3. Ensure that git does not report their absence:

        git status
        

      4. Run the following, ensuring that there is no error between commands, and that the command recreated the .eslintingore and .stylelintignore files:

        rm -rf .eslintignore .stylelintignore ; grunt amd; ls -l .*ignore
        rm -rf .eslintignore .stylelintignore ; grunt shifter; ls -l .*ignore
        rm -rf .eslintignore .stylelintignore ; grunt js; ls -l .*ignore
        rm -rf .eslintignore .stylelintignore ; grunt css; ls -l .*ignore
        rm -rf .eslintignore .stylelintignore ; grunt sass; ls -l .*ignore
        rm -rf .eslintignore .stylelintignore ; grunt rawcss; ls -l .*ignore
        rm -rf .eslintignore .stylelintignore ; grunt stylelint; ls -l .*ignore
        rm -rf .eslintignore .stylelintignore ; grunt ignorefiles; ls -l .*ignore
        

      5. Run grunt watch in a window:

        grunt watch
        

      6. touch some files to ensure that they build correctly:

        rm .eslintignore .stylelintignore ; touch theme/boost/amd/src/bootstrap/alert.js
        rm .eslintignore .stylelintignore ; touch theme/boost/scss/bootstrap/bootstrap.scss
        

      Show
      Run nvm use && npm ci to get all the nodejs stuff installed Ensure that you don't have any of the relevant ignore files hanging around: rm .eslintignore .stylelintignore Ensure that git does not report their absence: git status Run the following, ensuring that there is no error between commands, and that the command recreated the .eslintingore and .stylelintignore files: rm -rf .eslintignore .stylelintignore ; grunt amd; ls -l .*ignore rm -rf .eslintignore .stylelintignore ; grunt shifter; ls -l .*ignore rm -rf .eslintignore .stylelintignore ; grunt js; ls -l .*ignore rm -rf .eslintignore .stylelintignore ; grunt css; ls -l .*ignore rm -rf .eslintignore .stylelintignore ; grunt sass; ls -l .*ignore rm -rf .eslintignore .stylelintignore ; grunt rawcss; ls -l .*ignore rm -rf .eslintignore .stylelintignore ; grunt stylelint; ls -l .*ignore rm -rf .eslintignore .stylelintignore ; grunt ignorefiles; ls -l .*ignore Run grunt watch in a window: grunt watch touch some files to ensure that they build correctly: rm .eslintignore .stylelintignore ; touch theme/boost/amd/src/bootstrap/alert.js rm .eslintignore .stylelintignore ; touch theme/boost/scss/bootstrap/bootstrap.scss

    Description

      At the moment it's pretty awkward for a contributed plugin to ake use of a third-party plugin in Moodle. They'd have to modify the global .eslintignore or .stylelintignore files as appropriate, which are tracked in git.

      Those files are only generated when calling grunt ignorefiles, which is because they were historically extremely slow to generate.

      From MDL-67449 we refactored the way in which Grunt loads to be much faster, and to make use of our components.json file to intelligiently look for files to build. Prior to this it used a number of globstar regular expressions to find any potential plugin of any plugintype, which was inherently very slow.

      Now that MDL-67449 has landed it occurs to me that we should change the grunt process to run the ignorefiles command as required (on demand) - i.e. whenever the JS, CSS, or SCSS are built.

      Making this change will mean that any contributed plugin is now able to add third-party libraries to it's own thirdpartylibs.xml file and have it respected immediately. Without this change it is not possible to easily build a third-party module without modifying the core file (which can get messy), or wrapping the entire file in eslint ignore commands.

      Attachments

        Issue Links

          Activity

            People

              dobedobedoh Andrew Lyons
              dobedobedoh Andrew Lyons
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Gladys Basiana Gladys Basiana
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                12/Jul/21

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours, 1 minute
                  4h 1m