Skip to content

Commit

Permalink
Opt for short package names
Browse files Browse the repository at this point in the history
We use short package names instead of fully qualified package name,
while still retaining fully qualified system names.
  • Loading branch information
foretspaisibles committed Jul 30, 2024
1 parent 81f38c5 commit 5c9439d
Show file tree
Hide file tree
Showing 51 changed files with 77 additions and 84 deletions.
3 changes: 2 additions & 1 deletion development/makedoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
: ${subrdir:=${TOPLEVELDIR}/subr}
: ${makedocdir:=${TOPLEVELDIR}/obj/makedoc}
: ${makedocsystem:="org.melusina.webmachine"}
: ${makedocpackage:=${makedocsystem#'org.melusina.'}}

. "${subrdir}/stdlib.sh"

Expand Down Expand Up @@ -44,7 +45,7 @@ makedoc_extract()
--eval '(with-compilation-unit () (load "libexec/lisp/docstrings.lisp"))' \
--eval "(sb-texinfo:generate-includes
\"obj/makedoc/include/\"
(list :${makedocsystem}) :base-package :${makedocsystem})" \
(list :${makedocpackage}) :base-package :${makedocpackage})" \
--eval '(quit)'
}

Expand Down
3 changes: 2 additions & 1 deletion development/testsuite
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

