@evanpurkhiser/tooling-personal 1.25.0 → 1.27.0
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 +5 -5
- package/dist/cmd/pr.js +5 -3
- package/dist/cmd/select-commit.js +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -7,8 +7,8 @@ This is a set of tools I use in my day to day at work.
|
|
|
7
7
|
The `pr` command creates or updates a pull request associated to
|
|
8
8
|
one or more commits. The tool handles the following:
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
- Select which commits should be part of the PR
|
|
11
|
+
- Generates a branch from the commit message, and pushes the
|
|
12
|
+
commits up to the remote.
|
|
13
|
+
- Prompts for reviewers to assign to the pull request.
|
|
14
|
+
- Creates a pull request and assigns the selected reviewers.
|
package/dist/cmd/pr.js
CHANGED
|
@@ -12,7 +12,9 @@ const editor_1 = require("../editor");
|
|
|
12
12
|
const fzf_1 = require("../fzf");
|
|
13
13
|
const pulls_1 = require("../pulls");
|
|
14
14
|
const utils_1 = require("../utils");
|
|
15
|
-
|
|
15
|
+
function getCommits(to) {
|
|
16
|
+
return simple_git_1.default().log({ from: 'HEAD', to });
|
|
17
|
+
}
|
|
16
18
|
async function pr() {
|
|
17
19
|
const username = await utils_1.getEmailUsername();
|
|
18
20
|
const repo = await utils_1.getRepoKey();
|
|
@@ -35,7 +37,7 @@ async function pr() {
|
|
|
35
37
|
collectInfoTask.add({
|
|
36
38
|
title: 'Getting unpublished commits',
|
|
37
39
|
task: async (ctx, task) => {
|
|
38
|
-
const commits = await getCommits();
|
|
40
|
+
const commits = await getCommits('origin/master');
|
|
39
41
|
if (commits.total === 0) {
|
|
40
42
|
throw new Error('No commits to push');
|
|
41
43
|
}
|
|
@@ -97,7 +99,7 @@ async function pr() {
|
|
|
97
99
|
}
|
|
98
100
|
};
|
|
99
101
|
const doPush = async () => {
|
|
100
|
-
const newCommits = await getCommits();
|
|
102
|
+
const newCommits = await getCommits('origin/master');
|
|
101
103
|
const commitIdx = newCommits.all.length - selectedCommits.length;
|
|
102
104
|
const rebaseTargetCommit = newCommits.all[commitIdx];
|
|
103
105
|
const refSpec = `${rebaseTargetCommit.hash}:refs/heads/${branchName}`;
|
|
@@ -9,7 +9,7 @@ const fzf_1 = require("../fzf");
|
|
|
9
9
|
async function selectCommit() {
|
|
10
10
|
const commits = await simple_git_1.default().log({ from: 'HEAD', to: 'origin/master' });
|
|
11
11
|
const selected = await fzf_1.fzfSelect({
|
|
12
|
-
prompt: 'Select commit(s)
|
|
12
|
+
prompt: 'Select commit(s):',
|
|
13
13
|
genValues: addOption => commits.all.forEach(commit => {
|
|
14
14
|
const shortHash = commit.hash.slice(0, 8);
|
|
15
15
|
const label = chalk_1.default `{red ${shortHash}} {blue [${commit.author_name}]} {white ${commit.message}}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evanpurkhiser/tooling-personal",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.27.0",
|
|
4
4
|
"description": "Evan Purkhiser's personal tooling",
|
|
5
5
|
"repository": "https://github.com/evanpurkhiser/tooling-personal",
|
|
6
6
|
"author": "Evan Purkhiser",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"yargs": "^17.0.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@evanpurkhiser/eslint-config": "^0.
|
|
30
|
+
"@evanpurkhiser/eslint-config": "^0.17.0",
|
|
31
31
|
"@tsconfig/node16": "^1.0.1",
|
|
32
|
-
"eslint": "^
|
|
33
|
-
"prettier": "^
|
|
32
|
+
"eslint": "^8.45.0",
|
|
33
|
+
"prettier": "^3.0.0",
|
|
34
34
|
"ts-node": "^10.1.0",
|
|
35
35
|
"typescript": "^4.3.5"
|
|
36
36
|
},
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"pt": "./dist/index.js"
|
|
43
43
|
},
|
|
44
44
|
"volta": {
|
|
45
|
-
"node": "18.
|
|
45
|
+
"node": "18.17.0",
|
|
46
46
|
"yarn": "1.22.19"
|
|
47
47
|
}
|
|
48
48
|
}
|