@postxl/generator 1.3.1 → 1.3.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.
|
@@ -140,20 +140,35 @@ class GeneratorManager {
|
|
|
140
140
|
this.checkCircularDependencies();
|
|
141
141
|
const generatorsSorted = this.topologicalSort();
|
|
142
142
|
for (const generator of generatorsSorted) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
try {
|
|
144
|
+
// Not all generators extend the context and hence do not need to return it.
|
|
145
|
+
// Therefore, if the generator does not return the context, we use the original context.
|
|
146
|
+
context = (await generator.register(context)) ?? context;
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
throw new Error(`Generator ${(0, utils_1.yellow)(generator.id)} failed during register phase: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
150
|
+
}
|
|
146
151
|
}
|
|
147
152
|
for (const generator of generatorsSorted) {
|
|
148
153
|
if (!generator.afterRegistrations) {
|
|
149
154
|
continue;
|
|
150
155
|
}
|
|
151
|
-
|
|
156
|
+
try {
|
|
157
|
+
await generator.afterRegistrations(context);
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
throw new Error(`Generator ${(0, utils_1.yellow)(generator.id)} failed during afterRegistrations phase: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
161
|
+
}
|
|
152
162
|
}
|
|
153
163
|
for (const generator of generatorsSorted) {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
164
|
+
try {
|
|
165
|
+
// Not all generators extend the context and hence do not need to return it.
|
|
166
|
+
// Therefore, if the generator does not return the context, we use the original context.
|
|
167
|
+
context = (await generator.generate(context)) ?? context;
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
throw new Error(`Generator ${(0, utils_1.yellow)(generator.id)} failed during generate phase: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
171
|
+
}
|
|
157
172
|
}
|
|
158
173
|
return context;
|
|
159
174
|
}
|
package/dist/utils/sync.js
CHANGED
|
@@ -154,6 +154,9 @@ async function sync({ vfs, lockFilePath, diskFilePath, force }) {
|
|
|
154
154
|
await Promise.all(tasks);
|
|
155
155
|
return { success: true, ...result };
|
|
156
156
|
}
|
|
157
|
+
const validFilesWithMergeConflictMarkers = new Set([
|
|
158
|
+
'/CLAUDE.md', // Contains instructions for resolving merge conflicts
|
|
159
|
+
]);
|
|
157
160
|
/**
|
|
158
161
|
* Finds all files in the disk that contain unresolved merge conflict markers.
|
|
159
162
|
*
|
|
@@ -163,7 +166,9 @@ async function sync({ vfs, lockFilePath, diskFilePath, force }) {
|
|
|
163
166
|
function findFilesWithMergeConflicts(files) {
|
|
164
167
|
const filesWithConflicts = [];
|
|
165
168
|
for (const [filePath, { disk }] of files) {
|
|
166
|
-
if (disk.state === 'hash' &&
|
|
169
|
+
if (disk.state === 'hash' &&
|
|
170
|
+
(0, merge_conflict_1.hasMergeConflictMarkers)(disk.content) &&
|
|
171
|
+
!validFilesWithMergeConflictMarkers.has(filePath)) {
|
|
167
172
|
filesWithConflicts.push(filePath);
|
|
168
173
|
}
|
|
169
174
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@postxl/generator",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "Core package that orchestrates the code generation of a PXL project",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"jszip": "3.10.1",
|
|
47
47
|
"minimatch": "^10.1.1",
|
|
48
48
|
"p-limit": "3.1.0",
|
|
49
|
-
"@postxl/schema": "^1.
|
|
50
|
-
"@postxl/utils": "^1.3.
|
|
49
|
+
"@postxl/schema": "^1.3.0",
|
|
50
|
+
"@postxl/utils": "^1.3.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/diff": "8.0.0"
|