@wix/ditto-codegen-public 1.0.172 → 1.0.173
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 +46 -56
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -39504,6 +39504,23 @@ Expected plan (abbreviated):
|
|
|
39504
39504
|
}
|
|
39505
39505
|
});
|
|
39506
39506
|
|
|
39507
|
+
// dist/system-prompts/system-prompt-builders/utils/typescript-quality-guidelines.js
|
|
39508
|
+
var require_typescript_quality_guidelines = __commonJS({
|
|
39509
|
+
"dist/system-prompts/system-prompt-builders/utils/typescript-quality-guidelines.js"(exports2) {
|
|
39510
|
+
"use strict";
|
|
39511
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
39512
|
+
exports2.typescriptQualityGuidelines = void 0;
|
|
39513
|
+
exports2.typescriptQualityGuidelines = `<typescript_quality_guidelines>
|
|
39514
|
+
- Generated code MUST compile with zero TypeScript errors under strict settings:
|
|
39515
|
+
strict, noImplicitAny, strictNullChecks, exactOptionalPropertyTypes, noUncheckedIndexedAccess
|
|
39516
|
+
- Prefer type-narrowing and exhaustive logic over assertions; avoid non-null assertions (!) and unsafe casts (as any)
|
|
39517
|
+
- Treat optional values, refs, and array indexing results as possibly undefined and handle them explicitly
|
|
39518
|
+
- Use exhaustive checks for unions (e.g., switch with a never check) and return total values (no implicit undefined)
|
|
39519
|
+
- Do NOT use // @ts-ignore or // @ts-expect-error; fix the types or add guards instead
|
|
39520
|
+
</typescript_quality_guidelines>`;
|
|
39521
|
+
}
|
|
39522
|
+
});
|
|
39523
|
+
|
|
39507
39524
|
// dist/system-prompts/dashboardPage/dashboardPackage.js
|
|
39508
39525
|
var require_dashboardPackage = __commonJS({
|
|
39509
39526
|
"dist/system-prompts/dashboardPage/dashboardPackage.js"(exports2) {
|
|
@@ -64348,7 +64365,7 @@ ${componentDescription}
|
|
|
64348
64365
|
</description>${featuresBlock}
|
|
64349
64366
|
</component>`;
|
|
64350
64367
|
}
|
|
64351
|
-
|
|
64368
|
+
function buildWdsSystemPrompt(allowedComponents) {
|
|
64352
64369
|
const parsedData = wdsJson;
|
|
64353
64370
|
const relevantComponents = (parsedData.items || []).filter((component) => allowedComponents.has(component.storyName));
|
|
64354
64371
|
if (!relevantComponents.length) {
|
|
@@ -64369,6 +64386,7 @@ var require_dashboard_page_instructions = __commonJS({
|
|
|
64369
64386
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
64370
64387
|
exports2.dashboardPageInstructions = void 0;
|
|
64371
64388
|
var apiSpec_1 = require_apiSpec();
|
|
64389
|
+
var typescript_quality_guidelines_1 = require_typescript_quality_guidelines();
|
|
64372
64390
|
var dashboardPackage_1 = require_dashboardPackage();
|
|
64373
64391
|
var data_1 = require_data();
|
|
64374
64392
|
var dynamicParameters_1 = require_dynamicParameters();
|
|
@@ -64468,34 +64486,18 @@ export default function () {
|
|
|
64468
64486
|
- 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
64487
|
- Always verify component availability before using it in your generated code
|
|
64470
64488
|
- 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
64489
|
exports2.dashboardPageInstructions = {
|
|
64489
64490
|
role: dashboardPageRole,
|
|
64490
64491
|
filesAndCode: dashboardPageFilesAndCode,
|
|
64491
64492
|
wdsProviderUsage: dashboardPageWdsProviderUsage,
|
|
64492
64493
|
hardConstraints: dashboardPageHardConstraints,
|
|
64493
|
-
wdsReference: () =>
|
|
64494
|
-
apiReferences:
|
|
64495
|
-
|
|
64496
|
-
|
|
64497
|
-
|
|
64498
|
-
|
|
64494
|
+
wdsReference: () => (0, wdsPackage_1.buildWdsSystemPrompt)(supportedWDSComponents),
|
|
64495
|
+
apiReferences: `${dashboardPackage_1.dashboardPackage}
|
|
64496
|
+
${ecomPackage_1.ecomPackage}`,
|
|
64497
|
+
typescriptQualityGuidelines: typescript_quality_guidelines_1.typescriptQualityGuidelines,
|
|
64498
|
+
dataPrompt: data_1.dataPrompt,
|
|
64499
|
+
apiSpecPrompt: (0, apiSpec_1.apiSpecPrompt)(),
|
|
64500
|
+
dynamicParametersManagementPrompt: (0, dynamicParameters_1.dynamicParametersManagementPrompt)()
|
|
64499
64501
|
};
|
|
64500
64502
|
}
|
|
64501
64503
|
});
|
|
@@ -65342,13 +65344,12 @@ var require_dashboard_page_prompt = __commonJS({
|
|
|
65342
65344
|
var dashboard_page_instructions_1 = require_dashboard_page_instructions();
|
|
65343
65345
|
var CodeGenerationSystemPromptBuilder_1 = require_CodeGenerationSystemPromptBuilder();
|
|
65344
65346
|
var dashboardPagePrompt = async ({ useData, useApiSpec, useDynamicParameters, apiNames, useIteration }) => {
|
|
65345
|
-
const wdsReference = await dashboard_page_instructions_1.dashboardPageInstructions.wdsReference();
|
|
65346
65347
|
const systemPrompt = (0, CodeGenerationSystemPromptBuilder_1.codeGenerationSystemPromptBuilder)({
|
|
65347
65348
|
agentType: types_impl_1.ExtensionType.DASHBOARD_PAGE,
|
|
65348
65349
|
apiNames,
|
|
65349
65350
|
useData,
|
|
65350
65351
|
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();
|
|
65352
|
+
}).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
65353
|
if (useData) {
|
|
65353
65354
|
systemPrompt.withSection("data_prompt", dashboard_page_instructions_1.dashboardPageInstructions.dataPrompt);
|
|
65354
65355
|
}
|
|
@@ -65700,6 +65701,7 @@ var require_site_component_instructions = __commonJS({
|
|
|
65700
65701
|
"use strict";
|
|
65701
65702
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
65702
65703
|
exports2.siteComponentInstructions = void 0;
|
|
65704
|
+
var typescript_quality_guidelines_1 = require_typescript_quality_guidelines();
|
|
65703
65705
|
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
65706
|
var siteComponentImplementationGuidelines = `<rules>
|
|
65705
65707
|
- Return ONLY a JSON object matching the schema { path, content, type } (no prose, no markdown)
|
|
@@ -65722,14 +65724,7 @@ var require_site_component_instructions = __commonJS({
|
|
|
65722
65724
|
- Name things clearly; avoid magic numbers; extract tiny helpers if it improves clarity
|
|
65723
65725
|
</engineering_guidelines>
|
|
65724
65726
|
|
|
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>
|
|
65727
|
+
${typescript_quality_guidelines_1.typescriptQualityGuidelines}
|
|
65733
65728
|
`;
|
|
65734
65729
|
exports2.siteComponentInstructions = {
|
|
65735
65730
|
role: siteComponentRole,
|
|
@@ -65813,6 +65808,7 @@ var require_custom_element_instructions = __commonJS({
|
|
|
65813
65808
|
"use strict";
|
|
65814
65809
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
65815
65810
|
exports2.customElementInstructions = void 0;
|
|
65811
|
+
var typescript_quality_guidelines_1 = require_typescript_quality_guidelines();
|
|
65816
65812
|
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
65813
|
var customElementImplementationGuidelines = `<rules>
|
|
65818
65814
|
- Return ONLY a JSON object matching the schema { path, content, type } (no prose, no markdown)
|
|
@@ -65827,14 +65823,7 @@ var require_custom_element_instructions = __commonJS({
|
|
|
65827
65823
|
- Name things clearly; avoid magic numbers; extract tiny helpers if it improves clarity
|
|
65828
65824
|
</engineering_guidelines>
|
|
65829
65825
|
|
|
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>
|
|
65826
|
+
${typescript_quality_guidelines_1.typescriptQualityGuidelines}
|
|
65838
65827
|
|
|
65839
65828
|
<frontend_aesthetics>
|
|
65840
65829
|
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 +66293,13 @@ var require_backend_api_instructions = __commonJS({
|
|
|
66304
66293
|
var backendApiRole = `You are a specialized code-generation agent for creating Astro Server Endpoints (API Routes) for fullstack applications.`;
|
|
66305
66294
|
var backendApiImplementationGuidelines = `Generate clean, well-structured Astro Server Endpoints based on the API Spec that follow these patterns and best practices.
|
|
66306
66295
|
Focus on creating maintainable, secure, and efficient API routes that integrate well with frontend applications.`;
|
|
66307
|
-
var backendApiCoreKnowledge =
|
|
66296
|
+
var backendApiCoreKnowledge = `<astro_server_endpoints_overview>
|
|
66308
66297
|
- Astro Server Endpoints are API routes that run on the server side
|
|
66309
66298
|
- They are located in the \`src/pages/api/\` directory
|
|
66310
66299
|
- Each file exports named functions for HTTP methods (GET, POST, PUT, DELETE, etc.)
|
|
66311
66300
|
- Files use the \`.ts\` extension and are automatically converted to API endpoints
|
|
66312
|
-
|
|
66313
|
-
|
|
66301
|
+
</astro_server_endpoints_overview>
|
|
66302
|
+
<file_structure_and_naming>
|
|
66314
66303
|
- API routes are created in \`src/pages/api/\` directory
|
|
66315
66304
|
- File names become the endpoint path (e.g., \`users.ts\` \u2192 \`/api/users\`)
|
|
66316
66305
|
- For dynamic routes with parameters, use square brackets in the filename (e.g., \`/api/users/[id]\`)
|
|
@@ -66339,39 +66328,40 @@ export async function GET({ params }) {
|
|
|
66339
66328
|
});
|
|
66340
66329
|
}
|
|
66341
66330
|
\`\`\`
|
|
66342
|
-
|
|
66343
|
-
|
|
66331
|
+
</file_structure_and_naming>
|
|
66332
|
+
<typescript_patterns>
|
|
66344
66333
|
- Import \`APIRoute\` type from 'astro'
|
|
66345
66334
|
- Export named functions for HTTP methods: \`GET\`, \`POST\`, \`PUT\`, \`DELETE\`, \`PATCH\`
|
|
66346
66335
|
- Use async/await for handling asynchronous operations
|
|
66347
66336
|
- Always return a \`Response\` object
|
|
66348
|
-
|
|
66349
|
-
|
|
66337
|
+
</typescript_patterns>
|
|
66338
|
+
<request_handling>
|
|
66350
66339
|
- Access request data through the \`request\` parameter
|
|
66351
66340
|
- Use \`request.json()\` for POST/PUT request bodies
|
|
66352
66341
|
- Use \`request.url\` for the full URL
|
|
66353
66342
|
- Use \`new URL(request.url).searchParams\` for query parameters
|
|
66354
66343
|
- Access headers via \`request.headers\`
|
|
66355
|
-
|
|
66356
|
-
|
|
66344
|
+
</request_handling>
|
|
66345
|
+
<response_patterns>
|
|
66357
66346
|
- Always return a \`Response\` object
|
|
66358
66347
|
- Use \`JSON.stringify()\` for JSON responses
|
|
66359
66348
|
- Set appropriate status codes (200, 201, 400, 404, 500, etc.)
|
|
66360
66349
|
- Include proper headers, especially \`Content-Type: application/json\`
|
|
66361
|
-
|
|
66362
|
-
|
|
66350
|
+
</response_patterns>
|
|
66351
|
+
<common_patterns>
|
|
66363
66352
|
- GET endpoints for data retrieval
|
|
66364
66353
|
- POST endpoints for data creation
|
|
66365
66354
|
- PUT/PATCH endpoints for data updates
|
|
66366
66355
|
- DELETE endpoints for data removal
|
|
66367
66356
|
- Use proper HTTP status codes
|
|
66368
|
-
|
|
66369
|
-
|
|
66357
|
+
</common_patterns>
|
|
66358
|
+
<best_practices>
|
|
66370
66359
|
- Use proper TypeScript types
|
|
66371
66360
|
- Return appropriate HTTP status codes
|
|
66372
66361
|
- Include proper headers
|
|
66373
66362
|
- Use async/await for asynchronous operations
|
|
66374
|
-
- Keep endpoints focused and single-purpose
|
|
66363
|
+
- Keep endpoints focused and single-purpose
|
|
66364
|
+
</best_practices>`;
|
|
66375
66365
|
exports2.backendApiInstructions = {
|
|
66376
66366
|
role: backendApiRole,
|
|
66377
66367
|
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.173",
|
|
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": "143c2dbe2321cf37cf808acd5d4052c36631cc0a6f612540411cf062"
|
|
28
28
|
}
|