@@ -21,47 +21,55 @@ Astrolabe is built primarily using [Svelte], [Typescript], and [Tailwind CSS]. [
22To get started using Astrolabe first you need to run `npm install` inside the `ui` directory.
22To get started using Astrolabe first you need to run `npm install` inside the `ui` directory.
24−To develop you'll need a running ship to point to. To do so you first need to add a `.env.local` file to the `ui` directory. This file will not be committed. Adding `VITE_SHIP_URL={URL}` where **{URL}** is the URL of the ship you would like to point to, will allow you to run `npm run dev`. This will proxy all requests to the ship except for those powering the interface, allowing you to see live data.
24+To develop you'll need a running ship to point to. If it's running somewhere other than `http://localhost:8081`, make a copy of `.env` in the `ui` directory and name it `.env.local`. This file will not be committed. Change `VITE_SHIP_URL` to the URL of the ship you would like to point to.
26+Once your URL is correctly configured, you can run `npm run dev`. This will proxy all requests to the ship except for those powering the interface, allowing you to see live data.
26Regardless of what you run to develop, Vite will hot-reload code changes as you work so you don't have to constantly refresh.
28Regardless of what you run to develop, Vite will hot-reload code changes as you work so you don't have to constantly refresh.
28−### Deploying with `glob-ames` glob
30+# Deploying
301. Spin up a comet or distribution ship.
321. Spin up a comet or distribution ship.
312. Mount an `%astrolabe` desk. In Dojo:
332. Mount an `%astrolabe` desk. In Dojo:
32 1. `|merge %astrolabe our %base` to create a new desk.
34 1. `|merge %astrolabe our %base` to create a new desk.
33− 2. `|mount %work` to mount it.
35+ 2. `|mount %astrolabe` to mount it.
36+ 3. Set `ASTROLABE_DESK` in `.env.local` if the path to your desk is different.
37+3. Create and upload `glob-http`, if applicable (see below)
343. Install the desk
383. Install the desk
35− 1. From the root of the project: `./install.sh path/to/pier/astrolabe`
39+ 1. From the `ui` folder: `npm run install:desk`
36 2. From the distribution ship's dojo: `:treaty|unpublish %astrolabe`
40 2. From the distribution ship's dojo: `:treaty|unpublish %astrolabe`
37 2. From middleman or distribution ship's dojo: `|commit %astrolabe`
41 2. From middleman or distribution ship's dojo: `|commit %astrolabe`
38 3. (if using a comet as a middleman) `|public %astrolabe`
42 3. (if using a comet as a middleman) `|public %astrolabe`
39 4. (if using a comet as a middleman) from the actual distribution ship: `|install ~comet-name %astrolabe` or `|resume %astrolabe`
43 4. (if using a comet as a middleman) from the actual distribution ship: `|install ~comet-name %astrolabe` or `|resume %astrolabe`
40 5. (if using a comet as a middleman) from the actual distribution ship: `|pause %astrolabe`
44 5. (if using a comet as a middleman) from the actual distribution ship: `|pause %astrolabe`
45+4. Build UI and upload `glob-ames`
46+5. Publish the desk from dojo: `:treaty|publish %astrolabe`
48+### Deploying with `glob-ames` glob
49+1. Put the line `glob-ames+[~dister-midlev-mindyr 0v0]` in `desk.docket-0` if it's not there, where `~dister-midlevi-mindyr` is the `@p` of the distribution ship.
414. Build the UI with `npm run build` in the `ui` directory which will bundle all the code and assets into the `dist/` folder.
504. Build the UI with `npm run build` in the `ui` directory which will bundle all the code and assets into the `dist/` folder.
425. Upload the `dist/` folder as a glob to your distribution ship. Example url: https://distribution.urbit-ship.com/docket/upload
515. Upload the `dist/` folder as a glob to your distribution ship. Example url: https://distribution.urbit-ship.com/docket/upload
43−6. Publish the desk from dojo: `:treaty|publish %astrolabe`
45### Deploying with `glob-http` glob
53### Deploying with `glob-http` glob
47To deploy, run `npm run build` in the `ui` directory which will bundle all the code and assets into the `dist/` folder. This can then be made into a glob by doing the following:
55To deploy, run `npm run build` in the `ui` directory which will bundle all the code and assets into the `dist/` folder. This can then be made into a glob by doing the following:
49−1. Create or launch an urbit using the -F flag
57+1. Spin up a globber ship (comet or fakezod) (or just reuse your dev ship for this).
58+2. Mount an `%globber` desk. In Dojo:
50−2. On that urbit, if you don't already have a desk to run from, run `|merge %work our %base` to create a new desk and mount it with `|mount %work`.
59+ 1. `|merge %globber our %base` to create a new desk.
51−3. Now the `%work` desk is accessible through the host OS's filesystem as a directory of that urbit's pier ie `~/zod/work`.
60+ 2. `|mount %globber` to mount it.
52−4. From the `ui` directory you can run `rsync -avL --delete dist/ ~/zod/work/astrolabe` where `~/zod` is your fake urbit's pier.
61+ 3. Set `GLOBBER_DESK` in `.env.local` if the path to your globber desk is different.
53−5. Once completed you can then run `|commit %work` on your urbit and you should see your files logged back out from the dojo.
62+4. From the `ui` directory, run `npm run release` to build the ui and copy it to your globber desk
63+5. From the globber ship: `|commit %globber` (create basic mark files (see `png.hoon`) for any files without mark files)
54−6. Now run `=dir /=garden` to switch to the garden desk directory
64+6. Now run `=dir /=garden=` to switch to the garden desk directory
55−7. You can now run `-make-glob %work /astrolabe` which will take the folder where you just added files and create a glob which can be thought of as a sort of bundle. It will be output to `~/zod/.urb/put`.
65+7. `-make-glob %globber /astrolabe` which will take the folder where you just added files and create a glob which can be thought of as a sort of bundle. It will be output to `~/zod/.urb/put`.
56−8. If you navigate to `~/zod/.urb/put` you should see a file that looks like this `glob-0v5.fdf99.nph65.qecq3.ncpjn.q13mb.glob`. The characters between `glob-` and `.glob` are a hash of the glob's contents.
66+8. From the `ui` directory, run `npm run get-glob` to place the latest glob in the `globs` folder.
67+9. Copy the string printed by the last step, and paste it into `desk.docket-0`.
57−9. Now that we have the glob it can be uploaded to any publicly available HTTP endpoint that can serve files. This allows the glob to distributed over HTTP.
68+8. Upload the glob in `/globs/` to any publicly available HTTP endpoint that can serve files. This allows the glob to distributed over HTTP.
58−10. Once you've uploaded the glob, you should then update the corresponding entry in the docket file at `desk/desk.docket-0`. Both the full URL and the hash should be updated to match the glob we just created, on the line that looks like this:
69+10. Once you've uploaded the glob, paste the url into `desk/desk.docket-0`. Both the full URL and the hash should be updated to match the glob we just created, on the line that looks like this:
61− glob-http+['https://bootstrap.urbit.org/glob-0v5.fdf99.nph65.qecq3.ncpjn.q13mb.glob' 0v5.fdf99.nph65.qecq3.ncpjn.q13mb]
71+ glob-http+['https://bootstrap.urbit.org/glob-0v5.fdf99.nph65.qecq3.ncpjn.q13mb.glob' 0v5.fdf99.nph65.qecq3.ncpjn.q13mb]
64−11. This can now be safely committed and deployed.
66[svelte]: https://svelte.dev/
74[svelte]: https://svelte.dev/
67[typescript]: https://www.typescriptlang.org/
75[typescript]: https://www.typescriptlang.org/