@opentray/esbuild-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.
Files changed (2) hide show
  1. package/README.md +30 -0
  2. package/package.json +45 -0
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # @opentray/esbuild-plugin
2
+
3
+ esbuild adapter for the OpenTray runtime artifact packaging contract.
4
+
5
+ ```ts
6
+ import { build } from "esbuild";
7
+ import { openTrayEsbuildPlugin } from "@opentray/esbuild-plugin";
8
+
9
+ await build({
10
+ entryPoints: ["src/main.ts"],
11
+ outdir: "dist",
12
+ plugins: [
13
+ openTrayEsbuildPlugin({
14
+ app: { id: "com.example.build", name: "Build" },
15
+ runtimeHost: { source: "target/release/build-tray-host" },
16
+ nativeArtifacts: {
17
+ "darwin-arm64": { source: "target/release/libbuild_tray.dylib" },
18
+ },
19
+ }),
20
+ ],
21
+ });
22
+ ```
23
+
24
+ The adapter stages artifacts in esbuild's `onEnd` hook (after output is written)
25
+ and writes the same manifest shape as `@opentray/packaging`. It does not own tray
26
+ lifecycle, sessions, backend selection, or extension dispatch.
27
+
28
+ `outDir` is resolved from the esbuild `outdir`/`outfile` option, relative to the
29
+ esbuild `absWorkingDir`. Pass `outDir` or `mode` in the plugin options to override
30
+ them. `entry` is inferred from `entryPoints` unless given explicitly.
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@opentray/esbuild-plugin",
3
+ "version": "0.1.0",
4
+ "description": "esbuild 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
+ "esbuild": ">=0.20"
28
+ },
29
+ "peerDependenciesMeta": {
30
+ "esbuild": {
31
+ "optional": true
32
+ }
33
+ },
34
+ "devDependencies": {
35
+ "esbuild": "^0.28.1",
36
+ "tsdown": "^0.22.1",
37
+ "typescript": "^6.0.3",
38
+ "vitest": "^4.1.7"
39
+ },
40
+ "scripts": {
41
+ "build": "tsdown src/index.ts --format esm --dts",
42
+ "test": "vitest run --config vitest.config.ts",
43
+ "typecheck": "tsc --noEmit"
44
+ }
45
+ }