node-power-user 1.0.12 → 1.0.13
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/README.md +6 -0
- package/TODO.md +6 -0
- package/dist/cli.js +1 -0
- package/dist/commands/open.js +71 -0
- package/firebase-debug.log +58 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -91,6 +91,12 @@ Pull the latest changes from the remote repository and push your changes. You ca
|
|
|
91
91
|
npu sync
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
+
### Open Repository
|
|
95
|
+
Open the current repository's remote URL in your default browser.
|
|
96
|
+
```shell
|
|
97
|
+
npu open
|
|
98
|
+
```
|
|
99
|
+
|
|
94
100
|
### Check Version
|
|
95
101
|
Check the version of node-power-user.
|
|
96
102
|
```shell
|
package/TODO.md
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
1
|
Use "keychain" for something?
|
|
2
|
+
|
|
3
|
+
Interesting - the git status shows your branch is up to date now. However, the error you encountered was about needing to configure how to handle divergent branches in the future. The issue is that git needs to know your preference for handling situations where branches have diverged. You have three options:
|
|
4
|
+
Merge (git config pull.rebase false) - Creates merge commits
|
|
5
|
+
Rebase (git config pull.rebase true) - Replays your local commits on top of remote changes (cleaner history)
|
|
6
|
+
Fast-forward only (git config pull.ff only) - Only pulls if it can fast-forward (safest, but fails if branches diverged)
|
|
7
|
+
Which strategy would you prefer for handling divergent branches during pulls? I'd recommend rebase for a cleaner history, but I can set it to whichever you prefer. Would you like me to configure this globally for all your repositories or just for this one?
|
package/dist/cli.js
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
const logger = new (require('../lib/logger'))('node-power-user');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const jetpack = require('fs-jetpack');
|
|
5
|
+
const { execute } = require('node-powertools');
|
|
6
|
+
|
|
7
|
+
// Module
|
|
8
|
+
module.exports = async function (options) {
|
|
9
|
+
// Find the repository root by locating the .git folder
|
|
10
|
+
const repoRoot = findGitRoot(process.cwd());
|
|
11
|
+
if (!repoRoot) {
|
|
12
|
+
logger.error('Could not find the .git folder. Are you inside a Git repository?');
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
// Get the remote URL
|
|
18
|
+
const result = await execute('git remote get-url origin', {
|
|
19
|
+
log: false,
|
|
20
|
+
config: { cwd: repoRoot },
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
let remoteUrl = (result.stdout || '').trim();
|
|
24
|
+
|
|
25
|
+
if (!remoteUrl) {
|
|
26
|
+
logger.error('No remote origin found for this repository.');
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Convert SSH URL to HTTPS URL if needed
|
|
31
|
+
// git@github.com:owner/repo.git -> https://github.com/owner/repo
|
|
32
|
+
if (remoteUrl.startsWith('git@')) {
|
|
33
|
+
remoteUrl = remoteUrl
|
|
34
|
+
.replace(/^git@/, 'https://')
|
|
35
|
+
.replace(/:([^/])/, '/$1')
|
|
36
|
+
.replace(/\.git$/, '');
|
|
37
|
+
} else if (remoteUrl.startsWith('https://') || remoteUrl.startsWith('http://')) {
|
|
38
|
+
// Remove .git suffix if present
|
|
39
|
+
remoteUrl = remoteUrl.replace(/\.git$/, '');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Log the URL
|
|
43
|
+
logger.log(`Opening ${remoteUrl}...`);
|
|
44
|
+
|
|
45
|
+
// Open the URL in the default browser
|
|
46
|
+
await execute(`open "${remoteUrl}"`, {
|
|
47
|
+
log: false,
|
|
48
|
+
config: { cwd: repoRoot },
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
logger.log(logger.format.green('Repository opened in browser!'));
|
|
52
|
+
|
|
53
|
+
return true;
|
|
54
|
+
} catch (e) {
|
|
55
|
+
logger.error(`Failed to open repository`, e.stack);
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
function findGitRoot(startPath) {
|
|
61
|
+
let currentPath = startPath;
|
|
62
|
+
|
|
63
|
+
while (currentPath !== path.parse(currentPath).root) {
|
|
64
|
+
if (jetpack.exists(path.join(currentPath, '.git')) === 'dir') {
|
|
65
|
+
return currentPath;
|
|
66
|
+
}
|
|
67
|
+
currentPath = path.dirname(currentPath);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
[debug] [2025-10-26T14:46:37.834Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
2
|
+
[debug] [2025-10-26T14:46:37.835Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
3
|
+
[debug] [2025-10-26T14:46:37.836Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
4
|
+
[debug] [2025-10-26T14:46:37.837Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
5
|
+
[debug] [2025-10-26T14:46:37.837Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
6
|
+
[debug] [2025-10-26T14:46:37.845Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
7
|
+
[debug] [2025-10-26T14:46:37.845Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
8
|
+
[debug] [2025-10-26T14:46:37.837Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
9
|
+
[debug] [2025-10-26T14:46:37.838Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
10
|
+
[debug] [2025-10-26T14:46:37.838Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
11
|
+
[debug] [2025-10-26T14:46:37.849Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
12
|
+
[debug] [2025-10-26T14:46:37.849Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
13
|
+
[debug] [2025-10-26T14:46:37.860Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
14
|
+
[debug] [2025-10-26T14:46:37.861Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
15
|
+
[debug] [2025-10-26T14:46:37.860Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
16
|
+
[debug] [2025-10-26T14:46:37.861Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
17
|
+
[debug] [2025-10-26T14:46:37.861Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
18
|
+
[debug] [2025-10-26T14:46:37.863Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
19
|
+
[debug] [2025-10-26T14:46:37.863Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
20
|
+
[debug] [2025-10-26T14:46:37.864Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
21
|
+
[debug] [2025-10-26T14:46:37.864Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
22
|
+
[debug] [2025-10-26T14:46:37.861Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
23
|
+
[debug] [2025-10-26T14:46:37.862Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
24
|
+
[debug] [2025-10-26T14:46:37.862Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
25
|
+
[debug] [2025-10-26T14:46:37.864Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
26
|
+
[debug] [2025-10-26T14:46:37.864Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
27
|
+
[debug] [2025-10-26T14:46:37.864Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
28
|
+
[debug] [2025-10-26T14:46:37.864Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
29
|
+
[debug] [2025-10-26T20:17:50.677Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
30
|
+
[debug] [2025-10-26T20:17:50.679Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
31
|
+
[debug] [2025-10-26T20:17:50.679Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
32
|
+
[debug] [2025-10-26T20:17:50.679Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
33
|
+
[debug] [2025-10-26T20:17:50.688Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
34
|
+
[debug] [2025-10-26T20:17:50.688Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
35
|
+
[debug] [2025-10-26T20:17:50.700Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
36
|
+
[debug] [2025-10-26T20:17:50.700Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
37
|
+
[debug] [2025-10-26T20:17:50.701Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
38
|
+
[debug] [2025-10-26T20:17:50.701Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
39
|
+
[debug] [2025-10-26T20:17:50.703Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
40
|
+
[debug] [2025-10-26T20:17:50.703Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
41
|
+
[debug] [2025-10-26T20:17:50.703Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
42
|
+
[debug] [2025-10-26T20:17:50.703Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
43
|
+
[debug] [2025-10-26T20:17:50.755Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
44
|
+
[debug] [2025-10-26T20:17:50.757Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
45
|
+
[debug] [2025-10-26T20:17:50.757Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
46
|
+
[debug] [2025-10-26T20:17:50.758Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
47
|
+
[debug] [2025-10-26T20:17:50.769Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
48
|
+
[debug] [2025-10-26T20:17:50.769Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
49
|
+
[debug] [2025-10-26T20:17:50.780Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
50
|
+
[debug] [2025-10-26T20:17:50.780Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
51
|
+
[debug] [2025-10-26T20:17:50.781Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
52
|
+
[debug] [2025-10-26T20:17:50.781Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
53
|
+
[debug] [2025-10-26T20:17:50.782Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
54
|
+
[debug] [2025-10-26T20:17:50.782Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
55
|
+
[debug] [2025-10-26T20:17:50.783Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
56
|
+
[debug] [2025-10-26T20:17:50.783Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
57
|
+
[debug] [2025-10-27T13:47:53.709Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
58
|
+
[debug] [2025-10-27T13:47:53.716Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|