@tokamakdev/platform-macos-x64 0.1.1-beta.163 → 0.1.1-beta.165

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.
@@ -128,7 +128,7 @@ if [[ "$platform" == macos ]]; then
128
128
  app_dir=$resources_dir/app
129
129
  icon=${TOKAMAK_MACOS_ICON:-}
130
130
  splash=${TOKAMAK_MACOS_SPLASH_WIDTH:-}
131
- app_files=("${TOKAMAK_MACOS_PLIST:-}" "${TOKAMAK_MACOS_ENTITLEMENTS:-}" "${TOKAMAK_MACOS_SPLASH_IMAGE:-}" "${TOKAMAK_MACOS_SPLASH_IMAGE_DARK:-}")
131
+ app_files=("${TOKAMAK_MACOS_PLIST:-}" "${TOKAMAK_MACOS_PRIVACY_MANIFEST:-}" "${TOKAMAK_MACOS_ENTITLEMENTS:-}" "${TOKAMAK_MACOS_SPLASH_IMAGE:-}" "${TOKAMAK_MACOS_SPLASH_IMAGE_DARK:-}")
132
132
  else
133
133
  contents=$bundle
134
134
  executable_dir=$bundle
@@ -136,7 +136,7 @@ else
136
136
  app_dir=$bundle/app
137
137
  icon=${TOKAMAK_IOS_ICON:-}
138
138
  splash=${TOKAMAK_IOS_SPLASH_WIDTH:-}
139
- app_files=("${TOKAMAK_IOS_PLIST:-}" "${TOKAMAK_IOS_ENTITLEMENTS:-}" "${TOKAMAK_IOS_SPLASH_IMAGE:-}" "${TOKAMAK_IOS_SPLASH_IMAGE_DARK:-}")
139
+ app_files=("${TOKAMAK_IOS_PLIST:-}" "${TOKAMAK_IOS_PRIVACY_MANIFEST:-}" "${TOKAMAK_IOS_ENTITLEMENTS:-}" "${TOKAMAK_IOS_SPLASH_IMAGE:-}" "${TOKAMAK_IOS_SPLASH_IMAGE_DARK:-}")
140
140
  fi
141
141
  if [[ -n "$icon" && ! ( -d "$icon" && "$icon" == *.[iI][cC][oO][nN] ) ]]; then
142
142
  echo "$platform.icon must be an Icon Composer .icon package: $icon" >&2
@@ -254,8 +254,9 @@ ln -s "$pack/frameworks/TokamakRuntime.xcframework" "$app_package/TokamakRuntime
254
254
  # A plugin's class is a Swift type named with its module, which the package's
255
255
  # library product of the module's name provides.
256
256
  swift_type='^([A-Za-z_][A-Za-z0-9_]*)(\.[A-Za-z_][A-Za-z0-9_]*)+$'
257
- # A plugin's compilation conditions start with its id in capitals, such as
258
- # LOCATION_ for location, as each one applies to every module the app compiles.
257
+ # A plugin's compilation conditions start with its id as words in capitals,
258
+ # such as SECURE_STORAGE_ for secureStorage, as each one applies to every
259
+ # module the app compiles.
259
260
  compilation_conditions=
260
261
  dependencies=" .package(path: \"$plugin_api\"),"$'\n'
261
262
  products=" .product(name: \"TokamakPlugin\", package: \"TokamakPlugin\"),"$'\n'
