moodlehq / moodle-docker

A docker environment for moodle developers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Document AMD build step

fulldecent opened this issue · comments

When developing moodle plugins using client side JavaScript, it is necessary to build the JavaScript from amd using some build process. (Source: https://moodledev.io/docs/guides/javascript/modules)

This process requires some infrastructure (Node?) which I think is included in moodle-docker and is in-scope for this repo.

However the build process is not supported inside the docker image:

root@1be09377965d:/var/www/html# npx grunt amd
bash: npx: command not found

If module development is indeed supported in moodle-docker, we should add documentation for same into README.md. Or if it's missing let's please add it.

Hi @fulldecent - this repository is intended as a testing environment for Moodle, rather than a development environment

I've linked to the dev docs above for Node installation along with other dependencies

Thank you, I hear you.

If that's the case, this advertisement should be scaled back:

Screenshot 2024-04-09 at 15 49 57

The the project scope can be reduced.

Screenshot 2024-04-09 at 15 51 18

And then we can remove all references to this repo as a developer resource. And then also we should start a new project to make a moodle dev docker.


The reference you point to at https://moodledev.io/general/development/tools/nodejs#grunt assuems that npx is installed on the development environment. So probably this docker project, or a moodle-dev-docker successor should support that.

Hola,

not sure which is the problem here, you can follow the instructions available in the page that @paulholden linked, both in the host OR within the php docker container and you will get all the nodejs stack installed and running.

Personally I do that in the host, because the container is not needed for all that nodejs stuff, but the very same can be done within the container if you prefer to do so.

  • Install nvm: wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
  • Install nodejs: nvm install && nvm use
  • Use nodejs: npx grunt amd

Exactly the same instructions apply to both, so I don't get which one the problem is. As said, the above works exactly the same in the host or inside the container (but I think it's "silly" to run that inside the PHP container, that's just a very personal opinion, feel free, of course).

Ciao :-)

Thanks again @fulldecent - however nothing in the language you reference specifies that this is intended to be a development environment

"[...] aimed at Moodle developers and testers to easily deploy a testing environment" (emphasis mine)

In my mind developers develop. But here developers do testing. Maybe this is an American English/Australian English thing, lol.

Thanks for that note. With it this is actually a development environment. I'll add a note to README if it's in project scope.