@postxl/cli 1.11.1 → 1.11.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.
@@ -204,7 +204,7 @@ async function loadCustomSchema(providedPath) {
204
204
  if (error instanceof Error && 'code' in error && error.code === 'ENOENT') {
205
205
  throw new Error(`Schema file not found: ${resolvedPath}`);
206
206
  }
207
- throw new Error(`Failed to read schema file: ${error instanceof Error ? error.message : error}`);
207
+ throw new Error(`Failed to read schema file: ${error instanceof Error ? error.message : String(error)}`);
208
208
  }
209
209
  let json;
210
210
  try {
@@ -260,7 +260,7 @@ async function createFolderOrThrow(targetPath) {
260
260
  await fs.mkdir(targetPath, { recursive: true });
261
261
  return;
262
262
  }
263
- throw new Error(`Cannot access target path "${targetPath}": ${error instanceof Error ? error.message : error}`);
263
+ throw new Error(`Cannot access target path "${targetPath}": ${error instanceof Error ? error.message : String(error)}`);
264
264
  }
265
265
  if (!stat.isDirectory()) {
266
266
  throw new Error(`Target path "${targetPath}" already exists and is not a directory! Please choose a different path.`);
@@ -277,7 +277,7 @@ async function createFolderOrThrow(targetPath) {
277
277
  if (error instanceof Error && error.message.includes('already exists')) {
278
278
  throw error;
279
279
  }
280
- throw new Error(`Cannot read target path "${targetPath}": ${error instanceof Error ? error.message : error}`);
280
+ throw new Error(`Cannot read target path "${targetPath}": ${error instanceof Error ? error.message : String(error)}`);
281
281
  }
282
282
  }
283
283
  async function createProjectStructure({ name, slug, schema, projectPath, }) {
@@ -316,6 +316,7 @@ async function maybeReconstructBaseVfs(params) {
316
316
  ...options,
317
317
  ...(options.pattern ? { filePattern: options.pattern } : {}),
318
318
  ...(targetModelNames ? { targetModelNames } : {}),
319
+ isBaseReconstruction: true,
319
320
  });
320
321
  const baseGenerated = await manager.generate(baseContext);
321
322
  const baseG = await new generator_1.Generator(baseGenerated).generate((g) => g);
@@ -368,16 +369,17 @@ async function getLocalGenerators(params) {
368
369
  await execAsync(`tsc -b tsconfig.generate.json`);
369
370
  }
370
371
  catch (err) {
371
- if (err.stdout) {
372
- console.log(err.stdout);
372
+ const { stdout, stderr } = err;
373
+ if (stdout) {
374
+ console.log(stdout);
373
375
  }
374
- else if (err.stderr) {
375
- console.log(err.stderr);
376
+ else if (stderr) {
377
+ console.log(stderr);
376
378
  }
377
379
  else {
378
380
  console.log(JSON.stringify(err, null, 2));
379
381
  }
380
- params.program.error(`Failed to compile ${generateTsPath}:`, err);
382
+ params.program.error(`Failed to compile ${generateTsPath}:`);
381
383
  }
382
384
  // Check if `dist/generate.js` exists
383
385
  try {
@@ -408,7 +410,7 @@ async function getLocalGenerators(params) {
408
410
  }
409
411
  catch (e) {
410
412
  console.error(e);
411
- params.program.error(`Error importing local generate.js at ${generateJsPath}`, e);
413
+ params.program.error(`Error importing local generate.js at ${generateJsPath}`);
412
414
  }
413
415
  // Delete the tsconfig.generate.json file
414
416
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postxl/cli",
3
- "version": "1.11.1",
3
+ "version": "1.11.3",
4
4
  "description": "Command-line interface for PostXL code generation framework",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -45,9 +45,9 @@
45
45
  "dotenv": "17.4.2",
46
46
  "ts-morph": "26.0.0",
47
47
  "zod-validation-error": "5.0.0",
48
- "@postxl/generator": "^1.8.1",
49
- "@postxl/generators": "^3.2.2",
50
- "@postxl/schema": "^2.3.0",
48
+ "@postxl/generator": "^1.10.0",
49
+ "@postxl/generators": "^5.0.0",
50
+ "@postxl/schema": "^2.4.0",
51
51
  "@postxl/utils": "^1.4.2"
52
52
  },
53
53
  "devDependencies": {},