@webmate-studio/builder 0.2.25 → 0.2.26

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/build-service.js +7 -3
  2. package/package.json +1 -1
package/build-service.js CHANGED
@@ -101,9 +101,13 @@ function injectSvelteOptions(filename, content, componentMetadata) {
101
101
  }
102
102
 
103
103
  // Generate <svelte:options> block
104
- // IMPORTANT: props must be inline (single line) for Svelte compiler to parse it
105
- const propsJson = JSON.stringify(props); // No formatting - keep it inline
106
- const svelteOptions = `<svelte:options customElement={{ tag: "${tagName}", shadow: "none", props: ${propsJson} }} />\n\n`;
104
+ // IMPORTANT: props must be a JavaScript object literal, not JSON string
105
+ // Convert to JS syntax: { title: { type: "Number" } } instead of {"title":{"type":"Number"}}
106
+ const propsEntries = Object.entries(props).map(([name, config]) => {
107
+ return `${name}: { type: "${config.type}" }`;
108
+ }).join(', ');
109
+ const propsLiteral = `{ ${propsEntries} }`;
110
+ const svelteOptions = `<svelte:options customElement={{ tag: "${tagName}", shadow: "none", props: ${propsLiteral} }} />\n\n`;
107
111
 
108
112
  // Check if <svelte:options> already exists
109
113
  if (content.includes('<svelte:options')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webmate-studio/builder",
3
- "version": "0.2.25",
3
+ "version": "0.2.26",
4
4
  "type": "module",
5
5
  "description": "Webmate Studio Component Builder",
6
6
  "keywords": [