@bobfrankston/npmglobalize 1.0.36 → 1.0.37

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.
Files changed (3) hide show
  1. package/README.md +11 -4
  2. package/lib.js +12 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -203,17 +203,24 @@ Publishing requires being on a branch so commits and tags can be properly tracke
203
203
  ```
204
204
  The files are already updated! You don't need to run it again.
205
205
 
206
- 2. **Want to publish:**
206
+ 2. **Want to publish (have commits to keep):**
207
207
  ```bash
208
- git checkout master # Get back on a branch
208
+ git checkout -B master # Moves master branch to current commit (merges)
209
209
  npmglobalize # Now works normally
210
210
  ```
211
+ The `-B` flag moves your branch pointer to include the detached commits.
211
212
 
212
- 3. **Force publish anyway (not recommended):**
213
+ 3. **Want to publish (no commits made, safe to discard):**
214
+ ```bash
215
+ git checkout master # Just switch back to branch
216
+ npmglobalize # Now works normally
217
+ ```
218
+
219
+ 4. **Force publish anyway (not recommended):**
213
220
  ```bash
214
221
  npmglobalize --force # Proceeds despite detached HEAD
215
222
  ```
216
- Warning: Commits may be hard to track later. Consider merging back to a branch afterward.
223
+ Warning: Commits may be hard to track later.
217
224
 
218
225
  ## Command Reference
219
226
 
package/lib.js CHANGED
@@ -1293,10 +1293,13 @@ export async function globalize(cwd, options = {}) {
1293
1293
  console.log(colors.yellow('✓ Good news: Your files are already fixed!'));
1294
1294
  console.log(colors.yellow(' You don\'t need to run --conform again.'));
1295
1295
  console.log('');
1296
- console.log(colors.yellow('To publish, get back on a branch:'));
1297
- console.log(' git checkout master \x1b[2m# or whatever your branch is\x1b[0m');
1296
+ console.log(colors.yellow('To publish, merge back to your branch:'));
1297
+ console.log(' git checkout -B master \x1b[2m# moves master to current commit\x1b[0m');
1298
1298
  console.log(' npmglobalize \x1b[2m# will now work normally\x1b[0m');
1299
1299
  console.log('');
1300
+ console.log(colors.yellow('Or if you haven\'t made commits yet:'));
1301
+ console.log(' git checkout master \x1b[2m# just switch back\x1b[0m');
1302
+ console.log('');
1300
1303
  return true; // Success - conform was completed
1301
1304
  }
1302
1305
  else if (noPublish) {
@@ -1312,11 +1315,15 @@ export async function globalize(cwd, options = {}) {
1312
1315
  console.log(' This happens after checking out a specific commit or tag.');
1313
1316
  console.log(' Publishing requires being on a branch so git can track changes.');
1314
1317
  console.log('');
1315
- console.log(colors.yellow('To fix this:'));
1316
- console.log(' git checkout master \x1b[2m# or whatever your branch is\x1b[0m');
1318
+ console.log(colors.yellow('To fix this (if you have commits to keep):'));
1319
+ console.log(' git checkout -B master \x1b[2m# moves master branch to current commit\x1b[0m');
1320
+ console.log(' npmglobalize \x1b[2m# will now work\x1b[0m');
1321
+ console.log('');
1322
+ console.log(colors.yellow('Or if you haven\'t made commits (safe to discard):'));
1323
+ console.log(' git checkout master \x1b[2m# just switch back to branch\x1b[0m');
1317
1324
  console.log(' npmglobalize \x1b[2m# will now work\x1b[0m');
1318
1325
  console.log('');
1319
- console.log(colors.yellow('Or to force publish anyway (risky):'));
1326
+ console.log(colors.yellow('Or force publish anyway (risky):'));
1320
1327
  console.log(' npmglobalize --force \x1b[2m# proceeds despite detached HEAD\x1b[0m');
1321
1328
  console.log('');
1322
1329
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/npmglobalize",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
4
4
  "description": "Transform file: dependencies to npm versions for publishing",
5
5
  "main": "index.js",
6
6
  "type": "module",