: ${TOPLEVELDIR:=$(git rev-parse --show-toplevel)}
: ${testsuitesystem:="org.melusina.webmachine/testsuite"}
: ${testsuitepackage:=${testsuitesystem#'org.melusina.'}}
: ${testsuiteclean:='no'}
: ${testsuitelisp:='sbcl'}

Expand All @@ -37,7 +38,7 @@ testsuite_run()
fi
testsuite_lisp\
--eval "(ql:quickload \"${testsuitesystem}\" :silent t)"\
--eval "(${testsuitesystem}:$1)"\
--eval "(${testsuitepackage}:$1)"\
--eval '(org.melusina.confidence:quit)'
}

Expand Down
2 changes: 1 addition & 1 deletion example/domain/user.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine/example)
(in-package #:webmachine/example)

(defclass user ()
((id
Expand Down
2 changes: 1 addition & 1 deletion example/entrypoint.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine/example)
(in-package #:webmachine/example)

(defun create-users ()
(dolist (user-spec
Expand Down
2 changes: 1 addition & 1 deletion example/html.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine/example)
(in-package #:webmachine/example)


;;;;
Expand Down
2 changes: 1 addition & 1 deletion example/javascript.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine/example)
(in-package #:webmachine/example)

(defun utilities-javascript ()
(who:with-html-output (*standard-output*)
Expand Down
11 changes: 5 additions & 6 deletions example/package.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(defpackage #:org.melusina.webmachine/example
(defpackage #:webmachine/example
(:use #:common-lisp #:parenscript)
(:local-nicknames
(#:who #:cl-who)
(#:css #:cl-css)
(#:webmachine #:org.melusina.webmachine)
(#:asset #:org.melusina.webmachine/asset)
(#:server #:org.melusina.webmachine/server))
(#:asset #:webmachine/asset)
(#:server #:webmachine/server))
(:import-from
#:org.melusina.webmachine
#:webmachine
#:define-constant-resource)
(:export
#:functional-state-javascript
Expand All @@ -29,6 +28,6 @@
#:create-users
#:toplevel))

(in-package #:org.melusina.webmachine/example)
(in-package #:webmachine/example)

;;;; End of file `package.lisp'
17 changes: 8 additions & 9 deletions example/signature.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(defpackage #:org.melusina.webmachine/signature
(defpackage #:webmachine/signature
(:use #:cl #:parenscript)
(:local-nicknames
(#:webmachine #:org.melusina.webmachine)
(#:who #:cl-who))
(:export
#:verify-hmac-authorization-trait
Expand All @@ -24,7 +23,7 @@
#:signature-javascript
#:testsuite-signature-javascript))

(in-package #:org.melusina.webmachine/signature)
(in-package #:webmachine/signature)

(defparameter *signature-algorithm*
'(:external-format :utf-8
Expand Down Expand Up @@ -829,19 +828,19 @@ This must be implemented by resources using `HMAC-AUHTORIZATION'."))
#'find-key))))


(in-package #:org.melusina.webmachine/example)
(in-package #:webmachine/example)


;;;;
;;;; Example
;;;;

(defclass private-constant-resource (org.melusina.webmachine/signature:verify-hmac-authorization-trait webmachine:constant-resource)
(defclass private-constant-resource (webmachine/signature:verify-hmac-authorization-trait webmachine:constant-resource)
((signature-key-repository
:initarg :signature-key-repository
:initform nil)))

(defmethod org.melusina.webmachine/signature:find-signature-key ((resource private-constant-resource) identity)
(defmethod webmachine/signature:find-signature-key ((resource private-constant-resource) identity)
(cdr (assoc identity (slot-value resource 'signature-key-repository) :test #'string=)))

(defun make-example-data ()
Expand Down Expand Up @@ -916,8 +915,8 @@ This must be implemented by resources using `HMAC-AUHTORIZATION'."))
(signature-state-javascript)
(html-page-title "Signature")
(demonstrate-signature-button)
(org.melusina.webmachine/signature:testsuite-javascript)
(org.melusina.webmachine/signature:signature-javascript)
(org.melusina.webmachine/signature:testsuite-signature-javascript)))
(webmachine/signature:testsuite-javascript)
(webmachine/signature:signature-javascript)
(webmachine/signature:testsuite-signature-javascript)))

;;;; End of file `signature.lisp'
2 changes: 1 addition & 1 deletion example/utilities.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine/example)
(in-package #:webmachine/example)

(eval-when (:compile-toplevel :load-toplevel :execute)
(defmacro join (&body strings)
Expand Down
2 changes: 1 addition & 1 deletion example/view/about.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine/example)
(in-package #:webmachine/example)

(defun about-paragraph (&key label icon badges paragraph actions)
"Write an about paragraph."
Expand Down
2 changes: 1 addition & 1 deletion example/view/features.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine/example)
(in-package #:webmachine/example)

(defun features-paragraph (&key label icon badges paragraph actions)
"Write an features paragraph."
Expand Down
2 changes: 1 addition & 1 deletion example/view/health.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine/example)
(in-package #:webmachine/example)

(defun health-memory ()
(html-page-section (:id "memory" :title "Memory")
Expand Down
2 changes: 1 addition & 1 deletion example/view/home.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine/example)
(in-package #:webmachine/example)

(define-constant-resource (view-home :uri "/home" :content-type :text/html)
(html-page (:title "Home for Webmachine Example"
Expand Down
2 changes: 1 addition & 1 deletion example/view/login.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine/example)
(in-package #:webmachine/example)

(defun login-form ()
(who:with-html-output (*standard-output*)
Expand Down
2 changes: 1 addition & 1 deletion example/view/logout.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine/example)
(in-package #:webmachine/example)

(hunchentoot:define-easy-handler (logout :uri "/logout") ()
(when hunchentoot:*session*
Expand Down
2 changes: 1 addition & 1 deletion example/view/sign-up.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine/example)
(in-package #:webmachine/example)

(defun sign-up-form ()
(who:with-html-output (*standard-output*)
Expand Down
2 changes: 1 addition & 1 deletion example/view/user.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine/example)
(in-package #:webmachine/example)


;;;;
Expand Down
12 changes: 5 additions & 7 deletions libexec/lisp/development.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,18 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(defpackage #:org.melusina.webmachine/development
(defpackage #:webmachine/development
(:use #:cl)
(:local-nicknames
(#:atelier #:org.melusina.atelier)
(#:webmachine #:org.melusina.webmachine)
(#:testsuite #:org.melusina.webmachine/testsuite)
(#:server #:org.melusina.webmachine/server)
(#:example #:org.melusina.webmachine/example))
(#:testsuite #:webmachine/testsuite)
(#:server #:webmachine/server)
(#:example #:webmachine/example))
(:export
#:lint
#+quicklisp
#:reload))

(in-package #:org.melusina.webmachine/development)
(in-package #:webmachine/development)

(defun system-relative-pathname (pathname)
(flet ((system-source-directory ()
Expand Down
2 changes: 1 addition & 1 deletion server/entrypoint.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine/server)
(in-package #:webmachine/server)

(defparameter *swank-port* 4005
"The port of the SWANK listener.")
Expand Down
2 changes: 1 addition & 1 deletion server/html.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine/server)
(in-package #:webmachine/server)


;;;;
Expand Down
7 changes: 3 additions & 4 deletions server/package.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(defpackage #:org.melusina.webmachine/server
(defpackage #:webmachine/server
(:use #:common-lisp)
(:local-nicknames
(#:who #:cl-who)
(#:css #:cl-css)
(#:webmachine #:org.melusina.webmachine))
(#:css #:cl-css))
(:export

;; Server
Expand All @@ -31,6 +30,6 @@
;; HTML
#:html-page))

(in-package #:org.melusina.webmachine/server)
(in-package #:webmachine/server)

;;;; End of file `package.lisp'
2 changes: 1 addition & 1 deletion src/acceptor.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine)
(in-package #:webmachine)


;;;
Expand Down
8 changes: 3 additions & 5 deletions src/asset.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,20 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(defpackage #:org.melusina.webmachine/asset
(defpackage #:webmachine/asset
(:use #:cl)
(:local-nicknames
(#:webmachine #:org.melusina.webmachine))
(:export
#:make-bootstrap-resource
#:make-bootstrap-icons-resource
#:make-mathjax-resource
#:make-chartjs-resource))

(in-package #:org.melusina.webmachine/asset)
(in-package #:webmachine/asset)

(defparameter *assetdir*
#.(merge-pathnames
#p"asset/"
(asdf:system-source-directory (string-downcase (package-name *package*))))
(asdf:system-source-directory '#:org.melusina.webmachine))
"The pathname to the directory holding program assets.")

(defun asset-pathname (pathname)
Expand Down
2 changes: 1 addition & 1 deletion src/condition.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine)
(in-package #:webmachine)

(defun status-code-short-description (status-code)
"The short description associated with STATUS-CODE."
Expand Down
2 changes: 1 addition & 1 deletion src/configuration.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine)
(in-package #:webmachine)

(defparameter *catch-errors* t
"If non-NIL, catch any error and explain them to the client.
Expand Down
2 changes: 1 addition & 1 deletion src/constant-resource.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine)
(in-package #:webmachine)

(defclass constant-resource (resource)
((available-p
Expand Down
2 changes: 1 addition & 1 deletion src/content.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine)
(in-package #:webmachine)

(defun make-content-output-stream (raw-output-stream &key external-format encoding)
"Make a content output stream writing to the underlying RAW-OUTPUT-STREAM.
Expand Down
2 changes: 1 addition & 1 deletion src/directory-resource.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine)
(in-package #:webmachine)

(defclass directory-resource (resource)
((alias
Expand Down
2 changes: 1 addition & 1 deletion src/file-resource.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;;;; you should have received as part of this distribution. The terms
;;;; are also available at https://opensource.org/licenses/MIT

(in-package #:org.melusina.webmachine)
(in-package #:webmachine)

(defclass file-resource (resource)
((alias
Expand Down
Loading

0 comments on commit 5c9439d

Please sign in to comment.