@wix/ditto-codegen-public 1.0.172 → 1.0.174
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/dist/out.js +48 -56
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -37703,6 +37703,8 @@ Output:
|
|
|
37703
37703
|
- Consider grouping related parameters (e.g., activation settings, appearance settings)
|
|
37704
37704
|
- Default values should be sensible and demonstrate the expected format
|
|
37705
37705
|
- IMPORTANT: These parameters are persisted by the embeddedScripts parameters. Do NOT create CMS collections for this data.
|
|
37706
|
+
- STRICTLY use only the supported parameter types listed above. Do NOT use types from other contexts like CMS (e.g., do NOT use ARRAY_STRING, ARRAY, etc.).
|
|
37707
|
+
- If you need a list of values (like a list of emojis or strings), use TEXT type and describe the expected format (e.g., "Comma-separated list of emojis") in the description.
|
|
37706
37708
|
</guidelines>
|
|
37707
37709
|
|
|
37708
37710
|
</DYNAMIC_PARAMETERS_PLANNER_SYSTEM_PROMPT>
|
|
@@ -39504,6 +39506,23 @@ Expected plan (abbreviated):
|
|
|
39504
39506
|
}
|
|
39505
39507
|
});
|
|
39506
39508
|
|
|
39509
|
+
// dist/system-prompts/system-prompt-builders/utils/typescript-quality-guidelines.js
|
|
39510
|
+
var require_typescript_quality_guidelines = __commonJS({
|
|
39511
|
+
"dist/system-prompts/system-prompt-builders/utils/typescript-quality-guidelines.js"(exports2) {
|
|
39512
|
+
"use strict";
|
|
39513
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
39514
|
+
exports2.typescriptQualityGuidelines = void 0;
|
|
39515
|
+
exports2.typescriptQualityGuidelines = `<typescript_quality_guidelines>
|
|
39516
|
+
- Generated code MUST compile with zero TypeScript errors under strict settings:
|
|
39517
|
+
strict, noImplicitAny, strictNullChecks, exactOptionalPropertyTypes, noUncheckedIndexedAccess
|
|
39518
|
+
- Prefer type-narrowing and exhaustive logic over assertions; avoid non-null assertions (!) and unsafe casts (as any)
|
|
39519
|
+
- Treat optional values, refs, and array indexing results as possibly undefined and handle them explicitly
|
|
39520
|
+
- Use exhaustive checks for unions (e.g., switch with a never check) and return total values (no implicit undefined)
|
|
39521
|
+
- Do NOT use // @ts-ignore or // @ts-expect-error; fix the types or add guards instead
|
|
39522
|
+
</typescript_quality_guidelines>`;
|
|
39523
|
+
}
|
|
39524
|
+
});
|
|
39525
|
+
|
|
39507
39526
|
// dist/system-prompts/dashboardPage/dashboardPackage.js
|
|
39508
39527
|
var require_dashboardPackage = __commonJS({
|
|
39509
39528
|
"dist/system-prompts/dashboardPage/dashboardPackage.js"(exports2) {
|
|
@@ -64348,7 +64367,7 @@ ${componentDescription}
|
|
|
64348
64367
|
</description>${featuresBlock}
|
|
64349
64368
|
</component>`;
|
|
64350
64369
|
}
|
|
64351
|
-
|
|
64370
|
+
function buildWdsSystemPrompt(allowedComponents) {
|
|
64352
64371
|
const parsedData = wdsJson;
|
|
64353
64372
|
const relevantComponents = (parsedData.items || []).filter((component) => allowedComponents.has(component.storyName));
|
|
64354
64373
|
if (!relevantComponents.length) {
|
|
@@ -64369,6 +64388,7 @@ var require_dashboard_page_instructions = __commonJS({
|
|
|
64369
64388
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
64370
64389
|
exports2.dashboardPageInstructions = void 0;
|
|
64371
64390
|
var apiSpec_1 = require_apiSpec();
|
|
64391
|
+
var typescript_quality_guidelines_1 = require_typescript_quality_guidelines();
|
|
64372
64392
|
var dashboardPackage_1 = require_dashboardPackage();
|
|
64373
64393
|
var data_1 = require_data();
|
|
64374
64394
|
var dynamicParameters_1 = require_dynamicParameters();
|
|
@@ -64468,34 +64488,18 @@ export default function () {
|
|
|
64468
64488
|
- Do NOT use components from @wix/wix-ui-icons-common unless you know the correct import path and it's explicitly needed for icons
|
|
64469
64489
|
- Always verify component availability before using it in your generated code
|
|
64470
64490
|
- If you need a component not in the list, use a basic HTML element or create a simple custom component instead`;
|
|
64471
|
-
var dashboardPageWdsReference = async () => {
|
|
64472
|
-
const wdsPrompt = await (0, wdsPackage_1.buildWdsSystemPrompt)(supportedWDSComponents);
|
|
64473
|
-
return wdsPrompt;
|
|
64474
|
-
};
|
|
64475
|
-
var dashboardApiReferences = `${dashboardPackage_1.dashboardPackage}
|
|
64476
|
-
${ecomPackage_1.ecomPackage}`;
|
|
64477
|
-
var dashboardPageTypescriptQualityGuidelines = `<typescript_quality_guidelines>
|
|
64478
|
-
- Generated code MUST compile with zero TypeScript errors under strict settings:
|
|
64479
|
-
strict, noImplicitAny, strictNullChecks, exactOptionalPropertyTypes, noUncheckedIndexedAccess
|
|
64480
|
-
- Prefer type-narrowing and exhaustive logic over assertions; avoid non-null assertions (!) and unsafe casts (as any)
|
|
64481
|
-
- Treat optional values, refs, and array indexing results as possibly undefined and handle them explicitly
|
|
64482
|
-
- Use exhaustive checks for unions (e.g., switch with a never check) and return total values (no implicit undefined)
|
|
64483
|
-
- Do NOT use // @ts-ignore or // @ts-expect-error; fix the types or add guards instead
|
|
64484
|
-
</typescript_quality_guidelines>`;
|
|
64485
|
-
var dashboardPageDataPrompt = data_1.dataPrompt;
|
|
64486
|
-
var dashboardPageApiSpecPrompt = (0, apiSpec_1.apiSpecPrompt)();
|
|
64487
|
-
var dashboardPageDynamicParametersManagementPrompt = (0, dynamicParameters_1.dynamicParametersManagementPrompt)();
|
|
64488
64491
|
exports2.dashboardPageInstructions = {
|
|
64489
64492
|
role: dashboardPageRole,
|
|
64490
64493
|
filesAndCode: dashboardPageFilesAndCode,
|
|
64491
64494
|
wdsProviderUsage: dashboardPageWdsProviderUsage,
|
|
64492
64495
|
hardConstraints: dashboardPageHardConstraints,
|
|
64493
|
-
wdsReference: () =>
|
|
64494
|
-
apiReferences:
|
|
64495
|
-
|
|
64496
|
-
|
|
64497
|
-
|
|
64498
|
-
|
|
64496
|
+
wdsReference: () => (0, wdsPackage_1.buildWdsSystemPrompt)(supportedWDSComponents),
|
|
64497
|
+
apiReferences: `${dashboardPackage_1.dashboardPackage}
|
|
64498
|
+
${ecomPackage_1.ecomPackage}`,
|
|
64499
|
+
typescriptQualityGuidelines: typescript_quality_guidelines_1.typescriptQualityGuidelines,
|
|
64500
|
+
dataPrompt: data_1.dataPrompt,
|
|
64501
|
+
apiSpecPrompt: (0, apiSpec_1.apiSpecPrompt)(),
|
|
64502
|
+
dynamicParametersManagementPrompt: (0, dynamicParameters_1.dynamicParametersManagementPrompt)()
|
|
64499
64503
|
};
|
|
64500
64504
|
}
|
|
64501
64505
|
});
|
|
@@ -65342,13 +65346,12 @@ var require_dashboard_page_prompt = __commonJS({
|
|
|
65342
65346
|
var dashboard_page_instructions_1 = require_dashboard_page_instructions();
|
|
65343
65347
|
var CodeGenerationSystemPromptBuilder_1 = require_CodeGenerationSystemPromptBuilder();
|
|
65344
65348
|
var dashboardPagePrompt = async ({ useData, useApiSpec, useDynamicParameters, apiNames, useIteration }) => {
|
|
65345
|
-
const wdsReference = await dashboard_page_instructions_1.dashboardPageInstructions.wdsReference();
|
|
65346
65349
|
const systemPrompt = (0, CodeGenerationSystemPromptBuilder_1.codeGenerationSystemPromptBuilder)({
|
|
65347
65350
|
agentType: types_impl_1.ExtensionType.DASHBOARD_PAGE,
|
|
65348
65351
|
apiNames,
|
|
65349
65352
|
useData,
|
|
65350
65353
|
useIteration
|
|
65351
|
-
}).withRole(dashboard_page_instructions_1.dashboardPageInstructions.role).withSection("dashboard_page_extension_files_and_code", dashboard_page_instructions_1.dashboardPageInstructions.filesAndCode).withSection("wds_provider_usage", dashboard_page_instructions_1.dashboardPageInstructions.wdsProviderUsage).withSection("hard_constraints", dashboard_page_instructions_1.dashboardPageInstructions.hardConstraints).withSection("api_references", dashboard_page_instructions_1.dashboardPageInstructions.apiReferences).withSection("wds_reference", wdsReference).withContextExplanation().withApiDocs().withCorePrinciples().withImplementationGuidelines(dashboard_page_instructions_1.dashboardPageInstructions.typescriptQualityGuidelines).withExamples();
|
|
65354
|
+
}).withRole(dashboard_page_instructions_1.dashboardPageInstructions.role).withSection("dashboard_page_extension_files_and_code", dashboard_page_instructions_1.dashboardPageInstructions.filesAndCode).withSection("wds_provider_usage", dashboard_page_instructions_1.dashboardPageInstructions.wdsProviderUsage).withSection("hard_constraints", dashboard_page_instructions_1.dashboardPageInstructions.hardConstraints).withSection("api_references", dashboard_page_instructions_1.dashboardPageInstructions.apiReferences).withSection("wds_reference", dashboard_page_instructions_1.dashboardPageInstructions.wdsReference()).withContextExplanation().withApiDocs().withCorePrinciples().withImplementationGuidelines(dashboard_page_instructions_1.dashboardPageInstructions.typescriptQualityGuidelines).withExamples();
|
|
65352
65355
|
if (useData) {
|
|
65353
65356
|
systemPrompt.withSection("data_prompt", dashboard_page_instructions_1.dashboardPageInstructions.dataPrompt);
|
|
65354
65357
|
}
|
|
@@ -65700,6 +65703,7 @@ var require_site_component_instructions = __commonJS({
|
|
|
65700
65703
|
"use strict";
|
|
65701
65704
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
65702
65705
|
exports2.siteComponentInstructions = void 0;
|
|
65706
|
+
var typescript_quality_guidelines_1 = require_typescript_quality_guidelines();
|
|
65703
65707
|
var siteComponentRole = "You are a senior Wix CLI App Developer and React expert. Your job is to produce a beautiful, production\u2011quality site component quickly and correctly.";
|
|
65704
65708
|
var siteComponentImplementationGuidelines = `<rules>
|
|
65705
65709
|
- Return ONLY a JSON object matching the schema { path, content, type } (no prose, no markdown)
|
|
@@ -65722,14 +65726,7 @@ var require_site_component_instructions = __commonJS({
|
|
|
65722
65726
|
- Name things clearly; avoid magic numbers; extract tiny helpers if it improves clarity
|
|
65723
65727
|
</engineering_guidelines>
|
|
65724
65728
|
|
|
65725
|
-
|
|
65726
|
-
- Generated code MUST compile with zero TypeScript errors under strict settings:
|
|
65727
|
-
strict, noImplicitAny, strictNullChecks, exactOptionalPropertyTypes, noUncheckedIndexedAccess
|
|
65728
|
-
- Prefer type-narrowing and exhaustive logic over assertions; avoid non-null assertions (!) and unsafe casts (as any)
|
|
65729
|
-
- Treat optional values, refs, and array indexing results as possibly undefined and handle them explicitly
|
|
65730
|
-
- Use exhaustive checks for unions (e.g., switch with a never check) and return total values (no implicit undefined)
|
|
65731
|
-
- Do NOT use // @ts-ignore or // @ts-expect-error; fix the types or add guards instead
|
|
65732
|
-
</typescript_quality_guidelines>
|
|
65729
|
+
${typescript_quality_guidelines_1.typescriptQualityGuidelines}
|
|
65733
65730
|
`;
|
|
65734
65731
|
exports2.siteComponentInstructions = {
|
|
65735
65732
|
role: siteComponentRole,
|
|
@@ -65813,6 +65810,7 @@ var require_custom_element_instructions = __commonJS({
|
|
|
65813
65810
|
"use strict";
|
|
65814
65811
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
65815
65812
|
exports2.customElementInstructions = void 0;
|
|
65813
|
+
var typescript_quality_guidelines_1 = require_typescript_quality_guidelines();
|
|
65816
65814
|
var customElementRole = `You are a senior Wix CLI App Developer. Your job is to produce a beautiful, production\u2011quality site component quickly and correctly.`;
|
|
65817
65815
|
var customElementImplementationGuidelines = `<rules>
|
|
65818
65816
|
- Return ONLY a JSON object matching the schema { path, content, type } (no prose, no markdown)
|
|
@@ -65827,14 +65825,7 @@ var require_custom_element_instructions = __commonJS({
|
|
|
65827
65825
|
- Name things clearly; avoid magic numbers; extract tiny helpers if it improves clarity
|
|
65828
65826
|
</engineering_guidelines>
|
|
65829
65827
|
|
|
65830
|
-
|
|
65831
|
-
- Generated code MUST compile with zero TypeScript errors under strict settings:
|
|
65832
|
-
strict, noImplicitAny, strictNullChecks, exactOptionalPropertyTypes, noUncheckedIndexedAccess
|
|
65833
|
-
- Prefer type-narrowing and exhaustive logic over assertions; avoid non-null assertions (!) and unsafe casts (as any)
|
|
65834
|
-
- Treat optional values, refs, and array indexing results as possibly undefined and handle them explicitly
|
|
65835
|
-
- Use exhaustive checks for unions (e.g., switch with a never check) and return total values (no implicit undefined)
|
|
65836
|
-
- Do NOT use // @ts-ignore or // @ts-expect-error; fix the types or add guards instead
|
|
65837
|
-
</typescript_quality_guidelines>
|
|
65828
|
+
${typescript_quality_guidelines_1.typescriptQualityGuidelines}
|
|
65838
65829
|
|
|
65839
65830
|
<frontend_aesthetics>
|
|
65840
65831
|
You tend to converge toward generic, "on distribution" outputs. In frontend design, this creates what users call the "AI slop" aesthetic. Avoid this: make creative, distinctive frontends that surprise and delight.
|
|
@@ -66304,13 +66295,13 @@ var require_backend_api_instructions = __commonJS({
|
|
|
66304
66295
|
var backendApiRole = `You are a specialized code-generation agent for creating Astro Server Endpoints (API Routes) for fullstack applications.`;
|
|
66305
66296
|
var backendApiImplementationGuidelines = `Generate clean, well-structured Astro Server Endpoints based on the API Spec that follow these patterns and best practices.
|
|
66306
66297
|
Focus on creating maintainable, secure, and efficient API routes that integrate well with frontend applications.`;
|
|
66307
|
-
var backendApiCoreKnowledge =
|
|
66298
|
+
var backendApiCoreKnowledge = `<astro_server_endpoints_overview>
|
|
66308
66299
|
- Astro Server Endpoints are API routes that run on the server side
|
|
66309
66300
|
- They are located in the \`src/pages/api/\` directory
|
|
66310
66301
|
- Each file exports named functions for HTTP methods (GET, POST, PUT, DELETE, etc.)
|
|
66311
66302
|
- Files use the \`.ts\` extension and are automatically converted to API endpoints
|
|
66312
|
-
|
|
66313
|
-
|
|
66303
|
+
</astro_server_endpoints_overview>
|
|
66304
|
+
<file_structure_and_naming>
|
|
66314
66305
|
- API routes are created in \`src/pages/api/\` directory
|
|
66315
66306
|
- File names become the endpoint path (e.g., \`users.ts\` \u2192 \`/api/users\`)
|
|
66316
66307
|
- For dynamic routes with parameters, use square brackets in the filename (e.g., \`/api/users/[id]\`)
|
|
@@ -66339,39 +66330,40 @@ export async function GET({ params }) {
|
|
|
66339
66330
|
});
|
|
66340
66331
|
}
|
|
66341
66332
|
\`\`\`
|
|
66342
|
-
|
|
66343
|
-
|
|
66333
|
+
</file_structure_and_naming>
|
|
66334
|
+
<typescript_patterns>
|
|
66344
66335
|
- Import \`APIRoute\` type from 'astro'
|
|
66345
66336
|
- Export named functions for HTTP methods: \`GET\`, \`POST\`, \`PUT\`, \`DELETE\`, \`PATCH\`
|
|
66346
66337
|
- Use async/await for handling asynchronous operations
|
|
66347
66338
|
- Always return a \`Response\` object
|
|
66348
|
-
|
|
66349
|
-
|
|
66339
|
+
</typescript_patterns>
|
|
66340
|
+
<request_handling>
|
|
66350
66341
|
- Access request data through the \`request\` parameter
|
|
66351
66342
|
- Use \`request.json()\` for POST/PUT request bodies
|
|
66352
66343
|
- Use \`request.url\` for the full URL
|
|
66353
66344
|
- Use \`new URL(request.url).searchParams\` for query parameters
|
|
66354
66345
|
- Access headers via \`request.headers\`
|
|
66355
|
-
|
|
66356
|
-
|
|
66346
|
+
</request_handling>
|
|
66347
|
+
<response_patterns>
|
|
66357
66348
|
- Always return a \`Response\` object
|
|
66358
66349
|
- Use \`JSON.stringify()\` for JSON responses
|
|
66359
66350
|
- Set appropriate status codes (200, 201, 400, 404, 500, etc.)
|
|
66360
66351
|
- Include proper headers, especially \`Content-Type: application/json\`
|
|
66361
|
-
|
|
66362
|
-
|
|
66352
|
+
</response_patterns>
|
|
66353
|
+
<common_patterns>
|
|
66363
66354
|
- GET endpoints for data retrieval
|
|
66364
66355
|
- POST endpoints for data creation
|
|
66365
66356
|
- PUT/PATCH endpoints for data updates
|
|
66366
66357
|
- DELETE endpoints for data removal
|
|
66367
66358
|
- Use proper HTTP status codes
|
|
66368
|
-
|
|
66369
|
-
|
|
66359
|
+
</common_patterns>
|
|
66360
|
+
<best_practices>
|
|
66370
66361
|
- Use proper TypeScript types
|
|
66371
66362
|
- Return appropriate HTTP status codes
|
|
66372
66363
|
- Include proper headers
|
|
66373
66364
|
- Use async/await for asynchronous operations
|
|
66374
|
-
- Keep endpoints focused and single-purpose
|
|
66365
|
+
- Keep endpoints focused and single-purpose
|
|
66366
|
+
</best_practices>`;
|
|
66375
66367
|
exports2.backendApiInstructions = {
|
|
66376
66368
|
role: backendApiRole,
|
|
66377
66369
|
implementationGuidelines: backendApiImplementationGuidelines,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/ditto-codegen-public",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.174",
|
|
4
4
|
"description": "AI-powered Wix CLI app generator - standalone executable",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "node build.mjs",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"@wix/ditto-codegen": "1.0.0",
|
|
25
25
|
"esbuild": "^0.25.9"
|
|
26
26
|
},
|
|
27
|
-
"falconPackageHash": "
|
|
27
|
+
"falconPackageHash": "5e9ab84eca7dfd393dd52c5fb28146e77adecd047e29a951b80745ef"
|
|
28
28
|
}
|