From b69ef46dcd9745d53e6928765b031888f0c9454e Mon Sep 17 00:00:00 2001 From: Colum Ferry Date: Tue, 5 Nov 2024 17:47:49 +0000 Subject: [PATCH] fix(rspack): remove unnecessary required properties in schema validation (#28796) ## Current Behavior The `@nx/rspack:rspack` executor had listed other properties as required in the schema that could have been set by the rspack config. ## Expected Behavior Make those properties optional and add validation after config is resolved ## Related Issue(s) Fixes # --- docs/generated/packages/rspack/executors/rspack.json | 2 +- packages/rspack/src/executors/rspack/schema.d.ts | 4 ++-- packages/rspack/src/executors/rspack/schema.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/generated/packages/rspack/executors/rspack.json b/docs/generated/packages/rspack/executors/rspack.json index af209168355cb..b5ef6176cbd7f 100644 --- a/docs/generated/packages/rspack/executors/rspack.json +++ b/docs/generated/packages/rspack/executors/rspack.json @@ -155,7 +155,7 @@ "description": "Generates a `package.json` and pruned lock file with the project's `node_module` dependencies populated for installing in a container. If a `package.json` exists in the project's directory, it will be reused with dependencies populated." } }, - "required": ["outputPath", "tsConfig", "rspackConfig"], + "required": ["rspackConfig"], "definitions": { "assetPattern": { "oneOf": [ diff --git a/packages/rspack/src/executors/rspack/schema.d.ts b/packages/rspack/src/executors/rspack/schema.d.ts index 2d3ce45f375be..0aa8ef19f7367 100644 --- a/packages/rspack/src/executors/rspack/schema.d.ts +++ b/packages/rspack/src/executors/rspack/schema.d.ts @@ -4,9 +4,9 @@ export interface RspackExecutorSchema { target?: 'web' | 'node'; main?: string; index?: string; - tsConfig: string; + tsConfig?: string; typeCheck?: boolean; - outputPath: string; + outputPath?: string; outputFileName?: string; indexHtml?: string; mode?: Mode; diff --git a/packages/rspack/src/executors/rspack/schema.json b/packages/rspack/src/executors/rspack/schema.json index 0df44d650ddfa..d711a8f12427e 100644 --- a/packages/rspack/src/executors/rspack/schema.json +++ b/packages/rspack/src/executors/rspack/schema.json @@ -133,7 +133,7 @@ "description": "Generates a `package.json` and pruned lock file with the project's `node_module` dependencies populated for installing in a container. If a `package.json` exists in the project's directory, it will be reused with dependencies populated." } }, - "required": ["outputPath", "tsConfig", "rspackConfig"], + "required": ["rspackConfig"], "definitions": { "assetPattern": { "oneOf": [