feat(ios): runtime .pulsar bundle loader + SwiftPM plugin (2/6) - #203
Merged
Conversation
Foundation for custom preset bundles. Defines the .pulsar format (ZIP + manifest.json), a JSON schema, and pulsar-gen: a zero-dependency Node/TS CLI that reads a .pulsar and emits typed accessors for swift/kotlin/dart and an RN JSON sidecar (keyof-inference, nano-icons style). Includes a fixture bundle, golden outputs, and a node:test suite (7 passing). Portable emitter core is reusable from Studio's browser exporter.
Adds runtime bundle loading to the standalone iOS SDK (PulsarHaptics), the artifact RN + Flutter link against: - Bundle/PulsarUnzip.swift: minimal STORE+DEFLATE zip reader over the Compression framework (no new dependency). - Bundle/PulsarBundle.swift: Codable manifest, PresetHandle (lazy parse, synced audio via parsePatternWithSound, animation bytes for the app to render), LoadedBundle (untyped string-keyed surface for the RN/Flutter bridges), and the typed PulsarBundle<P>/BundleDescriptor<P>/BundleResolver. - Bundle/BundleLoader.swift: Pulsar.loadBundle(data:/path:) + typed loadBundle(_:strict:); haptics JSON decodes straight into PatternData; audio extracted to caches for Core Haptics. - pulsar-gen-swift host tool + PulsarGenPlugin build-tool plugin: regenerate the typed accessor on every build, no Node/network in the sandbox. - BundleTests: unzip + load + typed-view + schema-rejection (Swift Testing). The loaded bundle owns its handles, so no change to the compiled preset registry. Note: native/plugin code is not compiled in this environment (iOS/UIKit); verify via xcodebuild on a simulator.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack 2/6 — base:
feat/preset-bundles-format.What
Runtime bundle loading in the standalone iOS SDK (
PulsarHaptics, the pod RN + Flutter link against).Bundle/PulsarUnzip.swift— minimal STORE+DEFLATE zip reader over theCompressionframework (no new dependency).Bundle/PulsarBundle.swift— Codable manifest;PresetHandle(lazy parse, synced audio viaparsePatternWithSound, animation bytes exposed for the app to render);LoadedBundle(untyped string-keyed surface for the RN/Flutter bridges); typedPulsarBundle<P>/BundleDescriptor<P>/BundleResolver.Bundle/BundleLoader.swift—Pulsar.loadBundle(data:/path:)+ typedloadBundle(_:strict:). Haptics JSON decodes straight into the existingPatternData; audio extracted to caches for Core Haptics.pulsar-gen-swifthost tool +PulsarGenPluginbuild-tool plugin — regenerate the typed accessor on every build, no Node in the sandbox.BundleTests(Swift Testing): unzip + load + typed-view + schema rejection.The loaded bundle owns its handles, so the compiled preset registry is untouched.
Verification
xcodebuild teston a simulator (the design reusesPatternData/Player/PatternComposerand existing test patterns).