Skip to content

Conversation

@jgaehring
Copy link
Member

This cleans up the environment, targeting dist/ and node_modules directories in particular and restoring the project to more or less the same state as a fresh git clone (i.e., after running git clone <url> but before running npm install or npm run build. This applies to the examples/ subdirs, too, which can be 2+GB in total since they include Puppeteer, which in turn includes separate versions of Chromium.

I just happened to catch this today b/c I was clearing space on my hard drive and realized my local version of this repo was using up 2.5GB all on its own. After running the clean script it went down to 17.4MB.

I've also installed rimraf ("rm -rf for node in a cross-platform implementation") and updated all the other NPM deps.

I just ran the tests, however, for the example projects, which appear to be failing. So with that in mind, I'm opening this as a draft for now, since I don't have time to test more thoroughly, will update if I get more time to come back to this....

Cleans up environment, restoring it to more or less the same state as a
fresh git clone before running `npm install` and `npm run build`. This
applies to the examples, too, which can be 2+GB in total since they
include Puppeteer, which in turn includes separate versions of Chromium.
@symbioquine
Copy link
Collaborator

Looks reasonable.

I guess the next step is to check if the examples that are failing were already failing without your changes. We don't have a workflow to check them here on GitHub so it's possible they were actually broken by a previous change and we didn't notice...

The other thing of interest with this change is that I believe the new npm run clean command may actually only work once - since it would delete the rimraf dependency (assuming it's not available globally) and require a npm install before npm run clean will function again.

@jgaehring
Copy link
Member Author

I guess the next step is to check if the examples that are failing were already failing without your changes.

Yea I wondered that too but had to putit down at that point. Seems unlikely my changes would effect that, unless it was that first commit of updates (via npm audit fix), which could be omitted.

The other thing of interest with this change is that I believe the new npm run clean command may actually only work once

This is correct, which is fine imo, can't expect any script to run before deps are installed, but probably could be better named, "clean" usually just means remove build artifacts, so maybe "uninstall-all-deps" or something of that effect. Or something more targeted on the example pkgs since the big chromium binaries all live in their node_modules.

@jgaehring
Copy link
Member Author

Or something more targeted on the example pkgs since the big chromium binaries all live in their node_modules.

Oh and I guess that could correspond with the "install-all" script:

https://github.com/farmOS/farmOS-map/blob/main/examples%2Fpackage.json#L22-L26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants