Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/client-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
"tailwindcss": "^4.3.3",
"validup": "^2.0.1",
"vitest": "^4.1.11",
"vue": "^3.5.41",
"vue": "^3.5.42",
"vue-tsc": "^3.3.11",
"zod": "^4.4.3"
"zod": "^4.5.1"
},
"gitHead": "8881a3d4b427c45ac4b81ac4b31bf3d719463ef7"
}
5 changes: 2 additions & 3 deletions apps/server-core-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,14 @@
"routup": "^6.1.0",
"tar": "^7.5.22",
"tar-fs": "^3.1.3",
"tar-stream": "^3.2.0",
"tar-stream": "^3.2.1",
"uuid": "^14.0.2",
"validup": "^2.0.1",
"zod": "^4.4.3"
"zod": "^4.5.1"
},
"devDependencies": {
"@types/dockerode": "^4.0.1",
"@types/tar-fs": "^2.0.4",
"@types/tar-stream": "^3.1.4",
"@types/uuid": "^11.0.0",
"ts-node": "^10.9.2",
"vitest": "^4.1.11"
Expand Down
22 changes: 14 additions & 8 deletions apps/server-core-worker/src/adapters/docker/container-pack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@

import type { Readable } from 'node:stream';
import type { Container } from 'dockerode';
import type { Headers } from 'tar-stream';
import type { Header } from 'tar-stream';
import tar from 'tar-stream';

export type DockerContainerPackOptions = {
path: string,

validateEntry?: (entry: Headers) => void,
validateEntry?: (entry: Header) => void,

onEntryPackStarted?: (entry: Headers) => void,
onEntryPackFinished?: (entry: Headers) => void,
onEntryPackFailed?: (error: Error, entry: Headers) => void,
onEntryPackStarted?: (entry: Header) => void,
onEntryPackFinished?: (entry: Header) => void,
onEntryPackFailed?: (error: Error, entry: Header) => void,
};

export async function packDockerContainerWithTarStream(
Expand Down Expand Up @@ -77,7 +77,9 @@ export async function packDockerContainerWithTarStream(
});

stream.on('end', () => {
entry.end();
// streamx types end()'s argument as required; the runtime no-ops on
// undefined, so this stays a plain end().
entry.end(undefined);
});

stream.on('error', (err) => {
Expand All @@ -95,10 +97,14 @@ export async function packDockerContainerWithTarStream(
pack.finalize();
});

container.putArchive(pack, { path: options.path })
// tar-stream >= 3.2.1 types pack/extract as `streamx` streams rather than node
// ones. docker-modem only calls .on('error') and .pipe(req) on the archive, never
// the members streamx lacks (isPaused/unpipe/wrap), so the bridge is honest.
container.putArchive(pack as unknown as NodeJS.ReadableStream, { path: options.path })
.then(() => resolve())
.catch((err) => reject(err));

readable.pipe(extract);
// node's pipe drives the streamx destination through write/end/'drain'.
readable.pipe(extract as unknown as NodeJS.WritableStream);
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,14 @@ export class AnalysisBuilderExecuteHandler implements ComponentHandler<AnalysisB
});

entry.write(content);
entry.end();
// streamx types end()'s argument as required; the runtime no-ops on
// undefined, so this stays a plain end().
entry.end(undefined);

// tar-stream >= 3.2.1 types pack as a `streamx` Readable. streamx' pipe drives a
// node destination through write/end/'drain', so only the declarations disagree.
const buildStream = await this.docker
.buildImage(pack.pipe(createGzip()), {
.buildImage((pack as unknown as NodeJS.ReadableStream).pipe(createGzip()), {
t: this.buildImageTag(analysis),
platform: 'linux/amd64',
});
Expand Down
2 changes: 1 addition & 1 deletion apps/server-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"typeorm": "^1.1.0",
"typeorm-extension": "^4.1.0",
"validup": "^2.0.1",
"zod": "^4.4.3"
"zod": "^4.5.1"
},
"devDependencies": {
"@faker-js/faker": "^10.6.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/server-messenger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"typeorm": "^1.1.0",
"typeorm-extension": "^4.1.0",
"validup": "^2.0.1",
"zod": "^4.4.3"
"zod": "^4.5.1"
},
"scripts": {
"cli": "node dist/cli/index.mjs",
Expand Down
5 changes: 2 additions & 3 deletions apps/server-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,17 @@
"redis-extension": "^2.0.4",
"reflect-metadata": "^0.2.2",
"routup": "^6.1.0",
"tar-stream": "^3.2.0",
"tar-stream": "^3.2.1",
"typeorm": "^1.1.0",
"typeorm-extension": "^4.1.0",
"validup": "^2.0.1",
"zod": "^4.4.3"
"zod": "^4.5.1"
},
"devDependencies": {
"@faker-js/faker": "^10.6.0",
"@privateaim/server-test-kit": "^0.15.0",
"@trapi/cli": "^2.0.5",
"@types/busboy": "^1.5.4",
"@types/tar-stream": "^3.1.4",
"better-sqlite3": "^13.0.3",
"testcontainers": "^12.1.0",
"ts-node": "^10.9.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ async function packFile(
name: file.path,
size: file.size,
});
await pipeline(source, entry);

// tar-stream >= 3.2.1 types its entry sink as a `streamx` Writable, not a node one.
// It is not a node Writable, but it has the write/end/'drain' contract node's
// pipeline duck-types against, so only the declarations are incompatible.
await pipeline(source, entry as unknown as NodeJS.WritableStream);
}

export function packBucketFiles(
Expand Down
4 changes: 3 additions & 1 deletion apps/server-storage/test/unit/bucket-file.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ describe('controllers/bucket-file', () => {
client.bucket.stream(details.bucketId)
.then((data) => Readable.fromWeb(data as any))
.then((data) => {
data.pipe(extract);
// see bucket/stream.ts: tar-stream >= 3.2.1 types extract as a
// `streamx` Writable, which node's pipe accepts duck-typed.
data.pipe(extract as unknown as NodeJS.WritableStream);
})
.catch(() => resolve(0));
},
Expand Down
2 changes: 1 addition & 1 deletion apps/server-telemetry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"typeorm": "^1.1.0",
"typeorm-extension": "^4.1.0",
"validup": "^2.0.1",
"zod": "^4.4.3"
"zod": "^4.5.1"
},
"devDependencies": {
"@faker-js/faker": "^10.6.0",
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
},
"devDependencies": {
"vitepress": "^1.6.4",
"vue": "^3.5.41"
"vue": "^3.5.42"
}
}
Loading
Loading