Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions .changeset/first-release-cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@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.
- `drx info` prints the versions of the CLI, Node and the packages of each part of a project.
- 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`.
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"
]
}
}
}
1 change: 1 addition & 0 deletions .github/banner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 39 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ 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.
# There is no publish job here. release.yml cuts the releases.

on:
push:
Expand Down Expand Up @@ -107,10 +106,48 @@ jobs:

- 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 one step that needs the network: a site from the real quickstart
# tarball the registry entry points at.
- run: npm run test:e2e
Loading
Loading