You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* [Yarn](https://yarnpkg.com): We use Yarn to install our dependencies
31
+
# install node
32
+
brew install node
33
+
```
34
+
35
+
-[Yarn](https://yarnpkg.com): We use Yarn to install our dependencies
34
36
(rather than using npm). See the detailed [installation instructions][yarn-install].
35
37
38
+
-[Qri backend](#backend): The core functionality for working with Qri.
39
+
40
+
-[temp_registry_server](https://github.com/qri-io/temp_registry_server): This is a package we developed for use in Desktop end-to-end (e2e) testing. For more info about running the tests, see the project [README](https://github.com/qri-io/desktop/blob/master/README.md)
41
+
36
42
### Forking Qri on Github
37
43
38
44
To contribute code to Qri, you must have a GitHub account so you can push code to your own
@@ -42,7 +48,6 @@ First, [create a Github account](https://github.com/signup/free).
42
48
Afterwards, go ahead and
43
49
[fork the Qri desktop repository](https://github.com/qri-io/desktop/fork) ([Learn more about forking](http://help.github.com/forking)).
44
50
45
-
46
51
### Building Qri
47
52
48
53
To build Qri, you clone the source code repository and use Yarn to run the electron app:
@@ -78,36 +83,38 @@ The `yarn dev` command will launch a development version of the Qri electron app
78
83
To get access to Chrome Developer Tools, use the keyboard shortcut Command-Shift-C.
79
84
80
85
## Release process:
86
+
81
87
This will only work if you are internal to Qri and have the correct keys
82
88
83
-
1) change the frontend and backend version numbers in:
84
-
`/package.json`
85
-
`/app/package.json`
86
-
`version.js`
87
-
2) run `make update-changelog` to update the changelog
88
-
3) write release notes
89
-
4) build the correct version of the qri backend binary
90
-
5) ensure it is executable (chmod +x qri)
91
-
6) move the executable binary to the `/backend` directory
92
-
7) run `yarn dist`
93
-
8) ensure the Qri Desktop app running correctly and has all the correct version numbers
94
-
9) submit a pr, once approved merge
95
-
10) run `yarn dist --publish always` to create a release
96
-
11) Because notarizing the mac.zip file is broken in electron-builder right now (as per https://snippets.cacher.io/snippet/354a3eb7b0dcbe711383 & https://github.com/electron-userland/electron-builder/issues/4299):
97
-
- compress the app file that exists in`/release/mac`
98
-
- rename it to match the current mac.zip file in the `/release` directory
99
-
- replace the old zip file with the new one
100
-
- run `./node_modules/app-builder-bin/mac/app-builder blockmap -i release/FILENAME.zip -o release/throwaway.zip`
101
-
- app-builder is modifying the contents of the zip, which is messing up the notarization. The -o flag indicates an output file that app-builder can futz with without ruining the integrity of the original app
102
-
- take the updated file into from size, sha512 and blockMapSize
103
-
- update the `/release/latest-mac.yml` with that info
104
-
- replace `FILENAME.zip` to the release page
89
+
1. change the frontend and backend version numbers in:
90
+
`/package.json`
91
+
`/app/package.json`
92
+
`version.js`
93
+
2. run `make update-changelog` to update the changelog
94
+
3. write release notes
95
+
4. build the correct version of the qri backend binary
96
+
5. ensure it is executable (chmod +x qri)
97
+
6. move the executable binary to the `/backend` directory
98
+
7. run `yarn dist`
99
+
8. ensure the Qri Desktop app running correctly and has all the correct version numbers
100
+
9. submit a pr, once approved merge
101
+
10. run `yarn dist --publish always` to create a release
102
+
11. Because notarizing the mac.zip file is broken in electron-builder right now (as per https://snippets.cacher.io/snippet/354a3eb7b0dcbe711383 & https://github.com/electron-userland/electron-builder/issues/4299):
103
+
104
+
- compress the app file that exists in `/release/mac`
105
+
- rename it to match the current mac.zip file in the `/release` directory
106
+
- replace the old zip file with the new one
107
+
- run `./node_modules/app-builder-bin/mac/app-builder blockmap -i release/FILENAME.zip -o release/throwaway.zip`
108
+
- app-builder is modifying the contents of the zip, which is messing up the notarization. The -o flag indicates an output file that app-builder can futz with without ruining the integrity of the original app
109
+
- take the updated file into from size, sha512 and blockMapSize
110
+
- update the `/release/latest-mac.yml` with that info
111
+
- replace `FILENAME.zip` to the release page
105
112
106
113
## <aname="rules"></a> Coding Rules
107
114
108
115
To ensure consistency throughout the source code, keep these rules in mind as you are working:
109
116
110
-
* We use [eslint](style) coding style, please use standard to lint any changes before committing:
117
+
- We use [eslint](style) coding style, please use standard to lint any changes before committing:
111
118
112
119
```shell
113
120
# Use eslint to lint files
@@ -118,12 +125,13 @@ The output will point you to which files/lines need to be changed in order to me
118
125
119
126
## <aname="commits"></a> Git Commit Guidelines
120
127
121
-
We have very precise rules over how our git commit messages can be formatted. This leads to **more
122
-
readable messages** that are easy to follow when looking through the **project history**. But also,
128
+
We have very precise rules over how our git commit messages can be formatted. This leads to **more
129
+
readable messages** that are easy to follow when looking through the **project history**. But also,
123
130
we use the git commit messages to **generate the Qri change log**.
124
131
125
132
### Commit Message Format
126
-
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
133
+
134
+
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
127
135
format that includes a **type**, a **scope** and a **subject**:
128
136
129
137
```
@@ -140,43 +148,49 @@ Any line of the commit message cannot be longer 100 characters! This allows the
140
148
to read on GitHub as well as in various git tools.
141
149
142
150
### Revert
143
-
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header
151
+
152
+
If the commit reverts a previous commit, it should begin with `revert:`, followed by the header
144
153
of the reverted commit.
145
154
In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit
146
155
being reverted.
147
156
A commit with this format is automatically created by the [`git revert`][git-revert] command.
148
157
149
158
### Type
159
+
150
160
Must be one of the following:
151
161
152
-
***feat**: A new feature
153
-
***fix**: A bug fix
154
-
***docs**: Documentation only changes
155
-
***style**: Changes that do not affect the meaning of the code (white-space, formatting, missing
162
+
-**feat**: A new feature
163
+
-**fix**: A bug fix
164
+
-**docs**: Documentation only changes
165
+
-**style**: Changes that do not affect the meaning of the code (white-space, formatting, missing
156
166
semi-colons, etc)
157
-
***refactor**: A code change that neither fixes a bug nor adds a feature
158
-
***perf**: A code change that improves performance
159
-
***test**: Adding missing or correcting existing tests
160
-
***chore**: Changes to the build process or auxiliary tools and libraries such as documentation
167
+
-**refactor**: A code change that neither fixes a bug nor adds a feature
168
+
-**perf**: A code change that improves performance
169
+
-**test**: Adding missing or correcting existing tests
170
+
-**chore**: Changes to the build process or auxiliary tools and libraries such as documentation
161
171
generation
162
172
163
173
### Scope
174
+
164
175
The scope could be anything specifying place of the commit change. For example **NEED TO MAKE DECISION ABOUT THIS** , etc...
165
176
166
177
You can use `*` when the change affects more than a single scope.
167
178
168
179
### Subject
180
+
169
181
The subject contains succinct description of the change:
170
182
171
-
* use the imperative, present tense: "change" not "changed" nor "changes"
172
-
* don't capitalize first letter
173
-
* no dot (.) at the end
183
+
- use the imperative, present tense: "change" not "changed" nor "changes"
184
+
- don't capitalize first letter
185
+
- no dot (.) at the end
174
186
175
187
### Body
188
+
176
189
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
177
190
The body should include the motivation for the change and contrast this with previous behavior.
178
191
179
192
### Footer
193
+
180
194
The footer should contain any information about **Breaking Changes** and is also the place to
181
195
[reference GitHub issues that this commit closes][closing-issues].
182
196
@@ -185,19 +199,30 @@ The rest of the commit message is then used for this.
185
199
186
200
A detailed explanation can be found in this [document][commit-message-format].
###### This documentation has been adapted from the [Data Together](https://github.com/datatogether/datatogether), [Hyper](https://github.com/zeit/hyper), and [AngularJS](https://github.com/angular/angularJS) documentation.
199
212
200
-
## <a name="setup"></a>Running Storybook
213
+
## <aname="backend"></a>Connecting to the Qri backend
214
+
215
+
This Qri Desktop application is a Graphical User Interface (GUI) client of our [Qri backend](https://github.com/qri-io/qri). The backend provides an API that this Desktop app utilizes to give our users all the great features Qri has to offer like creating datasets, viewing dataset commit history and pushing datasets to [Qri cloud](https://qri.cloud/)!
216
+
217
+
As such, developing on this Qri Desktop project relies on a connection to the Qri backend. To install the Qri backend on your machine, follow the instructions of your choice [here](https://qri.io/docs/reference/installing-qri-cli) and ensure that wherever the qri binary was installed has been [added to your PATH](https://qri.io/docs/reference/installing-qri-cli#configuring-your-path). This will allow you to type `qri` command line commands (e.g. `qri connect`) at your terminal.
218
+
219
+
When this Qri Desktop app is running, it will look for the Qri backend in a few places in this order:
220
+
221
+
1. Is there a qri node already running on your machine? This would happen if you've run `qri connect` in a different terminal window. If so, Qri Desktop will use this existing node.
222
+
2. Is there a qri binary already installed on your PATH? If yes, use that binary to spin up a qri node.
223
+
3. Is there qri binary internal to this Desktop app (at `/desktop/backend/qri`)? If so, use that. This Desktop app comes packaged with qri binary when a user [downloads](https://qri.io/download) the app and will look here as a last resort. For most Desktop users this is the only version of the Qri backend they may have. If you as a developer have forked this project and not downloaded the app, you will not have this internal binary and need to download it separately.
224
+
225
+
## <aname="storybook"></a>Running Storybook
201
226
202
227
When developing new components for Qri Desktop, our team first builds them in [Storybook](https://storybook.js.org/docs/basics/introduction/). Storybook is a tool which allows us to build and showcase components in an isolated environment from our app.
203
228
@@ -208,5 +233,28 @@ When rendering Storybook stories which rely on fetched information from our [`qr
208
233
1. Set 'http://localhost:6006' as an entry under `allowedorigins` in the `config.yaml` file of your local qri repo. (Note: your local qri repo is _not_ a refence to [`qri` backend](https://github.com/qri-io/qri) code. It is rather where your qri configuration, peer information, datasets, and other metadata are stored at your `QRI_PATH`.) You can make this change by either using the `qri` command line and running `qri config set` or by directly editing the `config.yaml` located at your `QRI_PATH`.
209
234
2. Ensure the `qri` backend is running to receive your request by running `qri connect` in your terminal.
210
235
236
+
## <aname="repo"></a>Advanced: Managing Different Qri Repos
237
+
238
+
_Note_: the knowledge and management of different local qri repos is not necessary for developing on Qri Desktop. It is useful however for testing and development purposes to have one or more repos outside of your default qri repo; you can play around with these and delete them easily if something breaks without worrying about the consequences. It is also useful to have a test repo set up when developing on a version of the [Qri backend](https://github.com/qri-io/qri) that requires a migration and would otherwise alter the configuration of your default qri repo.
239
+
240
+
### What is a qri repo?
241
+
242
+
A qri repo is a storage location where Qri stores its local information (e.g. configuration, peer information, IPFS data, Logbooks, etc). This term is not to be confused with the location of the [Qri backend](https://github.com/qri-io/qri) source code that you may have downloaded on your machine.
243
+
244
+
A qri repo is configured for a Qri user when they [set up a qri instance](https://qri.io/docs/getting-started/qri-cli-quickstart#setup-your-qri-instance). This can happen in one of two ways:
245
+
1. When a CLI user runs `qri setup` at the command line after having [installed](https://qri.io/docs/reference/installing-qri-cli#installing-the-qri-binary) the qri binary
246
+
2. When a user opens the Desktop app for the first time
247
+
248
+
Qri uses your os home directory (`~/.qri` on macOS and Linux, or `HOME\.qri` on Windows) to store your qri repo unless you override the default by setting the `QRI_PATH` env var.
249
+
250
+
### How do I create another qri repo?
211
251
252
+
Let's imagine that we're working on a Desktop feature which relies on a dev version of the Qri backend that requires a migration. Instead of migrating our current default qri repo, we want to make a test one for this purpose. We need to build the Qri backend binary of the dev version and point to a new qri repo that we create.
212
253
254
+
1.**Build the binary**: clone the version of the Qri backend that you'd like locally to a destination of your choice (e.g. `~/qri-dev`). Then `cd` into the `qri` directory and build this from source by running `go build`. Running `go build` creates a version of qri binary in the same directory in which you ran the command, meaning this binary will be separate from the default one on your PATH and will only be referenced when you directly call it. We just need to make sure we make this binary executable before running it. Do this by running `chmod +x qri` and then you'll be able run it (`./qri`).
255
+
2.**Set QRI_PATH**: set the `QRI_PATH` env var to a location you create (e.g. `export QRI_PATH=~/qri-dev/test-repo/qri`).
256
+
3.**Set up new Qri instance**: now that `QRI_PATH` is pointed to your new location, `cd` into the folder where your local `qri` binary resides (`~/qri-dev/qri` in our example) and use your new local `qri` executable to set up a new qri instance (`./qri setup`). Note: if you were just creating a new qri instance without using a different version of the Qri backend, you could simply run `qri setup` using the default qri binary on your PATH.
257
+
4.**Spin up a new Qri node**: run `./qri connect` in your terminal to spin up a qri node using this new Qri backend.
258
+
5.**Start up the Desktop app**: start up Desktop in a different terminal window (`yarn dev`).
259
+
260
+
To switch back to the default qri backend, kill the currently running node (`killall -v qri`). To switch back to the default qri repo, delete `QRI_PATH` (`unset QRI_PATH`). It's recommended that you use the default qri backend when interacting with your default qri repo.
Copy file name to clipboardExpand all lines: README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@ Run normally (no developer features):
76
76
77
77
Run end to end tests:
78
78
79
-
-`go gettemp_registry_server`
79
+
-You'll need our `temp_registry_server` package to run e2e tests. You can either use the `go get` command (`go get github.com/qri-io/temp_registry_server`) or you can build it yourself by cloning the `temp_registry_server`[repo](https://github.com/qri-io/temp_registry_server), `cd` into the repo at the command line, running `go install` which will compile the binary for you (and likely put it in `~/go/bin`) and then [add that directory to your PATH](https://qri.io/docs/reference/installing-qri-cli#configuring-your-path). You'll know this was successful if you run the `which temp_registry_server` command and see the path to the binary.
80
80
- For macOS users run with `yarn test-e2e` which will also trigger a build, or run `yarn test-e2e-no-build` if you already have a build to test against
81
81
- For Windows users run `yarn test-win-e2e` or `yarn test-win-e2e-no-build`
0 commit comments