@inlang/sdk 2.6.0 → 2.6.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/README.md +4 -4
- package/dist/database/initDbAndSchema.test.js +1 -1
- package/dist/database/initDbAndSchema.test.js.map +1 -1
- package/dist/database/jsonbPlugin.js +1 -1
- package/dist/database/jsonbPlugin.js.map +1 -1
- package/dist/database/schema.d.ts +1 -1
- package/dist/database/schema.js.map +1 -1
- package/dist/lix-plugin/applyChanges.js +1 -1
- package/dist/lix-plugin/applyChanges.js.map +1 -1
- package/dist/lix-plugin/inlangLixPluginV1.test.js +1 -1
- package/dist/lix-plugin/inlangLixPluginV1.test.js.map +1 -1
- package/dist/plugin/schema.d.ts +2 -2
- package/dist/plugin/schema.js.map +1 -1
- package/dist/project/api.d.ts +1 -1
- package/dist/project/api.js.map +1 -1
- package/dist/project/loadProjectFromDirectory.d.ts.map +1 -1
- package/dist/project/loadProjectFromDirectory.js +4 -5
- package/dist/project/loadProjectFromDirectory.js.map +1 -1
- package/dist/project/loadProjectFromDirectory.test.js +2 -2
- package/dist/project/loadProjectFromDirectory.test.js.map +1 -1
- package/dist/services/env-variables/index.js +1 -1
- package/dist/services/env-variables/index.js.map +1 -1
- package/package.json +1 -1
- package/src/database/initDbAndSchema.test.ts +1 -1
- package/src/database/jsonbPlugin.ts +1 -1
- package/src/database/schema.ts +1 -1
- package/src/lix-plugin/applyChanges.ts +1 -1
- package/src/lix-plugin/inlangLixPluginV1.test.ts +1 -1
- package/src/plugin/schema.ts +2 -2
- package/src/project/api.ts +1 -1
- package/src/project/loadProjectFromDirectory.test.ts +2 -2
- package/src/project/loadProjectFromDirectory.ts +3 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["services/env-variables/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,oBAAoB,EAAE,SAAS;IAChC,4BAA4B,EAAE,SAAS;IACvC,WAAW,EAAE,OAAO;CACpB,CAAA","sourcesContent":["\nexport const ENV_VARIABLES = {\n PUBLIC_POSTHOG_TOKEN: undefined,\n\tPUBLIC_INLANG_SDK_SENTRY_DSN: undefined,\n\tSDK_VERSION: \"2.6.
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["services/env-variables/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,oBAAoB,EAAE,SAAS;IAChC,4BAA4B,EAAE,SAAS;IACvC,WAAW,EAAE,OAAO;CACpB,CAAA","sourcesContent":["\nexport const ENV_VARIABLES = {\n PUBLIC_POSTHOG_TOKEN: undefined,\n\tPUBLIC_INLANG_SDK_SENTRY_DSN: undefined,\n\tSDK_VERSION: \"2.6.2\",\n}\n"]}
|
package/package.json
CHANGED
|
@@ -154,7 +154,7 @@ test("it should preserve json-like text in variant patterns", async () => {
|
|
|
154
154
|
]);
|
|
155
155
|
});
|
|
156
156
|
|
|
157
|
-
// https://github.com/opral/inlang
|
|
157
|
+
// https://github.com/opral/inlang/issues/209
|
|
158
158
|
test.todo("it should enable foreign key constraints", async () => {
|
|
159
159
|
const sqlite = await createInMemoryDatabase({
|
|
160
160
|
readOnly: false,
|
|
@@ -229,7 +229,7 @@ function maybeSerializeJson(value: any): any {
|
|
|
229
229
|
return value;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
// The code here didn't work https://github.com/opral/inlang
|
|
232
|
+
// The code here didn't work https://github.com/opral/inlang/issues/132#issuecomment-2339321910
|
|
233
233
|
// but would be the "right" solution to avoid heuristics which column might or might not be a json column
|
|
234
234
|
// // modifies the query in place for readability and performance
|
|
235
235
|
// function mapQuery(
|
package/src/database/schema.ts
CHANGED
|
@@ -77,7 +77,7 @@ type VariantTable = {
|
|
|
77
77
|
/**
|
|
78
78
|
* A match is a variable reference that is either a literal or a catch-all.
|
|
79
79
|
*
|
|
80
|
-
* https://github.com/opral/inlang
|
|
80
|
+
* https://github.com/opral/inlang/issues/205
|
|
81
81
|
*
|
|
82
82
|
* @example
|
|
83
83
|
* match = { type: "match", name: "gender", value: { type: "literal", value: "male" }}
|
|
@@ -124,7 +124,7 @@ async function handleForeignKeyViolation(args: {
|
|
|
124
124
|
// TODO shouldn't throw. The API needs to be able to
|
|
125
125
|
// report issues back to the app without throwing and potentially failing
|
|
126
126
|
// to apply 1000 changes because 1 change is invalid
|
|
127
|
-
// same requirement as in inlang, see https://github.com/opral/inlang
|
|
127
|
+
// same requirement as in inlang, see https://github.com/opral/inlang/issues/213
|
|
128
128
|
.executeTakeFirstOrThrow();
|
|
129
129
|
|
|
130
130
|
if (args.change.type === "message") {
|
|
@@ -347,7 +347,7 @@ describe.skip("plugin.diff.file", () => {
|
|
|
347
347
|
]);
|
|
348
348
|
});
|
|
349
349
|
|
|
350
|
-
// https://github.com/opral/lix
|
|
350
|
+
// https://github.com/opral/lix/issues/33
|
|
351
351
|
test("it should generate changes after the first change", async () => {
|
|
352
352
|
const project = await loadProjectInMemory({ blob: await newProject() });
|
|
353
353
|
|
package/src/plugin/schema.ts
CHANGED
|
@@ -43,7 +43,7 @@ export type InlangPlugin<
|
|
|
43
43
|
*
|
|
44
44
|
* - `metadata` is optional and can be used to store additional information
|
|
45
45
|
* that is accessible in `importFiles` via `toBeImportedMetadata`. See
|
|
46
|
-
* https://github.com/opral/inlang
|
|
46
|
+
* https://github.com/opral/inlang/issues/218 for more info.
|
|
47
47
|
*
|
|
48
48
|
*/
|
|
49
49
|
toBeImportedFiles?: (args: {
|
|
@@ -87,7 +87,7 @@ export type InlangPlugin<
|
|
|
87
87
|
/**
|
|
88
88
|
* Exposing only a subset to ease mapping of fs functions.
|
|
89
89
|
*
|
|
90
|
-
* https://github.com/opral/inlang
|
|
90
|
+
* https://github.com/opral/inlang/issues/136
|
|
91
91
|
*/
|
|
92
92
|
export type NodeFsPromisesSubsetLegacy = {
|
|
93
93
|
readFile:
|
package/src/project/api.ts
CHANGED
|
@@ -52,7 +52,7 @@ export type ImportFile = {
|
|
|
52
52
|
* The metadata of the file to be imported.
|
|
53
53
|
*
|
|
54
54
|
* Used to store additional information that is accessible in `importFiles` via `toBeImportedFilesMetadata`.
|
|
55
|
-
* https://github.com/opral/inlang
|
|
55
|
+
* https://github.com/opral/inlang/issues/218
|
|
56
56
|
*/
|
|
57
57
|
toBeImportedFilesMetadata?: Record<string, any>;
|
|
58
58
|
};
|
|
@@ -885,7 +885,7 @@ test("it should provide plugins from disk for backwards compatibility but warn t
|
|
|
885
885
|
expect(settings.modules?.[0]).toBe("../local-plugins/mock-plugin.js");
|
|
886
886
|
});
|
|
887
887
|
|
|
888
|
-
// https://github.com/opral/inlang
|
|
888
|
+
// https://github.com/opral/inlang/issues/174
|
|
889
889
|
test("plugin calls that use fs should be intercepted to use an absolute path", async () => {
|
|
890
890
|
process.cwd = () => "/";
|
|
891
891
|
|
|
@@ -1102,7 +1102,7 @@ test("providing multiple plugins that have legacy loadMessages and saveMessages
|
|
|
1102
1102
|
expect(mockPlugin2.loadMessages).not.toHaveBeenCalled();
|
|
1103
1103
|
});
|
|
1104
1104
|
|
|
1105
|
-
// https://github.com/opral/inlang
|
|
1105
|
+
// https://github.com/opral/inlang/issues/228
|
|
1106
1106
|
// Skipped: project ids are intentionally unstable for unpacked projects for now.
|
|
1107
1107
|
test.skip("the lix id should be stable between loadings of the same project", async () => {
|
|
1108
1108
|
const mockRepo = {
|
|
@@ -2,7 +2,6 @@ import { newProject } from "./newProject.js";
|
|
|
2
2
|
import { loadProjectInMemory } from "./loadProjectInMemory.js";
|
|
3
3
|
import {
|
|
4
4
|
closeLix,
|
|
5
|
-
fileQueueSettled,
|
|
6
5
|
openLixInMemory,
|
|
7
6
|
toBlob,
|
|
8
7
|
type Lix,
|
|
@@ -98,7 +97,6 @@ export async function loadProjectFromDirectory(
|
|
|
98
97
|
lix: tempLix,
|
|
99
98
|
syncInterval: undefined,
|
|
100
99
|
});
|
|
101
|
-
await fileQueueSettled({ lix: tempLix });
|
|
102
100
|
|
|
103
101
|
// TODO call tempProject.lix.settled() to wait for the new settings file, and remove reload of the proejct as soon as reactive settings has landed
|
|
104
102
|
// NOTE: we need to ensure two things:
|
|
@@ -160,7 +158,7 @@ export async function loadProjectFromDirectory(
|
|
|
160
158
|
toBeImportedFilesMetadata: toBeImported.metadata,
|
|
161
159
|
});
|
|
162
160
|
} catch (e) {
|
|
163
|
-
// https://github.com/opral/inlang
|
|
161
|
+
// https://github.com/opral/inlang/issues/202
|
|
164
162
|
if ((e as any)?.code === "ENOENT") {
|
|
165
163
|
continue;
|
|
166
164
|
}
|
|
@@ -648,7 +646,7 @@ async function upsertFileInLix(
|
|
|
648
646
|
data: ArrayBuffer
|
|
649
647
|
) {
|
|
650
648
|
// force posix path when upserting into lix
|
|
651
|
-
// https://github.com/opral/inlang
|
|
649
|
+
// https://github.com/opral/inlang/issues/229
|
|
652
650
|
let posixPath = path.split(nodePath.win32.sep).join(nodePath.posix.sep);
|
|
653
651
|
|
|
654
652
|
if (posixPath.startsWith("/") === false) {
|
|
@@ -693,7 +691,7 @@ function categorizePlugins(plugins: readonly InlangPlugin[]) {
|
|
|
693
691
|
/**
|
|
694
692
|
* Imports local plugins for backwards compatibility.
|
|
695
693
|
*
|
|
696
|
-
* https://github.com/opral/inlang
|
|
694
|
+
* https://github.com/opral/inlang/issues/171
|
|
697
695
|
*/
|
|
698
696
|
async function importLocalPlugins(args: {
|
|
699
697
|
fs: typeof fs;
|