@inlang/sdk 0.30.0 → 0.32.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.
@@ -1 +1 @@
1
- {"version":3,"file":"maybeCreateFirstProjectId.d.ts","sourceRoot":"","sources":["../../src/migrations/maybeCreateFirstProjectId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IACrD,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,UAAU,CAAA;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBhB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAAE,IAAI,CAAC,EAAE,UAAU,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,+BAUvF"}
1
+ {"version":3,"file":"maybeCreateFirstProjectId.d.ts","sourceRoot":"","sources":["../../src/migrations/maybeCreateFirstProjectId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IACrD,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,UAAU,CAAA;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBhB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAAE,IAAI,CAAC,EAAE,UAAU,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,+BAcvF"}
@@ -35,7 +35,12 @@ export async function generateProjectId(args) {
35
35
  }
36
36
  const firstCommitHash = await args.repo.getFirstCommitHash();
37
37
  if (firstCommitHash) {
38
- return hash(`${firstCommitHash + args.projectPath}`);
38
+ try {
39
+ return await hash(`${firstCommitHash + args.projectPath}`);
40
+ }
41
+ catch (error) {
42
+ console.error("Failed to generate project_id", error);
43
+ }
39
44
  }
40
45
  return undefined;
41
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"migrateToDirectory.d.ts","sourceRoot":"","sources":["../../src/migrations/migrateToDirectory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,SAAgB;IACnD,SAAS,EAAE,iBAAiB,CAAA;IAC5B,WAAW,EAAE,MAAM,CAAA;CACnB,kBA0BA,CAAA"}
1
+ {"version":3,"file":"migrateToDirectory.d.ts","sourceRoot":"","sources":["../../src/migrations/migrateToDirectory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,SAAgB;IACnD,SAAS,EAAE,iBAAiB,CAAA;IAC5B,WAAW,EAAE,MAAM,CAAA;CACnB,kBA6BA,CAAA"}
@@ -22,6 +22,8 @@ export const maybeMigrateToDirectory = async (args) => {
22
22
  await args.nodeishFs.mkdir(args.projectPath);
23
23
  await args.nodeishFs.writeFile(`${args.projectPath}/settings.json`, settingsFile.data);
24
24
  await args.nodeishFs.writeFile(args.projectPath + ".README.md", readme);
25
+ // eslint-disable-next-line no-console
26
+ // console.log("🔔 migrated project.inlang to directory")
25
27
  };
26
28
  const readme = `
27
29
  # DELETE THE \`project.inlang.json\` FILE
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@inlang/sdk",
3
3
  "type": "module",
4
- "version": "0.30.0",
4
+ "version": "0.32.0",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -32,15 +32,15 @@
32
32
  "murmurhash3js": "^3.0.1",
33
33
  "solid-js": "1.6.12",
34
34
  "throttle-debounce": "^5.0.0",
35
- "@inlang/json-types": "1.1.0",
36
35
  "@inlang/language-tag": "1.5.1",
36
+ "@inlang/json-types": "1.1.0",
37
37
  "@inlang/message": "2.1.0",
38
38
  "@inlang/message-lint-rule": "1.4.5",
39
39
  "@inlang/module": "1.2.9",
40
- "@inlang/project-settings": "2.4.0",
41
40
  "@inlang/plugin": "2.4.9",
42
- "@inlang/translatable": "1.3.1",
41
+ "@inlang/project-settings": "2.4.0",
43
42
  "@inlang/result": "1.1.0",
43
+ "@inlang/translatable": "1.3.1",
44
44
  "@lix-js/client": "1.2.0",
45
45
  "@lix-js/fs": "1.0.0"
46
46
  },
package/src/api.ts CHANGED
@@ -80,7 +80,7 @@ export type MessageQueryApi = {
80
80
  }
81
81
  includedMessageIds: Subscribable<Message["id"][]>
82
82
  /*
83
- * getAll is depricated do not use it
83
+ * getAll is deprecated do not use it
84
84
  */
85
85
  getAll: Subscribable<Readonly<Message[]>>
86
86
  update: (args: { where: { id: Message["id"] }; data: Partial<Message> }) => boolean
@@ -41,7 +41,11 @@ export async function generateProjectId(args: { repo?: Repository; projectPath:
41
41
  const firstCommitHash = await args.repo.getFirstCommitHash()
42
42
 
43
43
  if (firstCommitHash) {
44
- return hash(`${firstCommitHash + args.projectPath}`)
44
+ try {
45
+ return await hash(`${firstCommitHash + args.projectPath}`)
46
+ } catch (error) {
47
+ console.error("Failed to generate project_id", error)
48
+ }
45
49
  }
46
50
  return undefined
47
51
  }
@@ -34,6 +34,9 @@ export const maybeMigrateToDirectory = async (args: {
34
34
  await args.nodeishFs.mkdir(args.projectPath)
35
35
  await args.nodeishFs.writeFile(`${args.projectPath}/settings.json`, settingsFile.data)
36
36
  await args.nodeishFs.writeFile(args.projectPath + ".README.md", readme)
37
+
38
+ // eslint-disable-next-line no-console
39
+ // console.log("🔔 migrated project.inlang to directory")
37
40
  }
38
41
 
39
42
  const readme = `