Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
1ffc286
chore: add linters, commit hooks and the private-host check
Decipher Nov 15, 2026
8fc8872
feat(cli): validate a starter registry entry
Decipher Nov 15, 2026
e4a76a6
feat(cli): read starters from a registry with a bundled fallback
Decipher Nov 15, 2026
61ae891
feat(cli): resolve sources and registries named in the user configura…
Decipher Nov 15, 2026
86026f9
feat(cli): add kind adapters for nuxt and drupal
Decipher Nov 15, 2026
34ddb65
feat(cli): record a project's layout and parts in drx.config.json
Decipher Nov 15, 2026
8b634f6
feat(cli): add the drx command runner and drx info
Decipher Nov 15, 2026
4b8927f
feat(cli): add drx init
Decipher Nov 15, 2026
3bbab99
feat(cli): add the drx binary and the package entry point
Decipher Nov 15, 2026
7fdf42c
feat(create-druxt): run drx init with the arguments given
Decipher Nov 15, 2026
ce9d5c3
test(cli): cover the starter prompt and a failed download, and set th…
Decipher Nov 15, 2026
b986f7d
ci: add the gitlab pipeline and the github actions workflow
Decipher Nov 15, 2026
4bee666
chore: add prose linting, the renovate policy and the issue and merge…
Decipher Nov 15, 2026
182df16
chore: add changesets with the first release of each package
Decipher Nov 15, 2026
1f64836
docs: add the readme, the changelog and the contributor and agent guides
Decipher Nov 15, 2026
9bf2bf6
docs: give each package its own readme and licence
Decipher Nov 15, 2026
d565357
ci: run the installed binaries directly in the pack check
Decipher Nov 15, 2026
f0bb1f9
chore: add a devcontainer that builds the packages and links drx
Decipher Nov 15, 2026
ce9362b
fix(cli): report a Composer package as installed only once it is in v…
Decipher Nov 15, 2026
767fcb8
chore: add php, composer and node 16 to the devcontainer, to run a cr…
Decipher Nov 15, 2026
908c4ec
feat(cli): find a starter's commands on the path
Decipher Nov 15, 2026
64d6201
feat(cli): warn from init when a starter's commands are missing
Decipher Nov 15, 2026
fc138f6
feat(starters): name the commands the quickstart needs
Decipher Nov 15, 2026
d10ba54
docs: describe the commands a starter needs and the check init makes
Decipher Nov 15, 2026
702b93f
feat(cli): let an adapter report a part's Druxt version and one package
Decipher Nov 15, 2026
72605a6
feat(cli): read the Druxt module registry, with a copy on disk
Decipher Nov 15, 2026
d15dfe0
feat(cli): compare a module's Druxt range with a part's Druxt version
Decipher Nov 15, 2026
7d3c77a
feat(cli): add drx module list, search and info
Decipher Nov 16, 2026
26fa796
test(cli): read the published module registry in the end-to-end run
Decipher Nov 16, 2026
143c0ee
docs: describe the module commands, the module registry and its cache
Decipher Nov 16, 2026
8e87734
feat(cli): let a starter entry describe its engines
Decipher Nov 16, 2026
aa107b1
feat(cli): add engine adapters that say how to run a backend tool
Decipher Nov 16, 2026
1f0e607
feat(cli): remove engine files and write the backend URL
Decipher Nov 16, 2026
24d6113
fix(cli): read drx.config.json from disk on every load
Decipher Nov 16, 2026
17bbda9
feat(cli): choose the engine of the backend at init
Decipher Nov 16, 2026
e7aabf6
feat(starters): describe the three engines of the quickstart
Decipher Nov 16, 2026
08dd689
docs: describe engines, the files init removes and the recorded choice
Decipher Nov 16, 2026
0cefb62
fix(starters): keep the quickstart's local tooling whatever engine is…
Decipher Nov 16, 2026
1340bcb
feat(cli): add the presentation module, with the Druxt wordmark
Decipher Nov 16, 2026
5bab354
feat(cli): mark output in a terminal, and quote a command to repeat
Decipher Nov 16, 2026
b9940a2
feat(cli): make init a guided run in a terminal
Decipher Nov 16, 2026
bba2ba4
feat(cli): open a menu on bare drx, and pick a module from a list
Decipher Nov 16, 2026
529d59b
test(cli): run every command under each unattended condition
Decipher Nov 16, 2026
ed955b2
feat(starters): describe the quickstart in one sentence
Decipher Nov 16, 2026
f061534
ci: run an unattended init in the pack check
Decipher Nov 16, 2026
aa7842d
docs: describe the terminal mode, the wordmark, colour and unattended…
Decipher Nov 16, 2026
46bd88c
fix(cli): mark what init removed and wrote as done
Decipher Nov 16, 2026
34499f1
feat(cli): read how a backend module is added from the registry
Decipher Nov 16, 2026
6fcaa79
feat(cli): let the nuxt adapter plan adding and removing a module
Decipher Nov 16, 2026
7e532ab
feat(cli): let the drupal adapter plan a module's backend steps
Decipher Nov 16, 2026
0814a67
feat(cli): add what a command that changes a project needs
Decipher Nov 16, 2026
85cb244
feat(cli): add drx add and drx remove
Decipher Nov 16, 2026
bab87ad
docs: describe drx add and drx remove
Decipher Nov 16, 2026
89601ed
chore(cli): describe the package by what it does now
Decipher Nov 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@4.0.1/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
12 changes: 12 additions & 0 deletions .changeset/first-release-cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@druxt/cli': minor
---

