lingo.dev 0.111.11 → 0.111.12

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/build/cli.mjs CHANGED
@@ -3067,6 +3067,7 @@ async function formatDataWithPrettier(data, filePath, options) {
3067
3067
  import path12 from "path";
3068
3068
  import fs9 from "fs/promises";
3069
3069
  import { Biome, Distribution } from "@biomejs/js-api";
3070
+ var shownWarnings = /* @__PURE__ */ new Set();
3070
3071
  function createBiomeLoader(options) {
3071
3072
  return createBaseFormatterLoader(options, async (data, filePath) => {
3072
3073
  return await formatDataWithBiome(data, filePath, options);
@@ -3091,26 +3092,43 @@ async function findBiomeConfig(startPath) {
3091
3092
  return null;
3092
3093
  }
3093
3094
  async function formatDataWithBiome(data, filePath, options) {
3095
+ let configPath = null;
3094
3096
  try {
3095
3097
  const biome = await Biome.create({
3096
3098
  distribution: Distribution.NODE
3097
3099
  });
3098
- const configPath = await findBiomeConfig(filePath);
3100
+ const openResult = biome.openProject(".");
3101
+ const projectKey = openResult.projectKey;
3102
+ configPath = await findBiomeConfig(filePath);
3099
3103
  if (!configPath && !options.alwaysFormat) {
3100
3104
  return data;
3101
3105
  }
3102
3106
  if (configPath) {
3103
3107
  const configContent = await fs9.readFile(configPath, "utf-8");
3104
- biome.applyConfiguration(JSON.parse(configContent));
3108
+ try {
3109
+ const config = JSON.parse(configContent);
3110
+ biome.applyConfiguration(projectKey, config);
3111
+ } catch (parseError) {
3112
+ throw new Error(
3113
+ `Invalid Biome configuration in ${configPath}: ${parseError instanceof Error ? parseError.message : "JSON parse error"}`
3114
+ );
3115
+ }
3105
3116
  }
3106
- const formatted = biome.formatContent(data, {
3117
+ const formatted = biome.formatContent(projectKey, data, {
3107
3118
  filePath
3108
3119
  });
3109
3120
  return formatted.content;
3110
3121
  } catch (error) {
3111
- if (error instanceof Error) {
3122
+ const ext2 = path12.extname(filePath);
3123
+ if (!shownWarnings.has(ext2)) {
3124
+ shownWarnings.add(ext2);
3112
3125
  console.log();
3113
- console.log("\u26A0\uFE0F Biome formatting failed:", error.message);
3126
+ console.log(
3127
+ `\u26A0\uFE0F Biome does not support ${ext2} files - skipping formatting`
3128
+ );
3129
+ if (error instanceof Error && error.message) {
3130
+ console.log(` ${error.message}`);
3131
+ }
3114
3132
  }
3115
3133
  return data;
3116
3134
  }
@@ -11253,7 +11271,7 @@ async function renderHero2() {
11253
11271
  // package.json
11254
11272
  var package_default = {
11255
11273
  name: "lingo.dev",
11256
- version: "0.111.11",
11274
+ version: "0.111.12",
11257
11275
  description: "Lingo.dev CLI",
11258
11276
  private: false,
11259
11277
  publishConfig: {
@@ -11383,8 +11401,8 @@ var package_default = {
11383
11401
  "@babel/parser": "^7.27.1",
11384
11402
  "@babel/traverse": "^7.27.4",
11385
11403
  "@babel/types": "^7.27.1",
11386
- "@biomejs/js-api": "^0.6.2",
11387
- "@biomejs/wasm-nodejs": "^1.8.3",
11404
+ "@biomejs/js-api": "^3.0.0",
11405
+ "@biomejs/wasm-nodejs": "^2.2.4",
11388
11406
  "@datocms/cma-client-node": "^4.0.1",
11389
11407
  "@gitbeaker/rest": "^39.34.3",
11390
11408
  "@inkjs/ui": "^2.0.0",