@wix/ditto-codegen-public 1.0.119 → 1.0.121
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 +44 -14
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -117630,11 +117630,14 @@ var require_utils11 = __commonJS({
|
|
|
117630
117630
|
zod_1.z.object({
|
|
117631
117631
|
operation: zod_1.z.union([
|
|
117632
117632
|
zod_1.z.literal(ditto_codegen_types_12.ExtensionGenerationOperation.INSERT),
|
|
117633
|
-
zod_1.z.literal(ditto_codegen_types_12.ExtensionGenerationOperation.UPDATE)
|
|
117634
|
-
|
|
117635
|
-
]).describe("File operation: insert (new file), update (modify existing), delete (remove file)").default(ditto_codegen_types_12.ExtensionGenerationOperation.INSERT),
|
|
117633
|
+
zod_1.z.literal(ditto_codegen_types_12.ExtensionGenerationOperation.UPDATE)
|
|
117634
|
+
]).describe("File operation: insert (new file), update (modify existing)").default(ditto_codegen_types_12.ExtensionGenerationOperation.INSERT),
|
|
117636
117635
|
path: zod_1.z.string().describe("Relative file path from project root").optional(),
|
|
117637
|
-
content: zod_1.z.string().describe("Complete file content as a string (for JSON files, stringify the object). Required for insert and update operations.")
|
|
117636
|
+
content: zod_1.z.string().describe("Complete file content as a string (for JSON files, stringify the object). Required for insert and update operations.")
|
|
117637
|
+
}),
|
|
117638
|
+
zod_1.z.object({
|
|
117639
|
+
operation: zod_1.z.literal(ditto_codegen_types_12.ExtensionGenerationOperation.DELETE),
|
|
117640
|
+
path: zod_1.z.string().describe("Relative file path from project root")
|
|
117638
117641
|
}),
|
|
117639
117642
|
zod_1.z.object({
|
|
117640
117643
|
operation: zod_1.z.literal(ditto_codegen_types_12.ExtensionGenerationOperation.EDIT),
|
|
@@ -133122,6 +133125,28 @@ var require_DittoEventEmitter = __commonJS({
|
|
|
133122
133125
|
}
|
|
133123
133126
|
});
|
|
133124
133127
|
|
|
133128
|
+
// dist/naturalJsonStringify.js
|
|
133129
|
+
var require_naturalJsonStringify = __commonJS({
|
|
133130
|
+
"dist/naturalJsonStringify.js"(exports2) {
|
|
133131
|
+
"use strict";
|
|
133132
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
133133
|
+
exports2.naturalJsonStringify = naturalJsonStringify;
|
|
133134
|
+
var util_1 = require("util");
|
|
133135
|
+
function naturalJsonStringify(obj) {
|
|
133136
|
+
return (0, util_1.inspect)(obj, {
|
|
133137
|
+
depth: null,
|
|
133138
|
+
// traverse all levels
|
|
133139
|
+
compact: false,
|
|
133140
|
+
// use multiple lines
|
|
133141
|
+
breakLength: 80,
|
|
133142
|
+
// line length before breaking
|
|
133143
|
+
maxArrayLength: null
|
|
133144
|
+
// show all array elements
|
|
133145
|
+
});
|
|
133146
|
+
}
|
|
133147
|
+
}
|
|
133148
|
+
});
|
|
133149
|
+
|
|
133125
133150
|
// dist/extensions/extensionGenerators.js
|
|
133126
133151
|
var require_extensionGenerators = __commonJS({
|
|
133127
133152
|
"dist/extensions/extensionGenerators.js"(exports2) {
|
|
@@ -133139,6 +133164,7 @@ var require_extensionGenerators = __commonJS({
|
|
|
133139
133164
|
var ditto_scaffolding_2 = require_dist13();
|
|
133140
133165
|
var EmbeddedScriptAgent_1 = require_EmbeddedScriptAgent2();
|
|
133141
133166
|
var ditto_codegen_types_12 = require_dist();
|
|
133167
|
+
var naturalJsonStringify_1 = require_naturalJsonStringify();
|
|
133142
133168
|
var ExtensionFactory = class {
|
|
133143
133169
|
static generateExtension({ extension, outputPath, scaffoldPath, generatedConfig }) {
|
|
133144
133170
|
const scaffoldDir = path_1.default.dirname(scaffoldPath);
|
|
@@ -133389,7 +133415,7 @@ var require_extensionGenerators = __commonJS({
|
|
|
133389
133415
|
}
|
|
133390
133416
|
function generateExtensionTsContent(builderMethodName, extensionConfig, extensionType, name) {
|
|
133391
133417
|
const extensionName = generateUniqueExtensionName(extensionType, name);
|
|
133392
|
-
const configString =
|
|
133418
|
+
const configString = (0, naturalJsonStringify_1.naturalJsonStringify)(extensionConfig);
|
|
133393
133419
|
return `import { extensions } from '@wix/astro/builders';
|
|
133394
133420
|
export const ${extensionName} = extensions.${builderMethodName}(${configString})
|
|
133395
133421
|
`;
|
|
@@ -133457,11 +133483,13 @@ var require_file_collector = __commonJS({
|
|
|
133457
133483
|
});
|
|
133458
133484
|
});
|
|
133459
133485
|
agentFiles.forEach((file) => {
|
|
133486
|
+
if (file.operation === ditto_codegen_types_12.ExtensionGenerationOperation.DELETE || file.operation === ditto_codegen_types_12.ExtensionGenerationOperation.EDIT) {
|
|
133487
|
+
allCreatedFiles.push(file);
|
|
133488
|
+
return;
|
|
133489
|
+
}
|
|
133460
133490
|
const hasScaffold = scaffolds.some((s) => s.path === file.path);
|
|
133461
|
-
|
|
133462
|
-
|
|
133463
|
-
operation: hasScaffold ? ditto_codegen_types_12.ExtensionGenerationOperation.INSERT : determineFileOperation(file.path || "", outputPath, existingFiles)
|
|
133464
|
-
});
|
|
133491
|
+
const operation = hasScaffold || !file.path ? ditto_codegen_types_12.ExtensionGenerationOperation.INSERT : determineFileOperation(file.path, outputPath, existingFiles);
|
|
133492
|
+
allCreatedFiles.push({ ...file, operation });
|
|
133465
133493
|
});
|
|
133466
133494
|
if (extensionFilePath) {
|
|
133467
133495
|
allCreatedFiles.push({
|
|
@@ -133994,6 +134022,7 @@ var require_cms = __commonJS({
|
|
|
133994
134022
|
var path_1 = __importDefault2(require("path"));
|
|
133995
134023
|
var crypto_1 = require("crypto");
|
|
133996
134024
|
var ditto_codegen_types_12 = require_dist();
|
|
134025
|
+
var naturalJsonStringify_1 = require_naturalJsonStringify();
|
|
133997
134026
|
exports2.CMS_BUILDER = "genericExtension";
|
|
133998
134027
|
exports2.CMS_COMP_TYPE = "DATA_COMPONENT";
|
|
133999
134028
|
exports2.CMS_COMP_NAME = "data-extension";
|
|
@@ -134017,10 +134046,7 @@ var require_cms = __commonJS({
|
|
|
134017
134046
|
...collection
|
|
134018
134047
|
};
|
|
134019
134048
|
});
|
|
134020
|
-
const
|
|
134021
|
-
import { extensions } from '@wix/astro/builders';
|
|
134022
|
-
|
|
134023
|
-
export const dataExtension = extensions.${exports2.CMS_BUILDER}(${JSON.stringify({
|
|
134049
|
+
const objStr = (0, naturalJsonStringify_1.naturalJsonStringify)({
|
|
134024
134050
|
compId: (0, crypto_1.randomUUID)(),
|
|
134025
134051
|
compName: exports2.CMS_COMP_NAME,
|
|
134026
134052
|
compType: exports2.CMS_COMP_TYPE,
|
|
@@ -134029,7 +134055,11 @@ export const dataExtension = extensions.${exports2.CMS_BUILDER}(${JSON.stringify
|
|
|
134029
134055
|
collections: collectionsData
|
|
134030
134056
|
}
|
|
134031
134057
|
}
|
|
134032
|
-
}
|
|
134058
|
+
});
|
|
134059
|
+
const generatedCode = `
|
|
134060
|
+
import { extensions } from '@wix/astro/builders';
|
|
134061
|
+
|
|
134062
|
+
export const dataExtension = extensions.${exports2.CMS_BUILDER}(${objStr});
|
|
134033
134063
|
`;
|
|
134034
134064
|
files.push({
|
|
134035
134065
|
operation: ditto_codegen_types_12.ExtensionGenerationOperation.INSERT,
|
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.121",
|
|
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": "e4988d81bb423f5cae6221518ca7c7e3f12937c96c95cdf314393e3e"
|
|
28
28
|
}
|