From bd2b048fbae76455d9bd218e28ed0803d7822b1a Mon Sep 17 00:00:00 2001 From: Yauhen Bichel Date: Sat, 26 Sep 2026 18:42:40 +0100 Subject: [PATCH] Add community files before open-sourcing - Issue forms: bug, feature, and a "new reference object" form that asks for the published size and its source. Private security link, no blank issues; the bug form says never to attach a real photo of skin. - A pull request checklist that repeats the design rules: stateless, frozen results, cited sizes, no real photos, estimates shown as estimates. - CODEOWNERS, .editorconfig and .nvmrc (Node 22, as CI). - README badges: CI, npm version, types, licence. Co-Authored-By: Claude Opus 5.5 --- .editorconfig | 12 +++++++ .github/CODEOWNERS | 2 ++ .github/ISSUE_TEMPLATE/bug_report.yml | 40 +++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 5 +++ .github/ISSUE_TEMPLATE/feature_request.yml | 29 +++++++++++++++ .github/ISSUE_TEMPLATE/reference_object.yml | 35 ++++++++++++++++++ .github/pull_request_template.md | 13 +++++++ .nvmrc | 1 + README.md | 5 +++ 9 files changed, 142 insertions(+) create mode 100644 .editorconfig create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/ISSUE_TEMPLATE/reference_object.yml create mode 100644 .github/pull_request_template.md create mode 100644 .nvmrc diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..8c52ff9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..078848b --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# Every change needs a review from a maintainer. +* @YauhenBichel diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..3f38f48 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,40 @@ +name: Bug report +description: An estimate or result that does not match the README. +labels: [bug] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time. **Never attach, paste or link a real photo of + a person's skin**, here or anywhere in this repository. The pixel sizes + and options you passed, and the result you got back, are enough. + Security problems go to info@molecare.co.uk instead (see SECURITY.md). + - type: textarea + id: what + attributes: + label: What happened + description: What you called, what you expected, and what came back (the result object is ideal). + validations: + required: true + - type: textarea + id: repro + attributes: + label: Smallest example + description: A few lines of code, with the reference object and options you used. + render: ts + validations: + required: true + - type: input + id: version + attributes: + label: Package version + placeholder: '1.0.0' + validations: + required: true + - type: input + id: runtime + attributes: + label: React Native or Expo version + placeholder: 'React Native 0.80, or Expo SDK 54' + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..91150d2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Report a security problem privately + url: https://github.com/MoleCare/rn-scale-reference/security/advisories/new + about: Please do not open a public issue for security problems. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..f70cbdc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,29 @@ +name: Feature request +description: An idea that would make the package more useful. +labels: [enhancement] +body: + - type: markdown + attributes: + value: | + This package estimates sizes and never presents an estimate as a clinical + measurement (see CONTRIBUTING.md). Ideas that label a size as worrying, + or hide the error in an estimate, will be declined. Better tilt handling, + uncertainty estimates and clearer messages are very welcome. + - type: textarea + id: problem + attributes: + label: The problem + description: What are you trying to do that is hard today? + validations: + required: true + - type: textarea + id: idea + attributes: + label: Your idea + description: How you would like it to work, ideally with the options or API you imagine. + - type: checkboxes + id: help + attributes: + label: Can you help? + options: + - label: I would like to open a pull request for this. diff --git a/.github/ISSUE_TEMPLATE/reference_object.yml b/.github/ISSUE_TEMPLATE/reference_object.yml new file mode 100644 index 0000000..8cb0355 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/reference_object.yml @@ -0,0 +1,35 @@ +name: New reference object +description: Suggest a coin, card or sticker of known size. +labels: [reference-object] +body: + - type: markdown + attributes: + value: | + Every size in this package comes from a published source, so please + include one (a mint, standards body or manufacturer page). + - type: input + id: name + attributes: + label: Object + placeholder: 'Euro 1 cent coin' + validations: + required: true + - type: input + id: size + attributes: + label: Published size in millimetres + placeholder: '16.25 mm diameter' + validations: + required: true + - type: input + id: source + attributes: + label: Source for the size + placeholder: 'https://…' + validations: + required: true + - type: textarea + id: notes + attributes: + label: Anything that affects accuracy + description: Worn edges, several versions in circulation, shiny surfaces and so on. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..9b3b596 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,13 @@ +## What this changes + + + +## Checklist + +- [ ] A test for the behaviour I changed (100% coverage stays) +- [ ] A line in the top section of `CHANGELOG.md`, if a user would notice +- [ ] Stateless: no module-level `let` or `var`, no caches, no `configure()` +- [ ] Results and tables stay `Object.freeze`d +- [ ] A new reference size cites its published source +- [ ] No real photos of people +- [ ] Estimates are still shown as estimates: no clinical wording, no false precision diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..2bd5a0a --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22 diff --git a/README.md b/README.md index c488401..f85ff12 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # @molecare/scale-reference +[![CI](https://github.com/MoleCare/rn-scale-reference/actions/workflows/ci.yml/badge.svg)](https://github.com/MoleCare/rn-scale-reference/actions/workflows/ci.yml) +[![npm](https://img.shields.io/npm/v/@molecare/scale-reference)](https://www.npmjs.com/package/@molecare/scale-reference) +![types included](https://img.shields.io/npm/types/@molecare/scale-reference) +[![licence](https://img.shields.io/badge/licence-Apache--2.0-blue)](LICENSE) + Estimate real-world sizes in a photo from an object of known size in the same frame: a calibration sticker or a coin. Give it the ellipse your detector found around the reference. It returns a scale, tells you when a photo can't be used,