diff --git a/Makefile b/Makefile index e2883d4..da51427 100644 --- a/Makefile +++ b/Makefile @@ -1,37 +1,22 @@ -# Low-tech Makefile to build and install dylan-tool. - -# Building an executable for a library named "dylan" causes a conflict with the -# base dylan library. I want this tool to be named "dylan" on the command line, -# so it's necessary to use a makefile to build and then rename the executable -# during the installation process. - -# Because there's currently no way to make a static executable this gets -# installed with the following directory structure: -# -# ${DYLAN}/install/dylan-tool/bin/dylan-tool # dylan-tool executable -# ${DYLAN}/install/dylan-tool/lib/* # dylan-tool used libraries -# ${DYLAN}/bin/dylan # symlink -# -> ../install/dylan-tool/bin/dylan-tool # to here -# -# So just make sure ${DYLAN}/bin (or ${HOME}/dylan/bin, the default) is on your path. +# Low-tech Makefile to build and install deft. DYLAN ?= $${HOME}/dylan -install_dir = $(DYLAN)/install/dylan-tool +install_dir = $(DYLAN)/install/deft install_bin = $(install_dir)/bin install_lib = $(install_dir)/lib -link_target = $(install_bin)/dylan-tool-app +link_target = $(install_bin)/deft-app link_source = $(DYLAN)/bin/dylan git_version := "$(shell git describe --tags --always --match 'v*')" -.PHONY: build build-with-version clean install install-debug really-install remove-dylan-tool-artifacts test dist distclean +.PHONY: build build-with-version clean install install-debug really-install remove-deft-artifacts test dist distclean -build: remove-dylan-tool-artifacts - OPEN_DYLAN_USER_REGISTRIES=${PWD}/registry dylan-compiler -build -unify dylan-tool-app +build: remove-deft-artifacts + OPEN_DYLAN_USER_REGISTRIES=${PWD}/registry dylan-compiler -build -unify deft-app # Hack to add the version to the binary with git tag info. Don't want this to # be the normal build because it causes unnecessary rebuilds. -build-with-version: remove-dylan-tool-artifacts +build-with-version: remove-deft-artifacts file="sources/commands/utils.dylan"; \ orig=$$(mktemp); \ temp=$$(mktemp); \ @@ -39,34 +24,34 @@ build-with-version: remove-dylan-tool-artifacts cat $${file} | sed "s,/.__./.*/.__./,/*__*/ \"${git_version}\" /*__*/,g" > $${temp}; \ mv $${temp} $${file}; \ OPEN_DYLAN_USER_REGISTRIES=${PWD}/registry \ - dylan-compiler -build -unify dylan-tool-app; \ + dylan-compiler -build -unify deft-app; \ cp -p $${orig} $${file} really-install: mkdir -p $(DYLAN)/bin - cp _build/sbin/dylan-tool-app $(DYLAN)/bin/ + cp _build/sbin/deft-app $(DYLAN)/bin/ install: build-with-version really-install # Build and install without the version hacking above. install-debug: build really-install -# dylan-tool needs to be buildable with submodules so that it can be built on +# Deft needs to be buildable with submodules so that it can be built on # new platforms without having to manually install deps. test: build OPEN_DYLAN_USER_REGISTRIES=${PWD}/registry \ - dylan-compiler -build dylan-tool-test-suite \ - && DYLAN_CATALOG=ext/pacman-catalog _build/bin/dylan-tool-test-suite + dylan-compiler -build deft-test-suite \ + && DYLAN_CATALOG=ext/pacman-catalog _build/bin/deft-test-suite dist: distclean install -# Sometimes I use dylan-tool to develop dylan-tool, so this makes sure to clean +# Sometimes I use deft to develop deft, so this makes sure to clean # up its artifacts. -remove-dylan-tool-artifacts: +remove-deft-artifacts: rm -rf _packages find registry -not -path '*/generic/*' -type f -exec rm {} \; -clean: remove-dylan-tool-artifacts +clean: remove-deft-artifacts rm -rf _build rm -rf _test diff --git a/README.md b/README.md index 7dd45f2..bc79bb5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# Dylan Tool +# Deft -[![tests](https://github.com/dylan-lang/dylan-tool/actions/workflows/test.yaml/badge.svg)](https://github.com/dylan-lang/dylan-tool/actions/workflows/test.yaml) -[![GitHub issues](https://img.shields.io/github/issues/dylan-lang/dylan-tool?color=blue)](https://github.com/dylan-lang/dylan-tool/issues) +[![tests](https://github.com/dylan-lang/deft/actions/workflows/test.yml/badge.svg)](https://github.com/dylan-lang/deft/actions/workflows/test.yml) +[![GitHub issues](https://img.shields.io/github/issues/dylan-lang/deft?color=blue)](https://github.com/dylan-lang/deft/issues) [![Matrix](https://img.shields.io/matrix/dylan-lang-general:matrix.org?color=blue&label=Chat%20on%20Matrix&server_fqdn=matrix.org)](https://app.element.io/#/room/#dylan-language:matrix.org) * Package management @@ -10,13 +10,13 @@ * No more Git submodules * Build/test from anywhere in your workspace -The `dylan` tool simplifies the management of Dylan workspaces and packages and +Deft simplifies the management of Dylan workspaces and packages and provides a simplified interface to the Open Dylan compiler for building and (soon) testing, and generating documentation. It eliminates the need to manage library locations (registries) by hand and the need to use git submodules to track dependencies. - $ dylan new application hello + $ deft new application hello Downloaded pacman-catalog@master to /tmp/dylan/_packages/pacman-catalog/master/src/ Created library hello. Created library hello-test-suite. @@ -29,7 +29,7 @@ track dependencies. $ cd hello - $ dylan build --all + $ deft build --all Open Dylan 2023.1 Build of 'hello-test-suite' completed Build of 'hello-app' completed @@ -45,9 +45,9 @@ repository. For any package to be downloadable it must have an entry in the catalog. Full documentation is -[here](https://opendylan.org/package/dylan-tool). +[here](https://opendylan.org/package/deft). ## Bugs If you have a feature request, think something should be designed differently, or find -bugs, [file a bug report](https://github.com/dylan-lang/dylan-tool/issues). +bugs, [file a bug report](https://github.com/dylan-lang/deft/issues). diff --git a/documentation/source/conf.py b/documentation/source/conf.py index a426081..dd876eb 100644 --- a/documentation/source/conf.py +++ b/documentation/source/conf.py @@ -12,13 +12,13 @@ # import os import sys -sys.path.insert(0, os.path.abspath('../../_packages/sphinx-extensions/current/src/sphinxcontrib')) +sys.path.insert(0, os.path.abspath('../../ext/sphinx-extensions/sphinxcontrib')) import dylan.themes as dylan_themes # -- Project information ----------------------------------------------------- -project = 'dylan-tool' +project = 'deft' copyright = '2021, Dylan Hackers' diff --git a/documentation/source/index.rst b/documentation/source/index.rst index 0e8e7d5..8154793 100644 --- a/documentation/source/index.rst +++ b/documentation/source/index.rst @@ -1,10 +1,10 @@ .. highlight:: shell -************** -``dylan`` Tool -************** +******************** +Deft - The Dylan CLI +******************** -The :program:`dylan` command-line tool is intended to make Dylan development +The :program:`deft` command-line tool is intended to make Dylan development easier by taking care of some of the drudgery for you, including: * managing Dylan workspaces and package dependencies @@ -29,7 +29,7 @@ package versioned releases. A package may contain zero or more Dylan libraries. workspace - The directory in which the :program:`dylan` tool operates. Effectively this + The directory in which :program:`deft` operates. Effectively this means a workspace is where the :file:`_build` and :file:`registry` directories are generated. In most cases, a workspace is the directory containing the :file:`dylan-package.json` file, but the ultimate arbiter is @@ -40,7 +40,7 @@ active package workspace is the same as a package directory so there is only one active package. See `Workspaces`_ for discussion of multi-package workspaces. - `dylan update`_ scans active packages when creating the registry. + `deft update`_ scans active packages when creating the registry. release A specific version of a package. A release has a `Semantic Version`_ associated @@ -58,13 +58,16 @@ packages. (This dependency will be removed in a future release.) Where are Packages Installed? ============================= -The :program:`dylan` tool installs package dependencies locally in the -workspace directory by default. However, you may choose to install them -globally with :command:`dylan update --global`. +:program:`deft` installs package dependencies in the :file:`_packages` +directory at the root of your workspace by default. However, you may choose to +install them globally with :command:`deft update --global`. -The package manager caches `its catalog -`_ into a global location per -user. This location is chosen based on environment variables, in this order: +The package manager always caches `its catalog +`_ in the global location (per +user). + +The global :file:`_packages` directory location is chosen based on environment +variables, in this order: 1. ``${DYLAN}/_packages`` if :envvar:`DYLAN` is set. @@ -80,26 +83,18 @@ user. This location is chosen based on environment variables, in this order: Building From Source ==================== -If you have **Open Dylan 2022.1 or later**, :program:`dylan` is already -installed as part of that release. But the :program:`dylan` tool is still under -active development and tends to move faster than the pace of Open Dylan -releases, so you may want to build the latest version. Here's how.... - -.. note:: Because an executable named "dylan" conflicts with the base Dylan - library during the build process, this library is named "dylan-tool". In - Open Dylan the executable is installed as :program:`dylan`, but here it is - installed as :program:`dylan-tool-app`. This way both can be used at the - same time, which is useful during development. - - This documentation usually uses the name :program:`dylan`. Keep this in mind - if you follow any examples below. +If you have **Open Dylan 2024.2 or later**, :program:`deft` is already +installed as part of that release. (In all 2022 and 2023 releases and in 2024.1 +the tool was named :program:`dylan` but has now been renamed to +:program:`deft`.) But :program:`deft` is still under active development so you +may want to build the latest version. Here's how.... #. Read the `Requirements`_ section, above. -#. Clone and build the "dylan-tool" project:: +#. Clone and build the "deft" project:: - $ git clone --recursive https://github.com/dylan-lang/dylan-tool.git - $ cd dylan-tool + $ git clone --recursive https://github.com/dylan-lang/deft + $ cd deft $ make $ make test # optional $ make install @@ -108,7 +103,7 @@ releases, so you may want to build the latest version. Here's how.... set ``$DYLAN``, make sure that ``$HOME/dylan/bin`` is on your ``$PATH``, as that is where the Makefile installs the executable. -You should now be able to run `dylan-tool-app help`_ and go through the Hello +You should now be able to run `deft-app help`_ and go through the Hello World example below. @@ -134,14 +129,14 @@ project), and change to that directory:: Now generate a new application library called "hello-world":: - $ dylan new application hello-world + $ deft new application hello-world Created library hello-world. Created library hello-world-test-suite. Created library hello-world-app. - Downloaded strings@1.1.0 to /home/you/dylan/hello-world/_packages/strings/1.1.0/src/ - Downloaded command-line-parser@3.1.1 to /home/you/dylan/hello-world/_packages/command-line-parser/3.1.1/src/ - Downloaded json@1.0.0 to /home/you/dylan/hello-world/_packages/json/1.0.0/src/ - Downloaded testworks@2.3.1 to /home/you/dylan/hello-world/_packages/testworks/2.3.1/src/ + Downloaded strings@1.1.0 to /home/you/dylan/workspaces/hello-world/_packages/strings/1.1.0/src/ + Downloaded command-line-parser@3.1.1 to /home/you/dylan/workspaces/hello-world/_packages/command-line-parser/3.1.1/src/ + Downloaded json@1.0.0 to /home/you/dylan/workspaces/hello-world/_packages/json/1.0.0/src/ + Downloaded testworks@2.3.1 to /home/you/dylan/workspaces/hello-world/_packages/testworks/2.3.1/src/ Workspace directory is /home/you/dylan/workspaces/hello-world/. Updated 18 files in /home/you/dylan/workspaces/hello-world/registry/. @@ -149,7 +144,7 @@ What did this do? 1. It created files with some initial code for your application, hello-world. 2. It created a test suite. -3. It ran ``dylan update``, which downloaded all the packages your application +3. It ran ``deft update``, which downloaded all the packages your application depends on. 4. It created a "registry" directory, which ``dylan-compiler`` will use to locate each used library. @@ -164,7 +159,7 @@ a pointer to the build file (a ".lid" file) for a library. Now let's build! :: $ cd hello-world - $ dylan build --all + $ deft build --all ...compiler output... $ _build/bin/hello-world @@ -199,9 +194,9 @@ to this:: "dependencies": [ "base64" ], -and then run `dylan update`_ again:: +and then run `deft update`_ again:: - $ dylan update + $ deft update Workspace directory is /home/you/dylan/workspaces/hello-world/. Updated 1 file in /home/you/dylan/workspaces/hello-world/registry/. @@ -211,16 +206,16 @@ downloaded. Usually it's a good idea to specify a particular version, like was installed. We also haven't actually changed the hello-world code to use base64. That is -left as an exercise. (Modify library.dylan and run ``dylan build -a`` again.) +left as an exercise. (Modify :file:`library.dylan` and run ``deft build -a`` again.) -Now that you've got a working project, try some other :program:`dylan` +Now that you've got a working project, try some other :program:`deft` `subcommands`_, the most useful ones are: -* `dylan status`_ tells you the status of the active packages. It will find the +* `deft status`_ tells you the status of the active packages. It will find the ``hello-world`` package but will complain that it's not a Git repository. Run ``git init`` in it if you like. -* `dylan list`_ with ``--all`` lists all the packages in the catalog. (Note +* `deft list`_ with ``--all`` lists all the packages in the catalog. (Note that many libraries are still included with Open Dylan. They'll be moved to packages eventually.) @@ -233,7 +228,7 @@ Workspaces ========== A workspace is a directory in which you work on a Dylan package, or multiple -interrelated packages. The :program:`dylan` tool often needs to find the root +interrelated packages. :program:`deft` often needs to find the root of the workspace, for example to decide where to write the "registry" directory or to invoke :program:`dylan-compiler`. It does this by looking for one of the following files, in the order shown, and by using the directory containing the @@ -264,10 +259,10 @@ multi-package workspace might look like this:: my-workspace/package-2/*.dylan my-workspace/package-2/*.lid my-workspace/package-2/dylan-package.json - my-workspace/registry // created by dylan tool + my-workspace/registry // created by deft my-workspace/workspace.json // created by you -Most :program:`dylan` subcommands need to be run inside a workspace so that +Most :program:`deft` subcommands need to be run inside a workspace so that they can * find or create the "registry" directory, @@ -286,7 +281,7 @@ JSON dictionary, ``{}``. } The ``"default-library"`` attribute is currently the only valid attribute and -is used by the `dylan build`_ command to decide which library to build when no +is used by the `deft build`_ command to decide which library to build when no other library is specified. A good choice would be your main test suite library. It may also be left unspecified. @@ -297,16 +292,16 @@ Open Dylan uses "registries" to locate used libraries. Setting up a development workspace historically involved a lot of manual Git cloning, creating registry files for each used library, and adding Git submodules. -`dylan update`_ takes care of that for you. It scans each active package and +`deft update`_ takes care of that for you. It scans each active package and its dependencies for ".lid" files and writes a registry file for each one (but see below for platform-specific libraries), and it downloads and installs package dependencies for you. .. note:: If you use the same workspace directory on multiple platforms (e.g., a network mounted directory or shared by a - virtual machine) you will need to run `dylan update`_ on + virtual machine) you will need to run `deft update`_ on **each** platform so that the correct platform-specific - registry entries are created. The :program:`dylan` tool + registry entries are created. :program:`deft` makes no attempt to figure out which packages are "generic" and which are platform-specific, so it always writes registry files specifically for the current platform, e.g., @@ -328,7 +323,7 @@ and only include it in that platform's LID file. To complicate matters, one LID file may include another LID file via the ``LID`` header. -In order for `dylan update`_ to generate the registry it must figure out which +In order for `deft update`_ to generate the registry it must figure out which LID files match the current platform. For example, when on Linux it shouldn't generate a registry file for a Windows-only library. @@ -353,8 +348,7 @@ platform for that library, or you must use the ``Platforms`` header in the **included** LID file to specify all platforms that *don't* have a platform-specific LID file. -For example, the base "dylan" library itself (not to be confused with the -:program:`dylan` tool) has a `dylan-win32.lid +For example, the base "dylan" library itself has a `dylan-win32.lid `_ file so that it can specify some Windows resource files. "dylan-win32.lid" includes "dylan.lid" and has ``Platforms: x86-win32``. Since there's nothing @@ -370,16 +364,16 @@ platforms it explicitly applies to by adding this:: Package Manager =============== -The :program:`dylan` tool relies on :doc:`pacman`, the Dylan package manager +:program:`deft` relies on :doc:`pacman`, the Dylan package manager (unrelated to the Arch Linux tool by the same name), to install dependencies. See :doc:`the pacman documentation ` for information on how to define a package, version syntax, and how dependency resolution works. -Global ``dylan`` Options -======================== +Global ``deft`` Options +======================= -Note that global command line options must be specified between "dylan" and the -first subcommand name. Example: ``dylan --debug build --all`` +Note that global command line options must be specified between "deft" and the +first subcommand name. Example: ``deft --debug build --all`` ``--debug`` Disables error handling so that when an error occurs the debugger will be @@ -400,37 +394,37 @@ Subcommands .. index:: - single: dylan help subcommand - single: subcommand; dylan help + single: deft help subcommand + single: subcommand; deft help -.. _dylan-tool-app help: +.. _deft-app help: -dylan help ----------- +deft help +--------- Displays overall help or help for a specific subcommand. Synopsis: - ``dylan help`` + ``deft help`` - ``dylan help [ ...]`` + ``deft help [ ...]`` - ``dylan [ ...] --help`` + ``deft [ ...] --help`` .. index:: - single: dylan build subcommand - single: subcommand; dylan build + single: deft build subcommand + single: subcommand; deft build -dylan build ------------ +deft build +---------- Build the configured default library or the specified libraries. Synopsis: - ``dylan build [options] [--all | lib1 lib2 ...]`` + ``deft build [options] [--all | lib1 lib2 ...]`` -`dylan build`_ is essentially a wrapper around :program:`dylan-compiler` that +`deft build`_ is essentially a wrapper around :program:`dylan-compiler` that has a few advantages: #. Invoke it from any directory inside your workspace and it will run the build @@ -446,7 +440,7 @@ has a few advantages: #. Specify multiple libraries on one command line, unlike with :program:`dylan-compiler`. -`dylan build`_ exits after the first library that generates serious compiler +`deft build`_ exits after the first library that generates serious compiler warnings, i.e., if :program:`dylan-compiler` exits with an error status. (Requires an Open Dylan release later than 2020.1.) @@ -475,15 +469,15 @@ status. (Requires an Open Dylan release later than 2020.1.) (Requires Open Dylan 2022.1 or later.) .. index:: - single: dylan install subcommand - single: subcommand; dylan install + single: deft install subcommand + single: subcommand; deft install -dylan install -------------- +deft install +------------ Install packages. -Synopsis: ``dylan install [ ...]`` +Synopsis: ``deft install [ ...]`` This command is primarily useful if you want to browse the source code in a package locally without having to worry about where to clone it from. If you @@ -492,13 +486,13 @@ are in a workspace directory the packages are installed in the workspace's .. index:: - single: dylan list subcommand - single: subcommand; dylan list + single: deft list subcommand + single: subcommand; deft list -.. _dylan-list: +.. _deft-list: -dylan list ----------- +deft list +--------- Display a list of installed packages along with the installed version number and the latest version available in the catalog, plus a short description. With @@ -510,56 +504,56 @@ installed version is lower than the latest published version. Example:: - $ dylan list + $ deft list Inst. Latest Package Description 0.1.0 0.1.0 base64 Base64 encoding ! 3.1.0 3.2.0 command-line-parser Parse command line flags and subcommands 0.1.0 0.1.0 concurrency Concurrency utilities - 0.6.0 0.6.0 dylan-tool Manage Dylan workspaces, packages, and registries + 0.6.0 0.6.0 deft Manage Dylan workspaces, packages, and registries ... .. index:: - single: dylan new application subcommand - single: subcommand; dylan new application + single: deft new application subcommand + single: subcommand; deft new application -dylan new application ---------------------- +deft new application +-------------------- Generate the boilerplate for a new executable application. -Synopsis: ``dylan new application [options] [ ...]`` +Synopsis: ``deft new application [options] [ ...]`` -This command is the same as `dylan new library`_ except that in addition to the +This command is the same as `deft new library`_ except that in addition to the ```` library it also generates a ``-app`` executable library with a ``main`` function. Here's an example of creating an executable named "killer-app" which depends on http version 1.0 and the latest version of logging. :: - $ dylan new application killer http@1.0 logging - $ dylan build --all + $ deft new application killer http@1.0 logging + $ deft build --all $ _build/bin/killer-test-suite $ _build/bin/killer-app -You must run ``dylan update`` whenever dependencies are changed, to install the +You must run ``deft update`` whenever dependencies are changed, to install the new dependencies and update the registry files. -**See also:** `dylan new library`_ +**See also:** `deft new library`_ .. index:: - single: dylan new library subcommand - single: subcommand; dylan new library + single: deft new library subcommand + single: subcommand; deft new library -dylan new library ------------------ +deft new library +---------------- Generate code for a new shared library. -Synopsis: ``dylan new library [options] [ ...]`` +Synopsis: ``deft new library [options] [ ...]`` -This command is the same as `dylan new application`_ except that it doesn't +This command is the same as `deft new application`_ except that it doesn't generate the corresponding ``-app`` executable library. Specifying dependencies is optional. They should be in the same form as @@ -572,10 +566,10 @@ This command generates the following code: * A :file:`dylan-package.json` file (unless this new library is being added to an existing package). -You must run ``dylan update`` whenever dependencies are changed, to install +You must run ``deft update`` whenever dependencies are changed, to install the new dependencies and update the registry files. -**See also:** `dylan new application`_ +**See also:** `deft new application`_ **Options:** @@ -586,8 +580,8 @@ the new dependencies and update the registry files. Here's an example of creating a library named "http" which depends on "strings" version 1.0 and the latest version of "logging". :: - $ dylan new library http strings@1.0 logging - $ dylan build --all + $ deft new library http strings@1.0 logging + $ deft build --all $ _build/bin/killer-app-test-suite Edit the generated :file:`dylan-package.json` file to set the repository URL, @@ -595,20 +589,20 @@ description, and other attributes for your package. .. index:: - single: dylan new workspace subcommand - single: subcommand; dylan new workspace + single: deft new workspace subcommand + single: subcommand; deft new workspace -dylan new workspace -------------------- +deft new workspace +------------------ Create a new workspace. -Synopsis: ``dylan new workspace [options] `` +Synopsis: ``deft new workspace [options] `` .. note:: In most cases there is no need to explicitly create a workspace since the package directory (the directory containing :file:`dylan-package.json`) will be used as the workspace by - :program:`dylan` subcommands if no workspace.json file is + :program:`deft` subcommands if no workspace.json file is found. Explicit workspaces are mainly needed when working on multiple interrelated packages at the same time. @@ -618,34 +612,34 @@ Synopsis: ``dylan new workspace [options] `` Create the workspace under this directory instead of in the current working directory. -`dylan new workspace`_ creates a new workspace directory and initializes it +`deft new workspace`_ creates a new workspace directory and initializes it with a :file:`workspace.json` file. The workspace name is the only required argument. Example:: - $ dylan new workspace my-app + $ deft new workspace my-app $ cd my-app $ ls -l total 8 -rw-r--r-- 1 you you 28 Dec 29 18:03 workspace.json Clone repositories in the top-level workspace directory to create active -packages (or create them with `dylan new library`_ and `dylan new -application`_), then run `dylan update`_. +packages (or create them with `deft new library`_ and `deft new +application`_), then run `deft update`_. **See also:** `Workspaces`_ .. index:: - single: dylan publish subcommand - single: subcommand; dylan publish + single: deft publish subcommand + single: subcommand; deft publish -dylan publish -------------- +deft publish +------------ The "publish" subcommand adds a new release of a package to the package catalog. -Synopsis: ``dylan publish `` +Synopsis: ``deft publish `` .. note:: For now, until a fully automated solution is implemented, the publish command works by modifying a local copy of the catalog so that you can @@ -664,7 +658,7 @@ you're satisfied that you're ready to release a new version of your package Also update any dependencies as needed. Normally this will happen naturally during development as you discover you need newer package versions, but this is a good time to review deps and update to get bug fixes if desired. - **Remember to** `dylan update`_ **and re-run your tests if you change + **Remember to** `deft update`_ **and re-run your tests if you change deps!** Push the above changes (if any) to your main branch. @@ -681,30 +675,30 @@ you're satisfied that you're ready to release a new version of your package $ cd pacman-catalog $ git switch -t -c my-package - In the next step the `dylan publish`_ command will make changes there for + In the next step the `deft publish`_ command will make changes there for you. -#. Run :command:`dylan publish /tmp/pacman-catalog`, pointing to where you +#. Run :command:`deft publish /tmp/pacman-catalog`, pointing to where you just cloned the pacman catalog. #. Commit the changes to `pacman-catalog`_ and submit a pull request. The tests to verify the catalog will be run automatically by the GitHub CI. #. Once your PR has been merged, verify that the package is available in the - catalog by running :command:`dylan install my-package@0.5.0`, substituting + catalog by running :command:`deft install my-package@0.5.0`, substituting your new package name and release version. .. index:: - single: dylan status subcommand - single: subcommand; dylan status + single: deft status subcommand + single: subcommand; deft status -dylan status ------------- +deft status +----------- Display the status of the current workspace. -Synopsis: ``dylan status`` +Synopsis: ``deft status`` **Options:** @@ -716,36 +710,36 @@ Synopsis: ``dylan status`` :: - $ dylan status + $ deft status Workspace: /home/cgay/dylan/workspaces/dt/ Active packages: http : ## master...origin/master (dirty) - dylan-tool : ## dev...master [ahead 2] (dirty) + deft : ## dev...master [ahead 2] (dirty) pacman-catalog : ## publish...master [ahead 1] (dirty) .. index:: - single: dylan update subcommand - single: dylan subcommand; update - single: subcommand; dylan update + single: deft update subcommand + single: deft subcommand; update + single: subcommand; deft update single: LID file single: active package single: dependencies single: workspace.json file -dylan update ------------- +deft update +----------- Update the workspace based on the current set of active packages. -Synopsis: ``dylan update`` +Synopsis: ``deft update`` The "update" command may be run from anywhere inside a workspace directory and performs two actions: #. Installs all active package dependencies, as specified in their :file:`dylan-package.json` files. Any time these dependencies are changed - you should run `dylan update`_ again. + you should run `deft update`_ again. #. Updates the registry to have an entry for each library in the workspace's active packages or their dependencies. @@ -764,28 +758,28 @@ performs two actions: **Example:** -Create a workspace named ``dt``, with one active package, "dylan-tool", update +Create a workspace named ``dt``, with one active package, "deft", update it, and build the test suite:: - $ dylan new workspace dt + $ deft new workspace dt $ cd dt - $ git clone --recursive https://github.com/dylan-lang/dylan-tool - $ dylan update - $ dylan build dylan-tool-test-suite + $ git clone --recursive https://github.com/dylan-lang/deft + $ deft update + $ deft build deft-test-suite .. index:: - single: dylan version subcommand - single: subcommand; dylan version + single: deft version subcommand + single: subcommand; deft version -dylan version -------------- +deft version +------------ -Show the version of the :program:`dylan` command you are using. This is the Git -version from which `dylan-tool `_ was +Show the version of the :program:`deft` command you are using. This is the Git +version from which `deft `_ was compiled. -Synopsis: ``dylan version`` +Synopsis: ``deft version`` Index and Search diff --git a/documentation/source/pacman.rst b/documentation/source/pacman.rst index 1f73acb..b38b948 100644 --- a/documentation/source/pacman.rst +++ b/documentation/source/pacman.rst @@ -8,7 +8,7 @@ Pacman is the Dylan package manager library. It knows how to find packages in the `catalog`_, install them, and how to resolve dependencies between them. This documentation describes the package model and how versioned dependencies -are resolved. Users generally manage workspaces and packages via `the dylan +are resolved. Users generally manage workspaces and packages via `the deft command`_. @@ -78,11 +78,12 @@ The Package File - dylan-package.json Packages are described by a ``dylan-package.json`` file in the package's top-level directory. This file contains the name, description, dependencies, and other metadata for the package. Let's look at the ``dylan-package.json`` -file for ``dylan-tool`` itself:: +file for :program:`deft` itself:: { - "name": "dylan-tool", - "version": "0.6.0", + "name": "deft", + "version": "0.1.0", + "license": "MIT", "category": "language-tools", "contact": "dylan-lang@googlegroups.com", "description": "Manage Dylan workspaces, packages, and registries", @@ -91,13 +92,14 @@ file for ``dylan-tool`` itself:: "command-line-parser@3.1.1", "json@1.0", "logging@2.1", - "regular-expressions@1.0", + "regular-expressions@0.2", "uncommon-dylan@0.2" ], "dev-dependencies": [ - "testworks@2.0" + "sphinx-extensions", + "testworks" ], - "url": "https://github.com/dylan-lang/dylan-tool" + "url": "https://github.com/dylan-lang/deft" } Required Package Attributes @@ -111,7 +113,7 @@ name description A brief description of the package intended to be displayed to users who are searching for the packages they need. In some contexts (for example the - :ref:`dylan-list` command) this may be truncated to only display the first + :ref:`deft-list` command) this may be truncated to only display the first sentence, or even less, so special care should be used when writing this part of the description. @@ -159,7 +161,7 @@ license-url Dependency Resolution ===================== -When `the dylan command`_ is asked to update a workspace it asks ``pacman`` to +When `the deft command`_ is asked to update a workspace it asks ``pacman`` to resolve the dependencies specified in the ``dylan-package.json`` file and to install the resolved versions of those packages. So how does ``pacman`` do the package resolution, especially if two packages depend on different versions of @@ -248,7 +250,7 @@ Index and Search .. _minimal version selection: https://research.swtch.com/vgo-mvs .. _principles: https://research.swtch.com/vgo-principles -.. _the dylan command: https://opendylan.org/documentation/dylan-tool/ +.. _the deft command: https://opendylan.org/documentation/deft/ .. _Semantic version: https://semver.org/spec/v2.0.0.html .. _Semantic versions: https://semver.org/spec/v2.0.0.html .. _SemVer 2.0: https://semver.org/spec/v2.0.0.html diff --git a/dylan-package.json b/dylan-package.json index 031ac04..e794377 100644 --- a/dylan-package.json +++ b/dylan-package.json @@ -1,6 +1,7 @@ { - "name": "dylan-tool", - "version": "0.11.1", + "name": "deft", + "version": "0.12.0", + "license": "MIT", "category": "language-tools", "contact": "dylan-lang@googlegroups.com", "description": "Manage Dylan workspaces, packages, and registries", @@ -16,5 +17,5 @@ "sphinx-extensions", "testworks" ], - "url": "https://github.com/dylan-lang/dylan-tool" + "url": "https://github.com/dylan-lang/deft" } diff --git a/registry/generic/deft b/registry/generic/deft new file mode 100644 index 0000000..52e8cc8 --- /dev/null +++ b/registry/generic/deft @@ -0,0 +1 @@ +abstract://dylan/sources/deft.lid diff --git a/registry/generic/deft-app b/registry/generic/deft-app new file mode 100644 index 0000000..215f994 --- /dev/null +++ b/registry/generic/deft-app @@ -0,0 +1 @@ +abstract://dylan/sources/deft-app.lid diff --git a/registry/generic/dylan-tool-test-suite b/registry/generic/deft-test-suite similarity index 100% rename from registry/generic/dylan-tool-test-suite rename to registry/generic/deft-test-suite diff --git a/registry/generic/dylan-tool b/registry/generic/dylan-tool deleted file mode 100644 index 26e251c..0000000 --- a/registry/generic/dylan-tool +++ /dev/null @@ -1 +0,0 @@ -abstract://dylan/sources/dylan-tool.lid diff --git a/registry/generic/dylan-tool-app b/registry/generic/dylan-tool-app deleted file mode 100644 index 7ebe48e..0000000 --- a/registry/generic/dylan-tool-app +++ /dev/null @@ -1 +0,0 @@ -abstract://dylan/sources/dylan-tool-app.lid diff --git a/sources/app-library.dylan b/sources/app-library.dylan index b8403a1..4ed1ef9 100644 --- a/sources/app-library.dylan +++ b/sources/app-library.dylan @@ -1,19 +1,19 @@ Module: dylan-user -define library dylan-tool-app +define library deft-app use common-dylan; use command-line-parser; - use dylan-tool; + use deft; use io; use logging; use system; end library; -define module dylan-tool-app +define module deft-app use common-dylan; use command-line-parser; - use dylan-tool; + use deft; use format-out; use logging; use operating-system, prefix: "os/"; diff --git a/sources/commands/build.dylan b/sources/commands/build.dylan index 189c0b7..40d0b88 100644 --- a/sources/commands/build.dylan +++ b/sources/commands/build.dylan @@ -1,5 +1,5 @@ -Module: dylan-tool -Synopsis: dylan build subcommand +Module: deft +Synopsis: build subcommand define class () diff --git a/sources/commands/command-line.dylan b/sources/commands/command-line.dylan index 5ac729f..c246107 100644 --- a/sources/commands/command-line.dylan +++ b/sources/commands/command-line.dylan @@ -1,4 +1,4 @@ -Module: dylan-tool +Module: deft Synopsis: Definition of the command-line as a whole @@ -8,13 +8,13 @@ define class () keyword help = ""; end; -define function dylan-tool-command-line +define function deft-command-line () => (p :: ) make(, help: format-to-string("Dylan dev swiss army knife - %s\n" - "https://docs.opendylan.org/packages/dylan-tool/documentation/source/", - $dylan-tool-version), + "https://opendylan.org/package/deft/index.html", + $deft-version), options: list(make(, name: "verbose", diff --git a/sources/commands/new-library.dylan b/sources/commands/new-library.dylan index b1911c6..1df55f3 100644 --- a/sources/commands/new-library.dylan +++ b/sources/commands/new-library.dylan @@ -1,4 +1,4 @@ -Module: dylan-tool +Module: deft Synopsis: Create the initial boilerplate for new Dylan libraries and applications @@ -22,7 +22,7 @@ define constant $deps-option " version. pkg@1.2 means a specific version. The test" " suite executable automatically depends on testworks."); -// dylan new application foo http json ... +// deft new application foo http json ... define constant $new-application-subcommand = make(, options: @@ -41,7 +41,7 @@ define constant $new-application-subcommand default: #f), $deps-option)); -// dylan new library foo http json ... +// deft new library foo http json ... define constant $new-library-subcommand = make(, options: diff --git a/sources/commands/publish.dylan b/sources/commands/publish.dylan index 1949890..5861eec 100644 --- a/sources/commands/publish.dylan +++ b/sources/commands/publish.dylan @@ -1,5 +1,5 @@ -Module: dylan-tool -Synopsis: The `dylan publish` command publishes a package to the catalog. +Module: deft +Synopsis: The `publish` subcommand publishes a package to the catalog. define class () diff --git a/sources/commands/simple-commands.dylan b/sources/commands/simple-commands.dylan index e1f8112..c00b707 100644 --- a/sources/commands/simple-commands.dylan +++ b/sources/commands/simple-commands.dylan @@ -1,4 +1,4 @@ -Module: dylan-tool +Module: deft Synopsis: Various command implementations not big enough to warrant their own file @@ -222,7 +222,7 @@ end method; define class () keyword name = "version"; - keyword help = "Display the current version of dylan-tool."; + keyword help = "Display the current version of deft."; end class; define constant $version-subcommand = make(); @@ -230,6 +230,6 @@ define constant $version-subcommand = make(); define method execute-subcommand (parser :: , subcmd :: ) => (status :: false-or()) - note("%s", $dylan-tool-version); + note("%s", $deft-version); 0 end method; diff --git a/sources/commands/utils.dylan b/sources/commands/utils.dylan index d2f7211..6816e47 100644 --- a/sources/commands/utils.dylan +++ b/sources/commands/utils.dylan @@ -1,5 +1,5 @@ -Module: dylan-tool -Synopsis: Utilities for use by dylan-tool commands +Module: deft +Synopsis: Utilities for use by deft commands // The Makefile replaces this string with the actual tagged version before @@ -7,7 +7,7 @@ Synopsis: Utilities for use by dylan-tool commands // Using the comment markers enables recovery if someone commits a string // other than "HEAD" by accident. git's `ident` attribute doesn't use tag // names and `filter` looks more complex than it's worth. -define constant $dylan-tool-version :: = /*__*/ "HEAD" /*__*/; +define constant $deft-version :: = /*__*/ "HEAD" /*__*/; // Run an executable or shell command. `command` may be a string or a sequence diff --git a/sources/dylan-tool-app.lid b/sources/deft-app.lid similarity index 64% rename from sources/dylan-tool-app.lid rename to sources/deft-app.lid index 8dd64c9..9aaf27d 100644 --- a/sources/dylan-tool-app.lid +++ b/sources/deft-app.lid @@ -1,3 +1,3 @@ -Library: dylan-tool-app +Library: deft-app Files: app-library.dylan main.dylan diff --git a/sources/dylan-tool.lid b/sources/deft.lid similarity index 95% rename from sources/dylan-tool.lid rename to sources/deft.lid index a797a2d..b7fc7c2 100644 --- a/sources/dylan-tool.lid +++ b/sources/deft.lid @@ -1,4 +1,4 @@ -Library: dylan-tool +Library: deft Files: library.dylan shared.dylan pacman/utils.dylan diff --git a/sources/library.dylan b/sources/library.dylan index 8af3cf3..0915534 100644 --- a/sources/library.dylan +++ b/sources/library.dylan @@ -1,6 +1,6 @@ Module: dylan-user -define library dylan-tool +define library deft use collections, import: { table-extensions }; use command-line-parser; @@ -18,7 +18,7 @@ define library dylan-tool import: { uncommon-dylan, uncommon-utils }; export - dylan-tool, + deft, pacman, %pacman, shared, @@ -209,7 +209,7 @@ define module %workspaces ; end module; -define module dylan-tool +define module deft use command-line-parser; use file-system, prefix: "fs/"; use format; @@ -230,5 +230,5 @@ define module dylan-tool use workspaces, prefix: "ws/"; export - dylan-tool-command-line; + deft-command-line; end module; diff --git a/sources/main.dylan b/sources/main.dylan index c8542d3..a093f5e 100644 --- a/sources/main.dylan +++ b/sources/main.dylan @@ -1,9 +1,9 @@ -Module: dylan-tool-app -Synopsis: dylan-tool-app main function +Module: deft-app +Synopsis: deft-app main function define function main () => (status :: false-or()) - let parser = dylan-tool-command-line(); + let parser = deft-command-line(); block () parse-command-line(parser, application-arguments()); *debug?* := get-option-value(parser, "debug"); diff --git a/sources/pacman/catalog-test.dylan b/sources/pacman/catalog-test.dylan index 2b95bfd..54af4be 100644 --- a/sources/pacman/catalog-test.dylan +++ b/sources/pacman/catalog-test.dylan @@ -1,4 +1,4 @@ -Module: dylan-tool-test-suite +Module: deft-test-suite define constant $http-package = make-test-package("http", diff --git a/sources/pacman/deps-test.dylan b/sources/pacman/deps-test.dylan index b7ba4a5..3932af6 100644 --- a/sources/pacman/deps-test.dylan +++ b/sources/pacman/deps-test.dylan @@ -1,4 +1,4 @@ -Module: dylan-tool-test-suite +Module: deft-test-suite // Verify that dep names follow the same rules as package names. define test test-dep-name-validation () diff --git a/sources/pacman/install-test.dylan b/sources/pacman/install-test.dylan index 0d73497..b8aaa4f 100644 --- a/sources/pacman/install-test.dylan +++ b/sources/pacman/install-test.dylan @@ -1,4 +1,4 @@ -Module: dylan-tool-test-suite +Module: deft-test-suite // This test does an actual install, which requires the git command and network // access. diff --git a/sources/pacman/packages-test.dylan b/sources/pacman/packages-test.dylan index 978a814..4698ba2 100644 --- a/sources/pacman/packages-test.dylan +++ b/sources/pacman/packages-test.dylan @@ -1,4 +1,4 @@ -Module: dylan-tool-test-suite +Module: deft-test-suite define test test-find-release () let versions = #("1.0.0", "2.0.0", "2.0.1", "2.1.0", "2.2.2", "3.0.0", "5.9.9"); diff --git a/sources/pacman/types-test.dylan b/sources/pacman/types-test.dylan deleted file mode 100644 index ef21852..0000000 --- a/sources/pacman/types-test.dylan +++ /dev/null @@ -1,3 +0,0 @@ -Module: pacman-test-suite - -delete me diff --git a/sources/pacman/versions-test.dylan b/sources/pacman/versions-test.dylan index f0aa5c1..0b986d6 100644 --- a/sources/pacman/versions-test.dylan +++ b/sources/pacman/versions-test.dylan @@ -1,4 +1,4 @@ -Module: dylan-tool-test-suite +Module: deft-test-suite define test test-string-to-version () for (vstring in #["4.5.6-beta1", // may be supported in future diff --git a/sources/shared-test.dylan b/sources/shared-test.dylan index 28ea3a8..d553585 100644 --- a/sources/shared-test.dylan +++ b/sources/shared-test.dylan @@ -1,4 +1,4 @@ -Module: dylan-tool-test-suite +Module: deft-test-suite define function capture-standard-output diff --git a/sources/test-suite-library.dylan b/sources/test-suite-library.dylan index afc5507..f74bed0 100644 --- a/sources/test-suite-library.dylan +++ b/sources/test-suite-library.dylan @@ -1,15 +1,15 @@ Module: dylan-user -define library dylan-tool-test-suite +define library deft-test-suite use common-dylan; - use dylan-tool; + use deft; use io; use strings; use system; use testworks; end library; -define module dylan-tool-test-suite +define module deft-test-suite use common-dylan; use file-system; use format; diff --git a/sources/test-suite.dylan b/sources/test-suite.dylan index e26cc54..57c2a18 100644 --- a/sources/test-suite.dylan +++ b/sources/test-suite.dylan @@ -1,3 +1,3 @@ -Module: dylan-tool-test-suite +Module: deft-test-suite run-test-application(); diff --git a/sources/test-suite.lid b/sources/test-suite.lid index 59aa08c..8e24da6 100644 --- a/sources/test-suite.lid +++ b/sources/test-suite.lid @@ -1,4 +1,4 @@ -library: dylan-tool-test-suite +library: deft-test-suite files: test-suite-library.dylan test-utils.dylan shared-test.dylan diff --git a/sources/test-utils.dylan b/sources/test-utils.dylan index 3b3f47b..112a45f 100644 --- a/sources/test-utils.dylan +++ b/sources/test-utils.dylan @@ -1,4 +1,4 @@ -Module: dylan-tool-test-suite +Module: deft-test-suite // Make a package with a release for each version in `versions`, each release // having the given deps. If catalog is provided, the package and releases are diff --git a/sources/workspaces/registry-test.dylan b/sources/workspaces/registry-test.dylan index a03e209..4539ef1 100644 --- a/sources/workspaces/registry-test.dylan +++ b/sources/workspaces/registry-test.dylan @@ -1,4 +1,4 @@ -Module: dylan-tool-test-suite +Module: deft-test-suite // The low-level LID parsing is done by the file-source-records library so this // test is mainly concerned with whether parsing the LID: header works. diff --git a/sources/workspaces/workspaces-test.dylan b/sources/workspaces/workspaces-test.dylan index 2903ef8..4ff5839 100644 --- a/sources/workspaces/workspaces-test.dylan +++ b/sources/workspaces/workspaces-test.dylan @@ -1,4 +1,4 @@ -module: dylan-tool-test-suite +module: deft-test-suite define test test-new () let test-dir = test-temp-directory(); @@ -22,7 +22,7 @@ define test test-find-workspace-directory () // Initially there is no workspace directory. let ws-dir = find-workspace-directory(bottom); - // On github this test runs inside the dylan-tool checkout, so there's + // On github this test runs inside the deft checkout, so there's // a dylan-package.json file outside the test-temp-directory(), hence // the prefix check. Succeed as long as the ws-dir is outside tmp. assert-true(~ws-dir