create-disposabl-app 0.14.13 → 0.14.14

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/dist/disposabl.js CHANGED
@@ -5,7 +5,7 @@ import { lock } from "proper-lockfile";
5
5
  // ../cli/package.json
6
6
  var package_default = {
7
7
  name: "@disposabl/cli",
8
- version: "0.14.13",
8
+ version: "0.14.14",
9
9
  type: "module",
10
10
  description: "Command-line access to your Disposabl app",
11
11
  license: "MIT",
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
8
8
  import { Command, CommanderError } from "commander";
9
9
  import * as p2 from "@clack/prompts";
10
10
  // package.json
11
- var version = "0.14.13";
11
+ var version = "0.14.14";
12
12
 
13
13
  // ../disposabl-kit/platforms.ts
14
14
  var platforms = [
@@ -34,7 +34,12 @@ test(
34
34
  }
35
35
  const app = randomBytes(16).toString("hex");
36
36
  const feed = `${site.origin}/desktop/updates/${app}/production/win32/x64/`;
37
- async function upload(build: number, attempt: number, bytes: string) {
37
+ async function upload(
38
+ build: number,
39
+ attempt: number,
40
+ bytes: string,
41
+ platform: "win32" | "darwin" = "win32",
42
+ ) {
38
43
  const url = await call("uploadUrl", {});
39
44
  expect(url.status).toBe("success");
40
45
  expect(new URL(url.value).hostname).toBe(origin.hostname);
@@ -45,12 +50,12 @@ test(
45
50
  return {
46
51
  app,
47
52
  channel: "production",
48
- platform: "win32",
49
- arch: "x64",
53
+ platform,
54
+ arch: platform === "darwin" ? "arm64" : "x64",
50
55
  version,
51
56
  build,
52
57
  attempt,
53
- filename: `fixture-${version}-full.nupkg`,
58
+ filename: `fixture-${version}${platform === "darwin" ? ".zip" : "-full.nupkg"}`,
54
59
  storageId,
55
60
  sha256: createHash("sha256").update(bytes).digest("hex"),
56
61
  sha1: createHash("sha1").update(bytes).digest("hex").toUpperCase(),
@@ -98,5 +103,49 @@ test(
98
103
  (await fetch(feed.replace("/production/", "/preview/") + "RELEASES"))
99
104
  .status,
100
105
  ).toBe(404);
106
+
107
+ const mac = await upload(1, 1, "macOS production package", "darwin");
108
+ expect((await call("publish", mac)).status).toBe("success");
109
+ const macFeed = feed.replace("/win32/x64/", "/darwin/arm64/");
110
+ const macManifest = await fetch(`${macFeed}RELEASES.json`);
111
+ expect(macManifest.headers.get("content-type")).toBe("application/json");
112
+ expect(macManifest.headers.get("cache-control")).toBe("no-store");
113
+ const macRelease = {
114
+ currentRelease: mac.version,
115
+ releases: [
116
+ {
117
+ version: mac.version,
118
+ updateTo: {
119
+ version: mac.version,
120
+ name: mac.version,
121
+ url: `${macFeed}${mac.filename}`,
122
+ },
123
+ },
124
+ ],
125
+ };
126
+ expect(await macManifest.json()).toEqual(macRelease);
127
+ expect(await (await fetch(`${macFeed}${mac.filename}`)).text()).toBe(
128
+ "macOS production package",
129
+ );
130
+ const preview = await upload(2, 1, "macOS preview package", "darwin");
131
+ expect(
132
+ (await call("publish", { ...preview, channel: "preview" })).status,
133
+ ).toBe("success");
134
+ expect(await (await fetch(`${macFeed}RELEASES.json`)).json()).toEqual(
135
+ macRelease,
136
+ );
137
+ const previewFeed = macFeed.replace("/production/", "/preview/");
138
+ const previewManifest = await (
139
+ await fetch(`${previewFeed}RELEASES.json`)
140
+ ).json();
141
+ expect(previewManifest.currentRelease).toBe(preview.version);
142
+ const previewUrl = previewManifest.releases[0].updateTo.url;
143
+ expect(previewUrl).toBe(previewFeed + preview.filename);
144
+ expect(await (await fetch(previewUrl)).text()).toBe(
145
+ "macOS preview package",
146
+ );
147
+ expect(await (await fetch(`${feed}RELEASES`)).text()).toBe(
148
+ `${next.sha1} ${feed}${next.filename} ${next.size}\n`,
149
+ );
101
150
  },
102
151
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-disposabl-app",
3
- "version": "0.14.13",
3
+ "version": "0.14.14",
4
4
  "description": "Create a Disposabl app",
5
5
  "type": "module",
6
6
  "license": "MIT",