create-disposabl-app 0.8.4 → 0.8.5

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
@@ -22,7 +22,7 @@ import { Command } from "commander";
22
22
  // ../cli/package.json
23
23
  var package_default = {
24
24
  name: "@disposabl/cli",
25
- version: "0.8.4",
25
+ version: "0.8.5",
26
26
  type: "module",
27
27
  description: "Command-line access to your Disposabl app",
28
28
  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.8.4";
11
+ var version = "0.8.5";
12
12
 
13
13
  // ../disposabl-kit/platforms.ts
14
14
  var platforms = [
@@ -1,5 +1,11 @@
1
1
  #!/usr/bin/env bash
2
2
  set -euo pipefail
3
+ manifest() {
4
+ bun x --no-install expo config --json | jq -ce --arg channel "${CHANNEL:-}" --arg runtime "${RUNTIME:-}" '
5
+ def required($name): if type == "string" and (test("[^[:space:]]")) then . else error("Missing or invalid " + $name) end;
6
+ {channel: ($channel | required("channel")), projectId: (.extra.eas.projectId | required("projectId")), applicationId: (.android.package | required("applicationId")), runtimeVersion: ($runtime | required("runtimeVersion") | if test("^[a-f0-9]{40,64}$") then . else error("Invalid runtimeVersion") end)}
7
+ '
8
+ }
3
9
  case "${1:?operation required}" in
4
10
  expo-env)
5
11
  if [[ -z "$EXPO_PROJECT_ID" ]]; then
@@ -56,13 +62,12 @@ for ((page=1; ; page++)); do
56
62
  jq --arg artifact "$artifact" --arg tag "$RELEASE_PREFIX-$CHANNEL-android" --arg legacy "$RELEASE_PREFIX-$CHANNEL" '[.[] | select(.draft | not) | select(.tag_name == $tag or .tag_name == $legacy or (.tag_name | startswith($legacy + "-"))) | select(any(.assets[]; .name == $artifact))] | sort_by(.tag_name != $tag, .tag_name != $legacy) | .[0] // {}' "$RUNNER_TEMP/releases.json" > "$RUNNER_TEMP/release.json"
57
63
  if jq -e '.id' "$RUNNER_TEMP/release.json" > /dev/null || [[ $(jq length "$RUNNER_TEMP/releases.json") -lt 100 ]]; then break; fi
58
64
  done
59
- bun x --no-install expo config --json > "$RUNNER_TEMP/mobile.json"
60
65
  RUNTIME=$(bun x --no-install expo-updates runtimeversion:resolve --platform android --workflow managed | jq -er 'select(.fingerprintSources != null) | .runtimeVersion | select(test("^[a-f0-9]{40,64}$"))')
61
66
  export RUNTIME
67
+ MANIFEST=$(manifest)
68
+ export MANIFEST
62
69
  bun -e '
63
- const config = await Bun.file(`${process.env.RUNNER_TEMP}/mobile.json`).json();
64
- if (!config.extra?.eas?.projectId) throw new Error("Link an Expo project first");
65
- const wanted = {channel: process.env.CHANNEL, projectId: config.extra.eas.projectId, applicationId: config.android.package, runtimeVersion: process.env.RUNTIME};
70
+ const wanted = JSON.parse(process.env.MANIFEST);
66
71
  const release = await Bun.file(`${process.env.RUNNER_TEMP}/release.json`).json();
67
72
  const prior = JSON.parse(/<!-- android (\{[^\n]+\}) -->/.exec(release.body || "")?.[1] || "null");
68
73
  const reusable = prior && Object.keys(wanted).every(k => prior[k] === wanted[k]) && /^[a-f0-9]{64}$/.test(prior.sha256 || "") && release.assets.some(a => a.name === process.env.artifact && a.state === "uploaded" && a.size > 0 && a.digest === `sha256:${prior.sha256}`);
@@ -75,7 +80,7 @@ bun -e '
75
80
  });
76
81
  if (report.exitCode) throw new Error("Cannot report Android prerequisites.");
77
82
  }
