pet-terminal 1.0.0 → 1.0.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/.eslintrc.json +22 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +54 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +35 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +69 -0
- package/.github/workflows/ci.yml +62 -0
- package/.prettierrc +8 -0
- package/.vscodeignore +17 -0
- package/CHANGELOG.md +63 -0
- package/CODE_OF_CONDUCT.md +84 -0
- package/CONTRIBUTING.md +193 -0
- package/README.md +307 -268
- package/data/.gitkeep +0 -0
- package/dist/commands/care.d.ts.map +1 -1
- package/dist/commands/care.js +1 -2
- package/dist/commands/care.js.map +1 -1
- package/dist/commands/clean.d.ts.map +1 -1
- package/dist/commands/clean.js +1 -2
- package/dist/commands/clean.js.map +1 -1
- package/dist/commands/feed.d.ts.map +1 -1
- package/dist/commands/feed.js +1 -2
- package/dist/commands/feed.js.map +1 -1
- package/dist/commands/git.d.ts.map +1 -1
- package/dist/commands/git.js +3 -4
- package/dist/commands/git.js.map +1 -1
- package/dist/commands/heal.d.ts.map +1 -1
- package/dist/commands/heal.js +1 -2
- package/dist/commands/heal.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +1 -2
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/inventory.d.ts.map +1 -1
- package/dist/commands/inventory.js +1 -2
- package/dist/commands/inventory.js.map +1 -1
- package/dist/commands/play.d.ts.map +1 -1
- package/dist/commands/play.js +1 -2
- package/dist/commands/play.js.map +1 -1
- package/dist/commands/release.d.ts +3 -0
- package/dist/commands/release.d.ts.map +1 -0
- package/dist/commands/release.js +61 -0
- package/dist/commands/release.js.map +1 -0
- package/dist/commands/shop.d.ts.map +1 -1
- package/dist/commands/shop.js +1 -2
- package/dist/commands/shop.js.map +1 -1
- package/dist/commands/sleep.d.ts.map +1 -1
- package/dist/commands/sleep.js +1 -2
- package/dist/commands/sleep.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +1 -2
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +1 -2
- package/dist/commands/sync.js.map +1 -1
- package/dist/core/__tests__/level-system.test.d.ts +2 -0
- package/dist/core/__tests__/level-system.test.d.ts.map +1 -0
- package/dist/core/__tests__/level-system.test.js +114 -0
- package/dist/core/__tests__/level-system.test.js.map +1 -0
- package/dist/core/__tests__/time-decay.test.d.ts +2 -0
- package/dist/core/__tests__/time-decay.test.d.ts.map +1 -0
- package/dist/core/__tests__/time-decay.test.js +106 -0
- package/dist/core/__tests__/time-decay.test.js.map +1 -0
- package/dist/core/database.d.ts.map +1 -1
- package/dist/core/database.js +2 -1
- package/dist/core/database.js.map +1 -1
- package/dist/core/pet.js +4 -4
- package/dist/core/pet.js.map +1 -1
- package/dist/core/time-decay.js.map +1 -1
- package/dist/core/welcome.d.ts.map +1 -1
- package/dist/core/welcome.js +8 -3
- package/dist/core/welcome.js.map +1 -1
- package/dist/extension.d.ts +10 -0
- package/dist/extension.d.ts.map +1 -0
- package/dist/extension.js +268 -0
- package/dist/extension.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/monitor/__tests__/git-monitor.test.d.ts +2 -0
- package/dist/monitor/__tests__/git-monitor.test.d.ts.map +1 -0
- package/dist/monitor/__tests__/git-monitor.test.js +208 -0
- package/dist/monitor/__tests__/git-monitor.test.js.map +1 -0
- package/dist/monitor/git-monitor.d.ts +11 -4
- package/dist/monitor/git-monitor.d.ts.map +1 -1
- package/dist/monitor/git-monitor.js +38 -14
- package/dist/monitor/git-monitor.js.map +1 -1
- package/dist/monitor/vscode-watcher.d.ts +50 -0
- package/dist/monitor/vscode-watcher.d.ts.map +1 -0
- package/dist/monitor/vscode-watcher.js +307 -0
- package/dist/monitor/vscode-watcher.js.map +1 -0
- package/dist/types/items.d.ts.map +1 -1
- package/dist/types/items.js +0 -11
- package/dist/types/items.js.map +1 -1
- package/dist/types/species.d.ts +1 -5
- package/dist/types/species.d.ts.map +1 -1
- package/dist/types/species.js +0 -96
- package/dist/types/species.js.map +1 -1
- package/dist/types/time.d.ts +7 -0
- package/dist/types/time.d.ts.map +1 -1
- package/dist/types/time.js +13 -8
- package/dist/types/time.js.map +1 -1
- package/dist/ui/ascii-art.d.ts +7 -0
- package/dist/ui/ascii-art.d.ts.map +1 -1
- package/dist/ui/ascii-art.js +92 -150
- package/dist/ui/ascii-art.js.map +1 -1
- package/dist/ui/display.d.ts +1 -1
- package/dist/ui/display.d.ts.map +1 -1
- package/dist/ui/display.js +3 -3
- package/dist/ui/display.js.map +1 -1
- package/dist/ui/vscode-dashboard.d.ts +34 -0
- package/dist/ui/vscode-dashboard.d.ts.map +1 -0
- package/dist/ui/vscode-dashboard.js +551 -0
- package/dist/ui/vscode-dashboard.js.map +1 -0
- package/docs/demo-script.sh +196 -0
- package/docs/submissions/awesome-cli-pr.md +53 -0
- package/docs/submissions/awesome-nodejs-pr.md +43 -0
- package/docs/submissions/blog-post.md +166 -0
- package/docs/submissions/reddit-javascript.md +71 -0
- package/docs/submissions/reddit-programming.md +59 -0
- package/package.json +117 -61
- package/pet-terminal-1.0.1.vsix +0 -0
- package/resources/pet-icon.svg +3 -0
- package/src/commands/care.ts +111 -0
- package/src/commands/clean.ts +115 -0
- package/src/commands/feed.ts +116 -0
- package/src/commands/git.ts +150 -0
- package/src/commands/heal.ts +116 -0
- package/src/commands/init.ts +92 -0
- package/src/commands/inventory.ts +119 -0
- package/src/commands/play.ts +123 -0
- package/src/commands/release.ts +59 -0
- package/src/commands/shop.ts +213 -0
- package/src/commands/sleep.ts +52 -0
- package/src/commands/status.ts +111 -0
- package/src/commands/sync.ts +71 -0
- package/src/commands/tutorial.ts +219 -0
- package/src/core/__tests__/level-system.test.ts +140 -0
- package/src/core/__tests__/time-decay.test.ts +134 -0
- package/src/core/auto-care.ts +348 -0
- package/src/core/config.ts +215 -0
- package/src/core/database.ts +90 -0
- package/src/core/inventory.ts +151 -0
- package/src/core/level-system.ts +70 -0
- package/src/core/pet.ts +911 -0
- package/src/core/shop.ts +242 -0
- package/src/core/time-decay.ts +167 -0
- package/src/core/welcome.ts +200 -0
- package/src/extension.ts +313 -0
- package/src/index.ts +87 -0
- package/src/monitor/__tests__/git-monitor.test.ts +247 -0
- package/src/monitor/git-monitor.ts +445 -0
- package/src/monitor/vscode-watcher.ts +347 -0
- package/src/types/auto-care.ts +83 -0
- package/src/types/config.ts +58 -0
- package/src/types/git.ts +72 -0
- package/src/types/items.ts +299 -0
- package/src/types/lowdb.d.ts +48 -0
- package/src/types/pet.ts +56 -0
- package/src/types/species.ts +77 -0
- package/src/types/stats.ts +32 -0
- package/src/types/time.ts +108 -0
- package/src/ui/ascii-art.ts +149 -0
- package/src/ui/display.ts +105 -0
- package/src/ui/help.ts +299 -0
- package/src/ui/progress-bar.ts +58 -0
- package/src/ui/vscode-dashboard.ts +554 -0
- package/tsconfig.json +21 -0
- package/vitest.config.ts +25 -0
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"parser": "@typescript-eslint/parser",
|
|
3
|
+
"extends": [
|
|
4
|
+
"eslint:recommended",
|
|
5
|
+
"plugin:@typescript-eslint/recommended"
|
|
6
|
+
],
|
|
7
|
+
"plugins": ["@typescript-eslint"],
|
|
8
|
+
"parserOptions": {
|
|
9
|
+
"ecmaVersion": 2020,
|
|
10
|
+
"sourceType": "module",
|
|
11
|
+
"project": "./tsconfig.json"
|
|
12
|
+
},
|
|
13
|
+
"rules": {
|
|
14
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
15
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
16
|
+
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }]
|
|
17
|
+
},
|
|
18
|
+
"env": {
|
|
19
|
+
"node": true
|
|
20
|
+
},
|
|
21
|
+
"ignorePatterns": ["**/__tests__/**", "**/*.test.ts", "dist", "node_modules"]
|
|
22
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: '[BUG] '
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Describe the Bug
|
|
10
|
+
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
## To Reproduce
|
|
14
|
+
|
|
15
|
+
Steps to reproduce the behavior:
|
|
16
|
+
|
|
17
|
+
1. Go to '...'
|
|
18
|
+
2. Run '....'
|
|
19
|
+
3. Scroll down to '....'
|
|
20
|
+
4. See error
|
|
21
|
+
|
|
22
|
+
## Expected Behavior
|
|
23
|
+
|
|
24
|
+
A clear and concise description of what you expected to happen.
|
|
25
|
+
|
|
26
|
+
## Screenshots
|
|
27
|
+
|
|
28
|
+
If applicable, add screenshots to help explain your problem.
|
|
29
|
+
|
|
30
|
+
## Environment
|
|
31
|
+
|
|
32
|
+
| Setting | Value |
|
|
33
|
+
|---------|-------|
|
|
34
|
+
| OS | [e.g. Windows 11, macOS 14, Ubuntu 22.04] |
|
|
35
|
+
| Node Version | [e.g. v20.10.0] |
|
|
36
|
+
| Pet Terminal Version | [e.g. 1.0.0] |
|
|
37
|
+
|
|
38
|
+
**Check version with:** `pet --version`
|
|
39
|
+
|
|
40
|
+
## Additional Context
|
|
41
|
+
|
|
42
|
+
Add any other context about the problem here.
|
|
43
|
+
|
|
44
|
+
- Pet species: [e.g. Cat, Dog, etc.]
|
|
45
|
+
- Pet level: [e.g. Level 5]
|
|
46
|
+
- Time since last sync: [e.g. 2 days]
|
|
47
|
+
|
|
48
|
+
## Console Output
|
|
49
|
+
|
|
50
|
+
If applicable, paste the console output below:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
[paste output here]
|
|
54
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: '[FEATURE] '
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Feature Description
|
|
10
|
+
|
|
11
|
+
A clear and concise description of the feature you'd like to see added to Pet Terminal.
|
|
12
|
+
|
|
13
|
+
## Problem Statement
|
|
14
|
+
|
|
15
|
+
What problem does this feature solve? Is your feature request related to a problem?
|
|
16
|
+
|
|
17
|
+
## Proposed Solution
|
|
18
|
+
|
|
19
|
+
A clear and concise description of what you want to happen.
|
|
20
|
+
|
|
21
|
+
## Alternative Solutions
|
|
22
|
+
|
|
23
|
+
Describe any alternative solutions or features you've considered.
|
|
24
|
+
|
|
25
|
+
## Examples
|
|
26
|
+
|
|
27
|
+
If applicable, add examples to help illustrate your feature:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
pet [new-command] --option
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Additional Context
|
|
34
|
+
|
|
35
|
+
Add any other context, mockups, or screenshots about the feature request here.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
|
|
3
|
+
A clear and concise description of what this PR changes.
|
|
4
|
+
|
|
5
|
+
## Type of Change
|
|
6
|
+
|
|
7
|
+
Mark the relevant type with an `x`:
|
|
8
|
+
|
|
9
|
+
- [ ] `feat` - New feature
|
|
10
|
+
- [ ] `fix` - Bug fix
|
|
11
|
+
- [ ] `docs` - Documentation changes
|
|
12
|
+
- [ ] `refactor` - Code refactoring (no functional changes)
|
|
13
|
+
- [ ] `perf` - Performance improvements
|
|
14
|
+
- [ ] `style` - Code style changes (formatting, etc.)
|
|
15
|
+
- [ ] `test` - Adding or updating tests
|
|
16
|
+
- [ ] `chore` - Maintenance tasks
|
|
17
|
+
|
|
18
|
+
## Related Issue
|
|
19
|
+
|
|
20
|
+
Fixes #(issue number)
|
|
21
|
+
Related to #(issue number)
|
|
22
|
+
|
|
23
|
+
## Changes Made
|
|
24
|
+
|
|
25
|
+
Briefly describe the main changes:
|
|
26
|
+
|
|
27
|
+
-
|
|
28
|
+
|
|
29
|
+
-
|
|
30
|
+
|
|
31
|
+
-
|
|
32
|
+
|
|
33
|
+
## Testing
|
|
34
|
+
|
|
35
|
+
Describe the testing you performed:
|
|
36
|
+
|
|
37
|
+
- [ ] Tested locally with `npm run build && npm link`
|
|
38
|
+
- [ ] All linting passes (`npm run lint`)
|
|
39
|
+
- [ ] Manual testing steps performed:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
[describe steps to test]
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Screenshots (if applicable)
|
|
46
|
+
|
|
47
|
+
Add screenshots to help verify your changes.
|
|
48
|
+
|
|
49
|
+
## Breaking Changes
|
|
50
|
+
|
|
51
|
+
Does this PR introduce any breaking changes?
|
|
52
|
+
|
|
53
|
+
- [ ] Yes (describe below)
|
|
54
|
+
- [ ] No
|
|
55
|
+
|
|
56
|
+
If yes, please describe:
|
|
57
|
+
|
|
58
|
+
## Checklist
|
|
59
|
+
|
|
60
|
+
- [ ] My code follows the project's style guidelines
|
|
61
|
+
- [ ] I have performed a self-review of my code
|
|
62
|
+
- [ ] I have commented my code where necessary
|
|
63
|
+
- [ ] I have updated the documentation accordingly
|
|
64
|
+
- [ ] My changes generate no new warnings
|
|
65
|
+
- [ ] I have tested my changes locally
|
|
66
|
+
|
|
67
|
+
## Additional Notes
|
|
68
|
+
|
|
69
|
+
Any additional notes for the reviewer.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master, main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [master, main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ${{ matrix.os }}
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
15
|
+
node-version: [18.x, 20.x]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout code
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Setup Node.js ${{ matrix.node-version }}
|
|
22
|
+
uses: actions/setup-node@v4
|
|
23
|
+
with:
|
|
24
|
+
node-version: ${{ matrix.node-version }}
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: npm ci
|
|
28
|
+
|
|
29
|
+
- name: Run linter
|
|
30
|
+
run: npm run lint
|
|
31
|
+
|
|
32
|
+
- name: Build project
|
|
33
|
+
run: npm run build
|
|
34
|
+
|
|
35
|
+
- name: Run tests
|
|
36
|
+
run: npm test
|
|
37
|
+
|
|
38
|
+
coverage:
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
|
|
41
|
+
steps:
|
|
42
|
+
- name: Checkout code
|
|
43
|
+
uses: actions/checkout@v4
|
|
44
|
+
|
|
45
|
+
- name: Setup Node.js
|
|
46
|
+
uses: actions/setup-node@v4
|
|
47
|
+
with:
|
|
48
|
+
node-version: 20.x
|
|
49
|
+
|
|
50
|
+
- name: Install dependencies
|
|
51
|
+
run: npm ci
|
|
52
|
+
|
|
53
|
+
- name: Run coverage
|
|
54
|
+
run: npm run test:coverage
|
|
55
|
+
|
|
56
|
+
- name: Upload coverage to Codecov
|
|
57
|
+
uses: codecov/codecov-action@v4
|
|
58
|
+
with:
|
|
59
|
+
files: ./coverage/coverage-final.json
|
|
60
|
+
flags: unittests
|
|
61
|
+
name: codecov-umbrella
|
|
62
|
+
continue-on-error: true
|
package/.prettierrc
ADDED
package/.vscodeignore
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# VS Code ignore file - excludes files from extension package
|
|
2
|
+
.vscode/**
|
|
3
|
+
.github/**
|
|
4
|
+
src/**
|
|
5
|
+
**/*.map
|
|
6
|
+
**/*.ts
|
|
7
|
+
tsconfig.json
|
|
8
|
+
vitest.config.ts
|
|
9
|
+
.eslintrc.json
|
|
10
|
+
.prettierrc
|
|
11
|
+
.gitignore
|
|
12
|
+
*.log
|
|
13
|
+
node_modules/**
|
|
14
|
+
CHANGELOG.md
|
|
15
|
+
CONTRIBUTING.md
|
|
16
|
+
CODE_OF_CONDUCT.md
|
|
17
|
+
# Keep dist (compiled JS), README, LICENSE, and package.json
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to Pet Terminal will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [1.0.2] - 2025-12-31
|
|
6
|
+
|
|
7
|
+
### Added - VS Code Extension
|
|
8
|
+
- Full VS Code Extension support with Status Bar integration
|
|
9
|
+
- Webview Dashboard with Tamagotchi-style visual interface and retro ASCII art
|
|
10
|
+
- Native Git monitoring via VS Code API - earn XP by committing code
|
|
11
|
+
- Interactive Commands via Command Palette (Feed, Play, Release)
|
|
12
|
+
- Real-time status updates every 3 seconds
|
|
13
|
+
|
|
14
|
+
### Added - New Features
|
|
15
|
+
- `pet release` command - say goodbye to your pet forever (CLI and VS Code)
|
|
16
|
+
- Modal confirmation dialogs for pet release in VS Code
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- Simplified species from 6 to 2 (Cat and Dog) for improved ASCII art quality
|
|
20
|
+
- Each species now has distinct, recognizable ASCII art:
|
|
21
|
+
- Cat: Pointed ears `/\_/\`, whiskers `># #<`
|
|
22
|
+
- Dog: Floppy ears `__ /__`, rounder face
|
|
23
|
+
- Updated README to reflect hybrid CLI + VS Code nature
|
|
24
|
+
- Updated installation instructions with VS Code `.vsix` support
|
|
25
|
+
|
|
26
|
+
### Removed
|
|
27
|
+
- Rabbit, Hamster, Bird, and Dragon species (art quality improvement)
|
|
28
|
+
- dragon_gem item (no longer applicable)
|
|
29
|
+
|
|
30
|
+
## [1.0.1] - 2025-12-30
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
- Database path: Changed from `process.cwd()/data/pet.json` to `~/.pet-terminal/pet.json`
|
|
34
|
+
- Git availability check logic bug
|
|
35
|
+
- Version display now reads from package.json
|
|
36
|
+
- XP progress bar display format
|
|
37
|
+
- Database path consistency in welcome screen
|
|
38
|
+
- Configuration comments to match actual decay rates
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
- Unit tests for core functionality (72 tests)
|
|
42
|
+
- CI/CD pipeline with GitHub Actions
|
|
43
|
+
|
|
44
|
+
## [1.0.0] - 2025-12-30
|
|
45
|
+
|
|
46
|
+
### Added
|
|
47
|
+
- Virtual pet system with 6 species: Cat, Dog, Rabbit, Hamster, Bird, Dragon
|
|
48
|
+
- Pet stats: Hunger, Happiness, Health, Cleanliness, Energy
|
|
49
|
+
- Level system with XP progression
|
|
50
|
+
- Mood states: Happy, Neutral, Sad, Critical, Sleeping
|
|
51
|
+
- Git commit detection with coin and XP rewards
|
|
52
|
+
- Shop system with food, toys, medicine, and cleaning supplies
|
|
53
|
+
- Inventory management
|
|
54
|
+
- One-click care command (`pet care`)
|
|
55
|
+
- Interactive tutorial for new users
|
|
56
|
+
- Colorful terminal output with ASCII art
|
|
57
|
+
- Config file support at `~/.pet-terminal/config.json`
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
[1.0.2]: https://github.com/lessen-xu/pet-terminal/releases/tag/v1.0.2
|
|
62
|
+
[1.0.1]: https://github.com/lessen-xu/pet-terminal/releases/tag/v1.0.1
|
|
63
|
+
[1.0.0]: https://github.com/lessen-xu/pet-terminal/releases/tag/v1.0.0
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, caste, color, religion, or sexual
|
|
10
|
+
identity and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the overall
|
|
26
|
+
community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or advances of
|
|
31
|
+
any kind
|
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
* Public or private harassment
|
|
34
|
+
* Publishing others' private information, such as a physical or email address,
|
|
35
|
+
without their explicit permission
|
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
+
professional setting
|
|
38
|
+
|
|
39
|
+
## Enforcement Responsibilities
|
|
40
|
+
|
|
41
|
+
Project maintainers are responsible for clarifying and enforcing our standards of
|
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
+
response to any instances of unacceptable behavior.
|
|
44
|
+
|
|
45
|
+
Project maintainers have the right and responsibility to remove, edit, or reject
|
|
46
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
47
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
48
|
+
decisions when appropriate.
|
|
49
|
+
|
|
50
|
+
## Scope
|
|
51
|
+
|
|
52
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
53
|
+
an individual is officially representing the community in public spaces.
|
|
54
|
+
Examples of representing our community include using an official project e-mail
|
|
55
|
+
address, posting via an official social media account, or acting as an appointed
|
|
56
|
+
representative at an online or offline event.
|
|
57
|
+
|
|
58
|
+
## Enforcement
|
|
59
|
+
|
|
60
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
61
|
+
reported to the project maintainers at lessenx2002@gmail.com. All complaints
|
|
62
|
+
will be reviewed and investigated promptly and fairly.
|
|
63
|
+
|
|
64
|
+
All project maintainers are obligated to respect the privacy and security of
|
|
65
|
+
the reporter of any incident.
|
|
66
|
+
|
|
67
|
+
## Attribution
|
|
68
|
+
|
|
69
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
70
|
+
version 2.1, available at
|
|
71
|
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][version].
|
|
72
|
+
|
|
73
|
+
Community Impact Guidelines were inspired by
|
|
74
|
+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
75
|
+
|
|
76
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
77
|
+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
|
78
|
+
[https://www.contributor-covenant.org/translations][translations].
|
|
79
|
+
|
|
80
|
+
[homepage]: https://www.contributor-covenant.org
|
|
81
|
+
[version]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
82
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
83
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
|
84
|
+
[translations]: https://www.contributor-covenant.org/translations
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# Contributing to Pet Terminal
|
|
2
|
+
|
|
3
|
+
First off, thank you for considering contributing to Pet Terminal! It's people like you that make Pet Terminal such a great tool.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Code of Conduct](#code-of-conduct)
|
|
8
|
+
- [How Can I Contribute?](#how-can-i-contribute)
|
|
9
|
+
- [Development Setup](#development-setup)
|
|
10
|
+
- [Coding Guidelines](#coding-guidelines)
|
|
11
|
+
- [Commit Message Conventions](#commit-message-conventions)
|
|
12
|
+
- [Submitting Changes](#submitting-changes)
|
|
13
|
+
|
|
14
|
+
## Code of Conduct
|
|
15
|
+
|
|
16
|
+
By participating in this project, you agree to maintain a respectful and inclusive environment. Please see [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) for details.
|
|
17
|
+
|
|
18
|
+
## How Can I Contribute?
|
|
19
|
+
|
|
20
|
+
### Reporting Bugs
|
|
21
|
+
|
|
22
|
+
Before creating bug reports, please check the existing issues to avoid duplicates. When you create a bug report, include as many details as possible using the [Bug Report template](.github/ISSUE_TEMPLATE/bug_report.md).
|
|
23
|
+
|
|
24
|
+
### Suggesting Enhancements
|
|
25
|
+
|
|
26
|
+
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, include:
|
|
27
|
+
- A clear title and description
|
|
28
|
+
- Specific use cases
|
|
29
|
+
- Possible implementation ideas (if you have them)
|
|
30
|
+
|
|
31
|
+
### Pull Requests
|
|
32
|
+
|
|
33
|
+
Pull requests are welcome! Here's how to get started:
|
|
34
|
+
|
|
35
|
+
1. Fork the repository
|
|
36
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
37
|
+
3. Make your changes
|
|
38
|
+
4. Commit your changes (follow [commit message conventions](#commit-message-conventions))
|
|
39
|
+
5. Push to the branch (`git push origin feature/amazing-feature`)
|
|
40
|
+
6. Open a Pull Request
|
|
41
|
+
|
|
42
|
+
## Development Setup
|
|
43
|
+
|
|
44
|
+
### Prerequisites
|
|
45
|
+
|
|
46
|
+
- Node.js >= 14.0.0
|
|
47
|
+
- npm or yarn
|
|
48
|
+
|
|
49
|
+
### Installation
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Clone your fork
|
|
53
|
+
git clone https://github.com/your-username/pet-terminal.git
|
|
54
|
+
cd pet-terminal
|
|
55
|
+
|
|
56
|
+
# Install dependencies
|
|
57
|
+
npm install
|
|
58
|
+
|
|
59
|
+
# Build the project
|
|
60
|
+
npm run build
|
|
61
|
+
|
|
62
|
+
# Link for local testing
|
|
63
|
+
npm link
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Running Commands
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Run in development mode
|
|
70
|
+
npm run dev
|
|
71
|
+
|
|
72
|
+
# Run linting
|
|
73
|
+
npm run lint
|
|
74
|
+
|
|
75
|
+
# Build for production
|
|
76
|
+
npm run build
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Project Structure
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
pet-terminal/
|
|
83
|
+
├── src/
|
|
84
|
+
│ ├── commands/ # CLI commands (init, feed, play, etc.)
|
|
85
|
+
│ ├── core/ # Core logic (pet, inventory, shop, database)
|
|
86
|
+
│ ├── monitor/ # Git monitoring and activity tracking
|
|
87
|
+
│ ├── types/ # TypeScript type definitions
|
|
88
|
+
│ ├── ui/ # Display and UI components
|
|
89
|
+
│ └── index.ts # Entry point
|
|
90
|
+
├── data/ # Local data storage (gitignored)
|
|
91
|
+
└── dist/ # Compiled JavaScript output
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Coding Guidelines
|
|
95
|
+
|
|
96
|
+
### TypeScript
|
|
97
|
+
|
|
98
|
+
- Use TypeScript for all new code
|
|
99
|
+
- Avoid using `any` type when possible
|
|
100
|
+
- Use interfaces for object shapes
|
|
101
|
+
- Add JSDoc comments for exported functions
|
|
102
|
+
|
|
103
|
+
### Code Style
|
|
104
|
+
|
|
105
|
+
- Use 2 spaces for indentation
|
|
106
|
+
- Use single quotes for strings
|
|
107
|
+
- Use const by default, let when reassignment is needed
|
|
108
|
+
- Follow existing naming conventions (camelCase for variables, PascalCase for classes)
|
|
109
|
+
|
|
110
|
+
### Error Handling
|
|
111
|
+
|
|
112
|
+
```typescript
|
|
113
|
+
// Always handle errors gracefully
|
|
114
|
+
try {
|
|
115
|
+
// operation
|
|
116
|
+
} catch (error) {
|
|
117
|
+
console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);
|
|
118
|
+
process.exit(1);
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### User Experience
|
|
123
|
+
|
|
124
|
+
- Always provide clear feedback to users
|
|
125
|
+
- Use chalk for colored terminal output
|
|
126
|
+
- Include helpful error messages with suggested actions
|
|
127
|
+
- Test edge cases (no pet found, low stats, etc.)
|
|
128
|
+
|
|
129
|
+
## Commit Message Conventions
|
|
130
|
+
|
|
131
|
+
We use semantic commit messages to make changelog generation easier:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
<type>(<scope>): <description>
|
|
135
|
+
|
|
136
|
+
[optional body]
|
|
137
|
+
|
|
138
|
+
[optional footer]
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Types
|
|
142
|
+
|
|
143
|
+
| Type | Description |
|
|
144
|
+
|------|-------------|
|
|
145
|
+
| `feat` | New feature |
|
|
146
|
+
| `fix` | Bug fix |
|
|
147
|
+
| `docs` | Documentation only changes |
|
|
148
|
+
| `style` | Code style changes (formatting, etc.) |
|
|
149
|
+
| `refactor` | Code refactoring |
|
|
150
|
+
| `perf` | Performance improvements |
|
|
151
|
+
| `test` | Adding or updating tests |
|
|
152
|
+
| `chore` | Maintenance tasks |
|
|
153
|
+
|
|
154
|
+
### Examples
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
feat(commands): add new pet grooming command
|
|
158
|
+
|
|
159
|
+
fix: resolve issue with pet stats not saving correctly
|
|
160
|
+
|
|
161
|
+
docs: update README with new installation instructions
|
|
162
|
+
|
|
163
|
+
refactor(core): simplify inventory management logic
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Submitting Changes
|
|
167
|
+
|
|
168
|
+
### Before Submitting
|
|
169
|
+
|
|
170
|
+
- [ ] Run `npm run lint` and fix any issues
|
|
171
|
+
- [ ] Run `npm run build` to ensure compilation works
|
|
172
|
+
- [ ] Test your changes manually
|
|
173
|
+
- [ ] Update documentation if needed
|
|
174
|
+
|
|
175
|
+
### Pull Request Checklist
|
|
176
|
+
|
|
177
|
+
- [ ] PR title follows semantic commit conventions
|
|
178
|
+
- [ ] PR description clearly describes changes
|
|
179
|
+
- [ ] Code follows project guidelines
|
|
180
|
+
- [ ] No new linting warnings
|
|
181
|
+
- [ ] All changes are tested
|
|
182
|
+
|
|
183
|
+
## Getting Help
|
|
184
|
+
|
|
185
|
+
If you need help:
|
|
186
|
+
|
|
187
|
+
- Open a GitHub issue with the `question` label
|
|
188
|
+
- Check existing documentation in the README
|
|
189
|
+
- Run `pet tutorial` for a guide to using the CLI
|
|
190
|
+
|
|
191
|
+
## License
|
|
192
|
+
|
|
193
|
+
By contributing, you agree that your contributions will be licensed under the [MIT License](LICENSE).
|