@@ -273,7 +274,7 @@ for plugin in "$input/plugins"/*/; do
273
274
  echo "plugin '$plugin_id' has no Swift package, apple/Package.swift" >&2
274
275
  exit 1
275
276
  fi
276
- condition_prefix=$(printf '%s' "$plugin_id" | tr 'a-z-' 'A-Z_')_
277
+ condition_prefix=$(printf '%s' "$plugin_id" | sed 's/[A-Z]/_&/g' | tr 'a-z' 'A-Z')_
277
278
  for condition_file in "$plugin/compilation-conditions"/*; do
278
279
  condition=$(<"$condition_file")
279
280
  if [[ ! "$condition" =~ ^${condition_prefix}[A-Za-z0-9_]+$ ]]; then
@@ -412,6 +413,7 @@ for framework in "$products"/PackageFrameworks/*.framework; do
412
413
  done
413
414
 
414
415
  write_plist
416
+ "$apple_tool" privacy-manifest --input "$input" --output "$resources_dir/PrivacyInfo.xcprivacy"
415
417
 
416
418
  # Plugins' resources go in the bundle's resources directory, where the system
417
419
  # finds files such as notification sounds by name.
@@ -151,7 +151,7 @@ final class TokamakApp: TokamakHostApp {
151
151
  }
152
152
 
153
153
  /// Delivers the event `name`, whose encoded data is `payload`, to the
154
- /// Worker's method of that name, and calls `completion` on the main thread
154
+ /// Worker's handler of that name, and calls `completion` on the main thread
155
155
  /// with its encoded reply, which is empty when it returns nothing. Fails
156
156
  /// unless it returns within `timeout`, which includes runtime startup. Call
157
157
  /// it on the main thread.
@@ -456,7 +456,7 @@ final class RuntimeHandle {
456
456
  }
457
457
 
458
458
  /// Delivers the event `name`, whose encoded data is `payload`, to the
459
- /// Worker's method of that name, blocking until it returns or `timeout`
459
+ /// Worker's handler of that name, blocking until it returns or `timeout`
460
460
  /// passes, and returns its encoded reply, which is empty when it returns
461
461
  /// nothing.
462
462
  func emit(_ name: String, payload: Data, timeout: TimeInterval) throws -> Data {
@@ -14,6 +14,10 @@
14
14
  "kind": "path",
15
15
  "description": "Info.plist whose values take precedence over generated and plugin values"
16
16
  },
17
+ "privacy-manifest": {
18
+ "kind": "path",
19
+ "description": "PrivacyInfo.xcprivacy used in place of the generated privacy manifest"
20
+ },
17
21
  "team-id": {
18
22
  "kind": "string",
19
23
  "description": "Apple Development team to sign with; builds are ad-hoc signed without one"
@@ -23,6 +27,7 @@
23
27
  "class": "string",
24
28
  "compilation-conditions": "strings",
25
29
  "plist": "path",
30
+ "privacy-manifest": "path",
26
31
  "resources": "paths"
27
32
  }
28
33
  }
@@ -40,8 +40,8 @@ public enum TokamakOverflow {
40
40
  /// replies are `Decodable`, method results and events `Encodable`, and options
41
41
  /// literal values.
42
42
  public struct TokamakExporter<Plugin> {
43
- /// Lists the event `name`: the Worker's method `name`, which starts with
44
- /// `_`, receives an `E`.
43
+ /// Lists the event `name`: the Worker's handler `name`, in its property
44
+ /// for the plugin, receives an `E`.
45
45
  public mutating func event<E: Encodable>(_ name: String, _ type: E.Type, doc: String = "") {}
46
46
 
47
47
  /// Lists the event `name`, whose handler receives an `E` and may reply with an `R`.
@@ -125,7 +125,7 @@ public protocol TokamakHostApp: AnyObject {
125
125
  #endif
126
126
 
127
127
  /// Delivers the event `name`, whose encoded data is `payload`, to the
128
- /// Worker's method of that name, and calls `completion` on the main thread
128
+ /// Worker's handler of that name, and calls `completion` on the main thread
129
129
  /// with its encoded reply, which is empty when it returns nothing. Fails
130
130
  /// unless it returns within `timeout`, which includes runtime startup.
131
131
  func emit(
@@ -183,23 +183,23 @@ public final class TokamakHost {
183
183
  }
184
184
  #endif
185
185
 
186
- /// Delivers the plugin's event `name` to the Worker's method of that name,
187
- /// with its encoded `payload`, and calls `completion` on the main thread
188
- /// with the method's encoded reply, which is empty when it returns nothing.
189
- /// Fails unless it returns within `timeout`, which includes runtime
190
- /// startup. Call it on the main thread.
186
+ /// Delivers the plugin's event `name` to the Worker's handler of that name,
187
+ /// in its property for the plugin, with its encoded `payload`, and calls
188
+ /// `completion` on the main thread with the handler's encoded reply, which
189
+ /// is empty when it returns nothing. Fails unless it returns within
190
+ /// `timeout`, which includes runtime startup. Call it on the main thread.
191
191
  public func emitBytes(
192
192
  _ name: String,
193
193
  payload: Data,
194
194
  timeout: TimeInterval,
195
195
  completion: @escaping (Result<Data, Error>) -> Void
196
196
  ) {
197
- app.emit(name, payload: payload, timeout: timeout, completion: completion)
197
+ app.emit("\(plugin).\(name)", payload: payload, timeout: timeout, completion: completion)
198
198
  }
199
199
 
200
- /// Delivers `event` to the Worker's method `name`, the plugin's event that
200
+ /// Delivers `event` to the Worker's handler `name`, the plugin's event that
201
201
  /// `Exports.swift` lists, then calls `completion` on the main thread. Fails
202
- /// unless the method returns within `timeout`, which includes runtime
202
+ /// unless the handler returns within `timeout`, which includes runtime
203
203
  /// startup. Call it on the main thread.
204
204
  public func emit(
205
205
  _ name: String,
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/macos-x64/tools/tokamak-swift-describe
3
3
  size: 34571400 bytes
4
- sha256: 46bebdce722eeb346ca9d2b3c7ef1b53bdba6bbd69aa3f5366d5db4904be25bc
4
+ sha256: 9266ae1318d8faeaa31b6a0c4812053ce33a2eb2ce0ff2fefb43da8fa3b6da98
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokamakdev/platform-macos-x64",
3
- "version": "0.1.1-beta.163",
3
+ "version": "0.1.1-beta.165",
4
4
  "description": "The tokamak platform pack for macos-x64",
5
5
  "repository": {
6
6
  "type": "git",