@lingo.dev/_compiler 0.3.5 → 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.
- package/build/chunk-OO4SG7IH.cjs +2649 -0
- package/build/chunk-YT6JFNHK.mjs +2649 -0
- package/build/index.cjs +164 -2688
- package/build/index.d.cts +6 -1
- package/build/index.d.ts +6 -1
- package/build/index.mjs +174 -2698
- package/build/lingo-turbopack-loader.cjs +47 -0
- package/build/lingo-turbopack-loader.d.cts +3 -0
- package/build/lingo-turbopack-loader.d.ts +3 -0
- package/build/lingo-turbopack-loader.mjs +45 -0
- package/package.json +1 -1
|
@@ -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,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
|
+
};
|