First release of the Druxt command-line tool, with the binary `drx`.

- `drx init` creates a site from a starter in a registry, records its layout and parts in `drx.config.json` and prints what the site needs next. `--engine` chooses how the backend runs, from the engines the starter lists or `none` for a backend that exists already. `init` keeps that engine's files only and warns when its commands are not on `PATH`.
- `drx module list`, `drx module search` and `drx module info` read the Druxt module registry, and in a project show what is installed and whether each module's range admits the Druxt there.
- `drx add` installs a module and lists it in the Nuxt config. It also requires and enables the Drupal modules the module needs, through the backend's engine. `drx remove` takes it out again. Both take `--dry-run`.
- `drx info` prints the versions of the CLI, Node and the packages of each part of a project.
- At a terminal, bare `drx` opens a menu and `drx init` is a guided run that asks before it writes. `--no-interactive`, `DRX_NO_INTERACTIVE=1`, `CI` or no terminal turn every prompt off.
- The registry holds one starter, `quickstart`, and the `monorepo` layout is the one available.
5 changes: 5 additions & 0 deletions .changeset/first-release-create-druxt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-druxt': minor
---

First release. `npm create druxt my-site` runs `drx init my-site` from `@druxt/cli`.
42 changes: 42 additions & 0 deletions .cspell-project-words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Add a term here rather than switching the check off for a file.
# Words this project uses that the standard dictionaries do not carry.
actionlint
automerge
citty
clack
commitlint
consola
corepack
cspell
dbaeumer
DDEV
druxt
druxtjs
esbenp
giget
gitleaks
interruptible
knip
Ksection
Lando
lndo
markdownlint
mise
Nuxt
nvmrc
opencode
unjs
unstub
vitest
yamllint
drush
PATHEXT
alacritty
COLORTERM
truecolor
wordmark
magicast
cweagans
docroot
relock
repatch
25 changes: 25 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"files": ["**/*.{js,mjs,ts,json,jsonc,md,yml,yaml}"],
"language": "en,en-GB",
"dictionaryDefinitions": [
{
"name": "project-words",
"path": "./.cspell-project-words.txt"
}
],
"dictionaries": ["project-words", "bash", "misc", "node", "softwareTerms"],
"ignorePaths": [
".git/",
"node_modules/",
"**/node_modules/",
"**/dist/",
"coverage/",
"reports/",
"**/CHANGELOG.md",
"package-lock.json",
".vale/",
"packages/cli/starters/",
"packages/cli/test/fixtures/"
],
"useGitignore": true
}
30 changes: 30 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "Druxt CLI",
"image": "mcr.microsoft.com/devcontainers/base:trixie",
"features": {
// The version in .nvmrc, which the pipelines build on. Node 16 is for running a site made from the 0.x
// starter: `nvm use 16.18.1` in the site's directory.
"ghcr.io/devcontainers/features/node:1": {
"version": "24.18.0",
"additionalVersions": "16.18.1"
},
// For the Drupal part of a site `drx init` creates. The feature builds PHP from source, against trixie's
// SQLite, which meets Drupal 11's minimum.
"ghcr.io/devcontainers/features/php:1": {
"version": "8.4",
"installComposer": true
},
"ghcr.io/devcontainers/features/github-cli:1": {}
},
// Installs the dependencies and builds both packages, so `drx` runs as soon as the container is up.
"postCreateCommand": "npm ci && npm run build && npm link --workspace @druxt/cli --workspace create-druxt",
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"vitest.explorer"
]
}
}
}
7 changes: 7 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env sh
# Conventional Commits, checked before the commit exists.
#
# This repository squash-merges, so the merge request or pull request title
# becomes the commit subject too. A prose title breaks the next push to the
# target branch for everyone, not only its author.
exec npx --no -- commitlint --edit "$1"
9 changes: 9 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env sh
# The fast half of CI: every linter, the type check, then the unit tests.
#
# The end-to-end test is not here. It downloads a real starter over the
# network, and a hook that needs the network gets bypassed with --no-verify.
set -e
npm run --silent lint
npm run --silent typecheck
npm test --silent
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bug report
about: Something does not work as documented
title: ''
labels: bug
assignees: ''
---

