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
48 changes: 2 additions & 46 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,6 @@ permissions:
id-token: write

jobs:
verify-jsr:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4

- name: setup deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x

- name: Get Version
id: vars
run: echo ::set-output name=version::$(echo ${{github.ref_name}} | sed 's/^v//')

- name: Build JSR
run: deno task build:jsr ${{steps.vars.outputs.version}}

- name: dry run publish
run: npx jsr publish --dry-run --allow-dirty --token=${{secrets.JSR_TOKEN}}

verify-npm:
runs-on: ubuntu-latest
steps:
Expand All @@ -55,7 +34,7 @@ jobs:
run: deno task build:npm ${{steps.vars.outputs.version}}

- name: dry run publish
run: npm publish --dry-run --tag=verify
run: npm publish --dry-run --access=public --tag=verify
working-directory: ./build/npm

- name: upload build
Expand All @@ -65,7 +44,7 @@ jobs:
path: ./build/npm

publish-npm:
needs: [verify-jsr, verify-npm]
needs: verify-npm
runs-on: ubuntu-latest

steps:
Expand All @@ -83,26 +62,3 @@ jobs:
- name: Publish NPM
run: npm publish --access=public --tag=latest
working-directory: ./build/npm

publish-jsr:
needs: [verify-jsr, verify-npm]
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v4

- name: setup deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x

- name: Get Version
id: vars
run: echo ::set-output name=version::$(echo ${{github.ref_name}} | sed 's/^v//')

- name: Build JSR
run: deno task build:jsr ${{steps.vars.outputs.version}}

- name: Publish JSR
run: npx jsr publish --allow-dirty --token=${{secrets.JSR_TOKEN}}
13 changes: 3 additions & 10 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
# Configliere
# @bomb.sh/router

Configuration for programs.

## Current state

Configliere is undergoing a ground-up rebuild. No implementation architecture is
established yet. Design from the bottom up with small API sketches, exact type
expectations, and tests before implementation. Do not carry architectural
assumptions forward from pre-rebuild history.

## Design references

