Skip to content

docs: update module usage instructions to remove Grunt and reflect dev-2.0 tooling #7871 #7886

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: dev-2.0
Choose a base branch
from

Conversation

LalitNarayanYadav
Copy link
Contributor

@LalitNarayanYadav LalitNarayanYadav commented Jun 7, 2025

Changes:

  • Removed outdated Grunt-based module bundling instructions from the main "Usage" section.
  • Added updated instructions using npm run build for dev-2.0 and guidance on custom builds via Rollup.
  • Moved legacy Grunt commands into a clearly labeled section with a deprecation warning.

Fixes #7871

PR Checklist

@ksen0
Copy link
Member

ksen0 commented Jun 7, 2025

Hi @LalitNarayanYadav thanks for working on this! To link the PR to an issue, please write: "Fixes #7871" (if the issue should be closed when this PR is merged; otherwise, write "Addresses [issue]"). Thank you!

@ksen0 ksen0 requested a review from perminder-17 June 7, 2025 11:41
@LalitNarayanYadav
Copy link
Contributor Author

Thanks you @ksen0 ! I'll keep it in mind.

Copy link
Collaborator

@perminder-17 perminder-17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These looks good so far, Really thanks for your awesome work. I'll give another round of review. I just need to ask weather you are confirm with these Spanish docs? I'll review them with translating with google translator and AI since I don't know spanish?

Comment on lines +206 to +207
npx eslint src/
npx eslint test/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, these commands look promising, and the npm run lint command appears to work correctly. Could you confirm whether changing the code’s indentation causes the linter to fail, or does it still pass? In my case, it always passes regardless of indentation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linter isn't implemented in v2+ yet. See #7853

In v1+ it wasn't configured for .md files. So my best bet is to not indent the code snippets.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aah...okay. Thanks for letting me know @error-four-o-four :)

Copy link
Collaborator

@perminder-17 perminder-17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I think we should also update the overview section. Currently it's something like:

An excellent new [feature](https://github.com/processing/p5.js/pull/2051) of p5.js allows user to build p5.js as a custom combination of its modules. This greatly helps in reducing the production version size of the library, as well as improves overall performance..

I think, the PR we link here adds a grunt task which takes in the arguments of modules it want to bundle together. Maybe we could remove/update it.

Comment on lines 18 to +21
cd p5.js
npm ci
npm run grunt
npm run grunt combineModules:module_x:module_y
npm run build # builds the full p5.js bundle
npm test # runs linter and tests using Vitest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is meant to show how to create a custom build of p5.js with selected components. Right now, the commands only build the full library and run the test suite. We should remove the final npm test line and replace it with the command that actually generates a custom bundle. I’m not sure whether the dev-2.0 branch already supports modular builds, @limzykenneth , could you confirm if dev-2.0 lets users assemble p5.js from a chosen set of modules, and if so, what the exact command is?

Comment on lines 18 to +21
cd p5.js
npm ci
npm run grunt
npm run grunt combineModules:module_x:module_y
npm run build # builds the full p5.js bundle
npm test # runs linter and tests using Vitest
Copy link
Collaborator

@perminder-17 perminder-17 Jun 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"runs linter and tests using Vitest" also, this line is misleading. Vitest never “runs the linter”, if you look at the script section, we have two different commands,

"scripts" : {
    "test": "vitest",
    "lint": "eslint .",
},

so, for lint we should write npm run lint, however we can probably remove the commands which is used for running tests in p5js from custom_p5_build.md?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: Remove legacy Grunt commands and transition fully to Vitest / npm scripts in dev-2.0
4 participants