@bestend/confluence-cli 1.15.1
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/.eslintrc.js +23 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +34 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +26 -0
- package/.github/ISSUE_TEMPLATE/feedback.md +37 -0
- package/.github/pull_request_template.md +31 -0
- package/.github/workflows/ci.yml +67 -0
- package/.github/workflows/publish.yml +26 -0
- package/.releaserc +17 -0
- package/CHANGELOG.md +232 -0
- package/CONTRIBUTING.md +246 -0
- package/LICENSE +21 -0
- package/README.md +454 -0
- package/bin/confluence.js +1225 -0
- package/bin/index.js +24 -0
- package/docs/PROMOTION.md +63 -0
- package/eslint.config.js +33 -0
- package/examples/copy-tree-example.sh +117 -0
- package/examples/create-child-page-example.sh +67 -0
- package/examples/demo-page-management.sh +68 -0
- package/examples/demo.sh +43 -0
- package/examples/sample-page.md +30 -0
- package/jest.config.js +13 -0
- package/lib/analytics.js +87 -0
- package/lib/config.js +437 -0
- package/lib/confluence-client.js +1810 -0
- package/llms.txt +46 -0
- package/package.json +57 -0
- package/tests/confluence-client.test.js +459 -0
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
# Contributing to Confluence CLI
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to Confluence CLI! This document provides guidelines and information about contributing to this project.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Code of Conduct](#code-of-conduct)
|
|
8
|
+
- [Getting Started](#getting-started)
|
|
9
|
+
- [Development Setup](#development-setup)
|
|
10
|
+
- [Making Changes](#making-changes)
|
|
11
|
+
- [Testing](#testing)
|
|
12
|
+
- [Submitting Changes](#submitting-changes)
|
|
13
|
+
- [Coding Standards](#coding-standards)
|
|
14
|
+
|
|
15
|
+
## Code of Conduct
|
|
16
|
+
|
|
17
|
+
This project adheres to a code of conduct. By participating, you are expected to uphold this code. Please be respectful and considerate in all interactions.
|
|
18
|
+
|
|
19
|
+
## Getting Started
|
|
20
|
+
|
|
21
|
+
1. Fork the repository on GitHub
|
|
22
|
+
2. Clone your fork locally
|
|
23
|
+
3. Create a branch for your changes
|
|
24
|
+
4. Make your changes
|
|
25
|
+
5. Test your changes
|
|
26
|
+
6. Submit a pull request
|
|
27
|
+
|
|
28
|
+
## Development Setup
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Clone your fork
|
|
32
|
+
git clone https://github.com/your-username/confluence-cli.git
|
|
33
|
+
cd confluence-cli
|
|
34
|
+
|
|
35
|
+
# Install dependencies
|
|
36
|
+
npm install
|
|
37
|
+
|
|
38
|
+
# Set up your test environment
|
|
39
|
+
export CONFLUENCE_DOMAIN="your-test-domain.atlassian.net"
|
|
40
|
+
export CONFLUENCE_API_TOKEN="your-test-token"
|
|
41
|
+
|
|
42
|
+
# Test the CLI locally
|
|
43
|
+
node bin/confluence.js --help
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Making Changes
|
|
47
|
+
|
|
48
|
+
### Branch Naming
|
|
49
|
+
|
|
50
|
+
Use descriptive branch names:
|
|
51
|
+
- `feature/add-page-creation` - for new features
|
|
52
|
+
- `fix/search-pagination` - for bug fixes
|
|
53
|
+
- `docs/update-readme` - for documentation updates
|
|
54
|
+
- `refactor/client-architecture` - for refactoring
|
|
55
|
+
|
|
56
|
+
### Commit Messages
|
|
57
|
+
|
|
58
|
+
Write clear, descriptive commit messages:
|
|
59
|
+
```
|
|
60
|
+
feat: add page creation functionality
|
|
61
|
+
|
|
62
|
+
- Add create command to CLI
|
|
63
|
+
- Implement createPage method in client
|
|
64
|
+
- Add tests for page creation
|
|
65
|
+
- Update README with new command
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Use conventional commit format:
|
|
69
|
+
- `feat:` - new features
|
|
70
|
+
- `fix:` - bug fixes
|
|
71
|
+
- `docs:` - documentation changes
|
|
72
|
+
- `style:` - formatting changes
|
|
73
|
+
- `refactor:` - code refactoring
|
|
74
|
+
- `test:` - adding tests
|
|
75
|
+
- `chore:` - maintenance tasks
|
|
76
|
+
|
|
77
|
+
## Testing
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Run all tests
|
|
81
|
+
npm test
|
|
82
|
+
|
|
83
|
+
# Run tests in watch mode
|
|
84
|
+
npm run test:watch
|
|
85
|
+
|
|
86
|
+
# Check test coverage
|
|
87
|
+
npm run test:coverage
|
|
88
|
+
|
|
89
|
+
# Manual testing
|
|
90
|
+
node bin/confluence.js read 123456789
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Test Guidelines
|
|
94
|
+
|
|
95
|
+
- Write tests for new functionality
|
|
96
|
+
- Ensure existing tests pass
|
|
97
|
+
- Aim for good test coverage
|
|
98
|
+
- Use descriptive test names
|
|
99
|
+
- Mock external API calls
|
|
100
|
+
|
|
101
|
+
## Submitting Changes
|
|
102
|
+
|
|
103
|
+
1. **Push your changes** to your fork
|
|
104
|
+
2. **Create a pull request** against the main branch
|
|
105
|
+
3. **Fill out the PR template** with:
|
|
106
|
+
- Description of changes
|
|
107
|
+
- Type of change (bug fix, feature, etc.)
|
|
108
|
+
- Testing performed
|
|
109
|
+
- Screenshots (if applicable)
|
|
110
|
+
|
|
111
|
+
### Pull Request Guidelines
|
|
112
|
+
|
|
113
|
+
- Keep PRs focused and atomic
|
|
114
|
+
- Include tests for new functionality
|
|
115
|
+
- Update documentation as needed
|
|
116
|
+
- Ensure CI passes
|
|
117
|
+
- Request review from maintainers
|
|
118
|
+
|
|
119
|
+
## Coding Standards
|
|
120
|
+
|
|
121
|
+
### JavaScript Style
|
|
122
|
+
|
|
123
|
+
- Use ES6+ features when appropriate
|
|
124
|
+
- Follow existing code style
|
|
125
|
+
- Use meaningful variable names
|
|
126
|
+
- Add comments for complex logic
|
|
127
|
+
- Keep functions small and focused
|
|
128
|
+
|
|
129
|
+
### Markdown Support
|
|
130
|
+
|
|
131
|
+
The CLI includes enhanced markdown support with:
|
|
132
|
+
|
|
133
|
+
- **Native Confluence Storage Format**: Converts markdown to native Confluence elements instead of HTML macros
|
|
134
|
+
- **Confluence Extensions**: Support for admonitions (`[!info]`, `[!warning]`, `[!note]`)
|
|
135
|
+
- **Bidirectional Conversion**: Convert from markdown to storage format and back
|
|
136
|
+
- **Rich Elements**: Tables, code blocks, lists, links, and formatting
|
|
137
|
+
|
|
138
|
+
Example markdown with Confluence extensions:
|
|
139
|
+
```markdown
|
|
140
|
+
# My Page
|
|
141
|
+
|
|
142
|
+
[!info]
|
|
143
|
+
This is an info admonition that will render as a Confluence info macro.
|
|
144
|
+
|
|
145
|
+
```javascript
|
|
146
|
+
console.log("Code blocks preserve syntax highlighting");
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
| Feature | Status |
|
|
150
|
+
|---------|--------|
|
|
151
|
+
| Tables | ✅ |
|
|
152
|
+
| Lists | ✅ |
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### File Structure
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
bin/ # CLI entry points
|
|
159
|
+
lib/ # Core library code
|
|
160
|
+
├── confluence-client.js
|
|
161
|
+
├── config.js
|
|
162
|
+
└── utils.js
|
|
163
|
+
tests/ # Test files
|
|
164
|
+
docs/ # Additional documentation
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Error Handling
|
|
168
|
+
|
|
169
|
+
- Always handle errors gracefully
|
|
170
|
+
- Provide helpful error messages
|
|
171
|
+
- Use appropriate exit codes
|
|
172
|
+
- Log errors appropriately
|
|
173
|
+
|
|
174
|
+
### Documentation
|
|
175
|
+
|
|
176
|
+
- Update README for new features
|
|
177
|
+
- Add JSDoc comments for functions
|
|
178
|
+
- Update CHANGELOG for releases
|
|
179
|
+
- Include usage examples
|
|
180
|
+
|
|
181
|
+
## Feature Requests
|
|
182
|
+
|
|
183
|
+
Before implementing major features:
|
|
184
|
+
|
|
185
|
+
1. **Check existing issues** to avoid duplication
|
|
186
|
+
2. **Create an issue** to discuss the feature
|
|
187
|
+
3. **Get maintainer feedback** before starting work
|
|
188
|
+
4. **Follow the agreed approach** in implementation
|
|
189
|
+
|
|
190
|
+
## Bug Reports
|
|
191
|
+
|
|
192
|
+
When reporting bugs:
|
|
193
|
+
|
|
194
|
+
1. **Check existing issues** first
|
|
195
|
+
2. **Provide reproduction steps**
|
|
196
|
+
3. **Include environment details**:
|
|
197
|
+
- Node.js version
|
|
198
|
+
- OS and version
|
|
199
|
+
- CLI version
|
|
200
|
+
4. **Share error messages** and logs
|
|
201
|
+
|
|
202
|
+
## Development Tips
|
|
203
|
+
|
|
204
|
+
### Local Testing
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
# Test against your Confluence instance
|
|
208
|
+
export CONFLUENCE_DOMAIN="your-domain.atlassian.net"
|
|
209
|
+
export CONFLUENCE_API_TOKEN="your-token"
|
|
210
|
+
|
|
211
|
+
# Test commands
|
|
212
|
+
node bin/confluence.js spaces
|
|
213
|
+
node bin/confluence.js search "test"
|
|
214
|
+
node bin/confluence.js read 123456789
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Debugging
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
# Enable debug mode
|
|
221
|
+
DEBUG=confluence-cli node bin/confluence.js read 123456789
|
|
222
|
+
|
|
223
|
+
# Use Node.js debugger
|
|
224
|
+
node --inspect-brk bin/confluence.js read 123456789
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Release Process
|
|
228
|
+
|
|
229
|
+
For maintainers:
|
|
230
|
+
|
|
231
|
+
1. Update version in `package.json`
|
|
232
|
+
2. Update `CHANGELOG.md`
|
|
233
|
+
3. Create git tag
|
|
234
|
+
4. Push to npm
|
|
235
|
+
5. Create GitHub release
|
|
236
|
+
|
|
237
|
+
## Questions?
|
|
238
|
+
|
|
239
|
+
If you have questions about contributing:
|
|
240
|
+
|
|
241
|
+
1. Check existing documentation
|
|
242
|
+
2. Search closed issues
|
|
243
|
+
3. Ask in a new issue
|
|
244
|
+
4. Contact maintainers
|
|
245
|
+
|
|
246
|
+
Thank you for contributing to Confluence CLI! 🚀
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Confluence CLI Contributors
|
|
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.
|