Skip to content
Closed
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
13 changes: 13 additions & 0 deletions lib/configSchema.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
build: {
type: 'object',
properties: {
esbuild: {
type: 'object',
properties: {
packages: { type: 'string', enum: ['external'] },
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

What are the valid values for esbuild's "packages" configuration option?

💡 Result:

The valid values for esbuild's "packages" configuration option are 'bundle' and 'external'.

Citations:


Expand packages enum to include valid esbuild configuration values.

The packages property is restricted to ['external'], but esbuild's packages option supports both 'bundle' and 'external'. This prevents users from explicitly configuring bundling behavior. Update the enum to include all valid values:

Fix
-                    packages: { type: 'string', enum: ['external'] },
+                    packages: { type: 'string', enum: ['bundle', 'external'] },
🧰 Tools
🪛 Biome (2.4.10)

[error] 7-7: Expected an expression but instead found 'enum'.

(parse)


[error] 7-7: Expected a statement but instead found ','.

(parse)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/configSchema.js` at line 7, Update the config schema so the packages enum
allows both esbuild values instead of only 'external': locate the configSchema
object where the packages property is defined (the "packages" key in
lib/configSchema.js) and change its enum to include 'bundle' as well (e.g.,
enum: ['external','bundle']) so users can explicitly choose bundling behavior.

},
additionalProperties: false,
},
},
additionalProperties: false,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: additionalProperties: false breaks plugin extensibility.

Setting additionalProperties: false on the build object will prevent plugins from adding their own build configurations via the defineBuildProperty method (shown in context snippet 1 from lib/classes/config-schema-handler/index.js:168-179). This breaks the plugin system's ability to extend build configuration.

For example, the esbuild plugin itself uses defineBuildProperty('esbuild', { ... }) to register its schema. If additionalProperties: false is enforced before plugin registration, this will fail validation.

Remove additionalProperties: false from line 12, or restructure the schema to use anyOf with plugin-extensible object variants.

🔓 Proposed fix: Remove the restrictive constraint
-              additionalProperties: false,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
additionalProperties: false,
🧰 Tools
🪛 Biome (2.4.10)

[error] 11-12: Expected a statement but instead found ',
additionalProperties: false,'.

(parse)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/configSchema.js` at line 12, The schema currently sets
additionalProperties: false on the build object which blocks plugins from
extending build config via defineBuildProperty; remove the additionalProperties:
false constraint from the build object in lib/configSchema.js (or replace it
with an anyOf/oneOf variant that permits plugin-registered keys) so that
defineBuildProperty (see config-schema-handler's defineBuildProperty usage) can
add plugin-specific properties like "esbuild" without failing validation.

},
Loading