@devultur/self-host 0.0.0-stage → 1.0.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.
- package/LICENSE +235 -0
- package/README.md +66 -2
- package/dist/chunk-D3KOHAVH.js +140 -0
- package/dist/chunk-VF4KBW3I.js +459 -0
- package/dist/cloudflare-kZ7J3LQ2.d.ts +19 -0
- package/dist/codecs-RKUOPKWR.js +198 -0
- package/dist/index.d.ts +530 -0
- package/dist/index.js +4008 -0
- package/dist/transcode/container.d.ts +10 -0
- package/dist/transcode/container.js +23 -0
- package/dist/wasm-modules-55Q2QP7Q.js +22 -0
- package/package.json +52 -3
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DurableObject } from 'cloudflare:workers';
|
|
2
|
+
import { C as ContainerLaunchRequest, a as ContainerLaunchResult } from '../cloudflare-kZ7J3LQ2.js';
|
|
3
|
+
|
|
4
|
+
declare class TranscodeContainer extends DurableObject {
|
|
5
|
+
private get container();
|
|
6
|
+
launch(request: ContainerLaunchRequest): Promise<ContainerLaunchResult>;
|
|
7
|
+
cancel(): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { TranscodeContainer };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
startTranscodeContainer,
|
|
3
|
+
watchContainer
|
|
4
|
+
} from "../chunk-VF4KBW3I.js";
|
|
5
|
+
|
|
6
|
+
// src/transcode/container.ts
|
|
7
|
+
import { DurableObject } from "cloudflare:workers";
|
|
8
|
+
var TranscodeContainer = class extends DurableObject {
|
|
9
|
+
get container() {
|
|
10
|
+
return this.ctx.container;
|
|
11
|
+
}
|
|
12
|
+
async launch(request) {
|
|
13
|
+
const started = startTranscodeContainer(this.container, request);
|
|
14
|
+
if (started.exited) this.ctx.waitUntil(watchContainer(started.exited, request.env));
|
|
15
|
+
return { alreadyRunning: started.alreadyRunning };
|
|
16
|
+
}
|
|
17
|
+
async cancel() {
|
|
18
|
+
if (this.container?.running) await this.container.destroy(new Error("transcode cancelled"));
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
TranscodeContainer
|
|
23
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// src/image/wasm-modules.ts
|
|
2
|
+
import avifDec from "@jsquash/avif/codec/dec/avif_dec.wasm";
|
|
3
|
+
import avifEnc from "@jsquash/avif/codec/enc/avif_enc.wasm";
|
|
4
|
+
import jpegDec from "@jsquash/jpeg/codec/dec/mozjpeg_dec.wasm";
|
|
5
|
+
import jpegEnc from "@jsquash/jpeg/codec/enc/mozjpeg_enc.wasm";
|
|
6
|
+
import pngCodec from "@jsquash/png/codec/pkg/squoosh_png_bg.wasm";
|
|
7
|
+
import resize from "@jsquash/resize/lib/resize/pkg/squoosh_resize_bg.wasm";
|
|
8
|
+
import webpDec from "@jsquash/webp/codec/dec/webp_dec.wasm";
|
|
9
|
+
import webpEnc from "@jsquash/webp/codec/enc/webp_enc_simd.wasm";
|
|
10
|
+
var codecWasmModules = {
|
|
11
|
+
jpegDec,
|
|
12
|
+
jpegEnc,
|
|
13
|
+
pngCodec,
|
|
14
|
+
webpDec,
|
|
15
|
+
webpEnc,
|
|
16
|
+
avifDec,
|
|
17
|
+
avifEnc,
|
|
18
|
+
resize
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
codecWasmModules
|
|
22
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devultur/self-host",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"license": "AGPL-3.0-only",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/devultur/devultur",
|
|
9
|
+
"directory": "packages/self-host"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/devultur/devultur#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/devultur/devultur/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./transcode-container": {
|
|
24
|
+
"types": "./dist/transcode/container.d.ts",
|
|
25
|
+
"import": "./dist/transcode/container.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@jsquash/avif": "2.1.1",
|
|
33
|
+
"@jsquash/jpeg": "1.6.0",
|
|
34
|
+
"@jsquash/png": "3.1.1",
|
|
35
|
+
"@jsquash/resize": "2.1.1",
|
|
36
|
+
"@jsquash/webp": "1.5.0",
|
|
37
|
+
"hono": "^4.7.0",
|
|
38
|
+
"@devultur/core": "1.0.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@cf-wasm/photon": "0.4.0",
|
|
42
|
+
"@cloudflare/workers-types": "^4.20250620.0",
|
|
43
|
+
"@types/node": "^22.20.0",
|
|
44
|
+
"tsup": "^8.5.1",
|
|
45
|
+
"typescript": "^5.8.0",
|
|
46
|
+
"wrangler": "^4.106.0"
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "tsup src/index.ts src/transcode/container.ts --format esm --dts --external cloudflare:workers --external '*.wasm' --clean",
|
|
53
|
+
"typecheck": "tsc --noEmit"
|
|
54
|
+
}
|
|
6
55
|
}
|