@lingo.dev/_compiler 0.7.1 → 0.7.2

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/index.cjs CHANGED
@@ -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.1",
28
+ version: "0.7.2",
29
29
  description: "Lingo.dev Compiler",
30
30
  private: false,
31
31
  publishConfig: {
@@ -41,7 +41,8 @@ var package_default = {
41
41
  ],
42
42
  scripts: {
43
43
  dev: "tsup --watch",
44
- build: "tsc --noEmit && tsup",
44
+ build: "pnpm typecheck && tsup",
45
+ typecheck: "tsc --noEmit",
45
46
  clean: "rm -rf build",
46
47
  test: "vitest --run",
47
48
  "test:watch": "vitest -w"
@@ -84,7 +85,7 @@ var package_default = {
84
85
  unplugin: "^2.1.2",
85
86
  vitest: "^2.1.4",
86
87
  zod: "^3.25.76",
87
- "posthog-node": "^4.17.0",
88
+ "posthog-node": "^5.5.1",
88
89
  "node-machine-id": "^1.1.12"
89
90
  },
90
91
  packageManager: "pnpm@9.12.3"
@@ -269,6 +270,28 @@ var unplugin = _unplugin.createUnplugin.call(void 0,
269
270
  }
270
271
  );
271
272
  var src_default = {
273
+ /**
274
+ * Initializes Lingo.dev Compiler for Next.js (App Router).
275
+ *
276
+ * @param compilerParams - The compiler parameters.
277
+ *
278
+ * @returns The Next.js configuration.
279
+ *
280
+ * @example Configuration for Next.js's default template
281
+ * ```ts
282
+ * import lingoCompiler from "lingo.dev/compiler";
283
+ * import type { NextConfig } from "next";
284
+ *
285
+ * const nextConfig: NextConfig = {
286
+ * /* config options here *\/
287
+ * };
288
+ *
289
+ * export default lingoCompiler.next({
290
+ * sourceRoot: "app",
291
+ * models: "lingo.dev",
292
+ * })(nextConfig);
293
+ * ```
294
+ */
272
295
  next: (compilerParams) => (nextConfig = {}) => {
273
296
  const mergedParams = _lodash2.default.merge(
274
297
  {},
@@ -335,6 +358,51 @@ var src_default = {
335
358
  }
336
359
  return nextConfig;
337
360
  },
361
+ /**
362
+ * Initializes Lingo.dev Compiler for Vite.
363
+ *
364
+ * @param compilerParams - The compiler parameters.
365
+ *
366
+ * @returns The Vite configuration.
367
+ *
368
+ * @example Configuration for Vite's "react-ts" template
369
+ * ```ts
370
+ * import { defineConfig, type UserConfig } from "vite";
371
+ * import react from "@vitejs/plugin-react";
372
+ * import lingoCompiler from "lingo.dev/compiler";
373
+ *
374
+ * // https://vite.dev/config/
375
+ * const viteConfig: UserConfig = {
376
+ * plugins: [react()],
377
+ * };
378
+ *
379
+ * export default defineConfig(() =>
380
+ * lingoCompiler.vite({
381
+ * models: "lingo.dev",
382
+ * })(viteConfig)
383
+ * );
384
+ * ```
385
+ *
386
+ * @example Configuration for React Router's default template
387
+ * ```ts
388
+ * import { reactRouter } from "@react-router/dev/vite";
389
+ * import tailwindcss from "@tailwindcss/vite";
390
+ * import lingoCompiler from "lingo.dev/compiler";
391
+ * import { defineConfig, type UserConfig } from "vite";
392
+ * import tsconfigPaths from "vite-tsconfig-paths";
393
+ *
394
+ * const viteConfig: UserConfig = {
395
+ * plugins: [tailwindcss(), reactRouter(), tsconfigPaths()],
396
+ * };
397
+ *
398
+ * export default defineConfig(() =>
399
+ * lingoCompiler.vite({
400
+ * sourceRoot: "app",
401
+ * models: "lingo.dev",
402
+ * })(viteConfig)
403
+ * );
404
+ * ```
405
+ */
338
406
  vite: (compilerParams) => (config) => {
339
407
  const mergedParams = _lodash2.default.merge(
340
408
  {},
package/build/index.d.cts CHANGED
@@ -125,12 +125,79 @@ type ModelIdentifier = `${string}:${string}`;
125
125
  declare const defaultParams: CompilerParams;
126
126
 
127
127
  declare const _default: {
128
+ /**
129
+ * Initializes Lingo.dev Compiler for Next.js (App Router).
130
+ *
131
+ * @param compilerParams - The compiler parameters.
132
+ *
133
+ * @returns The Next.js configuration.
134
+ *
135
+ * @example Configuration for Next.js's default template
136
+ * ```ts
137
+ * import lingoCompiler from "lingo.dev/compiler";
138
+ * import type { NextConfig } from "next";
139
+ *
140
+ * const nextConfig: NextConfig = {
141
+ * /* config options here *\/
142
+ * };
143
+ *
144
+ * export default lingoCompiler.next({
145
+ * sourceRoot: "app",
146
+ * models: "lingo.dev",
147
+ * })(nextConfig);
148
+ * ```
149
+ */
128
150
  next: (compilerParams?: Partial<typeof defaultParams> & {
129
151
  turbopack?: {
130
152
  enabled?: boolean | "auto";
131
153
  useLegacyTurbo?: boolean;
132
154
  };
133
155
  }) => (nextConfig?: any) => NextConfig;
156
+ /**
157
+ * Initializes Lingo.dev Compiler for Vite.
158
+ *
159
+ * @param compilerParams - The compiler parameters.
160
+ *
161
+ * @returns The Vite configuration.
162
+ *
163
+ * @example Configuration for Vite's "react-ts" template
164
+ * ```ts
165
+ * import { defineConfig, type UserConfig } from "vite";
166
+ * import react from "@vitejs/plugin-react";
167
+ * import lingoCompiler from "lingo.dev/compiler";
168
+ *
169
+ * // https://vite.dev/config/
170
+ * const viteConfig: UserConfig = {
171
+ * plugins: [react()],
172
+ * };
173
+ *
174
+ * export default defineConfig(() =>
175
+ * lingoCompiler.vite({
176
+ * models: "lingo.dev",
177
+ * })(viteConfig)
178
+ * );
179
+ * ```
180
+ *
181
+ * @example Configuration for React Router's default template
182
+ * ```ts
183
+ * import { reactRouter } from "@react-router/dev/vite";
184
+ * import tailwindcss from "@tailwindcss/vite";
185
+ * import lingoCompiler from "lingo.dev/compiler";
186
+ * import { defineConfig, type UserConfig } from "vite";
187
+ * import tsconfigPaths from "vite-tsconfig-paths";
188
+ *
189
+ * const viteConfig: UserConfig = {
190
+ * plugins: [tailwindcss(), reactRouter(), tsconfigPaths()],
191
+ * };
192
+ *
193
+ * export default defineConfig(() =>
194
+ * lingoCompiler.vite({
195
+ * sourceRoot: "app",
196
+ * models: "lingo.dev",
197
+ * })(viteConfig)
198
+ * );
199
+ * ```
200
+ */
134
201
  vite: (compilerParams?: Partial<typeof defaultParams>) => (config: any) => any;
135
202
  };
136
203
 
package/build/index.d.ts CHANGED
@@ -125,12 +125,79 @@ type ModelIdentifier = `${string}:${string}`;
125
125
  declare const defaultParams: CompilerParams;
126
126
 
127
127
  declare const _default: {
128
+ /**
129
+ * Initializes Lingo.dev Compiler for Next.js (App Router).
130
+ *
131
+ * @param compilerParams - The compiler parameters.
132
+ *
133
+ * @returns The Next.js configuration.
134
+ *
135
+ * @example Configuration for Next.js's default template
136
+ * ```ts
137
+ * import lingoCompiler from "lingo.dev/compiler";
138
+ * import type { NextConfig } from "next";
139
+ *
140
+ * const nextConfig: NextConfig = {
141
+ * /* config options here *\/
142
+ * };
143
+ *
144
+ * export default lingoCompiler.next({
145
+ * sourceRoot: "app",
146
+ * models: "lingo.dev",
147
+ * })(nextConfig);
148
+ * ```
149
+ */
128
150
  next: (compilerParams?: Partial<typeof defaultParams> & {
129
151
  turbopack?: {
130
152
  enabled?: boolean | "auto";
131
153
  useLegacyTurbo?: boolean;
132
154
  };
133
155
  }) => (nextConfig?: any) => NextConfig;
156
+ /**
157
+ * Initializes Lingo.dev Compiler for Vite.
158
+ *
159
+ * @param compilerParams - The compiler parameters.
160
+ *
161
+ * @returns The Vite configuration.
162
+ *
163
+ * @example Configuration for Vite's "react-ts" template
164
+ * ```ts
165
+ * import { defineConfig, type UserConfig } from "vite";
166
+ * import react from "@vitejs/plugin-react";
167
+ * import lingoCompiler from "lingo.dev/compiler";
168
+ *
169
+ * // https://vite.dev/config/
170
+ * const viteConfig: UserConfig = {
171
+ * plugins: [react()],
172
+ * };
173
+ *
174
+ * export default defineConfig(() =>
175
+ * lingoCompiler.vite({
176
+ * models: "lingo.dev",
177
+ * })(viteConfig)
178
+ * );
179
+ * ```
180
+ *
181
+ * @example Configuration for React Router's default template
182
+ * ```ts
183
+ * import { reactRouter } from "@react-router/dev/vite";
184
+ * import tailwindcss from "@tailwindcss/vite";
185
+ * import lingoCompiler from "lingo.dev/compiler";
186
+ * import { defineConfig, type UserConfig } from "vite";
187
+ * import tsconfigPaths from "vite-tsconfig-paths";
188
+ *
189
+ * const viteConfig: UserConfig = {
190
+ * plugins: [tailwindcss(), reactRouter(), tsconfigPaths()],
191
+ * };
192
+ *
193
+ * export default defineConfig(() =>
194
+ * lingoCompiler.vite({
195
+ * sourceRoot: "app",
196
+ * models: "lingo.dev",
197
+ * })(viteConfig)
198
+ * );
199
+ * ```
200
+ */
134
201
  vite: (compilerParams?: Partial<typeof defaultParams>) => (config: any) => any;
135
202
  };
136
203
 
package/build/index.mjs CHANGED
@@ -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.1",
28
+ version: "0.7.2",
29
29
  description: "Lingo.dev Compiler",
30
30
  private: false,
31
31
  publishConfig: {
@@ -41,7 +41,8 @@ var package_default = {
41
41
  ],
42
42
  scripts: {
43
43
  dev: "tsup --watch",
44
- build: "tsc --noEmit && tsup",
44
+ build: "pnpm typecheck && tsup",
45
+ typecheck: "tsc --noEmit",
45
46
  clean: "rm -rf build",
46
47
  test: "vitest --run",
47
48
  "test:watch": "vitest -w"
@@ -84,7 +85,7 @@ var package_default = {
84
85
  unplugin: "^2.1.2",
85
86
  vitest: "^2.1.4",
86
87
  zod: "^3.25.76",
87
- "posthog-node": "^4.17.0",
88
+ "posthog-node": "^5.5.1",
88
89
  "node-machine-id": "^1.1.12"
89
90
  },
90
91
  packageManager: "pnpm@9.12.3"
@@ -269,6 +270,28 @@ var unplugin = createUnplugin(
269
270
  }
270
271
  );
271
272
  var src_default = {
273
+ /**
274
+ * Initializes Lingo.dev Compiler for Next.js (App Router).
275
+ *
276
+ * @param compilerParams - The compiler parameters.
277
+ *
278
+ * @returns The Next.js configuration.
279
+ *
280
+ * @example Configuration for Next.js's default template
281
+ * ```ts
282
+ * import lingoCompiler from "lingo.dev/compiler";
283
+ * import type { NextConfig } from "next";
284
+ *
285
+ * const nextConfig: NextConfig = {
286
+ * /* config options here *\/
287
+ * };
288
+ *
289
+ * export default lingoCompiler.next({
290
+ * sourceRoot: "app",
291
+ * models: "lingo.dev",
292
+ * })(nextConfig);
293
+ * ```
294
+ */
272
295
  next: (compilerParams) => (nextConfig = {}) => {
273
296
  const mergedParams = _.merge(
274
297
  {},
@@ -335,6 +358,51 @@ var src_default = {
335
358
  }
336
359
  return nextConfig;
337
360
  },
361
+ /**
362
+ * Initializes Lingo.dev Compiler for Vite.
363
+ *
364
+ * @param compilerParams - The compiler parameters.
365
+ *
366
+ * @returns The Vite configuration.
367
+ *
368
+ * @example Configuration for Vite's "react-ts" template
369
+ * ```ts
370
+ * import { defineConfig, type UserConfig } from "vite";
371
+ * import react from "@vitejs/plugin-react";
372
+ * import lingoCompiler from "lingo.dev/compiler";
373
+ *
374
+ * // https://vite.dev/config/
375
+ * const viteConfig: UserConfig = {
376
+ * plugins: [react()],
377
+ * };
378
+ *
379
+ * export default defineConfig(() =>
380
+ * lingoCompiler.vite({
381
+ * models: "lingo.dev",
382
+ * })(viteConfig)
383
+ * );
384
+ * ```
385
+ *
386
+ * @example Configuration for React Router's default template
387
+ * ```ts
388
+ * import { reactRouter } from "@react-router/dev/vite";
389
+ * import tailwindcss from "@tailwindcss/vite";
390
+ * import lingoCompiler from "lingo.dev/compiler";
391
+ * import { defineConfig, type UserConfig } from "vite";
392
+ * import tsconfigPaths from "vite-tsconfig-paths";
393
+ *
394
+ * const viteConfig: UserConfig = {
395
+ * plugins: [tailwindcss(), reactRouter(), tsconfigPaths()],
396
+ * };
397
+ *
398
+ * export default defineConfig(() =>
399
+ * lingoCompiler.vite({
400
+ * sourceRoot: "app",
401
+ * models: "lingo.dev",
402
+ * })(viteConfig)
403
+ * );
404
+ * ```
405
+ */
338
406
  vite: (compilerParams) => (config) => {
339
407
  const mergedParams = _.merge(
340
408
  {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingo.dev/_compiler",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "Lingo.dev Compiler",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -50,14 +50,15 @@
50
50
  "unplugin": "^2.1.2",
51
51
  "vitest": "^2.1.4",
52
52
  "zod": "^3.25.76",
53
- "posthog-node": "^4.17.0",
53
+ "posthog-node": "^5.5.1",
54
54
  "node-machine-id": "^1.1.12",
55
- "@lingo.dev/_sdk": "0.10.2",
56
- "@lingo.dev/_spec": "0.39.3"
55
+ "@lingo.dev/_spec": "0.39.3",
56
+ "@lingo.dev/_sdk": "0.11.0"
57
57
  },
58
58
  "scripts": {
59
59
  "dev": "tsup --watch",
60
- "build": "tsc --noEmit && tsup",
60
+ "build": "pnpm typecheck && tsup",
61
+ "typecheck": "tsc --noEmit",
61
62
  "clean": "rm -rf build",
62
63
  "test": "vitest --run",
63
64
  "test:watch": "vitest -w"