draply-dev 1.3.7 → 1.3.8
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.
- package/bin/cli.js +6 -6
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -282,7 +282,7 @@ const server = http.createServer((req, res) => {
|
|
|
282
282
|
changesBlock += `\nElement .${item.className}:\n${propsStr}\n`;
|
|
283
283
|
});
|
|
284
284
|
|
|
285
|
-
const prompt = `You are a strict code editor
|
|
285
|
+
const prompt = `You are a strict code editor applying style changes to a file.
|
|
286
286
|
|
|
287
287
|
FILE: ${found.relativePath} (lines ${contextStart + 1}-${contextEnd + 1})
|
|
288
288
|
\`\`\`
|
|
@@ -295,17 +295,17 @@ IMPORTANT: Return ONLY a JSON array of search-and-replace pairs. Each pair forma
|
|
|
295
295
|
{"search": "exact code to find", "replace": "modified code to replace it with"}
|
|
296
296
|
|
|
297
297
|
Rules:
|
|
298
|
-
- "search" must be an EXACT substring from the file above (copy it precisely).
|
|
298
|
+
- "search" must be an EXACT substring from the file snippet above (copy it precisely).
|
|
299
299
|
- Ensure all double quotes inside JSON string values are properly escaped (\\").
|
|
300
300
|
- Do NOT include markdown fences, preambles, or explanations. Only the JSON array.
|
|
301
|
-
-
|
|
302
|
-
-
|
|
301
|
+
- If adding properties to an existing CSS rule or JS object (like a style object), you MUST REPLACE the old values for those properties if they already exist. DO NOT CREATE DUPLICATE KEYS.
|
|
302
|
+
- If the file is JSX, update the style object/prop. Do not duplicate properties inside object literals.
|
|
303
303
|
|
|
304
304
|
Example response:
|
|
305
305
|
[
|
|
306
306
|
{
|
|
307
|
-
"search": "
|
|
308
|
-
"replace": "
|
|
307
|
+
"search": "style={{ color: 'blue', opacity: 0.5 }}",
|
|
308
|
+
"replace": "style={{ color: '#ff0000', opacity: 0.5 }}"
|
|
309
309
|
}
|
|
310
310
|
]`;
|
|
311
311
|
|