Skip to content

Commit

Permalink
feat: allow overriding which command to run in the workspace via a ta…
Browse files Browse the repository at this point in the history
…sk option
  • Loading branch information
apaleslimghost committed Jul 25, 2024
1 parent 06bf443 commit a6542ab
Show file tree
Hide file tree
Showing 6 changed files with 529 additions and 28 deletions.
4 changes: 3 additions & 1 deletion lib/schemas/src/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { SmokeTestSchema } from './tasks/n-test'
import { CypressSchema } from './tasks/cypress'
import { HerokuProductionSchema } from './tasks/heroku-production'
import { ServerlessRunSchema } from './tasks/serverless-run'
import { WorkspaceCommandSchema } from './tasks/workspace-command'
import { z } from 'zod'

export const TaskSchemas = {
Expand All @@ -40,7 +41,8 @@ export const TaskSchemas = {
ServerlessTeardown: z.object({}).describe('Tear down existing serverless functions'),
TypeScript: TypeScriptSchema,
UploadAssetsToS3: UploadAssetsToS3Schema,
Webpack: WebpackSchema
Webpack: WebpackSchema,
WorkspaceCommand: WorkspaceCommandSchema
}

export type TaskOptions = InferSchemaOptions<typeof TaskSchemas>
9 changes: 9 additions & 0 deletions lib/schemas/src/tasks/workspace-command.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { z } from 'zod'

export const WorkspaceCommandSchema = z.object({
command: z.string().optional()
})

export type WorkspaceCommandOptions = z.infer<typeof WorkspaceCommandSchema>

export const Schema = WorkspaceCommandSchema
Loading

0 comments on commit a6542ab

Please sign in to comment.