@plasius/react-state 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,186 +0,0 @@
1
- name: CD (Publish to npm)
2
-
3
- on:
4
- workflow_dispatch:
5
-
6
- permissions:
7
- contents: write
8
- id-token: write # for npm provenance (requires Node 18+ and npm >=9)
9
- attestations: write
10
-
11
- jobs:
12
- publish:
13
- runs-on: ubuntu-latest
14
- environment: production
15
- steps:
16
- - name: Checkout
17
- uses: actions/checkout@v4
18
-
19
- - name: Use Node.js 22
20
- uses: actions/setup-node@v4
21
- with:
22
- node-version-file: '.nvmrc'
23
- cache: 'npm'
24
-
25
- - name: Bump version & decide publish flags
26
- id: pkg
27
- env:
28
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
29
- run: |
30
- set -euo pipefail
31
- git config user.name "github-actions[bot]"
32
- git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
33
- NEW_VER=$(npm version patch -m "chore: release v%s [skip ci]")
34
- echo "New version: $NEW_VER"
35
- git push --follow-tags
36
-
37
- # Expose tag (vX.Y.Z) and version (X.Y.Z) for later steps
38
- VER_NO_V=${NEW_VER#v}
39
- echo "tag=$NEW_VER" >> "$GITHUB_OUTPUT"
40
- echo "version=$VER_NO_V" >> "$GITHUB_OUTPUT"
41
-
42
- NAME=$(node -p "require('./package.json').name")
43
- echo "name=$NAME" >> "$GITHUB_OUTPUT"
44
- if npm view "$NAME" version >/dev/null 2>&1; then
45
- echo "flags=" >> "$GITHUB_OUTPUT"
46
- else
47
- echo "flags=--access public" >> "$GITHUB_OUTPUT"
48
- fi
49
-
50
- - name: Install deps (CI)
51
- run: npm ci
52
-
53
- - name: Test (coverage)
54
- run: npm run test -- --coverage
55
-
56
- - name: Upload coverage to Codecov
57
- uses: codecov/codecov-action@v4
58
- with:
59
- token: ${{ secrets.CODECOV_TOKEN }}
60
- files: ./coverage/lcov.info
61
- flags: unittests
62
- fail_ci_if_error: true
63
-
64
- - name: Build
65
- run: npm run build --if-present
66
-
67
- - name: Generate SBOM (CycloneDX)
68
- run: npm sbom --sbom-format=cyclonedx --sbom-type=library --omit dev > sbom.cdx.json
69
-
70
- - name: Attest SBOM (GitHub Artifact Attestations)
71
- uses: actions/attest-build-provenance@v3
72
- with:
73
- subject-path: sbom.cdx.json
74
-
75
- - name: Update CHANGELOG.md (move Unreleased to new version)
76
- env:
77
- VERSION: ${{ steps.pkg.outputs.version }}
78
- TAG: ${{ steps.pkg.outputs.tag }}
79
- GITHUB_REPOSITORY: ${{ github.repository }}
80
- verbose: true
81
- run: |
82
- set -euo pipefail
83
- git config user.name "github-actions[bot]"
84
- git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
85
-
86
- FILE="CHANGELOG.md"
87
- if [ ! -f "$FILE" ]; then
88
- echo "No CHANGELOG.md found; skipping changelog update."
89
- exit 0
90
- fi
91
-
92
- DATE=$(date -u +%Y-%m-%d)
93
- VERSION_LINE="## [${VERSION}] - ${DATE}"
94
-
95
- # Identify Unreleased block boundaries
96
- UNREL_START=$(grep -n '^## \[Unreleased\]' "$FILE" | cut -d: -f1 || true)
97
- if [ -z "$UNREL_START" ]; then
98
- echo "No '## [Unreleased]' section found; skipping changelog update."
99
- exit 0
100
- fi
101
- NEXT_HDR=$(awk 'NR>'"$UNREL_START"' && /^## \[/{print NR; exit}' "$FILE")
102
- if [ -z "$NEXT_HDR" ]; then
103
- NEXT_HDR=$(wc -l < "$FILE")
104
- NEXT_HDR=$((NEXT_HDR+1))
105
- fi
106
-
107
- # Extract sections
108
- HEADER=$(sed -n "1,${UNREL_START}p" "$FILE")
109
- UNREL_CONTENT=$(sed -n "$((UNREL_START+1)),$((NEXT_HDR-1))p" "$FILE")
110
- TAIL=$(sed -n "${NEXT_HDR},\$p" "$FILE")
111
-
112
- # Prepare new Unreleased template (Keep a Changelog style) without tabs/indent issues
113
- NEW_UNRELEASED=$(printf '%s\n' \
114
- '' \
115
- '- **Added**' \
116
- ' - (placeholder)' \
117
- '' \
118
- '- **Changed**' \
119
- ' - (placeholder)' \
120
- '' \
121
- '- **Fixed**' \
122
- ' - (placeholder)' \
123
- '' \
124
- '- **Security**' \
125
- ' - (placeholder)')
126
-
127
- # Build the new CHANGELOG content
128
- TMP_FILE=$(mktemp)
129
- {
130
- printf "%s\n" "$HEADER"
131
- printf "%s\n\n" "$NEW_UNRELEASED"
132
- printf "%s\n" "$VERSION_LINE"
133
- # If Unreleased was empty, at least add a placeholder so the section isn't blank
134
- if [ -z "$(echo "$UNREL_CONTENT" | tr -d '\n' | tr -d '[:space:]')" ]; then
135
- printf "### Changed\n- (no notable changes)\n\n"
136
- else
137
- printf "%s\n" "$UNREL_CONTENT"
138
- # Ensure a trailing newline after the inserted section
139
- printf "\n"
140
- fi
141
- printf "%s\n" "$TAIL"
142
- } > "$TMP_FILE"
143
-
144
- mv "$TMP_FILE" "$FILE"
145
-
146
- # Update bottom compare links
147
- # Update [Unreleased] compare to start at v${VERSION}
148
- COMPARE_URL="https://github.com/${GITHUB_REPOSITORY}/compare/v${VERSION}...HEAD"
149
- awk -v repl="[Unreleased]: ${COMPARE_URL}" 'BEGIN{OFS=FS} { if ($0 ~ /^\[Unreleased\]: /) { print repl } else { print } }' "$FILE" > "$FILE.tmp"
150
- mv "$FILE.tmp" "$FILE"
151
-
152
- # Append a link for the new version if not present
153
- if ! grep -q "^\[${VERSION}\]:" "$FILE"; then
154
- echo "[${VERSION}]: https://github.com/${GITHUB_REPOSITORY}/releases/tag/v${VERSION}" >> "$FILE"
155
- fi
156
-
157
- git add "$FILE"
158
- git commit -m "docs(changelog): release v${VERSION}"
159
- git push
160
-
161
- - name: Create GitHub Release from tag (first-party)
162
- env:
163
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
164
- run: |
165
- set -euo pipefail
166
- TAG="${{ steps.pkg.outputs.tag }}"
167
- if gh release view "$TAG" >/dev/null 2>&1; then
168
- echo "Release $TAG already exists; uploading SBOM asset."
169
- else
170
- gh release create "$TAG" \
171
- --title "Release $TAG" \
172
- --generate-notes \
173
- --latest
174
- fi
175
- # Upload/overwrite the SBOM asset on the release
176
- if [ -f sbom.cdx.json ]; then
177
- gh release upload "$TAG" sbom.cdx.json --clobber
178
- else
179
- echo "No SBOM generated; skipping upload."
180
- fi
181
-
182
- - name: Publish
183
- env:
184
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
185
- run: |
186
- npm publish ${{ steps.pkg.outputs.flags }} --provenance
@@ -1,16 +0,0 @@
1
- name: CI
2
- on:
3
- push: { branches: [main] }
4
- pull_request: { branches: [main] }
5
- jobs:
6
- build-test:
7
- runs-on: ubuntu-latest
8
- steps:
9
- - uses: actions/checkout@v4
10
- - uses: actions/setup-node@v4
11
- with:
12
- node-version: "22"
13
- cache: "npm"
14
- - run: npm ci
15
- - run: npm run build
16
- - run: npm test
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- 22
@@ -1,15 +0,0 @@
1
- {
2
- "version": "0.2.0",
3
- "configurations": [
4
- {
5
- "type": "node",
6
- "request": "launch",
7
- "name": "Debug Vitest",
8
- "program": "${workspaceFolder}/node_modules/vitest/vitest.mjs",
9
- "args": ["run"],
10
- "cwd": "${workspaceFolder}",
11
- "console": "integratedTerminal",
12
- "skipFiles": ["<node_internals>/**"]
13
- }
14
- ]
15
- }
package/CHANGELOG.md DELETED
@@ -1,72 +0,0 @@
1
-
2
- # Changelog
3
-
4
- All notable changes to this project will be documented in this file.
5
-
6
- The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/)**, and this project adheres to **[Semantic Versioning](https://semver.org/spec/v2.0.0.html)**.
7
-
8
- ---
9
-
10
- ## [Unreleased]
11
-
12
- - **Added**
13
- - (placeholder)
14
-
15
- - **Changed**
16
- - (placeholder)
17
-
18
- - **Fixed**
19
- - (placeholder)
20
-
21
- - **Security**
22
- - (placeholder)
23
-
24
- ## [1.0.10] - 2025-09-17
25
-
26
- - **Fixed**
27
- - CD Pipeline ordering fix for version in CHANGELOG.md
28
-
29
- ## [1.0.7] - 2025-09-17
30
-
31
- - **Added**
32
- - Code coverage added.
33
-
34
- ---
35
-
36
- ## [1.0.0] - 2025-09-16
37
-
38
- - **Added**
39
-
40
- - Initial public release of `@plasius/react-state`.
41
- - `createStore` for basic state container functionality with `dispatch`, `getState`, and subscription API.
42
- - `createScopedStoreContext` for React integration:
43
- - `<Provider>` component wrapping React trees,
44
- - `useStore()` to access state,
45
- - `useDispatch()` to dispatch actions.
46
- - Support for per-key subscriptions and selector-based subscriptions.
47
- - Unit tests with Vitest and component tests with React Testing Library.
48
-
49
- - **Changed**
50
- - N/A (initial release)
51
-
52
- - **Fixed**
53
- - N/A (initial release)
54
-
55
- ---
56
-
57
- ## Release process (maintainers)
58
-
59
- 1. Update `CHANGELOG.md` under **Unreleased** with user‑visible changes.
60
- 2. Bump version in `package.json` following SemVer (major/minor/patch).
61
- 3. Move entries from **Unreleased** to a new version section with the current date.
62
- 4. Tag the release in Git (`vX.Y.Z`) and push tags.
63
- 5. Publish to npm (via CI/CD or `npm publish`).
64
-
65
- > Tip: Use Conventional Commits in PR titles/bodies to make changelog updates easier.
66
-
67
- ---
68
-
69
- [Unreleased]: https://github.com/Plasius-LTD/react-state/compare/v1.0.10...HEAD
70
- [1.0.0]: https://github.com/Plasius-LTD/react-state/releases/tag/v1.0.0
71
- [1.0.7]: https://github.com/Plasius-LTD/react-state/releases/tag/v1.0.7
72
- [1.0.10]: https://github.com/Plasius-LTD/react-state/releases/tag/v1.0.10
@@ -1,79 +0,0 @@
1
- # Contributor Covenant Code of Conduct v2.1
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
- We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
-
9
- ## Our Standards
10
-
11
- Examples of behavior that contributes to a positive environment for our community include:
12
-
13
- - Demonstrating empathy and kindness toward other people
14
- - Being respectful of differing opinions, viewpoints, and experiences
15
- - Giving and gracefully accepting constructive feedback
16
- - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
- - Focusing on what is best not just for us as individuals, but for the overall community
18
-
19
- Examples of unacceptable behavior include:
20
-
21
- - The use of sexualized language or imagery, and sexual attention or advances of any kind
22
- - Trolling, insulting or derogatory comments, and personal or political attacks
23
- - Public or private harassment
24
- - Publishing others’ private information, such as a physical or email address, without their explicit permission
25
- - Other conduct which could reasonably be considered inappropriate in a professional setting
26
-
27
- ## Enforcement Responsibilities
28
-
29
- Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30
-
31
- Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
32
-
33
- ## Scope
34
-
35
- This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
36
-
37
- ## Enforcement
38
-
39
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [conduct@plasius.co.uk](mailto:conduct@plasius.co.uk). All complaints will be reviewed and investigated promptly and fairly.
40
-
41
- All community leaders are obligated to respect the privacy and security of the reporter of any incident.
42
-
43
- ## Enforcement Guidelines
44
-
45
- Community leaders will follow these Enforcement Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
46
-
47
- ### 1. Correction
48
-
49
- **Community Impact:** Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
50
-
51
- **Consequence:** A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
52
-
53
- ### 2. Warning
54
-
55
- **Community Impact:** A violation through a single incident or series of actions.
56
-
57
- **Consequence:** A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
58
-
59
- ### 3. Temporary Ban
60
-
61
- **Community Impact:** A serious violation of community standards, including sustained inappropriate behavior.
62
-
63
- **Consequence:** A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
64
-
65
- ### 4. Permanent Ban
66
-
67
- **Community Impact:** Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
68
-
69
- **Consequence:** A permanent ban from any sort of public interaction within the community.
70
-
71
- ## Attribution
72
-
73
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html)
74
-
75
- For answers to common questions about this code of conduct, see the [FAQ](https://www.contributor-covenant.org/faq)
76
-
77
- [homepage]: [https://www.contributor-covenant.org](https://www.contributor-covenant.org)
78
-
79
- If you have any questions or concerns regarding this Code of Conduct, please contact us at [conduct@plasius.co.uk](mailto:conduct@plasius.co.uk).
package/CONTRIBUTING.md DELETED
@@ -1,201 +0,0 @@
1
- # Contributing to @plasius/react-state
2
-
3
- First off: thanks for taking the time to contribute!
4
- This document explains how to work on the project, how to propose changes, and what we expect in pull requests.
5
-
6
- > TL;DR
7
- >
8
- > - Be respectful and follow the Code of Conduct.
9
- > - Open an issue before large changes; small fixes can go straight to a PR.
10
- > - Write tests, keep coverage steady or improving.
11
- > - Use Conventional Commits.
12
- > - Don’t include real PII in code, issues, tests, or logs.
13
-
14
- ---
15
-
16
- ## Code of Conduct
17
-
18
- Participation in this project is governed by our **Code of Conduct** (see `CODE_OF_CONDUCT.md`). By participating, you agree to abide by it.
19
-
20
- ## Licensing & CLA
21
-
22
- This project is open source (see `LICENSE`). To protect contributors and users, we require contributors to agree to our **Contributor License Agreement (CLA)** before we can merge PRs (see `legal/CLA.md`). You’ll be prompted automatically by the CLA bot on your first PR.
23
-
24
- > If your company has special legal needs, please contact the maintainers before sending large PRs.
25
-
26
- ## Security
27
-
28
- **Never** report security issues in public issues or PRs. Instead, follow the process in `SECURITY.md`.
29
-
30
- ---
31
-
32
- ## What this project does
33
-
34
- `@plasius/react-state` provides a small, strongly-typed schema library:
35
-
36
- - A fluent field builder (e.g. `field().string().required()`),
37
- - Built-in validators for common standards (ISO/RFC/OWASP, etc.),
38
- - PII annotations + redaction utilities,
39
- - Type inference for safe, consistent entities across projects.
40
-
41
- Contributions typically fall into: new validators, field builder features, type improvements, docs, and tooling quality.
42
-
43
- ---
44
-
45
- ## Getting started (local dev)
46
-
47
- ### Prerequisites
48
-
49
- - Node.js (use the version specified in `.nvmrc` if present: `nvm use`).
50
- - npm (we use npm scripts in this repo).
51
-
52
- ### Install
53
-
54
- ```bash
55
- npm ci
56
- ```
57
-
58
- ### Build
59
-
60
- ```bash
61
- npm run build
62
- ```
63
-
64
- ### Test
65
-
66
- ```bash
67
- npm test
68
- # or, if using Vitest in watch mode
69
- npm run test:watch
70
- ```
71
-
72
- ### Lint & format
73
-
74
- ```bash
75
- npm run lint
76
- npm run format
77
- ```
78
-
79
- > Tip: set up your editor to run ESLint and Prettier on save.
80
-
81
- ---
82
-
83
- ## How to propose a change
84
-
85
- ### 1) For bugs
86
-
87
- - Search existing issues first.
88
- - Open a new issue with:
89
- - Clear title, steps to reproduce, expected vs actual behaviour,
90
- - Minimal repro (code snippet or small repo),
91
- - Environment info (OS, Node, package version).
92
-
93
- ### 2) For features / refactors
94
-
95
- - For anything non-trivial, open an issue first and outline the proposal.
96
- - If the change affects public API or architecture, add an ADR draft (see `docs/adrs/`).
97
-
98
- ### 3) Good first issues
99
-
100
- We label approachable tasks as **good first issue** and **help wanted**.
101
-
102
- ---
103
-
104
- ## Branch, commit, PR
105
-
106
- ### Branching
107
-
108
- - Fork or create a feature branch from `main`: `feat/xyz` or `fix/abc`.
109
-
110
- ### **Commit messages** (Conventional Commits)
111
-
112
- - `feat: add ISO-3166 alpha-3 validator`
113
- - `fix: correct RFC5322 email regex edge-case`
114
- - `docs: expand PII redaction examples`
115
- - `refactor: simplify field builder pipeline`
116
- - `test: add cases for currency code`
117
- - `chore: bump dev deps`
118
-
119
- ### **Pull Requests**
120
-
121
- - Keep PRs focused and small when possible.
122
- - Include tests for new/changed behaviour.
123
- - Update docs (README, JSDoc, ADRs) as needed.
124
- - Add a clear description of what & why, with before/after examples if useful.
125
- - Ensure CI is green (lint, build, tests).
126
-
127
- ### **PR checklist**
128
-
129
- - [ ] Title uses Conventional Commits
130
- - [ ] Tests added/updated
131
- - [ ] Lint passes (`npm run lint`)
132
- - [ ] Build passes (`npm run build`)
133
- - [ ] Docs updated (README/ADR/CHANGELOG if needed)
134
- - [ ] No real PII in code, tests, or logs
135
-
136
- ---
137
-
138
- ## Coding standards
139
-
140
- - **Language:** TypeScript with `strict` types.
141
- - **Style:** ESLint + Prettier.
142
- - **Tests:** Prefer Vitest (or Jest) + `@testing-library/*` for React-facing bits.
143
- - **Public API:** Aim for backward compatibility; use SemVer and mark breaking changes clearly (`feat!:` or `fix!:`).
144
- - **Performance:** Avoid excessive allocations in hot paths; prefer immutable patterns but mind GC pressure.
145
- - **Docs:** Add TSDoc comments for exported types/functions.
146
-
147
- ### Validators
148
-
149
- - Add tests covering common/edge cases.
150
- - Cite the source/standard (e.g., ISO/RFC) in comments.
151
- - Keep regexes readable (use `x`/comments where possible) and benchmark if complex.
152
-
153
- ### PII handling
154
-
155
- - Never include real PII in fixtures or examples.
156
- - Ensure redaction/cleaning functions operate **before** logging.
157
- - Add tests confirming no PII leaks to logs or thrown errors.
158
-
159
- ---
160
-
161
- ## Adding dependencies
162
-
163
- - Minimise runtime dependencies; prefer dev dependencies.
164
- - Justify any new runtime dependency in the PR description (size, security, maintenance).
165
- - Avoid transitive heavy deps unless critical.
166
-
167
- ---
168
-
169
- ## Versioning & releases
170
-
171
- - We follow **SemVer**.
172
- - Breaking changes require a major bump and migration notes.
173
- - Keep the `CHANGELOG.md` (or release notes) clear about user-facing changes.
174
-
175
- ---
176
-
177
- ## Documentation
178
-
179
- - Update `README.md` with new features or setup steps.
180
- - Add or update ADRs in `docs/adrs/` for architectural decisions.
181
- - Keep examples minimal, copy-pasteable, and tested when feasible.
182
-
183
- ---
184
-
185
- ## Maintainers’ process (overview)
186
-
187
- - Triage new issues weekly; label and assign.
188
- - Review PRs for correctness, tests, and docs.
189
- - Squash-merge with Conventional Commit titles.
190
- - Publish from CI when applicable.
191
-
192
- ---
193
-
194
- ## Questions
195
-
196
- If you have questions or want feedback before building:
197
-
198
- - Open a discussion or issue with a short proposal,
199
- - Or draft a PR early (mark as **Draft**) to get directional feedback.
200
-
201
- Thanks again for contributing 💛
package/CONTRIBUTORS.md DELETED
@@ -1,27 +0,0 @@
1
- # Contributing Guidelines
2
-
3
- Thank you for considering contributing to this project! We welcome contributions that improve the code, documentation, and overall project quality.
4
-
5
- ## Getting Started
6
-
7
- - Fork the repository.
8
- - Create a feature branch from `main`.
9
- - Commit your changes with clear messages (we follow **Conventional Commits**).
10
- - Push your branch and open a Pull Request (PR).
11
-
12
- ## Requirements
13
-
14
- - Write tests alongside code where possible.
15
- - Ensure all tests pass before submitting a PR.
16
- - Follow the repository’s coding style and linting rules.
17
- - Update documentation (README, ADRs, etc.) when making significant changes.
18
- - When making architectural changes, create a new ADR (Architecture Decision Record) that **succeeds** the previous one rather than modifying old ADRs. This preserves history and ensures decisions are traceable.
19
- - Use the [ADR template](./docs/adrs/adr-template.md) when writing new ADRs to ensure consistency.
20
- - Before your first contribution, sign the appropriate Contributor License Agreement (CLA). See [legal/CLA.md](legal/CLA.md) for details, then email the signed document to [contributors@plasius.co.uk](mailto:contributors@plasius.co.uk).
21
-
22
- ## Communication
23
-
24
- - Use GitHub Issues for bugs and feature requests.
25
- - Pull Requests should describe the problem, solution, and trade-offs.
26
-
27
- We appreciate your support in making this project better!
package/SECURITY.md DELETED
@@ -1,17 +0,0 @@
1
- # Security Policy
2
-
3
- ## Supported Versions
4
-
5
- We currently support the latest major version of this project. Older versions may not receive security updates.
6
-
7
- ## Reporting a Vulnerability
8
-
9
- If you discover a security vulnerability, please report it privately by emailing us at [security@plasius.co.uk](mailto:security@plasius.co.uk). Please do not create a public issue for security-related matters.
10
-
11
- ## Response Timeline
12
-
13
- We aim to acknowledge your report within 2 business days and to provide a more detailed response (including next steps and, if applicable, a timeline for a fix) within 7 business days.
14
-
15
- ## Disclosure Policy
16
-
17
- We request that you give us the opportunity to address the vulnerability before publicly disclosing it. We will coordinate with you on public disclosure once a fix is available and deployed.
@@ -1,42 +0,0 @@
1
- # ADR-0001: React State Store Purpose and Scope
2
-
3
- ## Status
4
-
5
- - Proposed → Accepted
6
- - Date: 2025-09-12
7
- - Version: 1.0
8
- - Supersedes: N/A
9
- - Superseded by: N/A
10
-
11
- ## Context
12
-
13
- Managing React application state across multiple components is a common challenge. Existing solutions (Redux, Zustand, Jotai, etc.) offer different trade-offs in complexity, ergonomics, and bundle size. For the Plasius ecosystem, we want:
14
-
15
- - A minimal, type-safe state container,
16
- - Strong integration with React via Context and Hooks,
17
- - Support for both global and scoped stores,
18
- - Predictable subscription and unsubscribe behaviour,
19
- - Alignment with SOLID principles and enterprise-grade maintainability.
20
-
21
- ## Decision
22
-
23
- We will build a dedicated library, `@plasius/react-state`, that:
24
-
25
- - Provides a `createStore` primitive for basic state containers,
26
- - Provides `createScopedStoreContext` to integrate with React Context/Provider patterns,
27
- - Exposes hooks (`useStore`, `useDispatch`) to read state and dispatch actions,
28
- - Supports subscriptions: global, per-key, and selector-based,
29
- - Ensures distinct-until-changed semantics to avoid unnecessary re-renders,
30
- - Is published as an open source package under the Plasius-LTD organisation.
31
-
32
- ## Consequences
33
-
34
- - **Positive:** Consistent and predictable state handling across Plasius projects, type-safe APIs, lighter alternative to Redux, improved testability, open source adoption possible.
35
- - **Negative:** Adds maintenance burden to keep feature parity with evolving React ecosystem; community may default to established libraries.
36
- - **Neutral:** Internal consumers may still choose other state management libs if required, but Plasius packages will standardise on this one.
37
-
38
- ## Alternatives Considered
39
-
40
- - **Use Redux or Redux Toolkit:** Very mature, but verbose and heavier than desired.
41
- - **Use Zustand or Jotai:** Good ergonomics, but external dependency risk and less control over PII handling and subscription semantics.
42
- - **React Context alone:** Too minimal, lacking structured dispatch and subscribe/unsubscribe APIs.