@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.
Files changed (32) hide show
  1. package/README.md +4 -4
  2. package/dist/database/initDbAndSchema.test.js +1 -1
  3. package/dist/database/initDbAndSchema.test.js.map +1 -1
  4. package/dist/database/jsonbPlugin.js +1 -1
  5. package/dist/database/jsonbPlugin.js.map +1 -1
  6. package/dist/database/schema.d.ts +1 -1
  7. package/dist/database/schema.js.map +1 -1
  8. package/dist/lix-plugin/applyChanges.js +1 -1
  9. package/dist/lix-plugin/applyChanges.js.map +1 -1
  10. package/dist/lix-plugin/inlangLixPluginV1.test.js +1 -1
  11. package/dist/lix-plugin/inlangLixPluginV1.test.js.map +1 -1
  12. package/dist/plugin/schema.d.ts +2 -2
  13. package/dist/plugin/schema.js.map +1 -1
  14. package/dist/project/api.d.ts +1 -1
  15. package/dist/project/api.js.map +1 -1
  16. package/dist/project/loadProjectFromDirectory.d.ts.map +1 -1
  17. package/dist/project/loadProjectFromDirectory.js +4 -5
  18. package/dist/project/loadProjectFromDirectory.js.map +1 -1
  19. package/dist/project/loadProjectFromDirectory.test.js +2 -2
  20. package/dist/project/loadProjectFromDirectory.test.js.map +1 -1
  21. package/dist/services/env-variables/index.js +1 -1
  22. package/dist/services/env-variables/index.js.map +1 -1
  23. package/package.json +1 -1
  24. package/src/database/initDbAndSchema.test.ts +1 -1
  25. package/src/database/jsonbPlugin.ts +1 -1
  26. package/src/database/schema.ts +1 -1
  27. package/src/lix-plugin/applyChanges.ts +1 -1
  28. package/src/lix-plugin/inlangLixPluginV1.test.ts +1 -1
  29. package/src/plugin/schema.ts +2 -2
  30. package/src/project/api.ts +1 -1
  31. package/src/project/loadProjectFromDirectory.test.ts +2 -2
  32. package/src/project/loadProjectFromDirectory.ts +3 -5
@@ -1,6 +1,6 @@
1
1
  export const ENV_VARIABLES = {
2
2
  PUBLIC_POSTHOG_TOKEN: undefined,
3
3
  PUBLIC_INLANG_SDK_SENTRY_DSN: undefined,
4
- SDK_VERSION: "2.6.0",
4
+ SDK_VERSION: "2.6.2",
5
5
  };
6
6
  //# sourceMappingURL=index.js.map
@@ -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.0\",\n}\n"]}
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inlang/sdk",
3
- "version": "2.6.0",
3
+ "version": "2.6.2",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -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-sdk/issues/209
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-sdk/issues/132#issuecomment-2339321910
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(
@@ -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-sdk/issues/205
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-sdk/issues/213
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-sdk/issues/33
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
 
@@ -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-sdk/issues/218 for more info.
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-sdk/issues/136
90
+ * https://github.com/opral/inlang/issues/136
91
91
  */
92
92
  export type NodeFsPromisesSubsetLegacy = {
93
93
  readFile:
@@ -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-sdk/issues/218
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-sdk/issues/174
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-sdk/issues/228
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-sdk/issues/202
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-sdk/issues/229
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-sdk/issues/171
694
+ * https://github.com/opral/inlang/issues/171
697
695
  */
698
696
  async function importLocalPlugins(args: {
699
697
  fs: typeof fs;