@lingo.dev/_compiler 0.3.4 → 0.4.0

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.
@@ -0,0 +1,47 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkOO4SG7IHcjs = require('./chunk-OO4SG7IH.cjs');
5
+
6
+ // src/lingo-turbopack-loader.ts
7
+ async function lingo_turbopack_loader_default(source) {
8
+ const callback = this.async();
9
+ const params = this.getOptions();
10
+ const isDev = process.env.NODE_ENV !== "production";
11
+ try {
12
+ const dictionary = await _chunkOO4SG7IHcjs.loadDictionary.call(void 0, {
13
+ resourcePath: this.resourcePath,
14
+ resourceQuery: this.resourceQuery,
15
+ params,
16
+ sourceRoot: params.sourceRoot,
17
+ lingoDir: params.lingoDir,
18
+ isDev
19
+ });
20
+ if (dictionary) {
21
+ const code = `export default ${JSON.stringify(dictionary, null, 2)};`;
22
+ return callback(null, code);
23
+ }
24
+ const result = _chunkOO4SG7IHcjs.transformComponent.call(void 0, {
25
+ code: source,
26
+ params,
27
+ resourcePath: this.resourcePath,
28
+ sourceRoot: params.sourceRoot
29
+ });
30
+ return callback(
31
+ null,
32
+ result.code,
33
+ result.map ? JSON.stringify(result.map) : void 0
34
+ );
35
+ } catch (error) {
36
+ console.error(
37
+ `\u26A0\uFE0F Lingo.dev compiler (Turbopack) failed for ${this.resourcePath}:`
38
+ );
39
+ console.error("\u26A0\uFE0F Details:", error);
40
+ callback(error);
41
+ }
42
+ }
43
+
44
+
45
+ exports.default = lingo_turbopack_loader_default;
46
+
47
+ module.exports = exports.default;
@@ -0,0 +1,3 @@
1
+ declare function export_default(this: any, source: string): Promise<any>;
2
+
3
+ export = export_default;
@@ -0,0 +1,3 @@
1
+ declare function export_default(this: any, source: string): Promise<any>;
2
+
3
+ export { export_default as default };
@@ -0,0 +1,45 @@
1
+ import {
2
+ loadDictionary,
3
+ transformComponent
4
+ } from "./chunk-YT6JFNHK.mjs";
5
+
6
+ // src/lingo-turbopack-loader.ts
7
+ async function lingo_turbopack_loader_default(source) {
8
+ const callback = this.async();
9
+ const params = this.getOptions();
10
+ const isDev = process.env.NODE_ENV !== "production";
11
+ try {
12
+ const dictionary = await loadDictionary({
13
+ resourcePath: this.resourcePath,
14
+ resourceQuery: this.resourceQuery,
15
+ params,
16
+ sourceRoot: params.sourceRoot,
17
+ lingoDir: params.lingoDir,
18
+ isDev
19
+ });
20
+ if (dictionary) {
21
+ const code = `export default ${JSON.stringify(dictionary, null, 2)};`;
22
+ return callback(null, code);
23
+ }
24
+ const result = transformComponent({
25
+ code: source,
26
+ params,
27
+ resourcePath: this.resourcePath,
28
+ sourceRoot: params.sourceRoot
29
+ });
30
+ return callback(
31
+ null,
32
+ result.code,
33
+ result.map ? JSON.stringify(result.map) : void 0
34
+ );
35
+ } catch (error) {
36
+ console.error(
37
+ `\u26A0\uFE0F Lingo.dev compiler (Turbopack) failed for ${this.resourcePath}:`
38
+ );
39
+ console.error("\u26A0\uFE0F Details:", error);
40
+ callback(error);
41
+ }
42
+ }
43
+ export {
44
+ lingo_turbopack_loader_default as default
45
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingo.dev/_compiler",
3
- "version": "0.3.4",
3
+ "version": "0.4.0",
4
4
  "description": "Lingo.dev Compiler",
5
5
  "private": false,
6
6
  "publishConfig": {