@niroai/niro 0.3.2 → 0.3.3
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 -4
- package/docs/working-on-branches.md +22 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,8 +14,9 @@ One package gives you three things:
|
|
|
14
14
|
|
|
15
15
|
## Working on branches
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
Your projects cover the repos and branches you chose to index. On every question, Niro routes
|
|
18
|
+
to the project matching your repo and current branch. When you are on a branch **no project
|
|
19
|
+
covers** (with real changes), Niro refuses to answer from stale code. Your assistant offers the fix:
|
|
19
20
|
|
|
20
21
|
```bash
|
|
21
22
|
niro new-temp-project # run once in the repo folder
|
|
@@ -23,8 +24,9 @@ niro new-temp-project # run once in the repo folder
|
|
|
23
24
|
|
|
24
25
|
This creates your own private copy of the project that follows your branch and your
|
|
25
26
|
uncommitted edits, live (keep `niro watch` running). Teammates are not affected and cannot
|
|
26
|
-
see your copy. Switching branches needs nothing: Niro answers from your copy on the
|
|
27
|
-
branch and from the
|
|
27
|
+
see your copy. Switching branches needs nothing: Niro answers from your copy on the new
|
|
28
|
+
branch, and from the matching indexed project on branches you already cover. When your branch
|
|
29
|
+
is merged:
|
|
28
30
|
|
|
29
31
|
```bash
|
|
30
32
|
niro discard-temp-project
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
# Working on branches with Niro
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Your team decides what Niro indexes: you create projects, and each project
|
|
4
|
+
covers the repos and branches you choose. One project might index main,
|
|
5
|
+
another might index a develop or release branch. That is up to you.
|
|
6
|
+
|
|
7
|
+
When you ask a question, Niro picks the project that matches your repo and
|
|
8
|
+
the branch you are currently on. This page is about the moment when NO
|
|
9
|
+
project matches: you created a new branch and changed code that no project
|
|
10
|
+
has indexed yet. Two minutes to read.
|
|
6
11
|
|
|
7
12
|
## The short version
|
|
8
13
|
|
|
@@ -14,11 +19,12 @@ Run it in your repo folder when Niro asks for it. That is all.
|
|
|
14
19
|
|
|
15
20
|
## What you will see
|
|
16
21
|
|
|
17
|
-
You create a branch and start changing code.
|
|
22
|
+
You create a branch that no project covers and start changing code.
|
|
18
23
|
Then you ask your AI assistant something about the code.
|
|
19
24
|
|
|
20
|
-
Niro notices
|
|
21
|
-
a wrong answer based on
|
|
25
|
+
Niro notices that no project has indexed this branch. Instead of giving
|
|
26
|
+
you a wrong answer based on some other branch, it replies with something
|
|
27
|
+
like:
|
|
22
28
|
|
|
23
29
|
I cannot answer this safely. Your branch has diverged
|
|
24
30
|
from the branch Niro indexed.
|
|
@@ -44,8 +50,9 @@ From then on, answers come from YOUR code.
|
|
|
44
50
|
|
|
45
51
|
Nothing to do. Niro checks which branch you are on for every question.
|
|
46
52
|
|
|
47
|
-
- On your
|
|
48
|
-
-
|
|
53
|
+
- On your new branch: answers come from your private copy.
|
|
54
|
+
- On a branch one of your projects already indexes: answers come
|
|
55
|
+
from that project.
|
|
49
56
|
|
|
50
57
|
## When your work is merged
|
|
51
58
|
|
|
@@ -78,8 +85,13 @@ No. Niro copies the existing index instead of re-reading your code.
|
|
|
78
85
|
It normally takes seconds.
|
|
79
86
|
|
|
80
87
|
I just created a branch and have not changed anything. Will Niro nag me?
|
|
81
|
-
No. Your code is still identical to
|
|
82
|
-
normally. It only steps in once your code actually differs.
|
|
88
|
+
No. Your code is still identical to the branch you started from, so Niro
|
|
89
|
+
answers normally. It only steps in once your code actually differs.
|
|
90
|
+
|
|
91
|
+
We already have projects for main and develop. Do I need this?
|
|
92
|
+
Not while you are on main or develop: Niro routes to the matching project
|
|
93
|
+
by itself. You only need a temporary project for a branch that none of
|
|
94
|
+
your projects cover.
|
|
83
95
|
|
|
84
96
|
What if I really want an answer from the shared project while on my branch?
|
|
85
97
|
Tell your assistant so. The answer will be clearly labeled as describing
|