@bobfrankston/npmglobalize 1.0.182 → 1.0.184
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/lib.js +17 -10
- package/package.json +1 -7
package/lib.js
CHANGED
|
@@ -3883,10 +3883,10 @@ export async function globalize(cwd, options = {}, configOptions = {}) {
|
|
|
3883
3883
|
if (adoptable) {
|
|
3884
3884
|
choice = await promptChoice('How would you like to set up git?\n'
|
|
3885
3885
|
+ ' 1) Adopt history from existing remote (recommended)\n'
|
|
3886
|
-
+ ' 2) Initialize fresh git repository\n'
|
|
3887
3886
|
+ ' a) Adopt ALL (don\'t ask again for remaining deps)\n'
|
|
3887
|
+
+ ' 2) Initialize fresh git repository\n'
|
|
3888
3888
|
+ ' 3) Use local install only (skip git/publish)\n'
|
|
3889
|
-
+ ' 4) Abort\nChoice:', ['1', '
|
|
3889
|
+
+ ' 4) Abort\nChoice:', ['1', 'a', '2', '3', '4', '']);
|
|
3890
3890
|
if (choice === '3') {
|
|
3891
3891
|
console.log(colors.dim('Switching to local-only mode...'));
|
|
3892
3892
|
writeConfig(cwd, { ...configOptions, local: true }, new Set(['local']));
|
|
@@ -5591,11 +5591,13 @@ export async function globalize(cwd, options = {}, configOptions = {}) {
|
|
|
5591
5591
|
if (!publishResult.success) {
|
|
5592
5592
|
// Check for specific error types before recording
|
|
5593
5593
|
const output = (publishResult.output + '\n' + publishResult.stderr).toLowerCase();
|
|
5594
|
+
let alreadyPublished = false;
|
|
5594
5595
|
// "Already published" is benign — don't record as error
|
|
5595
5596
|
if (output.includes('cannot publish over') || output.includes('previously published')) {
|
|
5596
5597
|
const currentPkgVersion = readPackageJson(cwd).version;
|
|
5597
5598
|
if (output.includes(currentPkgVersion)) {
|
|
5598
5599
|
console.log(colors.green('✓ Already published — continuing'));
|
|
5600
|
+
alreadyPublished = true;
|
|
5599
5601
|
}
|
|
5600
5602
|
else {
|
|
5601
5603
|
console.error(colors.red('\nERROR: npm publish failed\n'));
|
|
@@ -5644,15 +5646,20 @@ export async function globalize(cwd, options = {}, configOptions = {}) {
|
|
|
5644
5646
|
recordBuildIssue(pkg.name || path.basename(cwd), 'error', 'npm publish failed');
|
|
5645
5647
|
console.error(colors.yellow('Publish failed — run npm login or check npm whoami'));
|
|
5646
5648
|
}
|
|
5647
|
-
if (
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5649
|
+
if (alreadyPublished) {
|
|
5650
|
+
// Treat as success — fall through to post-publish steps (push, tags, .commitmsg)
|
|
5651
|
+
}
|
|
5652
|
+
else {
|
|
5653
|
+
if (transformResult.transformed) {
|
|
5654
|
+
console.log('Restoring file: dependencies...');
|
|
5655
|
+
const failPkg = readPackageJson(cwd);
|
|
5656
|
+
restoreDeps(failPkg, verbose);
|
|
5657
|
+
writePackageJson(cwd, failPkg);
|
|
5658
|
+
runCommand('git', ['add', 'package.json'], { cwd, silent: true });
|
|
5659
|
+
gitCommit('Restore file: dependencies', cwd);
|
|
5660
|
+
}
|
|
5661
|
+
return false;
|
|
5654
5662
|
}
|
|
5655
|
-
return false;
|
|
5656
5663
|
}
|
|
5657
5664
|
// Determine what was published
|
|
5658
5665
|
const finalAccess = effectiveNpmVisibility || currentAccess || (isScoped ? 'restricted' : 'public');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobfrankston/npmglobalize",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.184",
|
|
4
4
|
"description": "Transform file: dependencies to npm versions for publishing",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -33,8 +33,6 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@bobfrankston/freezepak": "^0.1.8",
|
|
35
35
|
"@bobfrankston/importgen": "^0.1.36",
|
|
36
|
-
"@bobfrankston/mailx": "^1.0.466",
|
|
37
|
-
"@bobfrankston/npmglobalize": "^1.0.153",
|
|
38
36
|
"@bobfrankston/themecolors": "^0.1.6",
|
|
39
37
|
"@bobfrankston/userconfig": "^1.0.9",
|
|
40
38
|
"@npmcli/package-json": "^7.0.4",
|
|
@@ -50,8 +48,6 @@
|
|
|
50
48
|
".dependencies": {
|
|
51
49
|
"@bobfrankston/freezepak": "file:../freezepak",
|
|
52
50
|
"@bobfrankston/importgen": "file:../importgen",
|
|
53
|
-
"@bobfrankston/mailx": "^1.0.466",
|
|
54
|
-
"@bobfrankston/npmglobalize": "^1.0.153",
|
|
55
51
|
"@bobfrankston/themecolors": "file:../themecolors",
|
|
56
52
|
"@bobfrankston/userconfig": "file:../userconfig",
|
|
57
53
|
"@npmcli/package-json": "^7.0.4",
|
|
@@ -65,8 +61,6 @@
|
|
|
65
61
|
"dependencies": {
|
|
66
62
|
"@bobfrankston/freezepak": "^0.1.8",
|
|
67
63
|
"@bobfrankston/importgen": "^0.1.36",
|
|
68
|
-
"@bobfrankston/mailx": "^1.0.466",
|
|
69
|
-
"@bobfrankston/npmglobalize": "^1.0.153",
|
|
70
64
|
"@bobfrankston/themecolors": "^0.1.6",
|
|
71
65
|
"@bobfrankston/userconfig": "^1.0.9",
|
|
72
66
|
"@npmcli/package-json": "^7.0.4",
|