@tokamakdev/platform-macos-x64 0.1.1-beta.163 → 0.1.1-beta.164
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/macos-x64/build/entrypoint +4 -3
- package/macos-x64/native-shell/TokamakApp.swift +2 -2
- package/macos-x64/plugin-api/TokamakPlugin/Sources/TokamakPlugin/TokamakExports.swift +2 -2
- package/macos-x64/plugin-api/TokamakPlugin/Sources/TokamakPlugin/TokamakPlugins.swift +9 -9
- package/macos-x64/tools/tokamak-swift-describe +1 -1
- package/package.json +1 -1
|
@@ -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,
|
|
258
|
-
#
|
|
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
|
|
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
|
|
@@ -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
|
|
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
|
|
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 {
|
|
@@ -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
|
|
44
|
-
///
|
|
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
|
|
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
|
|
187
|
-
/// with its encoded `payload`, and calls
|
|
188
|
-
/// with the
|
|
189
|
-
///
|
|
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
|
|
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
|
|
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:
|
|
4
|
+
sha256: 9d3283b01f7b79106409b15f1b467d4fb6a62ccdc3b1ff2bae629a6031af0c57
|