diff --git a/CHANGELOG.md b/CHANGELOG.md index 86be1e0..7e7784e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [0.7.4] - 2024-06-20 + +### Added + +- `CONTRIBUTING.md` and `GOVERNANCE.md` + +### Changed + +- `README.md` headline formatting should conform to best practices + ## [0.7.3] - 2024-06-17 ### Added diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..97628d1 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,38 @@ +# How to contribute to oak-routing-ctrl + +## General Code of Conduct + +1. Please see [GOVERNANCE.md](./GOVERNANCE.md) for high-level information. +2. This library is meant to do 1 thing only (and must to it well), so we should + limit new features beyond the "scaffolding of API endpoint handlers" to the + minimum possible. +3. There is no direct pushing to `main` branch. Any change must go through a + Pull Request. This applies to all contributor roles. This includes typo + updates and other such one-liner fixes. +4. Code Coverage on the default branch (`main`) must always be 100%. +5. Any added feature or bugfix must be proven to work on all 4 runtimes (Deno, + Cloudflare Workers, Bun, and Node.js) + +## Library Publishing + +1. Publishing into the + [JavaScript Registry](https://jsr.io/@dklab/oak-routing-ctrl) may only happen + via git tags. A GitHub Action has been set up to automate publishing when a + new tag is created on (or pushed to) remote. +2. Only tag official releases on `main` branch. In other words: the + tagged commit must exist on the `main` branch. +3. Our git tags must always have the format `vX.Y.Z`: starting with the letter + `v` in lowercase, followed by `X.Y.Z` which conforms to the + [SemVer standard](https://semver.org/) where X = major, Y = minor, and Z = + patch. +4. Don't forget to update the library version in the `jsr.json` file + before tagging your commit for release, otherwise the release + won't happen. Heads up: the value in `jsr.json` file starts with + the major version directly (without the letter `v`) + - In the future, a tool such as + [semantic-release](https://github.com/semantic-release/semantic-release) + might be used to automate version bumps. +5. Before publishing an "official release", it's always advisable to publish an + "alpha release" first. For example, if you're working on the feature "foo", + for which you branched off from `main` at the most recent git tag `v1.5.1`, + then tagging your commit `v1.5.1-foo-alpha.1` would be an appropriate choice. diff --git a/GOVERNANCE.md b/GOVERNANCE.md new file mode 100644 index 0000000..384ef9f --- /dev/null +++ b/GOVERNANCE.md @@ -0,0 +1,12 @@ +# How oak-routing-ctrl is governed + +Before this library reaches v1.0.0, its initial author may hold more votes on +its development directions (mostly due to limited resources vs management +overheads). + +If you're interested in joining as co-contributor, please kindly open an Issue. +Any serious help is sincerely appreciated! + +Once the library has reached v1.0.0 and the project has gathered at least 2 +contributors, we will discuss how the future governance of the library should +be. diff --git a/README.md b/README.md index 86486c9..aefb21e 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ class MyPokedex { } ``` -# Forewords +## Forewords If you're familiar with the [npm library routing-controllers](https://www.npmjs.com/package/routing-controllers), @@ -32,18 +32,18 @@ replacement for routing-controllers, as it attempts to conform to yet. There's currently no plan to support TypeScript "experimental" decorators, but if you feel strongly for it, please feel free to fork this repo! -# Heads up +## Heads up For easy reading, the examples below do not specify any explicit version when installing library dependencies. But in your production code, it's advisable to pin every dependency to a specific version. -# Deno runtime +## Deno runtime Prerequisite: [Deno](https://docs.deno.com/runtime/manual/getting_started/installation) -## Example: Retrieving path parameters +### Example: Retrieving path parameters ```bash deno add @oak/oak @dklab/oak-routing-ctrl @@ -85,7 +85,7 @@ deno run --allow-env --allow-net main.ts curl localhost:1993/v1/hello/world # prints: hello, world ``` -## Example: Retrieving path parameters and request body +### Example: Retrieving path parameters and request body
View Example @@ -122,7 +122,7 @@ curl -H"Content-Type: application/json" localhost:1993/v1/tell/alice -d'{"messag
-## Example: Retrieving request query and path parameters +### Example: Retrieving request query and path parameters
View Example @@ -159,7 +159,7 @@ curl localhost:1993/v1/books/thriller\?page=2
-## Example: Accessing underlying context object +### Example: Accessing underlying context object
View Example @@ -192,9 +192,9 @@ curl -H"x-foo: lorem" localhost:1993/foo/bar
-# Other runtimes +## Other runtimes -## Node.js +### Node.js
View Example @@ -243,7 +243,7 @@ curl http://localhost:1993/v1/hello/world # prints: hello, world
-## Cloudflare Workers +### Cloudflare Workers
View Example @@ -285,7 +285,7 @@ curl http://{your-cloudflare-worker-domain}/hello/world # prints: hello, world
-## Bun +### Bun
View Example @@ -321,18 +321,18 @@ curl http://localhost:1993/v1/hello/world # prints: hello, world
-# Documentation +## Documentation Documentation is hosted on the Javascript Registry: https://jsr.io/@dklab/oak-routing-ctrl/doc -# Contributor Resources +## Contributor Resources -## Tests +### Tests ```bash deno test -A --coverage=cov_profile deno coverage cov_profile ``` -[![coverage](https://codecov.io/gh/Thesephi/oak-routing-ctrl/graphs/tree.svg?token=BA3M9P6410)](https://codecov.io/github/Thesephi/oak-routing-ctrl) +[![test coverage](https://codecov.io/gh/Thesephi/oak-routing-ctrl/graphs/tree.svg?token=BA3M9P6410)](https://codecov.io/github/Thesephi/oak-routing-ctrl) diff --git a/jsr.json b/jsr.json index 7c7e921..1ffdeac 100644 --- a/jsr.json +++ b/jsr.json @@ -1,6 +1,6 @@ { "name": "@dklab/oak-routing-ctrl", - "version": "0.7.3", + "version": "0.7.4", "exports": { ".": "./mod.ts", "./mod": "./mod.ts" @@ -12,6 +12,8 @@ "dev_deps.ts", "**/__snapshots__", ".github", - ".vscode" + ".vscode", + "./CONTRIBUTING.md", + "./GOVERNANCE.md" ] }