@bobfrankston/npmglobalize 1.0.73 → 1.0.75

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.
@@ -12,7 +12,8 @@
12
12
  "Bash(dir /T:W \"y:\\\\dev\\\\utils\\\\npmglobalize\\\\lib.*\")",
13
13
  "Bash(ls:*)",
14
14
  "Bash(dir:*)",
15
- "Bash(findstr:*)"
15
+ "Bash(findstr:*)",
16
+ "Bash(npm access:*)"
16
17
  ]
17
18
  }
18
19
  }
package/lib.js CHANGED
@@ -248,15 +248,15 @@ export function checkNpmAccess(packageName) {
248
248
  shell: true
249
249
  });
250
250
  if (viewResult.status === 0 && viewResult.stdout && viewResult.stdout.trim()) {
251
- // Package exists - now check access level
252
- const accessResult = spawnSync('npm', ['access', 'list', 'packages', packageName], {
251
+ // Package exists - check public/private status
252
+ const accessResult = spawnSync('npm', ['access', 'get', 'status', packageName], {
253
253
  encoding: 'utf-8',
254
254
  stdio: 'pipe',
255
255
  shell: true
256
256
  });
257
257
  if (accessResult.status === 0 && accessResult.stdout) {
258
258
  const output = accessResult.stdout.trim();
259
- if (output.includes('read-write') || output.includes('read-only')) {
259
+ if (output.includes('public')) {
260
260
  return 'public';
261
261
  }
262
262
  }
@@ -1439,6 +1439,7 @@ export async function globalize(cwd, options = {}, configOptions = {}) {
1439
1439
  // Check git status
1440
1440
  const gitStatus = getGitStatus(cwd);
1441
1441
  // Handle init mode
1442
+ let justInitialized = false;
1442
1443
  if (!gitStatus.isRepo) {
1443
1444
  console.log('No git repository found.');
1444
1445
  if (dryRun) {
@@ -1453,11 +1454,13 @@ export async function globalize(cwd, options = {}, configOptions = {}) {
1453
1454
  const success = await initGit(cwd, gitVisibility, dryRun);
1454
1455
  if (!success)
1455
1456
  return false;
1457
+ justInitialized = true;
1456
1458
  }
1457
1459
  else {
1458
1460
  const success = await initGit(cwd, gitVisibility, dryRun);
1459
1461
  if (!success)
1460
1462
  return false;
1463
+ justInitialized = true;
1461
1464
  }
1462
1465
  }
1463
1466
  else if (!gitStatus.hasRemote) {
@@ -1472,6 +1475,7 @@ export async function globalize(cwd, options = {}, configOptions = {}) {
1472
1475
  const success = await initGit(cwd, gitVisibility, dryRun);
1473
1476
  if (!success)
1474
1477
  return false;
1478
+ justInitialized = true;
1475
1479
  }
1476
1480
  // Re-check git status after potential init
1477
1481
  let currentGitStatus = getGitStatus(cwd);
@@ -1884,7 +1888,8 @@ export async function globalize(cwd, options = {}, configOptions = {}) {
1884
1888
  // Re-check git status after all transformations and potential commits
1885
1889
  currentGitStatus = getGitStatus(cwd);
1886
1890
  // Check if there are changes to commit or a custom message
1887
- if (!currentGitStatus.hasUncommitted && !message) {
1891
+ // justInitialized: first publish after creating repo - proceed even with clean tree
1892
+ if (!currentGitStatus.hasUncommitted && !message && !justInitialized) {
1888
1893
  console.log('');
1889
1894
  console.log('No changes to commit and no custom message specified.');
1890
1895
  // If install flag is set, install from local directory
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/npmglobalize",
3
- "version": "1.0.73",
3
+ "version": "1.0.75",
4
4
  "description": "Transform file: dependencies to npm versions for publishing",
5
5
  "main": "index.js",
6
6
  "type": "module",