Skip to content
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

Improved onboarding for contributors #13

84 changes: 84 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Continuous Integration

on:
push:
branches:
- main
- 11-contributing-to-the-library-while-using-a-different-version-of-nodejs-or-npm-could-make-unexpected-changes-to-the-published-packages
pull_request:
branches:
- main
- 11-contributing-to-the-library-while-using-a-different-version-of-nodejs-or-npm-could-make-unexpected-changes-to-the-published-packages

jobs:
build-and-test:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22.11.0]

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Verify Node.js and NPM Versions
run: |
NODE_VERSION=$(node -v)
REQUIRED_NODE_VERSION="v22.11.0"
if [ "$NODE_VERSION" != "$REQUIRED_NODE_VERSION" ]; then
echo "Incorrect Node.js version. Expected $REQUIRED_NODE_VERSION but found $NODE_VERSION."
exit 1
fi

NPM_VERSION=$(npm -v)
REQUIRED_NPM_VERSION="10.9.0"
if [ "$NPM_VERSION" != "$REQUIRED_NPM_VERSION" ]; then
echo "Incorrect NPM version. Expected $REQUIRED_NPM_VERSION but found $NPM_VERSION."
exit 1
fi

echo "Node.js and NPM versions are correct."

- name: Install Dependencies
run: npm install

- name: Build the Library
run: npm run build

- name: Verify Build Output
run: |
# Check if the output files exist
if [ ! -f dist/p5.asciify.js ]; then
echo "dist/p5.asciify.js not found!"
exit 1
fi

if [ ! -f dist/p5.asciify.min.js ]; then
echo "dist/p5.asciify.min.js not found!"
exit 1
fi

# Check if the files are not empty
if [ ! -s dist/p5.asciify.js ]; then
echo "dist/p5.asciify.js is empty!"
exit 1
fi

if [ ! -s dist/p5.asciify.min.js ]; then
echo "dist/p5.asciify.min.js is empty!"
exit 1
fi

echo "Build outputs are present and non-empty."

# Optional: Add a step to run basic tests on the bundled files
# - name: Run Tests
# run: npm test
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.11.0
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,10 @@ let myp5 = new p5(theSketch);


# Usage

Check out the [`Usage`](https://github.com/humanbydefinition/p5.asciify/wiki/02_Usage) section in the [`Wiki`](https://github.com/humanbydefinition/p5.asciify/wiki) to learn how to customize the ASCII conversion and apply various effects to your sketches! You'll find step-by-step instructions and examples on how to effectively use `p5.asciify` in your projects.

## Contributing
Contributions are welcome. Please [`open an issue`](https://github.com/humanbydefinition/p5.asciify/issues) or [`submit a pull request`](https://github.com/humanbydefinition/p5.asciify/pulls) on GitHub.
Contributions are welcome! To ensure consistency and avoid unexpected changes, please follow our [Contributing Guidelines](https://github.com/humanbydefinition/p5.asciify/wiki/04_Contributing) before submitting issues or pull requests.

## License
This project is licensed under the MIT License. See the [`LICENSE`](https://github.com/humanbydefinition/p5.asciify/blob/main/LICENSE) file for more details.
2 changes: 2 additions & 0 deletions dist/p5.asciify.js
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,8 @@
setup() {
this.p5Instance.pixelDensity(1);

console.log("test");

this.sketchFramebuffer = this.p5Instance.createFramebuffer({ format: this.p5Instance.FLOAT });

this.brightnessCharacterSet.setup({ p5Instance: this.p5Instance, type: "brightness", font: this.font, characters: this.brightnessOptions.characters, fontSize: this.commonOptions.fontSize });
Expand Down
2 changes: 1 addition & 1 deletion dist/p5.asciify.min.js

Large diffs are not rendered by default.

Loading