taalhavras / ucal

a martian calendar
53 stars 6 forks source link

Scaffold a basic working Gall agent #1

Closed jalehman closed 4 years ago

jalehman commented 4 years ago

Context

Before working on any real functionality I wanted to get something that at least works—that is, isn't broken. I based this work heavily after what Luke Champine (~watter-parker) has done with rote.

Additions

Gall Agent

There's now a gall agent that can be launched with |start %ucal. It does basically nothing at this point except:

Build System

The Gall agents I've seen to date utilize gulp and the JS ecosystem to build front-end assets and copy files from a project directory into an Urbit ship's pier. I like ~watter's use of a .urbitrc file, so I've made use of that pattern here.

Also of note is that the project layout mirrors an urbit pier within the urbit directory, which appears to be an emergent convention.

ucal spec in /sur

I've added the beginning of a data structure definition for ucal, but it's heavily simplistic and liable to change immensely. This was mostly added for practice and to have something real during scaffolding of the agent.

Testing

First, create a .urbitrc file in this repository with the following contents:

module.exports = {
  URBIT_PIERS: [
    "/path/to/your/ship/home"
  ]
};

From this repo:

yarn install
yarn build

You can also run yarn serve to copy files over to your ship's pier any time changes are made.

From your ship:

|commit %home
|start %ucal
:ucal &noun print-state :: >= [%0 cals={}]
:ucal &ucal-action [%new-calendar %cal 'hello']
:ucal &ucal-action [%new-event ~wolref-podlex %cal 'birthday' now [%span ~h1] 'some description']

TODO

taalhavras commented 4 years ago

lgtm!