Skip to content

Commit e34b25f

Browse files
committed
feat(middleware): add zod middleware
1 parent a5db3c7 commit e34b25f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ on:
99
required: true
1010
default: 'false'
1111
options:
12-
- true
13-
- false
12+
- 'true'
13+
- 'false'
1414
workflow_call:
1515
inputs:
1616
docs_only:
@@ -54,8 +54,6 @@ jobs:
5454
run: |
5555
node ./node_modules/.bin/nx release ${{ github.run_attempt == '1' && '--yes' || '--yes --verbose' }}
5656
env:
57-
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
58-
NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
5957
NPM_CONFIG_PROVENANCE: true
6058
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6159
if: github.ref == 'refs/heads/main' && github.event.inputs.docs_only == 'false'

packages/cli-forge/src/middleware/zod.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import { ParsedArgs } from '@cli-forge/parser';
22
import { MiddlewareFunction } from '../lib/public-api';
33
import type { z, ZodObject, ZodPipe } from 'zod';
44

5+
/*
6+
* Middleware that uses a Zod schema to validate and transform command arguments.
7+
* @param schema The Zod schema to use for validation and transformation.
8+
* @returns A middleware function that applies the Zod schema to the command arguments.
9+
*/
510
export function zodMiddleware<
611
TArgs extends ParsedArgs,
712
TSchema extends ZodObject | ZodPipe<ZodObject>

0 commit comments

Comments
 (0)