@webmate-studio/builder 0.2.24 → 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 -8
  2. package/package.json +1 -1
package/build-service.js CHANGED
@@ -101,14 +101,13 @@ function injectSvelteOptions(filename, content, componentMetadata) {
101
101
  }
102
102
 
103
103
  // Generate <svelte:options> block
104
- const propsJson = JSON.stringify(props, null, 3).replace(/^/gm, '\t\t\t'); // Indent props
105
- const svelteOptions = `<svelte:options
106
- customElement={{
107
- tag: "${tagName}",
108
- shadow: "none",
109
- props: ${propsJson}
110
- }}
111
- />\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`;
112
111
 
113
112
  // Check if <svelte:options> already exists
114
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.24",
3
+ "version": "0.2.26",
4
4
  "type": "module",
5
5
  "description": "Webmate Studio Component Builder",
6
6
  "keywords": [