Repository navigation
Fix pnpm app package discovery and unify tokenizer creation - #480
Merged
Merged
Conversation
The podspec walked up from its own folder to the first package.json. Under pnpm that folder is in the store, so in a monorepo the walk ended at the workspace root and ignored the app's "op-sqlite" config: a SQLCipher app built plain SQLite. Android already reads the app's package.json. The old lookup stays as it was. After it, when CocoaPods found a Podfile, the podspec walks up from the app (the folder above the Podfile), no higher than the folder the old lookup found, and uses the first package.json with an "op-sqlite" key. A config in a monorepo root package.json still works, and nothing above the workspace is read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The autolinker hands SwiftPM this package through a symlink inside the app, and #filePath keeps that path. It is not inside node_modules, so isUserApp was false and the manifest read example/package.json, which the published package does not ship: the app's "op-sqlite" config was ignored. Search from the real directory instead, then prefer the app's package.json as the podspec does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ftPM Reading the app's config switched on tokenizer code that didn't work in consumer apps: SwiftPM failed to compile, and CocoaPods under pnpm looked for c_sources inside the store. Lookup: - Check the app's package.json first, then fall back to the old search, in both the podspec and Package.swift. This replaces the walk and its bound, and also fixes installs outside the app's folder. - isUserApp in Package.swift now looks at the real directory. Tokenizers: - react-native.config.js is now the only place that generates tokenizers.h. The React Native CLI loads it, so `npx react-native config`, `use_native_modules!`, Gradle's autolinking and `spm add`/`update`/`sync` all run it. Remove generate_tokenizers_header_file.rb and the Gradle generator function. - It also copies the app's c_sources into the package, so SwiftPM compiles them the same way the podspec does. Edits to c_sources need `spm update`. - c_sources lives next to the package.json holding the config, and doesn't exist in a from-scratch app. The lifecycle is: set "tokenizers", run the command to generate the folder and header, fill in the sources, commit. All three build systems stop with a message naming the next step if something is missing, and SwiftPM leaves c_sources out of the build when tokenizers are off. Docs: - Add the tokenizer steps to the README and update the tokenizers page. - Android reads only the app's package.json. - SwiftPM's manifest cache ignores package.json edits. Document the command that clears it. - Remove the comment saying SQLCipher is untested under SwiftPM; the ios-sqlcipher CI job covers it.
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.
Follows up the work on #479