@neplex/upserve-tauri 0.0.0-stage → 0.1.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # @neplex/upserve-tauri
2
+
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Refresh package documentation with expanded guides, configuration and API references.
8
+ - Updated dependencies
9
+ - @neplex/upserve@0.1.1
10
+
11
+ ## 0.1.0
12
+
13
+ Initial implementation of Upserve update distribution.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Neplex Technologies
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,13 @@
1
- # Temporary Holding Version
1
+ # @neplex/upserve-tauri
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Serve Tauri v2 update endpoints using your existing static manifest and signatures.
4
+
5
+ ```sh
6
+ npm install @neplex/upserve @neplex/upserve-github @neplex/upserve-tauri @hono/node-server
7
+ ```
8
+
9
+ Add `tauri()` to your application adapters. Publish `latest.json` and all referenced signed updater artifacts in the same release. Point the updater at `/editor/stable/tauri/{{target}}/{{arch}}/{{current_version}}`. Keep your existing signing keys in the release pipeline.
10
+
11
+ Read the [guide](https://upserve.neplex.dev/docs/tauri) for a complete example and supported behavior, or browse the [documentation source](https://github.com/neplextech/upserve/tree/main/apps/docs/content/docs). During initial private development, packages may not be published yet; use the repository checkout instructions in the quick start.
12
+
13
+ MIT licensed.
@@ -0,0 +1,17 @@
1
+ import * as _$_neplex_upserve0 from "@neplex/upserve";
2
+ import * as _$hono_types0 from "hono/types";
3
+ import * as _$hono from "hono";
4
+
5
+ //#region src/index.d.ts
6
+ /** Tauri v2 manifest selection. Signature contents are passed through unchanged. */
7
+ interface TauriOptions {
8
+ /** Published manifest asset name; defaults to the integration standard filename. */
9
+ manifest?: string;
10
+ }
11
+ /** Expose /tauri/latest.json and /tauri/:target/:arch/:current. */
12
+ declare function tauri(options?: TauriOptions): {
13
+ name: string;
14
+ register(app: _$hono.Hono<_$hono_types0.BlankEnv, _$hono_types0.BlankSchema, "/">, services: _$_neplex_upserve0.AdapterServices): void;
15
+ };
16
+ //#endregion
17
+ export { TauriOptions, tauri };
package/dist/index.mjs ADDED
@@ -0,0 +1,57 @@
1
+ import { UpserveError, defineAdapter, newer, validVersion } from "@neplex/upserve";
2
+ //#region src/index.ts
3
+ /** Expose /tauri/latest.json and /tauri/:target/:arch/:current. */
4
+ function tauri(options = {}) {
5
+ return defineAdapter({
6
+ name: "tauri",
7
+ register(app, services) {
8
+ async function manifest(c) {
9
+ const release = await services.latest(c.req.param("channel"));
10
+ if (!release) return void 0;
11
+ return services.manifest(release, options.manifest ?? "latest.json", (text) => {
12
+ const input = JSON.parse(text);
13
+ if (!input || typeof input !== "object") throw new UpserveError("invalid", "Invalid Tauri manifest");
14
+ const value = input;
15
+ if (typeof value.version !== "string" || !validVersion(value.version) || value.version.replace(/^v/, "") !== release.version.replace(/^v/, "") || !value.platforms || typeof value.platforms !== "object") throw new UpserveError("invalid", "Invalid Tauri version or platforms");
16
+ const platforms = Object.create(null);
17
+ for (const [target, raw] of Object.entries(value.platforms)) {
18
+ if (!raw || typeof raw !== "object") throw new UpserveError("invalid", "Invalid Tauri platform");
19
+ const item = raw;
20
+ if (typeof item.url !== "string" || typeof item.signature !== "string" || !item.signature.trim()) throw new UpserveError("invalid", "Tauri signature missing");
21
+ const asset = release.assets.find((a) => a.url === item.url);
22
+ if (!asset) throw new UpserveError("invalid", "Tauri binary missing from release");
23
+ platforms[target] = {
24
+ signature: item.signature,
25
+ url: services.assetUrl(c, release, asset)
26
+ };
27
+ }
28
+ if (!Object.keys(platforms).length) throw new UpserveError("invalid", "Empty Tauri manifest");
29
+ return {
30
+ version: value.version,
31
+ notes: release.notes,
32
+ pub_date: release.publishedAt,
33
+ platforms
34
+ };
35
+ });
36
+ }
37
+ app.get("/tauri/latest.json", async (c) => {
38
+ const result = await manifest(c);
39
+ return result ? c.json(result) : c.body(null, 204);
40
+ });
41
+ app.get("/tauri/:target/:arch/:current", async (c) => {
42
+ const result = await manifest(c);
43
+ if (!result || !newer(result.version, c.req.param("current"))) return c.body(null, 204);
44
+ const platform = result.platforms[c.req.param("target") + "-" + c.req.param("arch")];
45
+ if (!platform) return c.body(null, 204);
46
+ return c.json({
47
+ version: result.version,
48
+ notes: result.notes,
49
+ pub_date: result.pub_date,
50
+ ...platform
51
+ });
52
+ });
53
+ }
54
+ });
55
+ }
56
+ //#endregion
57
+ export { tauri };
package/package.json CHANGED
@@ -1,6 +1,39 @@
1
1
  {
2
2
  "name": "@neplex/upserve-tauri",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1",
4
+ "description": "Composable application update distribution for Fetch runtimes",
5
+ "homepage": "https://upserve.neplex.dev",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/neplextech/upserve.git",
10
+ "directory": "packages/tauri"
11
+ },
12
+ "files": [
13
+ "dist",
14
+ "README.md",
15
+ "LICENSE",
16
+ "CHANGELOG.md"
17
+ ],
18
+ "type": "module",
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/index.d.mts",
22
+ "import": "./dist/index.mjs",
23
+ "default": "./dist/index.mjs"
24
+ }
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "dependencies": {
30
+ "hono": "^4.13.22",
31
+ "@neplex/upserve": "0.1.1"
32
+ },
33
+ "engines": {
34
+ "node": ">=22.13"
35
+ },
36
+ "scripts": {
37
+ "build": "tsdown"
38
+ }
6
39
  }