Skip to content

feat: add examples directory with five self-contained example projects - #1

Open
tasteee with Copilot wants to merge 3 commits into
mainfrom
copilot/add-examples-directory
Open

feat: add examples directory with five self-contained example projects#1
tasteee with Copilot wants to merge 3 commits into
mainfrom
copilot/add-examples-directory

Conversation

Copilot AI commented May 15, 2026

Copy link
Copy Markdown

Summary

Adds an examples/ directory containing five standalone dooz project examples. Each one demonstrates a distinct set of features from the README so users can see exactly how each capability is used in practice.


Examples

simple-scripts

The floor-level setup: a single dooz.yaml, no extension file. Covers literal patterns and variadic passthrough ([...rest]). Good for teams that only need short command aliases.

monorepo-workspace

A pnpm monorepo setup with workspace-scoped commands and a packageExists validator. Demonstrates:

  • Specificity rankingbuild all beats build <name> for the literal token all
  • Named captures inserted into pnpm --filter
  • Validator extension (dooz.js) that rejects unknown package names before any command runs

docker-deploy

Docker build / run / push / compose commands under dooz. Demonstrates:

  • Built-in lower filter to normalise service name casing
  • Specificity rankingbuild <service> <tag> beats build <service> when two tokens follow build
  • tagIsNotLatest validator that blocks accidental docker push api:latest

git-workflow

Uses a .dooz/ subdirectory layout instead of a root-level dooz.yaml, keeping the project root clean. Demonstrates:

  • .dooz/ config discovery
  • Custom kebab filter ("Add User Auth"feature/add-user-auth)
  • isSemanticVersion validator that enforces MAJOR.MINOR.PATCH on release branches and tags
  • Specificity rankingpush tags beats push [...rest]

full-featured

A comprehensive example that exercises every dooz capability in one place:

  • ResolverspackageKind derives kind from name; environmentInfo derives region and cluster from environment
  • Multiple validators per commanddeploy gates on both environmentExists and serviceExists
  • Custom filterskebab and truncate alongside built-in lower, upper, join, json
  • All pattern types — literals, named captures, and variadic remainder
  • Dry / explain modes documented in each README section

Changes

  • examples/README.md — index table linking all five examples
  • examples/simple-scripts/dooz.yaml + README.md
  • examples/monorepo-workspace/dooz.yaml + dooz.js + README.md
  • examples/docker-deploy/dooz.yaml + dooz.js + README.md
  • examples/git-workflow/.dooz/dooz.yaml + .dooz/dooz.js + README.md
  • examples/full-featured/dooz.yaml + dooz.js + README.md

Copilot AI requested a review from tasteee May 15, 2026 06:42
@tasteee
tasteee requested review from Copilot and removed request for tasteee May 15, 2026 06:45
@tasteee
tasteee marked this pull request as ready for review May 15, 2026 06:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new examples/ area with multiple standalone projects intended to demonstrate dooz features end-to-end (config discovery, pattern matching, filters, resolvers, validators, dry/explain).

Changes:

  • Introduces examples/README.md as an index + common “how to run” instructions.
  • Adds five example projects (simple-scripts, monorepo-workspace, docker-deploy, git-workflow, full-featured) with their own README.md and dooz configs/extensions.
  • Demonstrates extension authoring via dooz.js (custom filters/validators/resolvers) alongside config-only examples.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
examples/README.md Adds a top-level index and shared instructions for running examples.
examples/simple-scripts/README.md Documents the minimal “single dooz.yaml” example and its commands.
examples/simple-scripts/dooz.yaml Adds basic command aliases plus variadic passthrough patterns.
examples/monorepo-workspace/README.md Documents pnpm workspace usage, specificity ranking, and a validator.
examples/monorepo-workspace/dooz.yaml Adds pnpm workspace command patterns using captures + variadics + validator hooks.
examples/monorepo-workspace/dooz.js Implements a packageExists validator.
examples/docker-deploy/README.md Documents Docker workflow commands, filters, and validator behavior.
examples/docker-deploy/dooz.yaml Adds Docker build/run/push/compose patterns and validator usage.
examples/docker-deploy/dooz.js Implements a tagIsNotLatest validator.
examples/git-workflow/README.md Documents .dooz/ discovery, a kebab filter, semver validation, and ranking.
examples/git-workflow/.dooz/dooz.yaml Adds git workflow patterns (branching, commit, push/pull, tags, stash, log).
examples/git-workflow/.dooz/dooz.js Implements kebab filter and isSemanticVersion validator.
examples/full-featured/README.md Documents a comprehensive example covering all major dooz capabilities.
examples/full-featured/dooz.yaml Adds patterns using resolvers/validators/filters, plus “filter demo” commands.
examples/full-featured/dooz.js Implements resolvers (packageKind, environmentInfo), validators, and filters (kebab, truncate).

