({ packageName, packageRoot, files, target })
| 199 | } |
| 200 | |
| 201 | async function packageManifestEntries({ packageName, packageRoot, files, target }) { |
| 202 | const root = `node_modules/${packageName}`; |
| 203 | const entries = []; |
| 204 | const assets = {}; |
| 205 | |
| 206 | for (const file of files) { |
| 207 | const sourceBytes = await readFile(file); |
| 208 | const packageRelativePath = toPosixPath(relative(packageRoot, file)); |
| 209 | const relativePath = `${root}/${packageRelativePath}`; |
| 210 | const assetKey = `native/${target}/${relativePath}`; |
| 211 | entries.push({ |
| 212 | assetKey, |
| 213 | relativePath, |
| 214 | sha256: sha256(sourceBytes), |
| 215 | }); |
| 216 | assets[assetKey] = file; |
| 217 | } |
| 218 | |
| 219 | return { |
| 220 | packageManifest: { |
| 221 | name: packageName, |
| 222 | root, |
| 223 | files: entries, |
| 224 | }, |
| 225 | assets, |
| 226 | }; |
| 227 | } |
| 228 | |
| 229 | export const nativeAssetManifestKey = buildManifestKey; |
| 230 |
no test coverage detected