pinia-plugin-subscription 0.1.0 → 0.1.2
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.
- package/CHANGELOG.md +62 -0
- package/CONTRIBUTING.md +142 -0
- package/LICENSE +21 -21
- package/README.md +5 -1
- package/SECURITY.md +75 -0
- package/dist/pinia-plugin-subscription.js +549 -512
- package/dist/pinia-plugin-subscription.umd.cjs +4 -4
- package/dist/types/index.d.ts +121 -129
- package/package.json +73 -61
- package/dist/types/log.d.ts +0 -8
- package/dist/types/plugin.d.ts +0 -34
- package/dist/types/resourceId.d.ts +0 -4
- package/dist/types/store.d.ts +0 -15
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.2] - 2026-08-09
|
|
9
|
+
|
|
10
|
+
### Fix
|
|
11
|
+
- Added export helper class and functions
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.1.1] - 2026-08-08
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- Added a GitHub Actions workflow to run the test suite on every push and pull request.
|
|
18
|
+
- Added npm provenance-based publishing for improved supply-chain security.
|
|
19
|
+
- Added a CODEOWNERS file to require maintainer review for repository changes.
|
|
20
|
+
- Included documentation files in the published npm tarball to improve package quality signals.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
- Improved package metadata for npm publishing and discoverability.
|
|
24
|
+
- Documented the release and publishing process in the README.
|
|
25
|
+
- Added explicit package publishing configuration for public access and provenance.
|
|
26
|
+
|
|
27
|
+
### Security
|
|
28
|
+
- Improved release transparency by publishing with npm provenance.
|
|
29
|
+
- Added security and contribution documentation to the package contents.
|
|
30
|
+
|
|
31
|
+
## [0.1.0] - 2026-08-07
|
|
32
|
+
|
|
33
|
+
### Added
|
|
34
|
+
- **Core Plugin System:** `createPlugin()` function to create Pinia plugins from subscribers.
|
|
35
|
+
- **PluginSubscriber Class:** Abstract base class for creating reusable plugin subscribers.
|
|
36
|
+
- **Store Helper Class:** Wrapper around PiniaStore with utilities for state and subscription management.
|
|
37
|
+
- **PluginSubscriberInterface:** Interface for implementing custom subscribers.
|
|
38
|
+
- **Debug Mode:** Detailed logging support for plugin development and troubleshooting.
|
|
39
|
+
- **Reset Callbacks:** Custom store reset logic via `resetStoreCallback`.
|
|
40
|
+
- **Type Definitions:** Full TypeScript support with comprehensive type exports.
|
|
41
|
+
- **Test Suite:** Comprehensive Vitest coverage for all core functionality.
|
|
42
|
+
- **Documentation:** Complete README with API reference and examples.
|
|
43
|
+
- **MIT License:** Open source license for community use.
|
|
44
|
+
|
|
45
|
+
### Features
|
|
46
|
+
- Centralized subscriber registration for Pinia stores.
|
|
47
|
+
- `$reset` method added to all stores modified by the plugin.
|
|
48
|
+
- Support for store mutations and action subscriptions.
|
|
49
|
+
- Plugin-specific subscription management.
|
|
50
|
+
- State helper methods: `addToState()`, `stateHas()`, `getValue()`.
|
|
51
|
+
- Store helper methods: `storeHas()`.
|
|
52
|
+
- Performance monitoring utilities.
|
|
53
|
+
- Validation utilities for common object operations.
|
|
54
|
+
|
|
55
|
+
### Documentation
|
|
56
|
+
- Installation and usage examples.
|
|
57
|
+
- API reference for all public classes and functions.
|
|
58
|
+
- Contributing guidelines.
|
|
59
|
+
- Security policy.
|
|
60
|
+
|
|
61
|
+
[0.1.1]: https://github.com/AlxBDo/pinia-plugin-subscription/releases/tag/v0.1.1
|
|
62
|
+
[0.1.0]: https://github.com/AlxBDo/pinia-plugin-subscription/releases/tag/v0.1.0
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Contributing to pinia-plugin-subscription
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing! This document provides guidelines and instructions for contributing to this project.
|
|
4
|
+
|
|
5
|
+
## Code of Conduct
|
|
6
|
+
|
|
7
|
+
Please be respectful and constructive in all interactions with other contributors and maintainers.
|
|
8
|
+
|
|
9
|
+
## Getting Started
|
|
10
|
+
|
|
11
|
+
1. **Fork the repository** on GitHub
|
|
12
|
+
2. **Clone your fork** locally:
|
|
13
|
+
```bash
|
|
14
|
+
git clone https://github.com/YOUR_USERNAME/pinia-plugin-subscription.git
|
|
15
|
+
cd pinia-plugin-subscription
|
|
16
|
+
```
|
|
17
|
+
3. **Install dependencies**:
|
|
18
|
+
```bash
|
|
19
|
+
npm install
|
|
20
|
+
```
|
|
21
|
+
4. **Create a feature branch**:
|
|
22
|
+
```bash
|
|
23
|
+
git checkout -b feature/your-feature-name
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Development Workflow
|
|
27
|
+
|
|
28
|
+
### Running Tests
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm run test # Run tests in watch mode
|
|
32
|
+
npm run test -- run # Run tests once
|
|
33
|
+
npm run coverage # Generate coverage report
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Building
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm run build # Run tests, build, and generate types
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Preview Changes
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm run dev # Start development server
|
|
46
|
+
npm run preview # Preview production build
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Making Changes
|
|
50
|
+
|
|
51
|
+
### Code Style
|
|
52
|
+
|
|
53
|
+
- Follow the existing code style in the project
|
|
54
|
+
- Use TypeScript for all new code
|
|
55
|
+
- Ensure strict TypeScript compiler options are satisfied
|
|
56
|
+
- Write descriptive variable and function names
|
|
57
|
+
|
|
58
|
+
### Testing
|
|
59
|
+
|
|
60
|
+
- Write tests for all new features and bug fixes
|
|
61
|
+
- Ensure all existing tests pass before submitting
|
|
62
|
+
- Aim for >80% code coverage
|
|
63
|
+
|
|
64
|
+
### Commits
|
|
65
|
+
|
|
66
|
+
- Write clear, descriptive commit messages
|
|
67
|
+
- Use conventional commits format when possible:
|
|
68
|
+
- `feat:` for new features
|
|
69
|
+
- `fix:` for bug fixes
|
|
70
|
+
- `docs:` for documentation
|
|
71
|
+
- `test:` for tests
|
|
72
|
+
- `refactor:` for code refactoring
|
|
73
|
+
- `chore:` for build/dependencies
|
|
74
|
+
|
|
75
|
+
Example:
|
|
76
|
+
```
|
|
77
|
+
feat: add support for custom reset callbacks
|
|
78
|
+
|
|
79
|
+
- Implement resetStoreCallback in PluginSubscriberInterface
|
|
80
|
+
- Add tests for reset functionality
|
|
81
|
+
- Update documentation
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Submitting Changes
|
|
85
|
+
|
|
86
|
+
1. **Push to your fork**:
|
|
87
|
+
```bash
|
|
88
|
+
git push origin feature/your-feature-name
|
|
89
|
+
```
|
|
90
|
+
2. **Create a Pull Request** on GitHub with:
|
|
91
|
+
- Clear title describing the change
|
|
92
|
+
- Detailed description of what changed and why
|
|
93
|
+
- Reference to related issues if applicable
|
|
94
|
+
- Test results showing coverage
|
|
95
|
+
3. **Address review feedback** respectfully and promptly
|
|
96
|
+
|
|
97
|
+
## Pull Request Guidelines
|
|
98
|
+
|
|
99
|
+
- Keep PRs focused on a single feature or bug fix
|
|
100
|
+
- Include tests for your changes
|
|
101
|
+
- Update documentation if needed
|
|
102
|
+
- Ensure CI checks pass
|
|
103
|
+
- Request review from maintainers
|
|
104
|
+
|
|
105
|
+
## Reporting Bugs
|
|
106
|
+
|
|
107
|
+
Found a bug? Please create an issue on GitHub with:
|
|
108
|
+
|
|
109
|
+
1. **Title:** Clear, concise description
|
|
110
|
+
2. **Environment:** Node.js version, npm version, OS
|
|
111
|
+
3. **Steps to Reproduce:** Minimal reproduction steps
|
|
112
|
+
4. **Expected Behavior:** What should happen
|
|
113
|
+
5. **Actual Behavior:** What actually happens
|
|
114
|
+
6. **Additional Context:** Screenshots, error traces, etc.
|
|
115
|
+
|
|
116
|
+
## Proposing Features
|
|
117
|
+
|
|
118
|
+
Have an idea? Open a GitHub issue with:
|
|
119
|
+
|
|
120
|
+
1. **Title:** Clear feature name
|
|
121
|
+
2. **Description:** What problem does it solve?
|
|
122
|
+
3. **Use Cases:** When would this be useful?
|
|
123
|
+
4. **Proposed Solution:** How might it work?
|
|
124
|
+
5. **Alternatives:** Other approaches considered
|
|
125
|
+
|
|
126
|
+
## Release Process
|
|
127
|
+
|
|
128
|
+
Maintainers will:
|
|
129
|
+
|
|
130
|
+
1. Update `CHANGELOG.md` with changes
|
|
131
|
+
2. Bump version in `package.json` following Semantic Versioning
|
|
132
|
+
3. Create a git tag
|
|
133
|
+
4. Publish to npm
|
|
134
|
+
5. Create a GitHub release
|
|
135
|
+
|
|
136
|
+
## Questions?
|
|
137
|
+
|
|
138
|
+
- Check existing issues and discussions
|
|
139
|
+
- Open a new GitHub discussion if needed
|
|
140
|
+
- Contact maintainers via email
|
|
141
|
+
|
|
142
|
+
Thank you for contributing! 🙏
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Alexandre Bidaud
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Alexandre Bidaud
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -150,4 +150,8 @@ This plugin is tested with Vitest. Coverage reports are available in the `covera
|
|
|
150
150
|
|
|
151
151
|
## License
|
|
152
152
|
|
|
153
|
-
MIT
|
|
153
|
+
MIT
|
|
154
|
+
|
|
155
|
+
## Publishing
|
|
156
|
+
|
|
157
|
+
Releases are published to npm via GitHub Actions. The workflow uses npm provenance for better supply-chain security and requires a `NPM_TOKEN` secret in the repository settings.
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Reporting Security Vulnerabilities
|
|
4
|
+
|
|
5
|
+
If you discover a security vulnerability in pinia-plugin-subscription, please do **NOT** open a public GitHub issue. Instead, please email the maintainers privately.
|
|
6
|
+
|
|
7
|
+
**Email:** [Security Contact - reach out via GitHub profile]
|
|
8
|
+
|
|
9
|
+
Please include:
|
|
10
|
+
|
|
11
|
+
- Description of the vulnerability
|
|
12
|
+
- Steps to reproduce
|
|
13
|
+
- Potential impact
|
|
14
|
+
- Suggested fix (if available)
|
|
15
|
+
|
|
16
|
+
We will:
|
|
17
|
+
|
|
18
|
+
1. Acknowledge your report within 48 hours
|
|
19
|
+
2. Investigate the issue thoroughly
|
|
20
|
+
3. Work on a fix
|
|
21
|
+
4. Release a patched version
|
|
22
|
+
5. Credit you (if desired) in the release notes
|
|
23
|
+
|
|
24
|
+
## Supported Versions
|
|
25
|
+
|
|
26
|
+
| Version | Supported |
|
|
27
|
+
|---------|-----------|
|
|
28
|
+
| 0.1.x | ✅ Yes |
|
|
29
|
+
| < 0.1 | ❌ No |
|
|
30
|
+
|
|
31
|
+
## Security Best Practices
|
|
32
|
+
|
|
33
|
+
When using pinia-plugin-subscription:
|
|
34
|
+
|
|
35
|
+
1. **Keep Dependencies Updated:** Regularly update Pinia, Vue, and other dependencies to the latest versions
|
|
36
|
+
2. **Review Plugin Code:** Always review subscriber code before using in production
|
|
37
|
+
3. **Validate Store Data:** Validate data before storing in Pinia stores
|
|
38
|
+
4. **Debug Mode:** Disable debug mode in production (set `false` when calling `createPlugin`)
|
|
39
|
+
|
|
40
|
+
## Dependencies Security
|
|
41
|
+
|
|
42
|
+
This project depends on:
|
|
43
|
+
|
|
44
|
+
- **Pinia** - Vue state management
|
|
45
|
+
- **Vue** - JavaScript framework
|
|
46
|
+
|
|
47
|
+
We monitor these dependencies for vulnerabilities and recommend keeping them updated.
|
|
48
|
+
|
|
49
|
+
## Vulnerability Disclosure Timeline
|
|
50
|
+
|
|
51
|
+
- **Day 0:** Report received
|
|
52
|
+
- **Day 1-2:** Initial assessment
|
|
53
|
+
- **Day 3-7:** Fix development
|
|
54
|
+
- **Day 7-14:** Security release
|
|
55
|
+
- **Day 14:** Public disclosure
|
|
56
|
+
|
|
57
|
+
## Scope
|
|
58
|
+
|
|
59
|
+
This policy covers:
|
|
60
|
+
|
|
61
|
+
- ✅ Code in the pinia-plugin-subscription repository
|
|
62
|
+
- ✅ Published npm packages
|
|
63
|
+
- ✅ Security of the plugin API
|
|
64
|
+
|
|
65
|
+
This policy does NOT cover:
|
|
66
|
+
|
|
67
|
+
- ❌ Security of Pinia or Vue (report to their respective projects)
|
|
68
|
+
- ❌ Security of applications using this plugin
|
|
69
|
+
- ❌ Social engineering attacks
|
|
70
|
+
|
|
71
|
+
## Questions
|
|
72
|
+
|
|
73
|
+
For general security questions or concerns, open a private security advisory on GitHub.
|
|
74
|
+
|
|
75
|
+
Thank you for helping keep pinia-plugin-subscription secure! 🔒
|