@opentray/tsdown-plugin 0.1.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/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # @opentray/tsdown-plugin
2
+
3
+ tsdown adapter for the OpenTray runtime artifact packaging contract.
4
+
5
+ ```ts
6
+ import { defineConfig } from "tsdown";
7
+ import { openTrayTsdownPlugin } from "@opentray/tsdown-plugin";
8
+
9
+ export default defineConfig({
10
+ entry: ["src/main.ts"],
11
+ plugins: [
12
+ openTrayTsdownPlugin({
13
+ app: { id: "com.example.build", name: "Build" },
14
+ runtimeHost: { source: "target/release/build-tray-host" },
15
+ nativeArtifacts: {
16
+ "darwin-arm64": { source: "target/release/libbuild_tray.dylib" },
17
+ },
18
+ }),
19
+ ],
20
+ });
21
+ ```
22
+
23
+ The adapter stages artifacts during the tsdown build output (`writeBundle`) and
24
+ writes the same manifest shape as `@opentray/packaging`. It does not own tray
25
+ lifecycle, sessions, backend selection, or extension dispatch.
26
+
27
+ `outDir` is resolved from the writeBundle output options (`options.dir`). `mode`
28
+ defaults to `production`. Pass `outDir` or `mode` in the plugin options to
29
+ override them when running outside a real tsdown build.
@@ -0,0 +1,26 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "app": {
4
+ "id": "com.example.tsdown.build",
5
+ "name": "TSdown Build"
6
+ },
7
+ "artifactStem": "com-example-tsdown-build-4d02ee39ac",
8
+ "entry": "/Users/kzf/Dev/GitHub/jixoai-labs/opentray/packages/tsdown-plugin/examples/build-app/src/main.d.ts",
9
+ "adapter": {
10
+ "name": "tsdown",
11
+ "mode": "production"
12
+ },
13
+ "runtimeHost": {
14
+ "role": "runtime-host",
15
+ "path": "com-example-tsdown-build-4d02ee39ac/runtime/com-example-tsdown-build-4d02ee39ac",
16
+ "name": "com-example-tsdown-build-4d02ee39ac"
17
+ },
18
+ "nativeArtifacts": {
19
+ "darwin-arm64": {
20
+ "role": "native-sidecar",
21
+ "path": "com-example-tsdown-build-4d02ee39ac/native/darwin-arm64.dylib",
22
+ "name": "darwin-arm64.dylib"
23
+ }
24
+ },
25
+ "companionAssets": {}
26
+ }
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@opentray/tsdown-plugin",
3
+ "version": "0.1.0",
4
+ "description": "tsdown adapter for the OpenTray runtime artifact packaging contract.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/jixoai/opentray"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.mts",
14
+ "import": "./dist/index.mjs"
15
+ },
16
+ "./package.json": "./package.json"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "README.md"
21
+ ],
22
+ "sideEffects": false,
23
+ "dependencies": {
24
+ "@opentray/packaging": "0.1.0"
25
+ },
26
+ "peerDependencies": {
27
+ "tsdown": ">=0.20"
28
+ },
29
+ "peerDependenciesMeta": {
30
+ "tsdown": {
31
+ "optional": true
32
+ }
33
+ },
34
+ "devDependencies": {
35
+ "tsdown": "^0.22.1",
36
+ "typescript": "^6.0.3",
37
+ "vitest": "^4.1.7"
38
+ },
39
+ "scripts": {
40
+ "build": "tsdown src/index.ts --format esm --dts",
41
+ "test": "vitest run --config vitest.config.ts",
42
+ "typecheck": "tsc --noEmit"
43
+ }
44
+ }