@postxl/cli 1.11.2 → 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, }) {
@@ -369,16 +369,17 @@ async function getLocalGenerators(params) {
369
369
  await execAsync(`tsc -b tsconfig.generate.json`);
370
370
  }
371
371
  catch (err) {
372
- if (err.stdout) {
373
- console.log(err.stdout);
372
+ const { stdout, stderr } = err;
373
+ if (stdout) {
374
+ console.log(stdout);
374
375
  }
375
- else if (err.stderr) {
376
- console.log(err.stderr);
376
+ else if (stderr) {
377
+ console.log(stderr);
377
378
  }
378
379
  else {
379
380
  console.log(JSON.stringify(err, null, 2));
380
381
  }
381
- params.program.error(`Failed to compile ${generateTsPath}:`, err);
382
+ params.program.error(`Failed to compile ${generateTsPath}:`);
382
383
  }
383
384
  // Check if `dist/generate.js` exists
384
385
  try {
@@ -409,7 +410,7 @@ async function getLocalGenerators(params) {
409
410
  }
410
411
  catch (e) {
411
412
  console.error(e);
412
- params.program.error(`Error importing local generate.js at ${generateJsPath}`, e);
413
+ params.program.error(`Error importing local generate.js at ${generateJsPath}`);
413
414
  }
414
415
  // Delete the tsconfig.generate.json file
415
416
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postxl/cli",
3
- "version": "1.11.2",
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,8 +45,8 @@
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.9.0",
49
- "@postxl/generators": "^4.0.0",
48
+ "@postxl/generator": "^1.10.0",
49
+ "@postxl/generators": "^5.0.0",
50
50
  "@postxl/schema": "^2.4.0",
51
51
  "@postxl/utils": "^1.4.2"
52
52
  },