@linguanahq/build-core 0.1.1 → 0.1.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/dist/index.d.ts +6 -4
- package/dist/index.js +6 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export type StrictPolicy = boolean | {
|
|
|
26
26
|
duplicate?: boolean;
|
|
27
27
|
};
|
|
28
28
|
export type IntegrationMetadata = {
|
|
29
|
-
tool: "vite";
|
|
29
|
+
tool: "vite" | "next";
|
|
30
30
|
toolVersion: string;
|
|
31
31
|
framework: FrameworkId;
|
|
32
32
|
adapterVersion: string;
|
|
@@ -41,6 +41,8 @@ export type BuildSessionOptions = {
|
|
|
41
41
|
strict?: StrictPolicy;
|
|
42
42
|
};
|
|
43
43
|
export type RemoteBuildOptions = {
|
|
44
|
+
preview?: boolean;
|
|
45
|
+
signal?: AbortSignal;
|
|
44
46
|
apiUrl: string;
|
|
45
47
|
token: string;
|
|
46
48
|
translation?: false | {
|
|
@@ -66,7 +68,7 @@ export declare class BuildSession {
|
|
|
66
68
|
};
|
|
67
69
|
placeholders: {
|
|
68
70
|
name: string;
|
|
69
|
-
kind: "number" | "
|
|
71
|
+
kind: "number" | "date" | "time" | "value" | "component" | "plural" | "select";
|
|
70
72
|
}[];
|
|
71
73
|
confidence: "explicit" | "high";
|
|
72
74
|
locations: {
|
|
@@ -100,7 +102,7 @@ export declare class BuildSession {
|
|
|
100
102
|
};
|
|
101
103
|
placeholders: {
|
|
102
104
|
name: string;
|
|
103
|
-
kind: "number" | "
|
|
105
|
+
kind: "number" | "date" | "time" | "value" | "component" | "plural" | "select";
|
|
104
106
|
}[];
|
|
105
107
|
confidence: "explicit" | "high";
|
|
106
108
|
locations: {
|
|
@@ -122,7 +124,7 @@ export declare class BuildSession {
|
|
|
122
124
|
}[];
|
|
123
125
|
sourceRevision?: string | undefined;
|
|
124
126
|
integration?: {
|
|
125
|
-
tool: "vite";
|
|
127
|
+
tool: "vite" | "next";
|
|
126
128
|
toolVersion: string;
|
|
127
129
|
framework: "react" | "vue" | "svelte" | "solid";
|
|
128
130
|
adapterVersion: string;
|
package/dist/index.js
CHANGED
|
@@ -100,9 +100,11 @@ var BuildSession = class {
|
|
|
100
100
|
headers: {
|
|
101
101
|
"content-type": "application/json",
|
|
102
102
|
authorization: `Bearer ${remote.token}`,
|
|
103
|
-
"idempotency-key": hash
|
|
103
|
+
"idempotency-key": remote.preview ? `preview:${hash}` : hash
|
|
104
104
|
},
|
|
105
|
+
signal: remote.signal,
|
|
105
106
|
body: JSON.stringify({
|
|
107
|
+
...remote.preview ? { isPreview: true } : {},
|
|
106
108
|
schemaVersion: manifest.schemaVersion,
|
|
107
109
|
contentHash: hash,
|
|
108
110
|
byteLength: new TextEncoder().encode(body).byteLength,
|
|
@@ -115,7 +117,8 @@ var BuildSession = class {
|
|
|
115
117
|
const upload = await fetch(registration.upload.url, {
|
|
116
118
|
method: "PUT",
|
|
117
119
|
headers: registration.upload.headers,
|
|
118
|
-
body
|
|
120
|
+
body,
|
|
121
|
+
signal: remote.signal
|
|
119
122
|
});
|
|
120
123
|
if (!upload.ok)
|
|
121
124
|
throw new Error(`Manifest artifact upload failed (${upload.status})`);
|
|
@@ -123,6 +126,7 @@ var BuildSession = class {
|
|
|
123
126
|
`${endpoint}/api/v1/manifests/${registration.manifestId}/complete`,
|
|
124
127
|
{
|
|
125
128
|
method: "POST",
|
|
129
|
+
signal: remote.signal,
|
|
126
130
|
headers: {
|
|
127
131
|
authorization: `Bearer ${remote.token}`,
|
|
128
132
|
"idempotency-key": `${hash}:complete`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linguanahq/build-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Linguana build-core integration",
|
|
6
6
|
"exports": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"node": ">=22.12.0"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@linguanahq/catalog": "0.1.
|
|
20
|
+
"@linguanahq/catalog": "0.1.2"
|
|
21
21
|
},
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|