changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > org > docs / core/bin/skel.org

changeset 45: 517e7b6fb42d
parent: 6303e1f79470
author: Richard Westhaver <ellis@rwest.io>
date: Sun, 25 Aug 2024 00:15:40 -0400
permissions: -rw-r--r--
description: meta and task work
1 #+title: skel
2 #+author: Richard Westhaver
3 #+setupfile: ../../../clean.theme
4 #+OPTIONS: num:nil
5 #+INFOJS_OPT: toc:nil view:content
6 
7 The =skel= CLI is the primary build tool for contributors and serves a
8 similar role to language-agnostic build tools like [[https://www.gnu.org/software/make/][GNU Make]], but with
9 the features and ease-of-use of language-specific build tools like
10 Rust's [[https://github.com/rust-lang/cargo][Cargo]].
11 
12 * features
13 :PROPERTIES:
14 :ID: 90d78420-e6d9-4f18-8222-89c4670633b4
15 :END:
16 ** configuration
17 :PROPERTIES:
18 :ID: 2658a3d1-cfa5-436e-b2b0-9cf42a6f66c6
19 :END:
20 The ~skel~ tool can be configured at runtime using the CLI flags, or
21 via local configuration files. The configuration files are in the
22 ~skelfile~ format and are assigned the following locations by default:
23 - ~*default-user-skelrc*~ :: =$HOME/.skelrc=
24 - ~*default-system-skelrc*~ :: =/etc/skel/skelrc=
25 
26 Both files are optional and the user skelrc takes precedence over
27 system.
28 
29 Example =~/.skelrc=:
30 #+begin_src shell :results output
31 cat ~/.skelrc
32 #+end_src
33 
34 #+RESULTS:
35 #+begin_example
36 ;;; .skelrc @ 2023-10-12.02:58:08 -*- mode: skel; -*-
37 :name "Richard Westhaver"
38 :email "richard.westhaver@gmail.com"
39 :user "ellis"
40 :version "0.1.0"
41 :tags ("auto")
42 :fmt :pretty
43 :vc :hg
44 :auto-insert t
45 :license :mpl2
46 :log-level :info
47 :stash ".stash"
48 ;; :scratch ".stash/scratch"
49 :cache ".stash/cache"
50 :registry ".data/skel/registry"
51 :scripts ("/usr/local/share/stash/scripts" "~/stash/scripts")
52 #+end_example
53 
54 ** projects
55 :PROPERTIES:
56 :ID: 359441da-1b61-4d73-8563-605ea7262b58
57 :END:
58 Projects are the highest-level objects int the ~skel~ system. A project
59 consists of a list of slots which are populated automatically or by
60 the user. Once a project is initialized the slots can be accessed and
61 a set of high-level operations can be performed.
62 
63 The easiest way to initialize a project is with a ~skelfile~. These
64 files are parsed as a simplified Lisp dialect and generate
65 ~sk-project~ objects based on their contents.
66 
67 The simplest project looks like this:
68 
69 #+begin_src skel :noeval t
70 :name hello-world
71 #+end_src
72 
73 Don't worry, this is still lisp - the parentheses are implied. All we
74 actually need is a name to generate an object, and we can fill in the
75 blanks later as the project develops.
76 
77 Here is a more verbose example, still with only metadata:
78 
79 #+begin_src skel :noeval t
80 ;;; skelfile --- core skelfile -*- mode: skel; -*-
81 :name "core"
82 :author "Richard Westhaver <ellis@rwest.io>"
83 :version "0.1.0"
84 :license "MPL"
85 :description "The Compiler Company Core"
86 :vc :hg
87 :tags ("core")
88 :docs ((:org "readme") (:org "install") (:org "tests") (:org "todo"))
89 :import ("lisp/lisp.sk" "rust/rust.sk")
90 #+end_src
91 
92 Another example with rules and components:
93 
94 #+begin_src skel :noeval t
95 ;;; skelfile @ 2023-10-08.02:37:25 -*- mode: skel; -*-
96 :name skel
97 :author "ellis"
98 :version "0.1.0"
99 :description "a hacker's project compiler"
100 :license "MPL"
101 :vc :hg
102 :tags ("lisp")
103 :rules ((build () (print (asdf:make :skel/cli)))
104  (clean () #$rm -rf */*.fasl$#))
105 :docs ((:org "readme"))
106 :components
107 ((:elisp "sk"))
108 :stash "~/dev/comp/stash"
109 #+end_src
110 ** version control
111 :PROPERTIES:
112 :ID: c15f58b5-d55e-425b-acf5-7001ef4591e4
113 :END:
114 =skel= integrates closely with our Version Control System (VCS) which
115 is built on [[https://www.mercurial-scm.org/][Mercurial]], but we also interact with and host many [[https://git-scm.com/][Git]]
116 repositories.
117 
118 The =skel= tool helps us abstract away the differences between git/hg
119 and make maximum use of their utility. When you run a =skel vc=
120 command the currently active ~sk-project~ and configuration are used
121 to determine the appropriate VC backend to call. New backends can of
122 course be added as extensions.
123 
124 ** TODO compilers
125 :PROPERTIES:
126 :ID: 5ec3ae9d-8846-4374-a42b-5701606ad119
127 :END:
128 - State "TODO" from [2023-12-09 Sat 19:28]
129 One of the most unusual features of =skel= is the compiler set. With
130 the =skel= CLI you can compile the following types of files for your
131 project directly from a ~skelfile~:
132 - Makefile (.mk)
133 - Lisp system defs (.asd)
134 - Cargo.toml
135 - Containerfile
136 - .hgignore/.gitignore
137 
138 We treat skelfiles as the mother of all build formats and consolidate
139 different formats into our own project DSL. This helps reduce
140 complexity while increasing capability and portability.
141 
142 Project compilation occurs on demand with the =sk compile= command.
143 
144 ** TODO virtualization
145 :PROPERTIES:
146 :ID: fea87861-30c2-4739-b964-1ecb87d3ddff
147 :END:
148 - State "TODO" from [2023-12-09 Sat 18:55]
149 
150  =skel= offers a mechanism for generating and running Virtual
151  Machines (VMs) and Containers. Under the hood we depend on [[https://podman.io/][podman]]
152  for our container runtime as well as [[https://www.qemu.org/][QEMU]] for some
153  functionality.
154 
155 ** TODO emacs integration
156 :PROPERTIES:
157 :ID: 3df22a04-3f6b-4738-bd5f-3eb91977d3af
158 :END:
159 - State "TODO" from [2023-12-09 Sat 19:30]
160 =sk.el= is the Emacs support package for skel. It contains a
161 =skel-mode= for working with skelfiles and will soon contain
162 additional built-in integrations for =project.el=, =vc.el=, and more.
163 ** TODO deployment
164 :PROPERTIES:
165 :ID: 7e66bdf6-304e-423e-8db4-783e7f6ccfd7
166 :END:
167 - State "TODO" from [2023-12-09 Sat 19:37]
168 ** TODO visualization
169 :PROPERTIES:
170 :ID: efa22675-70d6-453f-b377-8e76875e5f1f
171 :END:
172 - State "TODO" from [2023-12-09 Sat 19:37]
173 * help
174 :PROPERTIES:
175 :ID: f8e9fab4-67dc-4e7f-b172-7e0fc21047ad
176 :END:
177 #+begin_src shell :results pp replace :exports both
178 skel -h
179 #+end_src
180 
181 #+RESULTS:
182 #+begin_example
183 skel v0.1.1 --- A hacker's project compiler.
184 
185  usage: skel [global] <command> [<arg>]
186 
187 options:
188  -h/--help* : print this message
189  -v/--version* : print version
190  -l/--level* : set log level (warn,info,debug,trace)
191  -c/--config* : set a custom skel user config
192  -i/--input* : input source
193  -o/--output* : output target
194 
195 commands:
196  init : initialize a skelfile in the current directory
197  -n/--name : project name
198  new : make a new skel project
199  -n/--name : project name
200  describe : describe a skelfile
201  show : show project slots
202  -f/--file : path to skelfile
203  -u/--user : print user configuration
204  -s/--system : print system configuration
205  vc : version control
206  -r/--root : repository path
207  id : print the project id
208  rev : print the current vc revision id
209  inspect : inspect the project skelfile
210  -f/--file : path to skelfile
211  make : build project targets
212  -t/--target : target to build
213  run : run a script or command
214  status : print the vc status
215  push : push the current project upstream
216  pull : pull the current project from remote
217  clone : clone a remote project
218  commit : commit changes to the project vc
219  edit : edit a project file in emacs.
220  shell : open the sk-shell interpreter
221 #+end_example
222