78
- console.log(`build=${blocked ? "blocked" : !reusable}\nruntime=${wanted.runtimeVersion}\nmanifest=${JSON.stringify(wanted)}\ntag=${reusable ? release.tag_name : ""}\nsha=${reusable ? prior.sha256 : ""}`);
83
+ console.log(`build=${blocked ? "blocked" : !reusable}\nruntime=${wanted.runtimeVersion}\ntag=${reusable ? release.tag_name : ""}\nsha=${reusable ? prior.sha256 : ""}`);
79
84
  ' >> "$GITHUB_OUTPUT"
80
85
  ;;
81
86
  expo-update)
@@ -84,6 +89,7 @@ mkdir -p dist/release
84
89
  gh release download "$TAG" --pattern "$artifact" --dir dist/release
85
90
  echo "$SHA dist/release/$artifact" | sha256sum --check
86
91
  cd apps/mobile
92
+ MANIFEST=$(manifest)
87
93
  bun x --no-install expo export --platform android --output-dir dist/update
88
94
  test "$(bun x --no-install expo-updates runtimeversion:resolve --platform android --workflow managed | jq -er .runtimeVersion)" = "$RUNTIME"
89
95
  test "$(gh api "repos/$GH_REPO/$SOURCE_PATH" --jq 'if has("head") then (if .state == "open" then .head.sha else "closed" end) else .object.sha end')" = "$SOURCE"
@@ -91,6 +97,7 @@ bun x "$EAS_CLI" update --platform android --channel "$CHANNEL" --environment "$
91
97
  jq --arg sha "$SHA" '. + {sha256: $sha, action: "update"}' <<< "$MANIFEST" > ../../dist/release/android.json
92
98
  ;;
93
99
  android-build)
100
+ MANIFEST=$(manifest)
94
101
  test "$(gh api "repos/$GH_REPO/$SOURCE_PATH" --jq 'if has("head") then (if .state == "open" then .head.sha else "closed" end) else .object.sha end')" = "$SOURCE"
95
102
  if [[ "$CHANNEL" == production ]]; then
96
103
  if [[ -n "${DISPOSABL_ANDROID_SIGNING:-}" ]]; then
@@ -46,7 +46,6 @@ jobs:
46
46
  ios: ${{ steps.platforms.outputs.ios }}
47
47
  android_build: ${{ steps.fingerprint.outputs.build }}
48
48
  android_runtime: ${{ steps.fingerprint.outputs.runtime }}
49
- android_manifest: ${{ steps.fingerprint.outputs.manifest }}
50
49
  convex_url: ${{ steps.deploy.outputs.CONVEX_URL }}
51
50
  convex_site_url: ${{ steps.deploy.outputs.CONVEX_SITE_URL }}
52
51
  env:
@@ -133,7 +132,6 @@ jobs:
133
132
  TAG: ${{ steps.fingerprint.outputs.tag }}
134
133
  SHA: ${{ steps.fingerprint.outputs.sha }}
135
134
  RUNTIME: ${{ steps.fingerprint.outputs.runtime }}
136
- MANIFEST: ${{ steps.fingerprint.outputs.manifest }}
137
135
  run: bash "$GITHUB_WORKSPACE/.github/scripts/mobile.sh" expo-update
138
136
  - &publish
139
137
  name: Publish
@@ -191,7 +189,6 @@ jobs:
191
189
  env:
192
190
  RUNTIME: ${{ needs.web.outputs.android_runtime }}
193
191
  DISPOSABL_ANDROID_CHANNEL: *channel
194
- MANIFEST: ${{ needs.web.outputs.android_manifest }}
195
192
  DISPOSABL_ANDROID_SIGNING: ${{ github.event_name == 'push' && secrets.DISPOSABL_ANDROID_SIGNING || '' }}
196
193
  ANDROID_KEYSTORE_BASE64: ${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_BASE64 || '' }}
197
194
  ANDROID_KEYSTORE_PASSWORD: ${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_PASSWORD || '' }}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-disposabl-app",
3
- "version": "0.8.4",
3
+ "version": "0.8.5",
4
4
  "description": "Create a Disposabl app",
5
5
  "type": "module",
6
6
  "license": "MIT",