moodlehq / moodle-docker

A docker environment for moodle developers
GNU General Public License v3.0
373 stars 244 forks source link

Document AMD build step #287

Closed fulldecent closed 2 months ago

fulldecent commented 2 months ago

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.

paulholden commented 2 months ago

Installation is documented at https://moodledev.io/general/development/tools/nodejs#grunt

paulholden commented 2 months ago

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

fulldecent commented 2 months ago

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.

stronk7 commented 2 months ago

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.

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 :-)

paulholden commented 2 months ago

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)

fulldecent commented 2 months ago

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.