MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add CODE_OF_CONDUCT.md with community standards and enforcement policy

+109 -10
+38
CODE_OF_CONDUCT.md
··· 1 + # Code of Conduct 2 + 3 + ## Our Pledge 4 + 5 + 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. 6 + 7 + ## Our Standards 8 + 9 + **Positive behavior includes:** 10 + 11 + - Being respectful and inclusive 12 + - Giving and accepting constructive feedback 13 + - Focusing on what is best for the community 14 + - Showing empathy towards others 15 + 16 + **Unacceptable behavior includes:** 17 + 18 + - Harassment, trolling, or personal attacks 19 + - Publishing others' private information without permission 20 + - Sexualized language or imagery 21 + - Other conduct which could reasonably be considered inappropriate 22 + 23 + ## Enforcement 24 + 25 + Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainer at **themackabu@gmail.com**. 26 + 27 + 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. 28 + 29 + ## Enforcement Actions 30 + 31 + 1. **Correction**: Private warning with clarity on the violation 32 + 2. **Warning**: Warning with consequences for continued behavior 33 + 3. **Temporary Ban**: Temporary ban from community interaction 34 + 4. **Permanent Ban**: Permanent ban from community interaction 35 + 36 + ## Attribution 37 + 38 + This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1.
+55
GOVERNANCE.md
··· 1 + # Governance 2 + 3 + ## Project Structure 4 + 5 + Ant is currently maintained as a single-maintainer open source project. 6 + 7 + ### Maintainer 8 + 9 + themackabu@gmail.com: 10 + 11 + - Final decision authority on project direction 12 + - Merge rights for all contributions 13 + - Release management 14 + 15 + ## Decision Making 16 + 17 + ### Day-to-day Decisions 18 + 19 + - Bug fixes and minor improvements are merged at maintainer discretion 20 + - Feature requests are discussed in GitHub issues 21 + 22 + ### Significant Changes 23 + 24 + For major changes (new modules, API changes, architectural decisions): 25 + 26 + 1. Open an issue or discussion for community input 27 + 2. Allow reasonable time for feedback 28 + 3. Maintainer makes final decision 29 + 30 + ## Contributions 31 + 32 + All contributors are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. 33 + 34 + ### Becoming a Maintainer 35 + 36 + As the project grows, additional maintainers may be added based on: 37 + 38 + - Consistent, quality contributions 39 + - Understanding of project goals and codebase 40 + - Demonstrated good judgment 41 + - Alignment with project values 42 + 43 + ## Releases 44 + 45 + - Releases are made at maintainer discretion 46 + - Semantic versioning is followed where practical 47 + - Breaking changes are documented in release notes 48 + 49 + ## Code of Conduct 50 + 51 + All participants are expected to follow the [Code of Conduct](CODE_OF_CONDUCT.md). 52 + 53 + ## Changes to Governance 54 + 55 + This governance model may evolve as the project and community grow. Changes will be documented in this file.
+9 -3
README.md
··· 7 7 8 8 ๐Ÿ“– [Read the blog post about Ant](https://s.tail.so/js-in-one-month) 9 9 10 + **This project has a [Code of Conduct](CODE_OF_CONDUCT.md).** 11 + 10 12 ## Installation 11 13 12 14 ```bash ··· 16 18 curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash 17 19 ``` 18 20 19 - ### Building from Source 21 + ## Building from Source 20 22 21 23 ```bash 22 24 git clone https://github.com/theMackabu/ant.git && cd ant ··· 26 28 meson compile -C build 27 29 ``` 28 30 29 - ### Security 31 + ## Security 30 32 31 33 For information on reporting security vulnerabilities in Ant, see [SECURITY.md](SECURITY.md). 32 34 33 - ### Contributing to Ant 35 + ## Contributing to Ant 34 36 35 37 We welcome contributions through pull request. See [CONTRIBUTING.md](CONTRIBUTING.md) for more details. 36 38 37 39 For more information about the internals, read the [ant deepwiki](https://deepwiki.com/theMackabu/ant). 40 + 41 + ## Current project team members 42 + 43 + For information about the governance of Ant, see [GOVERNANCE.md](GOVERNANCE.md).
+7 -7
examples/spa/server.ts
··· 1 - import { open } from 'ant:fs'; 1 + import { stream } from 'ant:fs'; 2 2 import { join, extname } from 'ant:path'; 3 3 import { createRouter, addRoute, findRoute } from '../rou3'; 4 4 ··· 30 30 31 31 addRoute(router, 'GET', '/api/version', async c => c.res.json({ version: Ant.version })); 32 32 33 - addRoute(router, 'GET', '**', c => { 33 + addRoute(router, 'GET', '**', async c => { 34 34 const reqPath = c.req.uri; 35 - if (reqPath === '/') return c.res.body(open(indexPath), 200, 'text/html'); 35 + if (reqPath === '/') return c.res.body(await stream(indexPath), 200, 'text/html'); 36 36 37 37 const filePath = join(basePath, reqPath); 38 38 39 39 if (validPaths.has(filePath)) { 40 40 const ext = extname(reqPath) || '.html'; 41 - return c.res.body(open(filePath), 200, mimeTypes.get(ext) ?? 'application/octet-stream'); 41 + return c.res.body(await stream(filePath), 200, mimeTypes.get(ext) ?? 'application/octet-stream'); 42 42 } 43 43 44 44 if (invalidPaths.has(filePath)) { 45 - return c.res.body(open(indexPath), 200, 'text/html'); 45 + return c.res.body(await stream(indexPath), 200, 'text/html'); 46 46 } 47 47 48 48 try { 49 - const file = open(filePath); 49 + const file = await stream(filePath); 50 50 validPaths.add(filePath); 51 51 52 52 const ext = extname(reqPath) || '.html'; 53 53 return c.res.body(file, 200, mimeTypes.get(ext) ?? 'application/octet-stream'); 54 54 } catch { 55 55 invalidPaths.add(filePath); 56 - return c.res.body(open(indexPath), 200, 'text/html'); 56 + return c.res.body(await stream(indexPath), 200, 'text/html'); 57 57 } 58 58 }); 59 59