- Read [`docs/insights.md`](docs/insights.md) before changing the architecture;
Expand Down Expand Up @@ -44,10 +37,10 @@ Strongly prefer one-word variable and function names (e.g. `dir` not `tmpDir`,
### Runtime and tooling

- **Runtime**: Deno
- **Registry**: JSR (`@frontside/configliere`)
- **Registry**: npm (`@bomb.sh/router`)
- **Linting**: `deno lint` (excludes `prefer-const`)
- **Testing**: `deno task test`
- **Build**: `deno task build:npm` (dnt) and `deno task build:jsr`
- **Build**: `deno task build:npm` (dnt)

### Dependencies

Expand Down
60 changes: 26 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Configliere
# @bomb.sh/router

**A statically typed entry-point router for command-line applications.**

An argument parser tells you what the user typed. Configliere tells you where
and how they intend to enter your program. For execution, it marshals a
An argument parser tells you what the user typed. `@bomb.sh/router` tells you
where and how they intend to enter your program. For execution, it binds a
validated, statically typed model for that entry point.

Configliere matches input to an intent: a method at an application-relative
route, such as:
`@bomb.sh/router` matches input to an intent: a method at an
application-relative route, such as:

```text
HELP /
Expand All @@ -20,19 +20,16 @@ EXECUTE /database/clean
Every reachable intent appears in the result type. Narrow `method` and `route`,
and TypeScript knows the exact model available at that entry point.

Configliere is not a CLI framework. It does not own handlers, effects, output,
or process lifetime. It is not a CLI parser whose product is a bag of flags. Its
product is a typed intent; your application decides what that intent does.

```text
input → bind and expand phases → resolve route + method → intent
```
`@bomb.sh/router` is not a CLI framework. It does not own handlers, effects,
output, or process lifetime. It is not a CLI parser whose product is a bag of
flags. Its product is a typed intent; your application decides what that intent
does.

## Define every way into the program

`route()` declares an address. `command()` declares an executable route. Every
route supports help; version and execution exist only where they are explicitly
added.
`route()` declares an address, and every `command()` is just an address that
declares an intent to execute. Every route supports help, whereas version and
execution exist only where they are explicitly added.

Definitions are immutable composition pipelines, not handler registrations:

Expand All @@ -47,7 +44,7 @@ import {
schema,
toggle,
version,
} from "@frontside/configliere";
} from "@bomb.sh/router";
import * as z from "zod";

export const app = command(
Expand Down Expand Up @@ -92,12 +89,7 @@ can stay flat even when the route tree is deep:

```ts
import process from "node:process";
import {
parse,
printErrors,
printHelp,
printVersion,
} from "@frontside/configliere";
import { parse, printErrors, printHelp, printVersion } from "@bomb.sh/router";
import { app } from "./app.ts";

const result = parse(app, { argv: process.argv.slice(2) });
Expand Down Expand Up @@ -152,14 +144,14 @@ An execute intent has two views of configuration:
| `simulacrum serve --port nope` | `unprocessable-content`; invalid data never reaches the application |

Command literals are routing tokens, not positional arguments. As route segments
become discoverable, Configliere scopes parameter binding to the segment that
owns each token. This makes identical option names on parent and child routes
unambiguous.
become discoverable, `@bomb.sh/router` scopes parameter binding to the segment
that owns each token. This makes identical option names on parent and child
routes unambiguous.

## Marshal configuration into the route
## Bind route parameters from multiple sources

CLI arguments are only one source. Configliere can marshal JavaScript values and
flat environment records into the same route-local models:
CLI arguments are only one source. `@bomb.sh/router` can bind JavaScript values
and flat environment records onto the same route-local models:

```ts
const result = parse(app, {
Expand Down Expand Up @@ -190,8 +182,8 @@ CLI → environment → JavaScript values → schema default
## Pause without surrendering the type system

Sometimes the route cannot be fully configured, or even fully discovered, until
the application performs I/O. Configliere can pause at a typed checkpoint and
resume with the result.
the application performs I/O. `@bomb.sh/router` can pause at a typed checkpoint
and resume with the result.

Dynamic phases serve two common cases:

Expand All @@ -206,9 +198,9 @@ exact type of what parsing can produce next.
### Help and version cross checkpoints

`--help` and `--version` request methods; they do not settle an intent or bypass
parsing. Configliere cannot produce either intent until it knows the deepest
selected route. A dynamic phase may introduce that route, its options, or its
version.
parsing. `@bomb.sh/router` cannot produce either intent until it knows the
deepest selected route. A dynamic phase may introduce that route, its options,
or its version.

The driver must therefore resume every increment until parsing returns an
intent—even when the arguments contain `--help` or `--version`. This applies
Expand Down Expand Up @@ -246,7 +238,7 @@ import {
schema,
type ValueSource,
version,
} from "@frontside/configliere";
} from "@bomb.sh/router";
import * as z from "zod";

const app = command(
Expand Down
6 changes: 2 additions & 4 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "@frontside/configliere",
"name": "@bomb.sh/router",
"exports": "./mod.ts",
"license": "MIT",
"publish": { "include": ["lib", "mod.ts", "README.md", "LICENSE.md"] },
"imports": {
"@std/expect": "jsr:@std/expect@^1.0.19",
"@std/testing/bdd": "jsr:@std/testing@^1.0.19/bdd",
Expand All @@ -16,7 +15,6 @@
},
"tasks": {
"test": "deno test",
"build:npm": "deno run -A tasks/build-npm.ts",
"build:jsr": "deno run -A tasks/build-jsr.ts"
"build:npm": "deno run -A tasks/build-npm.ts"
}
}
2 changes: 1 addition & 1 deletion diagnostics/node-ts5/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "configliere-node-ts5-diagnostics",
"name": "@bomb.sh/router-node-ts5-diagnostics",
"private": true,
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion docs/insights.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Configliere invariants
# @bomb.sh/router invariants

These principles are drawn from the current rebuild and earlier design
transcripts. Current decisions take precedence over superseded architectures.
Expand Down
Binary file removed images/configliere.jpeg
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/param.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ interface SchemaTransform<S extends Schema> extends Transform {
const unknown: Schema<unknown> = {
"~standard": {
version: 1,
vendor: "configliere",
vendor: "@bomb.sh/router",
validate: (value) => ({ value }),
},
};
2 changes: 1 addition & 1 deletion lib/toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function reader(name: string): ReadCLI {
const bool: Schema<boolean> = {
"~standard": {
version: 1,
vendor: "configliere",
vendor: "@bomb.sh/router",
validate(value) {
return typeof value === "undefined"
? { value: false }
Expand Down
14 changes: 0 additions & 14 deletions tasks/build-jsr.ts

This file was deleted.

8 changes: 4 additions & 4 deletions tasks/build-npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ await build({
},
package: {
// package.json properties
name: "configliere",
name: "@bomb.sh/router",
version,
description: "Configuration for programs",
license: "MIT",
author: "engineering@frontside.com",
author: "Bombshell Authors (https://github.com/bombshell-dev)",
repository: {
type: "git",
url: "git+https://github.com/thefrontside/configliere.git",
url: "git+https://github.com/bombshell-dev/router.git",
},
bugs: {
url: "https://github.com/thefrontside/configliere/issues",
url: "https://github.com/bombshell-dev/router/issues",
},
engines: {
node: ">= 16",
Expand Down
2 changes: 1 addition & 1 deletion test/argument.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
routes,
schema,
toggle,
} from "@frontside/configliere";
} from "@bomb.sh/router";
import { dynamic } from "../lib/dynamic.ts";

describe("argument()", () => {
Expand Down
Loading