@lingo.dev/_compiler 0.7.13 → 0.7.15
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/{chunk-2R23B26C.mjs → chunk-COKHINWO.mjs} +41 -53
- package/build/{chunk-E2V2L7SN.cjs → chunk-TMPC4O5V.cjs} +41 -53
- package/build/index.cjs +28 -33
- package/build/index.mjs +7 -12
- package/build/lingo-turbopack-loader.cjs +3 -3
- package/build/lingo-turbopack-loader.mjs +1 -1
- package/package.json +3 -3
|
@@ -974,18 +974,16 @@ var LCP = class _LCP {
|
|
|
974
974
|
fs4.mkdirSync(dir, { recursive: true });
|
|
975
975
|
}
|
|
976
976
|
fs4.writeFileSync(filePath, "{}");
|
|
977
|
-
console.log(dedent`
|
|
978
|
-
\n
|
|
979
|
-
⚠️ Lingo.dev Compiler detected missing meta.json file in lingo directory.
|
|
980
|
-
Please restart the build / watch command to regenerate all Lingo.dev Compiler files.
|
|
981
|
-
`);
|
|
982
977
|
try {
|
|
983
978
|
fs4.rmdirSync(path5.resolve(process.cwd(), ".next"), {
|
|
984
979
|
recursive: true
|
|
985
980
|
});
|
|
986
981
|
} catch (error) {
|
|
987
982
|
}
|
|
988
|
-
|
|
983
|
+
throw new Error(dedent`
|
|
984
|
+
⚠️ Lingo.dev Compiler detected missing meta.json file in lingo directory.
|
|
985
|
+
Please restart the build / watch command to regenerate all Lingo.dev Compiler files.
|
|
986
|
+
`);
|
|
989
987
|
}
|
|
990
988
|
}
|
|
991
989
|
static getInstance(params) {
|
|
@@ -2276,33 +2274,28 @@ var LCPAPI = class {
|
|
|
2276
2274
|
static _failMissingLLMKeyCi(providerId) {
|
|
2277
2275
|
let details = providerDetails[providerId];
|
|
2278
2276
|
if (!details) {
|
|
2279
|
-
|
|
2277
|
+
throw new Error(
|
|
2280
2278
|
`Internal Error: Missing details for provider "${providerId}" when reporting missing key in CI/CD. You might be using an unsupported provider.`
|
|
2281
2279
|
);
|
|
2282
|
-
process.exit(1);
|
|
2283
2280
|
}
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
\n
|
|
2287
|
-
💡 You're using Lingo.dev Localization Compiler, and it detected unlocalized components in your app.
|
|
2288
|
-
|
|
2289
|
-
The compiler needs a ${details.name} API key to translate missing strings, but ${details.apiKeyEnvVar} is not set in the environment.
|
|
2281
|
+
const errorMessage = dedent2`
|
|
2282
|
+
💡 You're using Lingo.dev Localization Compiler, and it detected unlocalized components in your app.
|
|
2290
2283
|
|
|
2291
|
-
|
|
2284
|
+
The compiler needs a ${details.name} API key to translate missing strings, but ${details.apiKeyEnvVar} is not set in the environment.
|
|
2292
2285
|
|
|
2293
|
-
|
|
2294
|
-
• Session-wide: export ${details.apiKeyEnvVar}=<your-api-key>
|
|
2295
|
-
• Project-wide / CI: add ${details.apiKeyEnvVar}=<your-api-key> to your pipeline environment variables
|
|
2286
|
+
This is unexpected: typically you run a full build locally, commit the generated translation files, and push them to CI/CD.
|
|
2296
2287
|
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
3. If the model you want to use isn't supported yet, raise an issue in our open-source repo: https://lingo.dev/go/gh
|
|
2288
|
+
However, If you want CI/CD to translate the new strings, provide the key with:
|
|
2289
|
+
• Session-wide: export ${details.apiKeyEnvVar}=<your-api-key>
|
|
2290
|
+
• Project-wide / CI: add ${details.apiKeyEnvVar}=<your-api-key> to your pipeline environment variables
|
|
2301
2291
|
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2292
|
+
⭐️ Also:
|
|
2293
|
+
1. If you don't yet have a ${details.name} API key, get one for free at ${details.getKeyLink}
|
|
2294
|
+
2. If you want to use a different LLM, update your configuration. Refer to documentation for help: https://lingo.dev/compiler
|
|
2295
|
+
3. If the model you want to use isn't supported yet, raise an issue in our open-source repo: https://lingo.dev/go/gh
|
|
2296
|
+
`;
|
|
2297
|
+
console.log(errorMessage);
|
|
2298
|
+
throw new Error(`Missing ${details.name} API key in CI/CD environment.`);
|
|
2306
2299
|
}
|
|
2307
2300
|
/**
|
|
2308
2301
|
* Show an actionable error message and exit the process when an LLM API call
|
|
@@ -2314,38 +2307,33 @@ var LCPAPI = class {
|
|
|
2314
2307
|
static _failLLMFailureLocal(providerId, targetLocale, errorMessage) {
|
|
2315
2308
|
const details = providerDetails[providerId];
|
|
2316
2309
|
if (!details) {
|
|
2317
|
-
|
|
2318
|
-
`Internal Error: Missing details for provider "${providerId}" when reporting local failure
|
|
2310
|
+
throw new Error(
|
|
2311
|
+
`Internal Error: Missing details for provider "${providerId}" when reporting local failure. Original Error: ${errorMessage}`
|
|
2319
2312
|
);
|
|
2320
|
-
console.error(`Original Error: ${errorMessage}`);
|
|
2321
|
-
process.exit(1);
|
|
2322
2313
|
}
|
|
2323
2314
|
const isInvalidApiKey = errorMessage.match("Invalid API Key");
|
|
2324
2315
|
if (isInvalidApiKey) {
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
⚠️ Lingo.dev Compiler requires a valid ${details.name} API key to translate your application.
|
|
2328
|
-
|
|
2329
|
-
It looks like you set ${details.name} API key but it is not valid. Please check your API key and try again.
|
|
2316
|
+
const message = dedent2`
|
|
2317
|
+
⚠️ Lingo.dev Compiler requires a valid ${details.name} API key to translate your application.
|
|
2330
2318
|
|
|
2331
|
-
|
|
2319
|
+
It looks like you set ${details.name} API key but it is not valid. Please check your API key and try again.
|
|
2332
2320
|
|
|
2333
|
-
|
|
2334
|
-
1. User-wide: Run npx lingo.dev@latest config set ${details.apiKeyConfigKey} <your-api-key>
|
|
2335
|
-
2. Project-wide: Add ${details.apiKeyEnvVar}=<your-api-key> to .env file in every project that uses Lingo.dev Localization Compiler
|
|
2336
|
-
3 Session-wide: Run export ${details.apiKeyEnvVar}=<your-api-key> in your terminal before running the compiler to set the API key for the current session
|
|
2321
|
+
Error details from ${details.name} API: ${errorMessage}
|
|
2337
2322
|
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2323
|
+
👉 You can set the API key in one of the following ways:
|
|
2324
|
+
1. User-wide: Run npx lingo.dev@latest config set ${details.apiKeyConfigKey} <your-api-key>
|
|
2325
|
+
2. Project-wide: Add ${details.apiKeyEnvVar}=<your-api-key> to .env file in every project that uses Lingo.dev Localization Compiler
|
|
2326
|
+
3 Session-wide: Run export ${details.apiKeyEnvVar}=<your-api-key> in your terminal before running the compiler to set the API key for the current session
|
|
2342
2327
|
|
|
2343
|
-
|
|
2344
|
-
|
|
2328
|
+
⭐️ Also:
|
|
2329
|
+
1. If you don't yet have a ${details.name} API key, get one for free at ${details.getKeyLink}
|
|
2330
|
+
2. If you want to use a different LLM, raise an issue in our open-source repo: https://lingo.dev/go/gh
|
|
2331
|
+
3. If you have questions, feature requests, or would like to contribute, join our Discord: https://lingo.dev/go/discord
|
|
2332
|
+
`;
|
|
2333
|
+
console.log(message);
|
|
2334
|
+
throw new Error(`Invalid ${details.name} API key.`);
|
|
2345
2335
|
} else {
|
|
2346
|
-
|
|
2347
|
-
dedent2`
|
|
2348
|
-
\n
|
|
2336
|
+
const message = dedent2`
|
|
2349
2337
|
⚠️ Lingo.dev Compiler tried to translate your application to "${targetLocale}" locale via ${details.name} but it failed.
|
|
2350
2338
|
|
|
2351
2339
|
Error details from ${details.name} API: ${errorMessage}
|
|
@@ -2356,12 +2344,12 @@ var LCPAPI = class {
|
|
|
2356
2344
|
1. Did you set ${details.apiKeyEnvVar ? `${details.apiKeyEnvVar}` : "the provider API key"} environment variable correctly ${!details.apiKeyEnvVar ? "(if required)" : ""}?
|
|
2357
2345
|
2. Did you reach any limits of your ${details.name} account?
|
|
2358
2346
|
3. If you have questions, feature requests, or would like to contribute, join our Discord: https://lingo.dev/go/discord
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2347
|
+
`;
|
|
2348
|
+
console.log(message);
|
|
2349
|
+
throw new Error(
|
|
2350
|
+
`Translation failed for locale "${targetLocale}" using ${details.name}: ${errorMessage}`
|
|
2362
2351
|
);
|
|
2363
2352
|
}
|
|
2364
|
-
process.exit(1);
|
|
2365
2353
|
}
|
|
2366
2354
|
};
|
|
2367
2355
|
|
|
@@ -974,18 +974,16 @@ var LCP = class _LCP {
|
|
|
974
974
|
fs4.mkdirSync(dir, { recursive: true });
|
|
975
975
|
}
|
|
976
976
|
fs4.writeFileSync(filePath, "{}");
|
|
977
|
-
console.log(_dedent2.default`
|
|
978
|
-
\n
|
|
979
|
-
⚠️ Lingo.dev Compiler detected missing meta.json file in lingo directory.
|
|
980
|
-
Please restart the build / watch command to regenerate all Lingo.dev Compiler files.
|
|
981
|
-
`);
|
|
982
977
|
try {
|
|
983
978
|
fs4.rmdirSync(path5.resolve(process.cwd(), ".next"), {
|
|
984
979
|
recursive: true
|
|
985
980
|
});
|
|
986
981
|
} catch (error) {
|
|
987
982
|
}
|
|
988
|
-
|
|
983
|
+
throw new Error(_dedent2.default`
|
|
984
|
+
⚠️ Lingo.dev Compiler detected missing meta.json file in lingo directory.
|
|
985
|
+
Please restart the build / watch command to regenerate all Lingo.dev Compiler files.
|
|
986
|
+
`);
|
|
989
987
|
}
|
|
990
988
|
}
|
|
991
989
|
static getInstance(params) {
|
|
@@ -2276,33 +2274,28 @@ var LCPAPI = class {
|
|
|
2276
2274
|
static _failMissingLLMKeyCi(providerId) {
|
|
2277
2275
|
let details = providerDetails[providerId];
|
|
2278
2276
|
if (!details) {
|
|
2279
|
-
|
|
2277
|
+
throw new Error(
|
|
2280
2278
|
`Internal Error: Missing details for provider "${providerId}" when reporting missing key in CI/CD. You might be using an unsupported provider.`
|
|
2281
2279
|
);
|
|
2282
|
-
process.exit(1);
|
|
2283
2280
|
}
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
\n
|
|
2287
|
-
💡 You're using Lingo.dev Localization Compiler, and it detected unlocalized components in your app.
|
|
2288
|
-
|
|
2289
|
-
The compiler needs a ${details.name} API key to translate missing strings, but ${details.apiKeyEnvVar} is not set in the environment.
|
|
2281
|
+
const errorMessage = _dedent2.default`
|
|
2282
|
+
💡 You're using Lingo.dev Localization Compiler, and it detected unlocalized components in your app.
|
|
2290
2283
|
|
|
2291
|
-
|
|
2284
|
+
The compiler needs a ${details.name} API key to translate missing strings, but ${details.apiKeyEnvVar} is not set in the environment.
|
|
2292
2285
|
|
|
2293
|
-
|
|
2294
|
-
• Session-wide: export ${details.apiKeyEnvVar}=<your-api-key>
|
|
2295
|
-
• Project-wide / CI: add ${details.apiKeyEnvVar}=<your-api-key> to your pipeline environment variables
|
|
2286
|
+
This is unexpected: typically you run a full build locally, commit the generated translation files, and push them to CI/CD.
|
|
2296
2287
|
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
3. If the model you want to use isn't supported yet, raise an issue in our open-source repo: https://lingo.dev/go/gh
|
|
2288
|
+
However, If you want CI/CD to translate the new strings, provide the key with:
|
|
2289
|
+
• Session-wide: export ${details.apiKeyEnvVar}=<your-api-key>
|
|
2290
|
+
• Project-wide / CI: add ${details.apiKeyEnvVar}=<your-api-key> to your pipeline environment variables
|
|
2301
2291
|
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2292
|
+
⭐️ Also:
|
|
2293
|
+
1. If you don't yet have a ${details.name} API key, get one for free at ${details.getKeyLink}
|
|
2294
|
+
2. If you want to use a different LLM, update your configuration. Refer to documentation for help: https://lingo.dev/compiler
|
|
2295
|
+
3. If the model you want to use isn't supported yet, raise an issue in our open-source repo: https://lingo.dev/go/gh
|
|
2296
|
+
`;
|
|
2297
|
+
console.log(errorMessage);
|
|
2298
|
+
throw new Error(`Missing ${details.name} API key in CI/CD environment.`);
|
|
2306
2299
|
}
|
|
2307
2300
|
/**
|
|
2308
2301
|
* Show an actionable error message and exit the process when an LLM API call
|
|
@@ -2314,38 +2307,33 @@ var LCPAPI = class {
|
|
|
2314
2307
|
static _failLLMFailureLocal(providerId, targetLocale, errorMessage) {
|
|
2315
2308
|
const details = providerDetails[providerId];
|
|
2316
2309
|
if (!details) {
|
|
2317
|
-
|
|
2318
|
-
`Internal Error: Missing details for provider "${providerId}" when reporting local failure
|
|
2310
|
+
throw new Error(
|
|
2311
|
+
`Internal Error: Missing details for provider "${providerId}" when reporting local failure. Original Error: ${errorMessage}`
|
|
2319
2312
|
);
|
|
2320
|
-
console.error(`Original Error: ${errorMessage}`);
|
|
2321
|
-
process.exit(1);
|
|
2322
2313
|
}
|
|
2323
2314
|
const isInvalidApiKey = errorMessage.match("Invalid API Key");
|
|
2324
2315
|
if (isInvalidApiKey) {
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
⚠️ Lingo.dev Compiler requires a valid ${details.name} API key to translate your application.
|
|
2328
|
-
|
|
2329
|
-
It looks like you set ${details.name} API key but it is not valid. Please check your API key and try again.
|
|
2316
|
+
const message = _dedent2.default`
|
|
2317
|
+
⚠️ Lingo.dev Compiler requires a valid ${details.name} API key to translate your application.
|
|
2330
2318
|
|
|
2331
|
-
|
|
2319
|
+
It looks like you set ${details.name} API key but it is not valid. Please check your API key and try again.
|
|
2332
2320
|
|
|
2333
|
-
|
|
2334
|
-
1. User-wide: Run npx lingo.dev@latest config set ${details.apiKeyConfigKey} <your-api-key>
|
|
2335
|
-
2. Project-wide: Add ${details.apiKeyEnvVar}=<your-api-key> to .env file in every project that uses Lingo.dev Localization Compiler
|
|
2336
|
-
3 Session-wide: Run export ${details.apiKeyEnvVar}=<your-api-key> in your terminal before running the compiler to set the API key for the current session
|
|
2321
|
+
Error details from ${details.name} API: ${errorMessage}
|
|
2337
2322
|
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2323
|
+
👉 You can set the API key in one of the following ways:
|
|
2324
|
+
1. User-wide: Run npx lingo.dev@latest config set ${details.apiKeyConfigKey} <your-api-key>
|
|
2325
|
+
2. Project-wide: Add ${details.apiKeyEnvVar}=<your-api-key> to .env file in every project that uses Lingo.dev Localization Compiler
|
|
2326
|
+
3 Session-wide: Run export ${details.apiKeyEnvVar}=<your-api-key> in your terminal before running the compiler to set the API key for the current session
|
|
2342
2327
|
|
|
2343
|
-
|
|
2344
|
-
|
|
2328
|
+
⭐️ Also:
|
|
2329
|
+
1. If you don't yet have a ${details.name} API key, get one for free at ${details.getKeyLink}
|
|
2330
|
+
2. If you want to use a different LLM, raise an issue in our open-source repo: https://lingo.dev/go/gh
|
|
2331
|
+
3. If you have questions, feature requests, or would like to contribute, join our Discord: https://lingo.dev/go/discord
|
|
2332
|
+
`;
|
|
2333
|
+
console.log(message);
|
|
2334
|
+
throw new Error(`Invalid ${details.name} API key.`);
|
|
2345
2335
|
} else {
|
|
2346
|
-
|
|
2347
|
-
_dedent2.default`
|
|
2348
|
-
\n
|
|
2336
|
+
const message = _dedent2.default`
|
|
2349
2337
|
⚠️ Lingo.dev Compiler tried to translate your application to "${targetLocale}" locale via ${details.name} but it failed.
|
|
2350
2338
|
|
|
2351
2339
|
Error details from ${details.name} API: ${errorMessage}
|
|
@@ -2356,12 +2344,12 @@ var LCPAPI = class {
|
|
|
2356
2344
|
1. Did you set ${details.apiKeyEnvVar ? `${details.apiKeyEnvVar}` : "the provider API key"} environment variable correctly ${!details.apiKeyEnvVar ? "(if required)" : ""}?
|
|
2357
2345
|
2. Did you reach any limits of your ${details.name} account?
|
|
2358
2346
|
3. If you have questions, feature requests, or would like to contribute, join our Discord: https://lingo.dev/go/discord
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2347
|
+
`;
|
|
2348
|
+
console.log(message);
|
|
2349
|
+
throw new Error(
|
|
2350
|
+
`Translation failed for locale "${targetLocale}" using ${details.name}: ${errorMessage}`
|
|
2362
2351
|
);
|
|
2363
2352
|
}
|
|
2364
|
-
process.exit(1);
|
|
2365
2353
|
}
|
|
2366
2354
|
};
|
|
2367
2355
|
|
package/build/index.cjs
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkTMPC4O5Vcjs = require('./chunk-TMPC4O5V.cjs');
|
|
21
21
|
|
|
22
22
|
// src/index.ts
|
|
23
23
|
var _unplugin = require('unplugin');
|
|
@@ -25,7 +25,7 @@ var _unplugin = require('unplugin');
|
|
|
25
25
|
// package.json
|
|
26
26
|
var package_default = {
|
|
27
27
|
name: "@lingo.dev/_compiler",
|
|
28
|
-
version: "0.7.
|
|
28
|
+
version: "0.7.15",
|
|
29
29
|
description: "Lingo.dev Compiler",
|
|
30
30
|
private: false,
|
|
31
31
|
publishConfig: {
|
|
@@ -132,7 +132,7 @@ async function trackEvent(event, properties) {
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
async function getActualId() {
|
|
135
|
-
const rc =
|
|
135
|
+
const rc = _chunkTMPC4O5Vcjs.getRc.call(void 0, );
|
|
136
136
|
const apiKey = process.env.LINGODOTDEV_API_KEY || _optionalChain([rc, 'optionalAccess', _3 => _3.auth, 'optionalAccess', _4 => _4.apiKey]);
|
|
137
137
|
const apiUrl = process.env.LINGODOTDEV_API_URL || _optionalChain([rc, 'optionalAccess', _5 => _5.auth, 'optionalAccess', _6 => _6.apiUrl]) || "https://engine.lingo.dev";
|
|
138
138
|
if (apiKey) {
|
|
@@ -160,20 +160,20 @@ async function getActualId() {
|
|
|
160
160
|
// src/index.ts
|
|
161
161
|
var keyCheckers = {
|
|
162
162
|
groq: {
|
|
163
|
-
checkEnv:
|
|
164
|
-
checkRc:
|
|
163
|
+
checkEnv: _chunkTMPC4O5Vcjs.getGroqKeyFromEnv,
|
|
164
|
+
checkRc: _chunkTMPC4O5Vcjs.getGroqKeyFromRc
|
|
165
165
|
},
|
|
166
166
|
google: {
|
|
167
|
-
checkEnv:
|
|
168
|
-
checkRc:
|
|
167
|
+
checkEnv: _chunkTMPC4O5Vcjs.getGoogleKeyFromEnv,
|
|
168
|
+
checkRc: _chunkTMPC4O5Vcjs.getGoogleKeyFromRc
|
|
169
169
|
},
|
|
170
170
|
mistral: {
|
|
171
|
-
checkEnv:
|
|
172
|
-
checkRc:
|
|
171
|
+
checkEnv: _chunkTMPC4O5Vcjs.getMistralKeyFromEnv,
|
|
172
|
+
checkRc: _chunkTMPC4O5Vcjs.getMistralKeyFromRc
|
|
173
173
|
},
|
|
174
174
|
"lingo.dev": {
|
|
175
|
-
checkEnv:
|
|
176
|
-
checkRc:
|
|
175
|
+
checkEnv: _chunkTMPC4O5Vcjs.getLingoDotDevKeyFromEnv,
|
|
176
|
+
checkRc: _chunkTMPC4O5Vcjs.getLingoDotDevKeyFromRc
|
|
177
177
|
}
|
|
178
178
|
};
|
|
179
179
|
var alreadySentBuildEvent = { value: false };
|
|
@@ -189,21 +189,20 @@ function sendBuildEvent(framework, config, isDev) {
|
|
|
189
189
|
var unplugin = _unplugin.createUnplugin.call(void 0,
|
|
190
190
|
(_params, _meta) => {
|
|
191
191
|
console.log("\u2139\uFE0F Starting Lingo.dev compiler...");
|
|
192
|
-
const params = _lodash2.default.defaults(_params,
|
|
193
|
-
if (!
|
|
192
|
+
const params = _lodash2.default.defaults(_params, _chunkTMPC4O5Vcjs.defaultParams);
|
|
193
|
+
if (!_chunkTMPC4O5Vcjs.isRunningInCIOrDocker.call(void 0, )) {
|
|
194
194
|
if (params.models === "lingo.dev") {
|
|
195
195
|
validateLLMKeyDetails(["lingo.dev"]);
|
|
196
196
|
} else {
|
|
197
197
|
const configuredProviders = getConfiguredProviders(params.models);
|
|
198
198
|
validateLLMKeyDetails(configuredProviders);
|
|
199
|
-
const invalidLocales =
|
|
199
|
+
const invalidLocales = _chunkTMPC4O5Vcjs.getInvalidLocales.call(void 0,
|
|
200
200
|
params.models,
|
|
201
201
|
params.sourceLocale,
|
|
202
202
|
params.targetLocales
|
|
203
203
|
);
|
|
204
204
|
if (invalidLocales.length > 0) {
|
|
205
|
-
|
|
206
|
-
\n
|
|
205
|
+
throw new Error(_dedent2.default`
|
|
207
206
|
⚠️ Lingo.dev Localization Compiler requires LLM model setup for the following locales: ${invalidLocales.join(
|
|
208
207
|
", "
|
|
209
208
|
)}.
|
|
@@ -212,14 +211,11 @@ var unplugin = _unplugin.createUnplugin.call(void 0,
|
|
|
212
211
|
1. Refer to documentation for help: https://lingo.dev/compiler
|
|
213
212
|
2. If you want to use a different LLM, raise an issue in our open-source repo: https://lingo.dev/go/gh
|
|
214
213
|
3. If you have questions, feature requests, or would like to contribute, join our Discord: https://lingo.dev/go/discord
|
|
215
|
-
|
|
216
|
-
✨
|
|
217
214
|
`);
|
|
218
|
-
process.exit(1);
|
|
219
215
|
}
|
|
220
216
|
}
|
|
221
217
|
}
|
|
222
|
-
|
|
218
|
+
_chunkTMPC4O5Vcjs.LCPCache.ensureDictionaryFile({
|
|
223
219
|
sourceRoot: params.sourceRoot,
|
|
224
220
|
lingoDir: params.lingoDir
|
|
225
221
|
});
|
|
@@ -227,9 +223,9 @@ var unplugin = _unplugin.createUnplugin.call(void 0,
|
|
|
227
223
|
sendBuildEvent("unplugin", params, isDev);
|
|
228
224
|
return {
|
|
229
225
|
name: package_default.name,
|
|
230
|
-
loadInclude: (id) => !!id.match(
|
|
226
|
+
loadInclude: (id) => !!id.match(_chunkTMPC4O5Vcjs.LCP_DICTIONARY_FILE_NAME),
|
|
231
227
|
async load(id) {
|
|
232
|
-
const dictionary = await
|
|
228
|
+
const dictionary = await _chunkTMPC4O5Vcjs.loadDictionary.call(void 0, {
|
|
233
229
|
resourcePath: id,
|
|
234
230
|
resourceQuery: "",
|
|
235
231
|
params: {
|
|
@@ -253,7 +249,7 @@ var unplugin = _unplugin.createUnplugin.call(void 0,
|
|
|
253
249
|
enforce: "pre",
|
|
254
250
|
transform(code, id) {
|
|
255
251
|
try {
|
|
256
|
-
const result =
|
|
252
|
+
const result = _chunkTMPC4O5Vcjs.transformComponent.call(void 0, {
|
|
257
253
|
code,
|
|
258
254
|
params,
|
|
259
255
|
resourcePath: id,
|
|
@@ -295,7 +291,7 @@ var src_default = {
|
|
|
295
291
|
next: (compilerParams) => (nextConfig = {}) => {
|
|
296
292
|
const mergedParams = _lodash2.default.merge(
|
|
297
293
|
{},
|
|
298
|
-
|
|
294
|
+
_chunkTMPC4O5Vcjs.defaultParams,
|
|
299
295
|
{
|
|
300
296
|
rsc: true,
|
|
301
297
|
turbopack: {
|
|
@@ -346,7 +342,7 @@ var src_default = {
|
|
|
346
342
|
turbopackConfigPath.rules ??= {};
|
|
347
343
|
const rules = turbopackConfigPath.rules;
|
|
348
344
|
const lingoGlob = `**/*.{ts,tsx,js,jsx}`;
|
|
349
|
-
const lingoLoaderPath =
|
|
345
|
+
const lingoLoaderPath = _chunkTMPC4O5Vcjs.__require.resolve("./lingo-turbopack-loader.cjs");
|
|
350
346
|
rules[lingoGlob] = {
|
|
351
347
|
loaders: [
|
|
352
348
|
{
|
|
@@ -406,7 +402,7 @@ var src_default = {
|
|
|
406
402
|
vite: (compilerParams) => (config) => {
|
|
407
403
|
const mergedParams = _lodash2.default.merge(
|
|
408
404
|
{},
|
|
409
|
-
|
|
405
|
+
_chunkTMPC4O5Vcjs.defaultParams,
|
|
410
406
|
{ rsc: false },
|
|
411
407
|
compilerParams
|
|
412
408
|
);
|
|
@@ -420,7 +416,7 @@ var src_default = {
|
|
|
420
416
|
};
|
|
421
417
|
function getConfiguredProviders(models) {
|
|
422
418
|
return _lodash2.default.chain(Object.values(models)).map((modelString) => modelString.split(":")[0]).filter(Boolean).uniq().filter(
|
|
423
|
-
(providerId) =>
|
|
419
|
+
(providerId) => _chunkTMPC4O5Vcjs.providerDetails.hasOwnProperty(providerId) && keyCheckers.hasOwnProperty(providerId)
|
|
424
420
|
).value();
|
|
425
421
|
}
|
|
426
422
|
function validateLLMKeyDetails(configuredProviders) {
|
|
@@ -431,7 +427,7 @@ function validateLLMKeyDetails(configuredProviders) {
|
|
|
431
427
|
const missingProviders = [];
|
|
432
428
|
const foundProviders = [];
|
|
433
429
|
for (const providerId of configuredProviders) {
|
|
434
|
-
const details =
|
|
430
|
+
const details = _chunkTMPC4O5Vcjs.providerDetails[providerId];
|
|
435
431
|
const checkers = keyCheckers[providerId];
|
|
436
432
|
if (!details || !checkers) continue;
|
|
437
433
|
const foundInEnv = !!checkers.checkEnv();
|
|
@@ -466,16 +462,15 @@ function validateLLMKeyDetails(configuredProviders) {
|
|
|
466
462
|
⭐️ If you don't yet have a ${status.details.name} API key, get one for free at ${status.details.getKeyLink}
|
|
467
463
|
`);
|
|
468
464
|
}
|
|
469
|
-
|
|
465
|
+
const errorMessage = _dedent2.default`
|
|
470
466
|
\n
|
|
471
467
|
⭐️ Also:
|
|
472
468
|
1. If you want to use a different LLM, update your configuration. Refer to documentation for help: https://lingo.dev/compiler
|
|
473
469
|
2. If the model/provider you want to use isn't supported yet, raise an issue in our open-source repo: https://lingo.dev/go/gh
|
|
474
470
|
3. If you have questions, feature requests, or would like to contribute, join our Discord: https://lingo.dev/go/discord
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
process.exit(1);
|
|
471
|
+
`;
|
|
472
|
+
console.log(errorMessage);
|
|
473
|
+
throw new Error("Missing required LLM API keys. See details above.");
|
|
479
474
|
} else if (foundProviders.length > 0) {
|
|
480
475
|
console.log(_dedent2.default`
|
|
481
476
|
\n
|
package/build/index.mjs
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
loadDictionary,
|
|
18
18
|
providerDetails,
|
|
19
19
|
transformComponent
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-COKHINWO.mjs";
|
|
21
21
|
|
|
22
22
|
// src/index.ts
|
|
23
23
|
import { createUnplugin } from "unplugin";
|
|
@@ -25,7 +25,7 @@ import { createUnplugin } from "unplugin";
|
|
|
25
25
|
// package.json
|
|
26
26
|
var package_default = {
|
|
27
27
|
name: "@lingo.dev/_compiler",
|
|
28
|
-
version: "0.7.
|
|
28
|
+
version: "0.7.15",
|
|
29
29
|
description: "Lingo.dev Compiler",
|
|
30
30
|
private: false,
|
|
31
31
|
publishConfig: {
|
|
@@ -202,8 +202,7 @@ var unplugin = createUnplugin(
|
|
|
202
202
|
params.targetLocales
|
|
203
203
|
);
|
|
204
204
|
if (invalidLocales.length > 0) {
|
|
205
|
-
|
|
206
|
-
\n
|
|
205
|
+
throw new Error(dedent`
|
|
207
206
|
⚠️ Lingo.dev Localization Compiler requires LLM model setup for the following locales: ${invalidLocales.join(
|
|
208
207
|
", "
|
|
209
208
|
)}.
|
|
@@ -212,10 +211,7 @@ var unplugin = createUnplugin(
|
|
|
212
211
|
1. Refer to documentation for help: https://lingo.dev/compiler
|
|
213
212
|
2. If you want to use a different LLM, raise an issue in our open-source repo: https://lingo.dev/go/gh
|
|
214
213
|
3. If you have questions, feature requests, or would like to contribute, join our Discord: https://lingo.dev/go/discord
|
|
215
|
-
|
|
216
|
-
✨
|
|
217
214
|
`);
|
|
218
|
-
process.exit(1);
|
|
219
215
|
}
|
|
220
216
|
}
|
|
221
217
|
}
|
|
@@ -466,16 +462,15 @@ function validateLLMKeyDetails(configuredProviders) {
|
|
|
466
462
|
⭐️ If you don't yet have a ${status.details.name} API key, get one for free at ${status.details.getKeyLink}
|
|
467
463
|
`);
|
|
468
464
|
}
|
|
469
|
-
|
|
465
|
+
const errorMessage = dedent`
|
|
470
466
|
\n
|
|
471
467
|
⭐️ Also:
|
|
472
468
|
1. If you want to use a different LLM, update your configuration. Refer to documentation for help: https://lingo.dev/compiler
|
|
473
469
|
2. If the model/provider you want to use isn't supported yet, raise an issue in our open-source repo: https://lingo.dev/go/gh
|
|
474
470
|
3. If you have questions, feature requests, or would like to contribute, join our Discord: https://lingo.dev/go/discord
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
process.exit(1);
|
|
471
|
+
`;
|
|
472
|
+
console.log(errorMessage);
|
|
473
|
+
throw new Error("Missing required LLM API keys. See details above.");
|
|
479
474
|
} else if (foundProviders.length > 0) {
|
|
480
475
|
console.log(dedent`
|
|
481
476
|
\n
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkTMPC4O5Vcjs = require('./chunk-TMPC4O5V.cjs');
|
|
5
5
|
|
|
6
6
|
// src/lingo-turbopack-loader.ts
|
|
7
7
|
async function lingo_turbopack_loader_default(source) {
|
|
@@ -9,7 +9,7 @@ async function lingo_turbopack_loader_default(source) {
|
|
|
9
9
|
const params = this.getOptions();
|
|
10
10
|
const isDev = process.env.NODE_ENV !== "production";
|
|
11
11
|
try {
|
|
12
|
-
const dictionary = await
|
|
12
|
+
const dictionary = await _chunkTMPC4O5Vcjs.loadDictionary.call(void 0, {
|
|
13
13
|
resourcePath: this.resourcePath,
|
|
14
14
|
resourceQuery: this.resourceQuery,
|
|
15
15
|
params,
|
|
@@ -21,7 +21,7 @@ async function lingo_turbopack_loader_default(source) {
|
|
|
21
21
|
const code = `export default ${JSON.stringify(dictionary, null, 2)};`;
|
|
22
22
|
return callback(null, code);
|
|
23
23
|
}
|
|
24
|
-
const result =
|
|
24
|
+
const result = _chunkTMPC4O5Vcjs.transformComponent.call(void 0, {
|
|
25
25
|
code: source,
|
|
26
26
|
params,
|
|
27
27
|
resourcePath: this.resourcePath,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingo.dev/_compiler",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.15",
|
|
4
4
|
"description": "Lingo.dev Compiler",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"zod": "^3.25.76",
|
|
53
53
|
"posthog-node": "^5.5.1",
|
|
54
54
|
"node-machine-id": "^1.1.12",
|
|
55
|
-
"@lingo.dev/_sdk": "0.12.
|
|
56
|
-
"@lingo.dev/_spec": "0.41.
|
|
55
|
+
"@lingo.dev/_sdk": "0.12.6",
|
|
56
|
+
"@lingo.dev/_spec": "0.41.1"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"dev": "tsup --watch",
|