## What happened

## What you expected

## How to reproduce

The command you ran, with its options:

```bash

```

## Versions

Paste the output of `npx @druxt/cli info`, run inside the project if there is one.

```text

```

## Anything else

The full output of the command, or a link to a reproduction.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest something the CLI should do
title: ''
labels: enhancement
assignees: ''
---

## The problem

What are you trying to do that the CLI makes hard or impossible?

## What you would like

## Alternatives you have considered

## Anything else
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!--
Title this pull request the way you would title a commit:

<type>(<scope>): <description>

This repository squash-merges, so the title becomes the commit subject. A prose
title passes review and then breaks the next push to the target branch.
-->

## What changed

## Why

## How it was checked

- [ ] `npm run lint` and `npm run typecheck` pass
- [ ] `npm test` passes, and coverage did not drop
- [ ] A changeset is included, if a published package changed
- [ ] Nothing that resolves only on a private network reached a tracked file
153 changes: 153 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
---
name: CI

# The same lint and test set as .gitlab-ci.yml. Nothing on this side lints this
# file: the GitLab pipeline runs actionlint over it.
#
# There is no publish job. A release is cut by hand from the changesets until
# a workflow with its own token is added on purpose.

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
# Actions are pinned to commit SHAs, not tags. A tag is a mutable
# reference to code that runs with this repository's credentials.
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
persist-credentials: false
# The attribution and prose checks read the pull request's own
# commits, so its base has to be present.
fetch-depth: 0

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version-file: .nvmrc
cache: npm

# corepack reads the packageManager field, so the manager the lockfile was
# written by is the one that installs it, and this file never names one.
- run: corepack enable && corepack prepare --activate

- run: npm ci

- run: npm run lint:js

- run: npm run lint:format

- run: npm run typecheck

- run: npm run lint:md

- run: npm run lint:cspell

- run: npm run lint:knip

# This repository is public. A host only the author can reach must never
# reach a tracked file.
- run: npm run lint:private

- name: Lint commit messages
if: github.event_name == 'pull_request'
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: npm run lint:commit -- --from "$BASE_SHA" --to HEAD --verbose

# The work is the author's. No commit, pull request description or
# tracked file may credit an AI tool as author, co-author or generator.
- name: Check for AI attribution
env:
ATTRIBUTION_BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
MERGE_REQUEST_DESCRIPTION: ${{ github.event.pull_request.body }}
run: bash .gitlab/scripts/check-attribution.sh

# Project voice over the markdown a change touches, its commit messages
# and the pull request description.
- name: Lint prose
env:
PROSE_BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
MERGE_REQUEST_DESCRIPTION: ${{ github.event.pull_request.body }}
PROSE_LINT_GLOB: "!.changeset/README.md"
run: |
bash .gitlab/scripts/install-vale.sh .vale/bin .vale/styles
bash .gitlab/scripts/lint-prose.sh

- run: npm run lint:audit

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
persist-credentials: false

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version-file: .nvmrc
cache: npm

- run: corepack enable && corepack prepare --activate

- run: npm ci

# The coverage floor in vitest.config.ts is what fails here.
- run: npm test -- --reporter=default --reporter=junit --outputFile.junit=reports/junit/junit.xml

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: always()
with:
name: test-results
path: reports/junit/

# A published install reads each package's files allowlist and links its
# binaries, which the unit tests do not.
pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
persist-credentials: false

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version-file: .nvmrc
cache: npm

- run: corepack enable && corepack prepare --activate

- run: npm ci

- run: npm run build

- name: Pack, install and run the packages
run: |
mkdir -p "$RUNNER_TEMP/pack-check"
npm pack --workspaces --pack-destination "$RUNNER_TEMP/pack-check"
version="$(node -p "require('./packages/cli/package.json').version")"
cd "$RUNNER_TEMP/pack-check"
npm init -y > /dev/null
npm install ./druxt-cli-*.tgz ./create-druxt-*.tgz --no-audit --no-fund
test "$(./node_modules/.bin/drx --version)" = "$version"
test -f node_modules/@druxt/cli/starters/index.json
./node_modules/.bin/drx info
./node_modules/.bin/create-druxt --help
# The unattended path, as a pipeline runs it: no prompt, defaults applied.
./node_modules/.bin/drx init pack-site --yes --no-interactive --json
test -f pack-site/drx.config.json

# The one step that needs the network: a site from the real quickstart
# tarball the registry entry points at.
- run: npm run test:e2e
Loading