Commit 0e95b89
authored
fix(build): pack phonemis submodule sources in npm tarball (#1182)
## Description
Init the phonemis git submodule in `create-package.sh` so its sources
are present in the published npm tarball. Previously the submodule was
empty at pack time, so the podspec's
`third-party/common/phonemis/src/**/*.{cpp,hpp,h}` source-files glob
found nothing and TTS-using apps could not build from the npm package.
`data/`, `scripts/`, `test/`, and `requirements.txt` are trimmed in the
script (working-tree trim, restored on exit via `trap`) rather than via
the `package.json` `files` field, because the submodule's own
`.gitignore` re-includes `scripts/build*` via `!scripts/build*` and
`npm-packlist` honors that rule against `files` exclusions.
### Introduces a breaking change?
- [ ] Yes
- [x] No
### Type of change
- [x] Bug fix (change which fixes an issue)
- [ ] New feature (change which adds functionality)
- [ ] Documentation update (improves or adds clarity to existing
documentation)
- [ ] Other (chores, tests, code style improvements etc.)
### Tested on
- [x] iOS
- [x] Android
### Testing instructions
1. From `packages/react-native-executorch`, run
`./scripts/create-package.sh`.
2. `tar tzf react-native-executorch-*.tgz | grep phonemis/src | wc -l` →
87 source files.
3. `tar tzf react-native-executorch-*.tgz | grep -E
"phonemis/(data|test|requirements)"` → empty.
4. Install the tarball into a fresh RN/Expo app, run `pod install` +
iOS/Android build; phonemis should compile cleanly into
`libreact-native-executorch.{a,so}`.
### Screenshots
### Related issues
### Checklist
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have updated the documentation accordingly
- [x] My changes generate no new warnings
### Additional notes1 parent ed3d972 commit 0e95b89
1 file changed
Lines changed: 19 additions & 0 deletions
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
3 | 22 | | |
4 | 23 | | |
5 | 24 | | |
| |||
0 commit comments