@geastack/apple 0.2.25 → 0.2.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geastack/apple",
3
- "version": "0.2.25",
3
+ "version": "0.2.26",
4
4
  "description": "Generated Apple SDK bindings plus the macOS, iOS and tvOS native build targets for Gea apps.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -119,7 +119,9 @@ function buildOutputs(root, manifest, platform, build, where, log) {
119
119
  if (outputs.some((file) => !fs.existsSync(file))) {
120
120
  log(`[gea] building ${libraries.join(', ')} for ${platform} from ${manifest.name} (once; cached in ${out})`)
121
121
  const runner = /\.sh$/.test(script) ? ['bash', [script, ...command.slice(1), '--out', out]] : [script, [...command.slice(1), '--out', out]]
122
- execFileSync(runner[0], runner[1], { cwd: root, stdio: ['ignore', 'inherit', 'inherit'] })
122
+ // The build's own output goes to stderr: callers read this module's answer
123
+ // from stdout.
124
+ execFileSync(runner[0], runner[1], { cwd: root, stdio: ['ignore', 2, 'inherit'] })
123
125
  for (const file of outputs) mustExist(file, `${where} (after ${command[0]})`)
124
126
  }
125
127
  return {
@@ -590,6 +590,18 @@ generate_app() {
590
590
  done
591
591
  (( alreadySelected != 0 )) || extraArgs+=(--extra-geatsc-plugin "$declaredPluginPath")
592
592
  done < <(node -e 'for(const p of JSON.parse(process.argv[1]).paths)console.log(p)' "$declaredAppPlugins")
593
+ # gea.targets.macos.tsconfig: the TypeScript project the compiler reads the
594
+ # program under, as build-ios.sh passes it. Without it the compiler takes the
595
+ # project nearest the staged entry, and an app that maps modules through
596
+ # `paths` (a three.js app's barrel) is read with those modules untyped -- an
597
+ # analysis that outgrows the compiler's heap.
598
+ local declaredProject
599
+ declaredProject="$(node -e '
600
+ const app = JSON.parse(process.argv[1]);
601
+ const tsconfig = app.targetConfig?.macos?.tsconfig;
602
+ if (tsconfig) console.log(require("node:path").resolve(app.root, tsconfig));
603
+ ' "$declaredAppMetadata")" || return 1
604
+ [[ -z "$declaredProject" ]] || extraArgs+=(--project "$declaredProject")
593
605
  if [[ "$appRuntime" == "apple-native" ]]; then
594
606
  extraArgs+=(--apple-native)
595
607
  fi
@@ -2197,6 +2209,31 @@ if [[ "$APP_ID" == "gea-companion" ]]; then
2197
2209
  if replace_content_stable "$COMPANION_TOOLS_DIR/$(basename "$d")" "$RESOURCE_TMP"; then BUNDLE_CONTENT_CHANGED=1; fi
2198
2210
  done
2199
2211
  fi
2212
+
2213
+ # Libraries the program's packages build for macOS (gea-native.json "macos"
2214
+ # "build", e.g. native-webgl-angle's ANGLE built from WebKit's sources, once and
2215
+ # cached): a dynamic library goes into Contents/Frameworks, where the package's
2216
+ # host loads it, and its notices into Resources.
2217
+ if [[ -n "$SINGLE_APP_DIR" ]]; then
2218
+ PACKAGE_BUILDS="$(node --input-type=module -e "
2219
+ import { readUikitNativePackages } from '$ROOT_DIR/targets/ios/native-packages.mjs'
2220
+ import fs from 'node:fs'
2221
+ const graph = process.argv[2]
2222
+ const found = readUikitNativePackages({ appRoot: process.argv[1], moduleGraphPath: fs.existsSync(graph) ? graph : undefined, target: 'macos' })
2223
+ for (const file of found.libraries) if (file.endsWith('.dylib')) console.log('lib ' + file)
2224
+ for (const file of found.resources) console.log('res ' + file)
2225
+ " "$SINGLE_APP_DIR" "$GENERATED_DIR/module-graph/gea-module-graph.json")" || { echo "Package native builds failed for '$APP_ID'" >&2; exit 1; }
2226
+ while IFS= read -r line; do
2227
+ [[ -n "$line" ]] || continue
2228
+ kind="${line%% *}"; file="${line#* }"
2229
+ if [[ "$kind" == lib ]]; then dest="$APP_BUNDLE/Contents/Frameworks/$(basename "$file")"; else dest="$RES_DIR/$(basename "$file")"; fi
2230
+ mkdir -p "$(dirname "$dest")"
2231
+ if [[ ! -f "$dest" ]] || ! cmp -s "$file" "$dest"; then
2232
+ cp "$file" "$dest"
2233
+ BUNDLE_CONTENT_CHANGED=1
2234
+ fi
2235
+ done <<< "$PACKAGE_BUILDS"
2236
+ fi
2200
2237
  timing_mark resources
2201
2238
 
2202
2239
  # Ad-hoc sign only after an input changed. The completion stamp is deliberately