From f3ed7e0d8993fc441375cd0f8a6584b72f6b1bec Mon Sep 17 00:00:00 2001 From: theMackabu Date: Sat, 7 Feb 2026 02:23:28 -0800 Subject: [PATCH] add CODE_OF_CONDUCT.md with community standards and enforcement policy --- CODE_OF_CONDUCT.md | 38 +++++++++++++++++++++++++++++ GOVERNANCE.md | 55 ++++++++++++++++++++++++++++++++++++++++++ README.md | 12 ++++++--- examples/spa/server.ts | 14 +++++------ 4 files changed, 109 insertions(+), 10 deletions(-) create mode 100644 CODE_OF_CONDUCT.md create mode 100644 GOVERNANCE.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..31434f5 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,38 @@ +# Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +**Positive behavior includes:** + +- Being respectful and inclusive +- Giving and accepting constructive feedback +- Focusing on what is best for the community +- Showing empathy towards others + +**Unacceptable behavior includes:** + +- Harassment, trolling, or personal attacks +- Publishing others' private information without permission +- Sexualized language or imagery +- Other conduct which could reasonably be considered inappropriate + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainer at **themackabu@gmail.com**. + +All complaints will be reviewed and investigated promptly and fairly. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. + +## Enforcement Actions + +1. **Correction**: Private warning with clarity on the violation +2. **Warning**: Warning with consequences for continued behavior +3. **Temporary Ban**: Temporary ban from community interaction +4. **Permanent Ban**: Permanent ban from community interaction + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1. diff --git a/GOVERNANCE.md b/GOVERNANCE.md new file mode 100644 index 0000000..f36abf1 --- /dev/null +++ b/GOVERNANCE.md @@ -0,0 +1,55 @@ +# Governance + +## Project Structure + +Ant is currently maintained as a single-maintainer open source project. + +### Maintainer + +themackabu@gmail.com: + +- Final decision authority on project direction +- Merge rights for all contributions +- Release management + +## Decision Making + +### Day-to-day Decisions + +- Bug fixes and minor improvements are merged at maintainer discretion +- Feature requests are discussed in GitHub issues + +### Significant Changes + +For major changes (new modules, API changes, architectural decisions): + +1. Open an issue or discussion for community input +2. Allow reasonable time for feedback +3. Maintainer makes final decision + +## Contributions + +All contributors are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. + +### Becoming a Maintainer + +As the project grows, additional maintainers may be added based on: + +- Consistent, quality contributions +- Understanding of project goals and codebase +- Demonstrated good judgment +- Alignment with project values + +## Releases + +- Releases are made at maintainer discretion +- Semantic versioning is followed where practical +- Breaking changes are documented in release notes + +## Code of Conduct + +All participants are expected to follow the [Code of Conduct](CODE_OF_CONDUCT.md). + +## Changes to Governance + +This governance model may evolve as the project and community grow. Changes will be documented in this file. diff --git a/README.md b/README.md index 59f2b7f..9b741c1 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ Full async/await, modules, HTTP servers, crypto, and more. 📖 [Read the blog post about Ant](https://s.tail.so/js-in-one-month) +**This project has a [Code of Conduct](CODE_OF_CONDUCT.md).** + ## Installation ```bash @@ -16,7 +18,7 @@ curl -fsSL https://ant.themackabu.com/install | bash curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash ``` -### Building from Source +## Building from Source ```bash git clone https://github.com/theMackabu/ant.git && cd ant @@ -26,12 +28,16 @@ meson setup build meson compile -C build ``` -### Security +## Security For information on reporting security vulnerabilities in Ant, see [SECURITY.md](SECURITY.md). -### Contributing to Ant +## Contributing to Ant We welcome contributions through pull request. See [CONTRIBUTING.md](CONTRIBUTING.md) for more details. For more information about the internals, read the [ant deepwiki](https://deepwiki.com/theMackabu/ant). + +## Current project team members + +For information about the governance of Ant, see [GOVERNANCE.md](GOVERNANCE.md). diff --git a/examples/spa/server.ts b/examples/spa/server.ts index e9a7871..92485e1 100644 --- a/examples/spa/server.ts +++ b/examples/spa/server.ts @@ -1,4 +1,4 @@ -import { open } from 'ant:fs'; +import { stream } from 'ant:fs'; import { join, extname } from 'ant:path'; import { createRouter, addRoute, findRoute } from '../rou3'; @@ -30,30 +30,30 @@ declare function addRoute(router: unknown, method: string, path: string, handler addRoute(router, 'GET', '/api/version', async c => c.res.json({ version: Ant.version })); -addRoute(router, 'GET', '**', c => { +addRoute(router, 'GET', '**', async c => { const reqPath = c.req.uri; - if (reqPath === '/') return c.res.body(open(indexPath), 200, 'text/html'); + if (reqPath === '/') return c.res.body(await stream(indexPath), 200, 'text/html'); const filePath = join(basePath, reqPath); if (validPaths.has(filePath)) { const ext = extname(reqPath) || '.html'; - return c.res.body(open(filePath), 200, mimeTypes.get(ext) ?? 'application/octet-stream'); + return c.res.body(await stream(filePath), 200, mimeTypes.get(ext) ?? 'application/octet-stream'); } if (invalidPaths.has(filePath)) { - return c.res.body(open(indexPath), 200, 'text/html'); + return c.res.body(await stream(indexPath), 200, 'text/html'); } try { - const file = open(filePath); + const file = await stream(filePath); validPaths.add(filePath); const ext = extname(reqPath) || '.html'; return c.res.body(file, 200, mimeTypes.get(ext) ?? 'application/octet-stream'); } catch { invalidPaths.add(filePath); - return c.res.body(open(indexPath), 200, 'text/html'); + return c.res.body(await stream(indexPath), 200, 'text/html'); } }); -- 2.51.2