Skip to content

Commit 365743e

Browse files
authored
Merge branch 'main' into fix/bump-biome-deps
2 parents 4421f6a + dbbb245 commit 365743e

34 files changed

+308
-306
lines changed

demo/new-compiler-next16/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @compiler/demo-next
22

3+
## 0.1.27
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`73a8c73`](https://github.com/lingodotdev/lingo.dev/commit/73a8c731f5af03db9c165000e87ee5e5a1086a48)]:
8+
- @lingo.dev/compiler@0.4.0
9+
310
## 0.1.26
411

512
### Patch Changes

demo/new-compiler-next16/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@compiler/demo-next",
3-
"version": "0.1.26",
3+
"version": "0.1.27",
44
"private": true,
55
"scripts": {
66
"dev": "next dev",

packages/cli/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# lingo.dev
22

3+
## 0.133.0
4+
5+
### Minor Changes
6+
7+
- [#2035](https://github.com/lingodotdev/lingo.dev/pull/2035) [`73a8c73`](https://github.com/lingodotdev/lingo.dev/commit/73a8c731f5af03db9c165000e87ee5e5a1086a48) Thanks [@AndreyHirsa](https://github.com/AndreyHirsa)! - Migrate SDK and CLI to unified API endpoints. All requests now use `api.lingo.dev` with `X-API-Key` auth. Added `engineId` config option (auto-migrated from `vNext`)
8+
9+
### Patch Changes
10+
11+
- Updated dependencies [[`73a8c73`](https://github.com/lingodotdev/lingo.dev/commit/73a8c731f5af03db9c165000e87ee5e5a1086a48)]:
12+
- @lingo.dev/_compiler@0.12.0
13+
- @lingo.dev/_spec@0.49.0
14+
- @lingo.dev/_sdk@0.16.0
15+
316
## 0.132.10
417

518
### Patch Changes

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lingo.dev",
3-
"version": "0.132.10",
3+
"version": "0.133.0",
44
"description": "Lingo.dev CLI",
55
"private": false,
66
"repository": {

packages/cli/src/cli/cmd/ci/index.ts

Lines changed: 16 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import path from "path";
21
import { Command } from "interactive-commander";
32
import createOra from "ora";
43
import { getSettings } from "../../utils/settings";
@@ -7,7 +6,6 @@ import { IIntegrationFlow } from "./flows/_base";
76
import { PullRequestFlow } from "./flows/pull-request";
87
import { InBranchFlow } from "./flows/in-branch";
98
import { getPlatformKit } from "./platforms";
10-
import { getConfig } from "../../utils/config";
119

1210
interface CIOptions {
1311
parallel?: boolean;
@@ -72,53 +70,29 @@ export default new Command()
7270
parseBooleanArg,
7371
)
7472
.action(async (options: CIOptions) => {
75-
const configDir = options.workingDirectory
76-
? path.resolve(process.cwd(), options.workingDirectory)
77-
: process.cwd();
78-
const originalCwd = process.cwd();
79-
let config;
80-
try {
81-
process.chdir(configDir);
82-
config = getConfig(false);
83-
} finally {
84-
process.chdir(originalCwd);
85-
}
86-
87-
const isVNext = !!config?.vNext;
88-
8973
const settings = getSettings(options.apiKey);
9074

91-
if (isVNext) {
92-
if (!settings.auth.vnext?.apiKey) {
93-
console.error(
94-
"No LINGO_API_KEY provided. vNext requires LINGO_API_KEY environment variable.",
95-
);
96-
return;
97-
}
98-
} else {
99-
if (!settings.auth.apiKey) {
100-
console.error("No API key provided");
101-
return;
102-
}
75+
if (!settings.auth.apiKey) {
76+
console.error(
77+
"No API key provided. Set LINGO_API_KEY environment variable or use --api-key flag.",
78+
);
79+
return;
80+
}
10381

104-
const authenticator = createAuthenticator({
105-
apiUrl: settings.auth.apiUrl,
106-
apiKey: settings.auth.apiKey,
107-
});
82+
const authenticator = createAuthenticator({
83+
apiUrl: settings.auth.apiUrl,
84+
apiKey: settings.auth.apiKey,
85+
});
10886

109-
const auth = await authenticator.whoami();
110-
if (!auth) {
111-
console.error("Not authenticated");
112-
return;
113-
}
87+
const auth = await authenticator.whoami();
88+
if (!auth) {
89+
console.error("Not authenticated");
90+
return;
11491
}
11592

11693
const env = {
11794
...(settings.auth.apiKey && {
118-
LINGODOTDEV_API_KEY: settings.auth.apiKey,
119-
}),
120-
...(settings.auth.vnext?.apiKey && {
121-
LINGO_API_KEY: settings.auth.vnext.apiKey,
95+
LINGO_API_KEY: settings.auth.apiKey,
12296
}),
12397
LINGODOTDEV_PULL_REQUEST: options.pullRequest?.toString() || "false",
12498
...(options.commitMessage && {
@@ -162,7 +136,7 @@ export default new Command()
162136
}
163137

164138
const hasChanges = await flow.run({
165-
parallel: isVNext || options.parallel,
139+
parallel: options.parallel,
166140
});
167141
if (!hasChanges) {
168142
return;

packages/cli/src/cli/cmd/ci/platforms/_base.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export abstract class PlatformKit<
4747

4848
get config() {
4949
const env = Z.object({
50+
LINGO_API_KEY: Z.string().optional(),
5051
LINGODOTDEV_API_KEY: Z.string().optional(),
5152
LINGODOTDEV_PULL_REQUEST: Z.preprocess(
5253
(val) => val === "true" || val === true,
@@ -68,7 +69,7 @@ export abstract class PlatformKit<
6869
}).parse(process.env);
6970

7071
return {
71-
replexicaApiKey: env.LINGODOTDEV_API_KEY || "",
72+
replexicaApiKey: env.LINGO_API_KEY || env.LINGODOTDEV_API_KEY || "",
7273
isPullRequestMode: env.LINGODOTDEV_PULL_REQUEST,
7374
commitMessage: env.LINGODOTDEV_COMMIT_MESSAGE || defaultMessage,
7475
pullRequestTitle: env.LINGODOTDEV_PULL_REQUEST_TITLE || defaultMessage,

packages/cli/src/cli/cmd/i18n.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ export default new Command()
439439
let processPayload = createProcessor(i18nConfig!.provider, {
440440
apiKey: settings.auth.apiKey,
441441
apiUrl: settings.auth.apiUrl,
442+
engineId: i18nConfig!.engineId,
442443
});
443444
processPayload = withExponentialBackoff(
444445
processPayload,

packages/cli/src/cli/cmd/login.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Press Enter to open the browser for authentication.
4949
5050
---
5151
52-
Having issues? Put LINGODOTDEV_API_KEY in your .env file instead.
52+
Having issues? Put LINGO_API_KEY in your .env file instead.
5353
`.trim() + "\n",
5454
);
5555

packages/cli/src/cli/cmd/run/setup.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,18 @@ export default async function setup(input: CmdRunContext) {
5050
{
5151
title: "Selecting localization provider",
5252
task: async (ctx, task) => {
53-
const isPseudo = ctx.flags.pseudo || ctx.config?.dev?.usePseudotranslator;
53+
const isPseudo =
54+
ctx.flags.pseudo || ctx.config?.dev?.usePseudotranslator;
5455
const provider = isPseudo ? "pseudo" : ctx.config?.provider;
55-
const vNext = ctx.config?.vNext;
56-
ctx.localizer = createLocalizer(provider, ctx.flags.apiKey, vNext);
56+
const engineId = ctx.config?.engineId;
57+
ctx.localizer = createLocalizer(provider, engineId, ctx.flags.apiKey);
5758
if (!ctx.localizer) {
5859
throw new Error(
5960
"Could not create localization provider. Please check your i18n.json configuration.",
6061
);
6162
}
6263
task.title =
63-
ctx.localizer.id === "Lingo.dev" ||
64-
ctx.localizer.id === "Lingo.dev vNext"
64+
ctx.localizer.id === "Lingo.dev"
6565
? `Using ${chalk.hex(colors.green)(ctx.localizer.id)} provider`
6666
: ctx.localizer.id === "pseudo"
6767
? `Using ${chalk.hex(colors.blue)("pseudo")} mode for testing`
@@ -71,8 +71,7 @@ export default async function setup(input: CmdRunContext) {
7171
{
7272
title: "Checking authentication",
7373
enabled: (ctx) =>
74-
(ctx.localizer?.id === "Lingo.dev" ||
75-
ctx.localizer?.id === "Lingo.dev vNext") &&
74+
ctx.localizer?.id === "Lingo.dev" &&
7675
!ctx.flags.pseudo &&
7776
!ctx.config?.dev?.usePseudotranslator,
7877
task: async (ctx, task) => {
@@ -87,9 +86,7 @@ export default async function setup(input: CmdRunContext) {
8786
},
8887
{
8988
title: "Validating configuration",
90-
enabled: (ctx) =>
91-
ctx.localizer?.id !== "Lingo.dev" &&
92-
ctx.localizer?.id !== "Lingo.dev vNext",
89+
enabled: (ctx) => ctx.localizer?.id !== "Lingo.dev",
9390
task: async (ctx, task) => {
9491
const validationStatus = await ctx.localizer!.validateSettings!();
9592
if (!validationStatus.valid) {
@@ -103,9 +100,7 @@ export default async function setup(input: CmdRunContext) {
103100
{
104101
title: "Initializing localization provider",
105102
async task(ctx, task) {
106-
const isLingoDotDev =
107-
ctx.localizer!.id === "Lingo.dev" ||
108-
ctx.localizer!.id === "Lingo.dev vNext";
103+
const isLingoDotDev = ctx.localizer!.id === "Lingo.dev";
109104
const isPseudo = ctx.localizer!.id === "pseudo";
110105

111106
const subTasks = isLingoDotDev

packages/cli/src/cli/localizer/_types.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ export type LocalizerProgressFn = (
1717
) => void;
1818

1919
export interface ILocalizer {
20-
id:
21-
| "Lingo.dev"
22-
| "Lingo.dev vNext"
23-
| "pseudo"
24-
| NonNullable<I18nConfig["provider"]>["id"];
20+
id: "Lingo.dev" | "pseudo" | NonNullable<I18nConfig["provider"]>["id"];
2521
checkAuth: () => Promise<{
2622
authenticated: boolean;
2723
username?: string;

0 commit comments

Comments
 (0)