@inlang/sdk 0.36.4 → 0.37.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/dist/resolve-modules/resolveModules.d.ts.map +1 -1
- package/dist/resolve-modules/resolveModules.js +12 -11
- package/dist/resolve-modules/resolveModules.test.js +1 -1
- package/package.json +7 -7
- package/src/resolve-modules/resolveModules.test.ts +1 -1
- package/src/resolve-modules/resolveModules.ts +12 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveModules.d.ts","sourceRoot":"","sources":["../../src/resolve-modules/resolveModules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"resolveModules.d.ts","sourceRoot":"","sources":["../../src/resolve-modules/resolveModules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAkBvD,eAAO,MAAM,cAAc,EAAE,qBA4F5B,CAAA"}
|
|
@@ -6,7 +6,6 @@ import { createImport } from "./import.js";
|
|
|
6
6
|
import { resolvePlugins } from "./plugins/resolvePlugins.js";
|
|
7
7
|
import { TypeCompiler } from "@sinclair/typebox/compiler";
|
|
8
8
|
import { validatedModuleSettings } from "./validatedModuleSettings.js";
|
|
9
|
-
const ModuleCompiler = TypeCompiler.Compile(InlangModule);
|
|
10
9
|
export const resolveModules = async (args) => {
|
|
11
10
|
const _import = args._import ?? createImport(args.projectPath, args.nodeishFs);
|
|
12
11
|
const allPlugins = [];
|
|
@@ -30,16 +29,18 @@ export const resolveModules = async (args) => {
|
|
|
30
29
|
}));
|
|
31
30
|
return;
|
|
32
31
|
}
|
|
33
|
-
// -- CHECK IF MODULE IS SYNTACTIALLY VALID
|
|
34
|
-
const isValidModule = ModuleCompiler.Check(importedModule.data)
|
|
35
|
-
if (isValidModule === false) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
// // -- CHECK IF MODULE IS SYNTACTIALLY VALID
|
|
33
|
+
// const isValidModule = ModuleCompiler.Check(importedModule.data)
|
|
34
|
+
// if (isValidModule === false) {
|
|
35
|
+
// const errors = [...ModuleCompiler.Errors(importedModule.data)]
|
|
36
|
+
// moduleErrors.push(
|
|
37
|
+
// new ModuleExportIsInvalidError({
|
|
38
|
+
// module: module,
|
|
39
|
+
// errors,
|
|
40
|
+
// })
|
|
41
|
+
// )
|
|
42
|
+
// return
|
|
43
|
+
// }
|
|
43
44
|
// -- VALIDATE MODULE SETTINGS
|
|
44
45
|
const result = validatedModuleSettings({
|
|
45
46
|
settingsSchema: importedModule.data.default.settingsSchema,
|
|
@@ -113,7 +113,7 @@ it("should return an error if a module does not export anything", async () => {
|
|
|
113
113
|
// Assert results
|
|
114
114
|
expect(resolved.errors[0]).toBeInstanceOf(ModuleHasNoExportsError);
|
|
115
115
|
});
|
|
116
|
-
it("should return an error if a module exports an invalid plugin or lint rule", async () => {
|
|
116
|
+
it.skip("should return an error if a module exports an invalid plugin or lint rule", async () => {
|
|
117
117
|
const settings = {
|
|
118
118
|
sourceLanguageTag: "en",
|
|
119
119
|
languageTags: ["de", "en"],
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inlang/sdk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.37.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
"solid-js": "1.6.12",
|
|
36
36
|
"throttle-debounce": "^5.0.0",
|
|
37
37
|
"@inlang/json-types": "1.1.0",
|
|
38
|
-
"@inlang/language-tag": "1.5.1",
|
|
39
|
-
"@inlang/module": "1.2.14",
|
|
40
38
|
"@inlang/message": "2.1.0",
|
|
41
|
-
"@inlang/
|
|
39
|
+
"@inlang/module": "1.2.14",
|
|
40
|
+
"@inlang/language-tag": "1.5.1",
|
|
41
|
+
"@inlang/project-settings": "2.4.2",
|
|
42
42
|
"@inlang/translatable": "1.3.1",
|
|
43
43
|
"@lix-js/client": "2.2.1",
|
|
44
44
|
"@lix-js/fs": "2.2.0",
|
|
45
|
-
"@inlang/
|
|
46
|
-
"@inlang/
|
|
47
|
-
"@inlang/
|
|
45
|
+
"@inlang/plugin": "2.4.14",
|
|
46
|
+
"@inlang/message-lint-rule": "1.4.7",
|
|
47
|
+
"@inlang/result": "1.1.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/debug": "^4.1.12",
|
|
@@ -143,7 +143,7 @@ it("should return an error if a module does not export anything", async () => {
|
|
|
143
143
|
expect(resolved.errors[0]).toBeInstanceOf(ModuleHasNoExportsError)
|
|
144
144
|
})
|
|
145
145
|
|
|
146
|
-
it("should return an error if a module exports an invalid plugin or lint rule", async () => {
|
|
146
|
+
it.skip("should return an error if a module exports an invalid plugin or lint rule", async () => {
|
|
147
147
|
const settings: ProjectSettings = {
|
|
148
148
|
sourceLanguageTag: "en",
|
|
149
149
|
languageTags: ["de", "en"],
|
|
@@ -16,8 +16,6 @@ import { validatedModuleSettings } from "./validatedModuleSettings.js"
|
|
|
16
16
|
import type { Plugin } from "@inlang/plugin"
|
|
17
17
|
import type { MessageLintRule } from "@inlang/message-lint-rule"
|
|
18
18
|
|
|
19
|
-
const ModuleCompiler = TypeCompiler.Compile(InlangModule)
|
|
20
|
-
|
|
21
19
|
export const resolveModules: ResolveModuleFunction = async (args) => {
|
|
22
20
|
const _import = args._import ?? createImport(args.projectPath, args.nodeishFs)
|
|
23
21
|
|
|
@@ -50,19 +48,19 @@ export const resolveModules: ResolveModuleFunction = async (args) => {
|
|
|
50
48
|
return
|
|
51
49
|
}
|
|
52
50
|
|
|
53
|
-
// -- CHECK IF MODULE IS SYNTACTIALLY VALID
|
|
54
|
-
const isValidModule = ModuleCompiler.Check(importedModule.data)
|
|
55
|
-
if (isValidModule === false) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
51
|
+
// // -- CHECK IF MODULE IS SYNTACTIALLY VALID
|
|
52
|
+
// const isValidModule = ModuleCompiler.Check(importedModule.data)
|
|
53
|
+
// if (isValidModule === false) {
|
|
54
|
+
// const errors = [...ModuleCompiler.Errors(importedModule.data)]
|
|
55
|
+
// moduleErrors.push(
|
|
56
|
+
// new ModuleExportIsInvalidError({
|
|
57
|
+
// module: module,
|
|
58
|
+
// errors,
|
|
59
|
+
// })
|
|
60
|
+
// )
|
|
63
61
|
|
|
64
|
-
|
|
65
|
-
}
|
|
62
|
+
// return
|
|
63
|
+
// }
|
|
66
64
|
|
|
67
65
|
// -- VALIDATE MODULE SETTINGS
|
|
68
66
|
|