Skip to content

Commit 52a0111

Browse files
committed
docs: updating docs references
1 parent d4d0f3a commit 52a0111

4 files changed

Lines changed: 153 additions & 49 deletions

File tree

README.md

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,12 @@ npm install -g packdev
3838

3939
3. **Switch to development mode**:
4040
```bash
41-
packdev init
42-
npm install
41+
packdev init # Automatically runs npm/yarn/pnpm install
4342
```
4443

4544
4. **Restore production versions**:
4645
```bash
47-
packdev finish
48-
npm install
46+
packdev finish # Automatically runs npm/yarn/pnpm install
4947
```
5048

5149
📖 **[Full Quick Start Guide →](docs/QUICK-START.md)**
@@ -77,17 +75,40 @@ Develop a library alongside your app:
7775
```bash
7876
# In your app directory
7977
packdev add my-utils ../my-utils
80-
packdev init
81-
npm install
78+
packdev init # Automatically installs dependencies
8279

8380
# Make changes to ../my-utils
8481
# Test immediately in your app
8582
# Changes reflect instantly (no rebuild needed for JS)
8683

87-
packdev finish # When ready for production
84+
packdev finish # Automatically restores and reinstalls
8885
```
8986

90-
### Example 2: Git Auto-Commit Safety Hook
87+
### Example 2: Clean Git Branch Switching
88+
89+
Avoid merge conflicts and "uncommitted changes" when switching branches:
90+
91+
```bash
92+
# Working with local dependencies
93+
packdev init # Development mode active
94+
95+
# Need to switch branches?
96+
packdev finish # Clean package.json instantly
97+
98+
# Switch freely without conflicts
99+
git checkout main # ✅ No blocking warnings
100+
git checkout feature/other-work # ✅ Clean switching
101+
102+
# Back to your branch
103+
git checkout feature/your-work
104+
packdev init # Resume local development
105+
```
106+
107+
**Benefits**: No package.json conflicts, clean git status, fast context switching
108+
109+
📖 **[Git Workflows →](docs/WORKFLOW.md#git-branch-switching)**
110+
111+
### Example 3: Git Auto-Commit Safety Hook
91112

92113
Prevent accidentally committing local development configurations:
93114

@@ -108,7 +129,7 @@ git commit -m "WIP: testing something"
108129

109130
📖 **[Git Hooks Documentation →](docs/GITHUB-HOOKS.md)**
110131

111-
### Example 3: CI/CD Testing with Multiple Variants
132+
### Example 4: CI/CD Testing with Multiple Variants
112133

113134
Test your app against different package versions in CI:
114135

@@ -159,8 +180,8 @@ jobs:
159180
# Apply configuration
160181
packdev init
161182
162-
- name: Install dependencies
163-
run: npm install
183+
- name: Install dependencies (handled by packdev init)
184+
run: echo "Dependencies installed by packdev init"
164185

165186
- name: Run tests
166187
run: npm test

docs/QUICK-START.md

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,12 @@ packdev list
6464

6565
### 2. Start Development
6666
```bash
67-
packdev init
68-
npm install # Now uses local packages and git repositories
67+
packdev init # Automatically installs dependencies
6968
```
7069

7170
### 3. Finish Development
7271
```bash
73-
packdev finish
72+
packdev finish # Automatically restores and reinstalls dependencies
7473
git commit -m "implement new features"
7574
```
7675

@@ -89,24 +88,45 @@ packdev setup-hooks
8988
| `create-config` | Setup project | `packdev create-config` |
9089
| `add <pkg> <path>` | Track package | `packdev add axios ../my-axios` |
9190
| `add <pkg> <git-url>` | Track git repo | `packdev add ui git@github.com:org/ui.git#dev` |
92-
| `init` | Start development | `packdev init` |
93-
| `finish` | End development | `packdev finish` |
91+
| `init` | Start development (auto-installs) | `packdev init` |
92+
| `finish` | End development (auto-installs) | `packdev finish` |
9493
| `status` | Check current state | `packdev status` |
9594

95+
**Note**: `init` and `finish` automatically run `npm install` (or `yarn`/`pnpm`). Use `--no-install` flag to skip this.
96+
9697
## 💡 Common Scenarios
9798

99+
### Branch Switching Without Conflicts
100+
```bash
101+
# Working with local dependencies
102+
packdev init # Development mode active
103+
104+
# Need to switch branches?
105+
packdev finish # Clean package.json instantly
106+
107+
# Switch freely without conflicts
108+
git checkout main # ✅ No "uncommitted changes" warnings
109+
git checkout feature/other # ✅ Clean switching
110+
111+
# Resume work
112+
git checkout your-branch
113+
packdev init # Back to local development
114+
```
115+
116+
**Why this helps**: No package.json merge conflicts, clean git status, fast context switching between branches
117+
98118
### Testing Local and Git Changes
99119
```bash
100120
# Test local changes
101121
packdev add @myorg/utils ../shared-utils
102-
packdev init
122+
packdev init # Automatically installs dependencies
103123
# Test your changes locally
104124

105125
# Test git repository features
106126
packdev add ui-components https://github.com/myorg/ui.git#experiment
107-
packdev init
127+
packdev init # Automatically installs with git dependency
108128
# Test experimental branch
109-
packdev finish
129+
packdev finish # Automatically restores and reinstalls
110130
```
111131

112132
### Team Collaboration
@@ -117,14 +137,14 @@ git commit -m "add local dev config"
117137

118138
# Team members use same setup
119139
git pull
120-
packdev init
140+
packdev init # Automatically installs for team member
121141
```
122142

123143
### Multiple Projects
124144
```bash
125145
# Same local package in multiple projects
126-
cd project-a && packdev add shared ../shared && packdev init
127-
cd project-b && packdev add shared ../shared && packdev init
146+
cd project-a && packdev add shared ../shared && packdev init # Auto-installs
147+
cd project-b && packdev add shared ../shared && packdev init # Auto-installs
128148
# Both projects now use local ../shared
129149
```
130150

docs/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,10 @@ Welcome to the comprehensive documentation for `packdev` - the TypeScript-based
8484
### Daily Development
8585
```bash
8686
# Morning
87-
packdev init
88-
npm install
87+
packdev init # Automatically installs dependencies
8988

9089
# Evening
91-
packdev finish
90+
packdev finish # Automatically restores and reinstalls
9291
git commit -m "implement feature X"
9392
```
9493
📖 **Read**: [Workflow Guide](./WORKFLOW.md) - Daily Development Cycle

0 commit comments

Comments
 (0)