@opentray/webpack-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 +30 -0
- package/package.json +45 -0
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @opentray/webpack-plugin
|
|
2
|
+
|
|
3
|
+
webpack adapter for the OpenTray runtime artifact packaging contract.
|
|
4
|
+
|
|
5
|
+
```js
|
|
6
|
+
import { openTrayWebpackPlugin } from "@opentray/webpack-plugin";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
entry: { main: "./src/main.ts" },
|
|
10
|
+
output: { path: "dist" },
|
|
11
|
+
plugins: [
|
|
12
|
+
openTrayWebpackPlugin({
|
|
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 in webpack's `afterEmit` hook (after output is
|
|
24
|
+
written) and writes the same manifest shape as `@opentray/packaging`. It does not
|
|
25
|
+
own tray lifecycle, sessions, backend selection, or extension dispatch.
|
|
26
|
+
|
|
27
|
+
`outDir` is resolved from `compiler.options.output.path`. `mode` is resolved from
|
|
28
|
+
`compiler.options.mode`. `entry` is inferred from the webpack entry config (string,
|
|
29
|
+
array, `{ main }`, or an entry map). Pass `outDir`, `mode`, or `entry` in the
|
|
30
|
+
plugin options to override them.
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opentray/webpack-plugin",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "webpack 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
|
+
"webpack": ">=5"
|
|
28
|
+
},
|
|
29
|
+
"peerDependenciesMeta": {
|
|
30
|
+
"webpack": {
|
|
31
|
+
"optional": true
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"tsdown": "^0.22.1",
|
|
36
|
+
"typescript": "^6.0.3",
|
|
37
|
+
"vitest": "^4.1.7",
|
|
38
|
+
"webpack": "^5.108.1"
|
|
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
|
+
}
|