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
6 changes: 6 additions & 0 deletions .changeset/short-hoops-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@t-req/core": minor
"@t-req/app": minor
---

Add JSON/JSONC-first Config v2 with deterministic layering (profiles + overrides), safe {env:}/{file:} substitutions, and command-resolver support. Improve cookie persistence safety with serialized writes and add coverage for critical config paths.
77 changes: 77 additions & 0 deletions .github/workflows/release-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Release App

on:
workflow_dispatch:
inputs:
version:
description: "Version to publish (e.g., 0.1.0)"
required: true
type: string
dry-run:
description: "Dry run (don't actually publish)"
required: false
type: boolean
default: false

jobs:
release:
name: Build and Publish App
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write

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

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: bun install
working-directory: packages/app

- name: Update version
run: |
cd packages/app
bun -e "
const pkg = await Bun.file('package.json').json();
pkg.version = '${{ inputs.version }}';
pkg.optionalDependencies = {
'@t-req/app-darwin-arm64': '${{ inputs.version }}',
'@t-req/app-darwin-x64': '${{ inputs.version }}',
'@t-req/app-linux-arm64': '${{ inputs.version }}',
'@t-req/app-linux-x64': '${{ inputs.version }}',
'@t-req/app-windows-x64': '${{ inputs.version }}',
};
await Bun.write('package.json', JSON.stringify(pkg, null, 2));
"

- name: Build and Publish
run: |
cd packages/app
if [ "${{ inputs.dry-run }}" = "true" ]; then
bun run script/publish.ts --dry-run
else
bun run script/publish.ts
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create GitHub Release
if: ${{ !inputs.dry-run }}
run: |
gh release create app-v${{ inputs.version }} \
--title "App v${{ inputs.version }}" \
--generate-notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ HTTP request parsing, execution, and testing. Define requests in `.http` files,
| Package | Description |
|---------|-------------|
| [@t-req/core](./packages/core) | Core HTTP request parsing and execution library |
| [@t-req/app](./packages/app) | CLI for scaffolding, executing, and serving t-req projects |
| [@t-req/ui](./packages/ui) | Shared UI components and Tailwind CSS configuration |

## Documentation
Expand Down Expand Up @@ -62,6 +63,7 @@ t-req/
├── examples/ # Usage examples
├── packages/
│ ├── core/ # @t-req/core - HTTP parsing & execution
│ ├── app/ # @t-req/app - CLI tool
│ └── ui/ # @t-req/ui - UI components & theming
├── .changeset/ # Changesets for versioning
└── ...
Expand Down
2 changes: 1 addition & 1 deletion apps/webdocs/src/content/docs/concepts/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ X-Request-ID: {{$uuid()}}
X-Timestamp: {{$timestamp()}}

{
"random_value": {{$random(1, 100)}}
"random_value": {{$random([1, 100])}}
}
```

Expand Down
6 changes: 3 additions & 3 deletions apps/webdocs/src/content/docs/guides/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ const client = createClient({

```http
GET https://api.example.com/admin
Authorization: Basic {{$basicAuth({{username}}, {{password}})}}
Authorization: Basic {{$basicAuth(["{{username}}", "{{password}}"])}}
```

> **Note:** Variables inside resolver calls are interpolated first. The expression
> `{{$basicAuth({{username}}, {{password}})}}` first becomes `{{$basicAuth(admin, secret)}}`,
> **Note:** Variables inside resolver calls are interpolated first. With JSON-args, the expression
> `{{$basicAuth(["{{username}}", "{{password}}"])}}` becomes `{{$basicAuth(["admin", "secret"])}}`,
> then the resolver is called with literal strings `"admin"` and `"secret"`.

Or pre-encode in the variable:
Expand Down
5 changes: 3 additions & 2 deletions apps/webdocs/src/content/docs/reference/interpolation.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ interpolate('User: {{user.name}}', {
```
{{$resolverName()}}
{{$resolverName(arg1)}}
{{$resolverName(arg1, arg2)}}
{{$resolverName(["arg1","arg2"])}}
```

```typescript
Expand All @@ -129,7 +129,8 @@ const interp = createInterpolator({
},
});

await interp.interpolate('Value: {{$random(1, 10)}}', {});
// Prefer JSON-array args for unambiguous parsing:
await interp.interpolate('Value: {{$random([1, 10])}}', {});
// "Value: 7" (random between 1-10)
```

Expand Down
Loading