@inlang/sdk 0.30.0 → 0.31.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,+
|
|
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
|
-
|
|
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
|
}
|
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.31.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
"@inlang/json-types": "1.1.0",
|
|
36
36
|
"@inlang/language-tag": "1.5.1",
|
|
37
37
|
"@inlang/message": "2.1.0",
|
|
38
|
-
"@inlang/message-lint-rule": "1.4.5",
|
|
39
38
|
"@inlang/module": "1.2.9",
|
|
40
39
|
"@inlang/project-settings": "2.4.0",
|
|
41
|
-
"@inlang/plugin": "2.4.9",
|
|
42
|
-
"@inlang/translatable": "1.3.1",
|
|
43
40
|
"@inlang/result": "1.1.0",
|
|
41
|
+
"@inlang/plugin": "2.4.9",
|
|
42
|
+
"@inlang/message-lint-rule": "1.4.5",
|
|
44
43
|
"@lix-js/client": "1.2.0",
|
|
44
|
+
"@inlang/translatable": "1.3.1",
|
|
45
45
|
"@lix-js/fs": "1.0.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
@@ -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
|
-
|
|
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
|
}
|