Create and manage p5.js projects. Schellenberg customized the template to work well for CS30, but this is just a slight adaptation of the p5.vscode extension by Sam Lavigne.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
This is a slightly adapted version of Sam Lavigne's p5.vscode extension. The relevant changes are:
index.html file from the template links to the un-minified version of p5.js by default, which allows for the use of the FES (Friendly Error System) built into p5.js.
includes an .eslintrc.json file in the template folder. All p5.js functions/variables are included as globals (to avoid having them trigger non-used variable/function warnings).
includes the ESLint extension as part of the bundle.
for any of the ESLint functionality to work, the student must install nodejs, then run npm install -g eslint (this is only required one time, and should work on all future projects).
p5.vscode - Original Info
p5.vscode helps you create p5.js projects in Visual Studio Code. It also includes autocompletion, a simple tool to browse and install third-party p5 libraries, and the Live Server extension.
I made this extension for my students in particular, but I hope it's helpful for anyone using p5. I'm aware there are a few other VS Code extensions that do something similar, but they didn't quite meet my requirements.
Instructions
To create a new p5 project:
Open the Command Palette (with command-shift-p on Mac, or ctrl-shift-p on Windows) and then start typing and select Create p5.js Project.
Select a new empty folder to put your project in.
(optional) click the "Go Live" button in the bottom status bar to open your sketch in a browser
To install p5 libraries:
Open the Command Palette, then start typing and select Install p5 Contributor Library
Select the library you'd like to install and hit enter.
Select Install to download the library and add it as a script tag to your index file, or select Visit home page to view documentation for that library.
Features
Creates a p5.js project by populating an empty folder with required html/css/js files.
Browse and install third-party p5.js libraries.
Autocompletion and documentation for p5 keywords & functions using TypeScript definitions.
Avoids CDN use so that project creation can work offline.
Comes bundled with other recommended VS Code extensions to make things easier for beginners & students.
Troubleshooting
When creating a new project, please select an empty folder.
Library installation requires a project workspace containing an index.html file and a libraries folder.
I've attempted to integrate all the contributed libraries found on p5's library page. If I've missed anything, please just let me know.