@slicemachine/manager 0.24.4-alpha.xru-slice-generation-ai-poc.2 → 0.24.4-alpha.xru-slice-generation-ai-poc.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slicemachine/manager",
3
- "version": "0.24.4-alpha.xru-slice-generation-ai-poc.2",
3
+ "version": "0.24.4-alpha.xru-slice-generation-ai-poc.3",
4
4
  "description": "Manage all aspects of a Slice Machine project.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -71,7 +71,7 @@
71
71
  "@prismicio/mocks": "2.8.0",
72
72
  "@prismicio/types-internal": "3.3.0",
73
73
  "@segment/analytics-node": "^2.1.2",
74
- "@slicemachine/plugin-kit": "0.4.66-alpha.xru-slice-generation-ai-poc.2",
74
+ "@slicemachine/plugin-kit": "0.4.66-alpha.xru-slice-generation-ai-poc.3",
75
75
  "cookie": "^1.0.1",
76
76
  "cors": "^2.8.5",
77
77
  "execa": "^7.1.1",
@@ -2757,47 +2757,48 @@ export default PascalNameToReplace;
2757
2757
  );
2758
2758
 
2759
2759
  // Ensure to wait to have all slices code and mocks before writing on the disk
2760
- await updatedSlices.forEach(
2761
- async ({ updatedSlice, componentCode, updatedMock }, index) => {
2762
- console.log(
2763
- "STEP 7: Update the slice code for:",
2764
- `${index} - ${updatedSlice.name}`,
2765
- );
2766
- if (componentCode) {
2767
- const { errors } = await this.createSlice({
2768
- libraryID: DEFAULT_LIBRARY_ID,
2769
- model: updatedSlice,
2770
- componentContents: componentCode,
2771
- });
2760
+ for (let index = 0; index < updatedSlices.length; index++) {
2761
+ const { updatedSlice, componentCode, updatedMock } =
2762
+ updatedSlices[index];
2772
2763
 
2773
- if (errors.length > 0) {
2774
- console.log(
2775
- `Errors while updating the slice code for ${index} - ${updatedSlice.name}:`,
2776
- errors,
2777
- );
2778
- await this.createSlice({
2779
- libraryID: DEFAULT_LIBRARY_ID,
2780
- model: updatedSlice,
2781
- });
2782
- }
2783
- } else {
2764
+ console.log(
2765
+ "STEP 7: Update the slice code for:",
2766
+ `${index} - ${updatedSlice.name}`,
2767
+ );
2768
+ if (componentCode) {
2769
+ const { errors } = await this.createSlice({
2770
+ libraryID: DEFAULT_LIBRARY_ID,
2771
+ model: updatedSlice,
2772
+ componentContents: componentCode,
2773
+ });
2774
+
2775
+ if (errors.length > 0) {
2776
+ console.log(
2777
+ `Errors while updating the slice code for ${index} - ${updatedSlice.name}:`,
2778
+ errors,
2779
+ );
2784
2780
  await this.createSlice({
2785
2781
  libraryID: DEFAULT_LIBRARY_ID,
2786
2782
  model: updatedSlice,
2787
2783
  });
2788
2784
  }
2789
-
2790
- console.log(
2791
- "STEP 8: Persist the generated mocks for:",
2792
- `${index} - ${updatedSlice.name}`,
2793
- );
2794
- await this.updateSliceMocks({
2785
+ } else {
2786
+ await this.createSlice({
2795
2787
  libraryID: DEFAULT_LIBRARY_ID,
2796
- sliceID: updatedSlice.id,
2797
- mocks: updatedMock,
2788
+ model: updatedSlice,
2798
2789
  });
2799
- },
2800
- );
2790
+ }
2791
+
2792
+ console.log(
2793
+ "STEP 8: Persist the generated mocks for:",
2794
+ `${index} - ${updatedSlice.name}`,
2795
+ );
2796
+ await this.updateSliceMocks({
2797
+ libraryID: DEFAULT_LIBRARY_ID,
2798
+ sliceID: updatedSlice.id,
2799
+ mocks: updatedMock,
2800
+ });
2801
+ }
2801
2802
 
2802
2803
  console.log("STEP 9: THE END");
2803
2804