@postxl/generator 1.3.3 → 1.3.4

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.
@@ -64,13 +64,13 @@ const packageJsonConfig = {
64
64
  };
65
65
  async function format({ path, content }) {
66
66
  const ext = (0, path_1.extname)(path);
67
- const parser = parsers[ext];
68
- if (parser === undefined || typeof content !== 'string') {
67
+ const supportsPrettier = parsers[ext] !== undefined;
68
+ if (!supportsPrettier || typeof content !== 'string') {
69
69
  return content;
70
70
  }
71
71
  const config = (0, path_1.basename)(path) === 'package.json' ? packageJsonConfig : prettier_config_1.prettierConfig;
72
72
  try {
73
- return await prettier.format(content, { ...config, parser });
73
+ return await prettier.format(content, { ...config, filepath: path });
74
74
  }
75
75
  catch (err) {
76
76
  console.error(`${content}\n\nFailed to format ${path}\n\n`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postxl/generator",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
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.3.0",
50
- "@postxl/utils": "^1.3.1"
49
+ "@postxl/schema": "^1.4.1",
50
+ "@postxl/utils": "^1.3.2"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/diff": "8.0.0"