pupt-lib 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +6 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -369,15 +369,12 @@ async function renderChildrenFallback(children, state) {
369
369
  }
370
370
  async function renderComponentWithValidation(type, componentName, props, children, state, renderFn, resolveFn) {
371
371
  const schema = getSchema(type);
372
- if (!schema) {
373
- throw new Error(
374
- `Component "${componentName}" does not have a schema defined. All components must declare a static schema.`
375
- );
376
- }
377
- const validationErrors = validateProps(componentName, { ...props, children }, schema);
378
- if (validationErrors.length > 0) {
379
- state.context.errors.push(...validationErrors);
380
- return renderChildrenFallback(children, state);
372
+ if (schema) {
373
+ const validationErrors = validateProps(componentName, { ...props, children }, schema);
374
+ if (validationErrors.length > 0) {
375
+ state.context.errors.push(...validationErrors);
376
+ return renderChildrenFallback(children, state);
377
+ }
381
378
  }
382
379
  try {
383
380
  let resolvedValue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pupt-lib",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "TypeScript library for creating AI prompts using JSX syntax",
5
5
  "license": "MIT",
6
6
  "author": "",