diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 39ad296..e28762f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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: @@ -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 @@ -65,7 +44,7 @@ jobs: path: ./build/npm publish-npm: - needs: [verify-jsr, verify-npm] + needs: verify-npm runs-on: ubuntu-latest steps: @@ -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}} diff --git a/AGENTS.md b/AGENTS.md index fbec01a..97a440c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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; @@ -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 diff --git a/README.md b/README.md index 55b795b..7036e18 100644 --- a/README.md +++ b/README.md @@ -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 / @@ -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: @@ -47,7 +44,7 @@ import { schema, toggle, version, -} from "@frontside/configliere"; +} from "@bomb.sh/router"; import * as z from "zod"; export const app = command( @@ -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) }); @@ -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, { @@ -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: @@ -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 @@ -246,7 +238,7 @@ import { schema, type ValueSource, version, -} from "@frontside/configliere"; +} from "@bomb.sh/router"; import * as z from "zod"; const app = command( diff --git a/deno.json b/deno.json index f35814a..71c4462 100644 --- a/deno.json +++ b/deno.json @@ -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", @@ -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" } } diff --git a/diagnostics/node-ts5/package.json b/diagnostics/node-ts5/package.json index acdef7d..d430505 100644 --- a/diagnostics/node-ts5/package.json +++ b/diagnostics/node-ts5/package.json @@ -1,5 +1,5 @@ { - "name": "configliere-node-ts5-diagnostics", + "name": "@bomb.sh/router-node-ts5-diagnostics", "private": true, "type": "module", "scripts": { diff --git a/docs/insights.md b/docs/insights.md index 54291e0..2bd9b2b 100644 --- a/docs/insights.md +++ b/docs/insights.md @@ -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. diff --git a/images/configliere.jpeg b/images/configliere.jpeg deleted file mode 100644 index 954f2f6..0000000 Binary files a/images/configliere.jpeg and /dev/null differ diff --git a/lib/param.ts b/lib/param.ts index 59d75b4..c37a364 100644 --- a/lib/param.ts +++ b/lib/param.ts @@ -68,7 +68,7 @@ interface SchemaTransform extends Transform { const unknown: Schema = { "~standard": { version: 1, - vendor: "configliere", + vendor: "@bomb.sh/router", validate: (value) => ({ value }), }, }; diff --git a/lib/toggle.ts b/lib/toggle.ts index 10b07a1..ee77d2e 100644 --- a/lib/toggle.ts +++ b/lib/toggle.ts @@ -107,7 +107,7 @@ function reader(name: string): ReadCLI { const bool: Schema = { "~standard": { version: 1, - vendor: "configliere", + vendor: "@bomb.sh/router", validate(value) { return typeof value === "undefined" ? { value: false } diff --git a/tasks/build-jsr.ts b/tasks/build-jsr.ts deleted file mode 100644 index 35fea44..0000000 --- a/tasks/build-jsr.ts +++ /dev/null @@ -1,14 +0,0 @@ -import jsonDeno from "../deno.json" with { type: "json" }; - -let [version] = Deno.args; -if (!version) { - throw new Error("a version argument is required to build the JSR package"); -} - -await Deno.writeTextFile( - new URL("../deno.json", import.meta.url), - JSON.stringify({ - ...jsonDeno, - version, - }), -); diff --git a/tasks/build-npm.ts b/tasks/build-npm.ts index 3e3d0fb..0de8460 100644 --- a/tasks/build-npm.ts +++ b/tasks/build-npm.ts @@ -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", diff --git a/test/argument.test.ts b/test/argument.test.ts index 2459723..196e089 100644 --- a/test/argument.test.ts +++ b/test/argument.test.ts @@ -12,7 +12,7 @@ import { routes, schema, toggle, -} from "@frontside/configliere"; +} from "@bomb.sh/router"; import { dynamic } from "../lib/dynamic.ts"; describe("argument()", () => {