Comment thread examples/simple-scripts/README.md Outdated

The simplest possible dooz setup: a single `dooz.yaml` with no extension file.

Every command is a short alias for a longer `npm` or tool invocation. No resolvers, no validators, no captures — just clean pattern-to-command mappings.
Comment thread examples/docker-deploy/README.md Outdated
## Features shown

- **Built-in `lower` filter** — `{{service | lower}}` normalises casing without any extension code.
- **Specificity ranking** — `build <service> <tag>` wins over `build <service>` when two tokens follow `build`.
Comment on lines +10 to +26
- description: Run a service container interactively
input: run <service> [...rest]
output: docker run --rm {{rest}} {{service | lower}}

- description: Push a versioned image to the registry
input: push <service> <tag>
output: docker push {{service | lower}}:{{tag}}
validates: [tagIsNotLatest]

- description: View logs for a running container
input: logs <service> [...rest]
output: docker logs {{service}} {{rest}}

- description: Stop a named running container
input: stop <service>
output: docker stop {{service}}

Comment thread examples/full-featured/dooz.yaml Outdated

- description: Print deployment metadata for an environment
input: info <environment>
output: echo "Region{{':'}} {{region}}, Cluster{{':'}} {{cluster}}"
Comment thread examples/full-featured/dooz.yaml Outdated

- description: Print extra args joined with a separator
input: flags <name> [...rest]
output: echo "{{name}} -> {{rest | join(' | ')}}"
Comment thread examples/full-featured/dooz.yaml Outdated
- description: Deploy a service to an environment
input: deploy <environment> <service>
output: ./scripts/deploy.sh {{environment}} {{service | lower}}
uses: [environmentInfo]
Comment thread examples/full-featured/README.md Outdated
- **`environmentInfo` resolver** — reads `environment`, returns `region` and `cluster` for use in the template.
- **Three validators** — `packageExists`, `environmentExists`, `serviceExists` each have a clear `description` used as the failure message.
- **`kebab` custom filter** — converts space-separated words to a lowercase hyphenated slug.
- **`truncate` custom filter** — shortens a value to a max character count and appends `…`; takes a numeric argument: `{{name | truncate(10)}}`.
@tasteee

tasteee commented May 15, 2026

Copy link
Copy Markdown
Owner

@copilot please see comments and apply fixes

Copilot AI commented May 15, 2026

Copy link
Copy Markdown
Author

@copilot please see comments and apply fixes

Done in af85d01. Here's a summary of every fix applied:

  • simple-scripts/README.md — changed "no captures" to "no named captures" (the config does use [...rest] variadic passthrough).
  • docker-deploy/dooz.yaml — changed build <service> to build <service> [...rest] so both build patterns genuinely compete on dooz build api 1.4.2, with build <service> <tag> winning via specificity. Also added --name {{service | lower}} to the run command so logs and stop reference the correct container name.
  • docker-deploy/README.md — updated the commands table and the "Features shown" section to reflect the above.
  • full-featured/dooz.yaml — removed shell quotes from the flags template (quotes become literal " argv tokens); replaced {{':'}} with a literal colon and removed surrounding quotes in the info template; removed uses: [environmentInfo] from deploy since region/cluster aren't referenced in its output.
  • full-featured/README.md — removed shell quotes from the flags expected output; updated info expected output to match the new template; changed to ... in the truncate filter description.

Copilot AI requested a review from tasteee May 15, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants