changelog shortlog graph tags branches files raw help

Mercurial > core / changeset: skel package fixes

changeset 72: 2942d051f906
parent 71: 97c99e44a22f
child 73: cacf33d478b5
author: ellis <ellis@rwest.io>
date: Sun, 03 Dec 2023 19:13:03 -0500
files: lisp/lib/skel/comp.lisp lisp/lib/skel/comp/containerfile.lisp lisp/lib/skel/comp/ignore.lisp lisp/lib/skel/core/header.lisp lisp/lib/skel/core/obj.lisp lisp/lib/skel/core/proto.lisp lisp/lib/skel/core/util.lisp lisp/lib/skel/core/vm.lisp lisp/lib/skel/pkg.lisp
description: skel package fixes
     1.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2+++ b/lisp/lib/skel/comp.lisp	Sun Dec 03 19:13:03 2023 -0500
     1.3@@ -0,0 +1,8 @@
     1.4+(uiop:define-package :skel/comp
     1.5+  (:use :skel/core)    
     1.6+  (:use-reexport
     1.7+   :skel/comp/make
     1.8+   :skel/comp/asd
     1.9+   :skel/comp/containerfile
    1.10+   :skel/comp/ignore))
    1.11+
     2.1--- a/lisp/lib/skel/comp/containerfile.lisp	Sun Dec 03 18:44:14 2023 -0500
     2.2+++ b/lisp/lib/skel/comp/containerfile.lisp	Sun Dec 03 19:13:03 2023 -0500
     2.3@@ -0,0 +1,4 @@
     2.4+(defpackage :skel/comp/containerfile
     2.5+  (:use :cl :skel/core))
     2.6+
     2.7+(in-package :skel/comp/containerfile)
     3.1--- a/lisp/lib/skel/comp/ignore.lisp	Sun Dec 03 18:44:14 2023 -0500
     3.2+++ b/lisp/lib/skel/comp/ignore.lisp	Sun Dec 03 19:13:03 2023 -0500
     3.3@@ -0,0 +1,4 @@
     3.4+(defpackage :skel/comp/ignore
     3.5+  (:use :cl :skel/core))
     3.6+
     3.7+(in-package :skel/comp/ignore)
     4.1--- a/lisp/lib/skel/core/header.lisp	Sun Dec 03 18:44:14 2023 -0500
     4.2+++ b/lisp/lib/skel/core/header.lisp	Sun Dec 03 19:13:03 2023 -0500
     4.3@@ -1,7 +1,9 @@
     4.4 ;;; File Headers
     4.5 (defpackage :skel/core/header
     4.6   (:use :cl :std :skel/core/proto)
     4.7-  (:export :make-source-header-comment))
     4.8+  (:export
     4.9+   :make-file-header :make-shebang-file-header :make-source-file-header :file-header-kind
    4.10+   :make-source-header-comment :make-shebang-comment))
    4.11 
    4.12 (in-package :skel/core/header)
    4.13 
     5.1--- a/lisp/lib/skel/core/obj.lisp	Sun Dec 03 18:44:14 2023 -0500
     5.2+++ b/lisp/lib/skel/core/obj.lisp	Sun Dec 03 19:13:03 2023 -0500
     5.3@@ -1,7 +1,17 @@
     5.4 ;;; Objects
     5.5 (defpackage :skel/core/obj
     5.6   (:use :cl :std :skel/core/proto :skel/core/vc :skel/core/header :sb-unix)
     5.7-  (:import-from :uiop :read-file-forms :ensure-absolute-pathname))
     5.8+  (:import-from :uiop :read-file-forms :ensure-absolute-pathname)
     5.9+  (:export
    5.10+   ;; cfg
    5.11+   :*skel-project* :*skel-user-config* :*default-skelrc* :*skel-project-registry* 
    5.12+   :*default-skelfile* :*default-skel-user* :*default-skel-cache* :*default-user-skel-config* 
    5.13+   :*default-system-skel-config* :*skelfile-extension* :*skelfile-boundary*
    5.14+   ;; obj
    5.15+   :skel :sk-meta :def-sk-class :sk-project :sk-target :sk-source :sk-vc
    5.16+   :sk-rule :sk-rule-target :sk-rule-source :sk-rule-recipe :make-sk-rule 
    5.17+   :sk-description :sk-kind :sk-rules :sk-id :sk-version :sk-name :sk-docs :sk-document 
    5.18+   :sk-command :sk-scripts :sk-script :sk-config :sk-snippets :sk-snippet :sk-abbrevs :sk-abbrev))
    5.19 
    5.20 (in-package :skel/core/obj)
    5.21 
     6.1--- a/lisp/lib/skel/core/proto.lisp	Sun Dec 03 18:44:14 2023 -0500
     6.2+++ b/lisp/lib/skel/core/proto.lisp	Sun Dec 03 19:13:03 2023 -0500
     6.3@@ -1,6 +1,26 @@
     6.4 ;;; Proto
     6.5 (defpackage :skel/core/proto
     6.6-  (:use :cl))
     6.7+  (:use :cl)
     6.8+  (:export
     6.9+   ;; proto
    6.10+   :sk-run
    6.11+   :sk-new
    6.12+   :sk-save
    6.13+   :sk-tangle
    6.14+   :sk-weave
    6.15+   :sk-call
    6.16+   :sk-print
    6.17+   :sk-load
    6.18+   :sk-compile
    6.19+   :rehash-object
    6.20+   :sk-transform
    6.21+   :sk-read-file
    6.22+   :sk-write
    6.23+   :sk-writeln
    6.24+   :sk-write-string
    6.25+   :sk-write-file
    6.26+   :sk-read-file
    6.27+   :sk-install-user-config))
    6.28 
    6.29 (in-package :skel/core/proto)
    6.30 
     7.1--- a/lisp/lib/skel/core/util.lisp	Sun Dec 03 18:44:14 2023 -0500
     7.2+++ b/lisp/lib/skel/core/util.lisp	Sun Dec 03 19:13:03 2023 -0500
     7.3@@ -1,6 +1,15 @@
     7.4 ;;; Utils
     7.5 (defpackage :skel/core/util
     7.6-  (:use :cl :skel/core/obj :skel/core/proto))
     7.7+  (:use :cl :skel/core/obj :skel/core/proto :std/fu)
     7.8+  (:export 
     7.9+   :init-skelrc :load-skelrc
    7.10+   :init-skel-user-config
    7.11+   :init-skelfile
    7.12+   :load-skelfile
    7.13+   :find-skelfile
    7.14+   :find-project-root
    7.15+   :describe-skeleton
    7.16+   :describe-project))
    7.17 
    7.18 (in-package :skel/core/util)
    7.19 
    7.20@@ -18,9 +27,28 @@
    7.21   "Initialize the *SKEL-USER-CONFIG* var."
    7.22   (setq *skel-user-config* (load-skelrc file)))
    7.23 
    7.24-(defun load-skelfile (file)
    7.25-  "Load the 'skelfile' FILE."
    7.26-  (load-ast (sk-read-file (make-instance 'sk-project) file)))
    7.27+(eval-when (:compile-toplevel :load-toplevel :execute)
    7.28+  (defun load-skelfile (file)
    7.29+    "Load the 'skelfile' FILE."
    7.30+    (load-ast (sk-read-file (make-instance 'sk-project) file)))
    7.31+
    7.32+  (defun find-project-root (path name)
    7.33+    "Return PATH if it is a `skel-project' by checking for
    7.34+  NAME."
    7.35+    (if (probe-file (merge-pathnames name path))
    7.36+        path
    7.37+        (let ((next (pathname-parent-directory-pathname path)))
    7.38+	  (when (eql path next)
    7.39+	    (find-project-root next name)))))
    7.40+
    7.41+  (defun init-skelfile (&optional file name cfg)
    7.42+    "Initialize a skelfile."
    7.43+    (let ((sk (make-instance 'sk-project 
    7.44+		:name (or name (pathname-name (getcwd)))))
    7.45+	  (path (or file *default-skelfile*))
    7.46+	  (fmt :collapsed))
    7.47+      (when cfg (setf sk (sk-install-user-config sk cfg)))
    7.48+      (sk-write-file sk :path path :fmt fmt))))
    7.49 
    7.50 (defun find-skelfile (start &key (load nil) (name *default-skelfile*) (walk t))
    7.51   "Walk up the current directory returning the path to a 'skelfile', else
    7.52@@ -40,24 +68,6 @@
    7.53 	    sk)
    7.54 	(warn "failed to find skelfile"))))
    7.55 
    7.56-(defun find-project-root (path name)
    7.57-  "Return PATH if it is a `skel-project' by checking for
    7.58-  NAME."
    7.59-  (if (probe-file (merge-pathnames name path))
    7.60-      path
    7.61-      (let ((next (pathname-parent-directory-pathname path)))
    7.62-	(when (eql path next)
    7.63-	  (find-project-root next name)))))
    7.64-
    7.65-(defun init-skelfile (&optional file name cfg)
    7.66-  "Initialize a skelfile."
    7.67-  (let ((sk (make-instance 'sk-project 
    7.68-			   :name (or name (pathname-name (getcwd)))))
    7.69-	(path (or file *default-skelfile*))
    7.70-	(fmt :collapsed))
    7.71-    (when cfg (setf sk (sk-install-user-config sk cfg)))
    7.72-    (sk-write-file sk :path path :fmt fmt)))
    7.73-
    7.74 (defun describe-skeleton (skel &optional (stream t))
    7.75   "Describe the object SKEL which should inherit from the `skel' superclass."
    7.76   (print-object skel stream)
     8.1--- a/lisp/lib/skel/core/vm.lisp	Sun Dec 03 18:44:14 2023 -0500
     8.2+++ b/lisp/lib/skel/core/vm.lisp	Sun Dec 03 19:13:03 2023 -0500
     8.3@@ -3,7 +3,9 @@
     8.4 ;; Stack slots refer to objects. a Stack is a sequence of objects
     8.5 ;; which can be output to a stream using a specialized function.
     8.6 (defpackage :skel/core/vm
     8.7-  (:use :cl :std :skel/core/obj :skel/core/proto))
     8.8+  (:use :cl :std :skel/core/obj :skel/core/proto)
     8.9+  (:export
    8.10+   :make-stack-slot :make-sk-vm :sks-ref :sks-pop :sks-push))
    8.11 
    8.12 (in-package :skel/core/vm)
    8.13 
     9.1--- a/lisp/lib/skel/pkg.lisp	Sun Dec 03 18:44:14 2023 -0500
     9.2+++ b/lisp/lib/skel/pkg.lisp	Sun Dec 03 19:13:03 2023 -0500
     9.3@@ -6,50 +6,12 @@
     9.4 
     9.5 ;;; Code:
     9.6 (uiop:define-package :skel/pkg
     9.7-    (:nicknames :skel)
     9.8+  (:nicknames :skel)
     9.9   (:use :cl :cl-ppcre :std :sb-mop)
    9.10+  (:use-reexport :skel/core :skel/comp)
    9.11   (:import-from :sb-unix :uid-username)
    9.12   (:import-from :uiop :ensure-absolute-pathname)
    9.13-  (:shadowing-import-from :uiop :pathname-parent-directory-pathname :read-file-forms)
    9.14-  (:export
    9.15-   ;; cfg
    9.16-   :*skel-project* :*skel-user-config* :*default-skelrc* :*skel-project-registry* 
    9.17-   :*default-skelfile* :*default-skel-user* :*default-skel-cache* :*default-user-skel-config* 
    9.18-   :*default-system-skel-config* :*skelfile-extension* :*skelfile-boundary*
    9.19-   ;; proto
    9.20-   :sk-run
    9.21-   :sk-new
    9.22-   :sk-save
    9.23-   :sk-tangle
    9.24-   :sk-weave
    9.25-   :sk-call
    9.26-   :sk-print
    9.27-   :sk-load
    9.28-   :sk-compile
    9.29-   :rehash-object
    9.30-   :sk-transform
    9.31-   :sk-read-file
    9.32-   :sk-write
    9.33-   :sk-writeln
    9.34-   :sk-write-string
    9.35-   :sk-write-file
    9.36-   :sk-read-file
    9.37-   :sk-install-user-config
    9.38-   ;; obj
    9.39-   :skel :sk-meta :def-sk-class :sk-project :sk-target :sk-source
    9.40-   :sk-rule :sk-rule-target :sk-rule-source :sk-rule-recipe :make-sk-rule 
    9.41-   :sk-description :sk-kind :sk-rules :sk-id :sk-version :sk-name :sk-docs :sk-document 
    9.42-   :sk-command :sk-scripts :sk-script :sk-config :sk-snippets :sk-snippet :sk-abbrevs :sk-abbrev
    9.43-   ;; accesors
    9.44-   :sk-vc
    9.45-   ;; header
    9.46-   :make-file-header :make-shebang-file-header :make-source-file-header :file-header-kind
    9.47-   :make-source-header-comment :make-shebang-comment 
    9.48-   ;; utils
    9.49-   :init-skelfile :init-skelrc :load-skelrc :find-skelfile :load-skelfile
    9.50-   :describe-skeleton :describe-project :init-skel-user-config
    9.51-   ;; vm
    9.52-   :make-stack-slot :make-sk-vm :sks-ref :sks-pop :sks-push))
    9.53+  (:shadowing-import-from :uiop :pathname-parent-directory-pathname :read-file-forms))
    9.54 
    9.55 (in-package :skel/pkg)
    9.56 (defvar *skel-version* "0.1.0")