@expo/repack-app 0.2.12 → 0.2.13

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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -42,7 +42,7 @@ ${n}
42
42
  ${i}
43
43
  )
44
44
  end
45
- `.replace(/^\s*[\r\n]/gm,"")}var Un=P(Kg()),Ji=P(require("node:assert")),he=P(require("node:fs/promises")),Ri=P(require("node:path"));async function Gg({config:t,infoPlistPath:o,originalAppId:e,options:s}){let i=t.ios?.bundleIdentifier;(0,Ji.default)(i,"The `bundleIdentifier` must be specified in the `ios` config.");let r=Array.isArray(t.scheme)?t.scheme[0]:t.scheme;await An(o,s,n=>{let a=n.CFBundleURLTypes.slice();for(let m of a)if(Array.isArray(m.CFBundleURLSchemes)){let w=m.CFBundleURLSchemes.map(f=>{let k=f.replace(e,i).replace(/^exp\+.+$/g,`exp+${Ie(t.slug)}`);return r&&(k=f.replace(/^myapp$/g,r)),k});m.CFBundleURLSchemes=w}let c=t.ios?.version||t.version||"1.0.0",u=t.ios?.buildNumber||"1",d={...n,CFBundleDisplayName:t.name,CFBundleName:t.name,CFBundleExecutable:zi(t.name),CFBundleIdentifier:i,CFBundleVersion:c,CFBundleShortVersionString:u},x=n.NSUserActivityTypes?.map(m=>m.replace(e,i));return x&&(d.NSUserActivityTypes=x),d})}async function bg(t,o,e,s){await An(o,s,i=>{let r=t.updates?.enabled??!0,n={...i,EXUpdatesEnabled:r};e&&(n.EXUpdatesRuntimeVersion=e);let a=t.updates?.url;return a&&(n.EXUpdatesURL=a),n})}async function vg(t,o){let e,s;return await An(t,o,i=>(e=i.CFBundleIdentifier,s=i.CFBundleExecutable,i)),(0,Ji.default)(e,"Expected `CFBundleIdentifier` to be present in Info.plist"),(0,Ji.default)(s,"Expected `CFBundleExecutable` to be present in Info.plist"),{appId:e,executableName:s}}async function Wg({appWorkingDirectory:t,assetRoot:o,bundleOutputPath:e}){await Promise.all([he.default.rm(Ri.default.join(t,"main.jsbundle"),{force:!0}),he.default.rm(Ri.default.join(t,"assets"),{recursive:!0,force:!0})]),await he.default.copyFile(e,Ri.default.join(t,"main.jsbundle")),await Js(o)&&await Rt(o,t)}async function An(t,o,e){let{spawnAsync:s}=o;await s("plutil",["-convert","xml1",t]);let i=await he.default.readFile(t,"utf8"),r=await Un.default.parse(i),n=e(r),a=Un.default.build(n);await he.default.writeFile(t,a),await s("plutil",["-convert","binary1",t])}async function qg(t){let o=await Ze(t),{workingDirectory:e,logger:s}=o;await ht.default.mkdir(e,{recursive:!0}),_i(o.projectRoot,o.env);let{exp:i}=yi(o.projectRoot,{isPublicConfig:!0,skipSDKVersionRequirement:!0});(0,Bi.default)(i.ios?.bundleIdentifier,"Expected app ID (`ios.bundleIdentifier`) to be defined in app.json");let r=di(o.projectRoot),n=r?await wi(o,i):null;r&&s.info(pg.default.dim(`Resolved runtime version: ${n}`)),s.time(`Extracting artifact from ${o.sourceAppPath}`);let a=await D_(o),c=Ro.default.join(a,"Info.plist"),{appId:u,executableName:d}=await vg(c,o);a=await $_({config:i,appWorkingDirectory:a,executableName:d});let x=Ro.default.join(a,"Info.plist");if(s.timeEnd(`Extracting artifact from ${o.sourceAppPath}`),await fi({appWorkingDirectory:a,options:o})){s.time("Generating bundle");let{assetRoot:k,bundleOutputPath:W}=await hi(i,o);if(s.timeEnd("Generating bundle"),s.time("Adding bundled resources"),await Wg({appWorkingDirectory:a,assetRoot:k,bundleOutputPath:W}),s.timeEnd("Adding bundled resources"),r){s.time("Generating 'app.manifest' for expo-updates");let p=await Oi(o),q=Ro.default.join(a,"EXUpdates.bundle");(0,Bi.default)(await Js(q),"Expected EXUpdates.bundle directory to exist"),await ht.default.copyFile(p,Ro.default.join(q,Ro.default.basename(p))),s.timeEnd("Generating 'app.manifest' for expo-updates")}}s.time("Updating Info.plist"),await Gg({config:i,infoPlistPath:x,originalAppId:u,options:o}),s.timeEnd("Updating Info.plist"),s.time("Updating Expo.plist"),await bg(i,Ro.default.join(a,"Expo.plist"),n,o),s.timeEnd("Updating Expo.plist"),s.time("Generating app.config");let w=await gi(o,i);await ht.default.copyFile(w,Ro.default.join(a,"EXConstants.bundle","app.config")),s.timeEnd("Generating app.config"),s.time("Creating updated artifact");let f;if(o.outputPath.endsWith(".app")?f=await H_(o,a):f=await ox(o,a),s.timeEnd("Creating updated artifact"),o.iosSigningOptions&&((0,Bi.default)(f.endsWith(".ipa"),"Signing is only supported for .ipa files"),s.time(`Resigning the IPA at ${f}`),await $y(f,o.iosSigningOptions,o),s.timeEnd(`Resigning the IPA at ${f}`)),await ht.default.rename(f,o.outputPath),!o.skipWorkingDirCleanup)try{await ht.default.rm(e,{recursive:!0})}catch{}return o.outputPath}async function $y(t,o,e){let s=await Ze(e),{spawnAsync:i}=s,r=Ro.default.join(s.workingDirectory,"fastlane");await ht.default.mkdir(r,{recursive:!0});let n=tx("resign_ipa",t,o);await ht.default.writeFile(Ro.default.join(r,"Fastfile"),n),await i("fastlane",["resign_ipa"],{cwd:r,env:s.env})}0&&(module.exports={ConsoleLogger,repackAppAndroidAsync,repackAppIosAsync});
45
+ `.replace(/^\s*[\r\n]/gm,"")}var Un=P(Kg()),Ji=P(require("node:assert")),he=P(require("node:fs/promises")),Ri=P(require("node:path"));async function Gg({config:t,infoPlistPath:o,originalAppId:e,options:s}){let i=t.ios?.bundleIdentifier;(0,Ji.default)(i,"The `bundleIdentifier` must be specified in the `ios` config.");let r=Array.isArray(t.scheme)?t.scheme[0]:t.scheme;await An(o,s,n=>{let a=n.CFBundleURLTypes.slice();for(let m of a)if(Array.isArray(m.CFBundleURLSchemes)){let w=m.CFBundleURLSchemes.map(f=>{let k=f.replace(e,i).replace(/^exp\+.+$/g,`exp+${Ie(t.slug)}`);return r&&(k=f.replace(/^myapp$/g,r)),k});m.CFBundleURLSchemes=w}let c=t.ios?.version||t.version||"1.0.0",u=t.ios?.buildNumber||"1",d={...n,CFBundleDisplayName:t.name,CFBundleName:t.name,CFBundleExecutable:zi(t.name),CFBundleIdentifier:i,CFBundleVersion:u,CFBundleShortVersionString:c},x=n.NSUserActivityTypes?.map(m=>m.replace(e,i));return x&&(d.NSUserActivityTypes=x),d})}async function bg(t,o,e,s){await An(o,s,i=>{let r=t.updates?.enabled??!0,n={...i,EXUpdatesEnabled:r};e&&(n.EXUpdatesRuntimeVersion=e);let a=t.updates?.url;return a&&(n.EXUpdatesURL=a),n})}async function vg(t,o){let e,s;return await An(t,o,i=>(e=i.CFBundleIdentifier,s=i.CFBundleExecutable,i)),(0,Ji.default)(e,"Expected `CFBundleIdentifier` to be present in Info.plist"),(0,Ji.default)(s,"Expected `CFBundleExecutable` to be present in Info.plist"),{appId:e,executableName:s}}async function Wg({appWorkingDirectory:t,assetRoot:o,bundleOutputPath:e}){await Promise.all([he.default.rm(Ri.default.join(t,"main.jsbundle"),{force:!0}),he.default.rm(Ri.default.join(t,"assets"),{recursive:!0,force:!0})]),await he.default.copyFile(e,Ri.default.join(t,"main.jsbundle")),await Js(o)&&await Rt(o,t)}async function An(t,o,e){let{spawnAsync:s}=o;await s("plutil",["-convert","xml1",t]);let i=await he.default.readFile(t,"utf8"),r=await Un.default.parse(i),n=e(r),a=Un.default.build(n);await he.default.writeFile(t,a),await s("plutil",["-convert","binary1",t])}async function qg(t){let o=await Ze(t),{workingDirectory:e,logger:s}=o;await ht.default.mkdir(e,{recursive:!0}),_i(o.projectRoot,o.env);let{exp:i}=yi(o.projectRoot,{isPublicConfig:!0,skipSDKVersionRequirement:!0});(0,Bi.default)(i.ios?.bundleIdentifier,"Expected app ID (`ios.bundleIdentifier`) to be defined in app.json");let r=di(o.projectRoot),n=r?await wi(o,i):null;r&&s.info(pg.default.dim(`Resolved runtime version: ${n}`)),s.time(`Extracting artifact from ${o.sourceAppPath}`);let a=await D_(o),c=Ro.default.join(a,"Info.plist"),{appId:u,executableName:d}=await vg(c,o);a=await $_({config:i,appWorkingDirectory:a,executableName:d});let x=Ro.default.join(a,"Info.plist");if(s.timeEnd(`Extracting artifact from ${o.sourceAppPath}`),await fi({appWorkingDirectory:a,options:o})){s.time("Generating bundle");let{assetRoot:k,bundleOutputPath:W}=await hi(i,o);if(s.timeEnd("Generating bundle"),s.time("Adding bundled resources"),await Wg({appWorkingDirectory:a,assetRoot:k,bundleOutputPath:W}),s.timeEnd("Adding bundled resources"),r){s.time("Generating 'app.manifest' for expo-updates");let p=await Oi(o),q=Ro.default.join(a,"EXUpdates.bundle");(0,Bi.default)(await Js(q),"Expected EXUpdates.bundle directory to exist"),await ht.default.copyFile(p,Ro.default.join(q,Ro.default.basename(p))),s.timeEnd("Generating 'app.manifest' for expo-updates")}}s.time("Updating Info.plist"),await Gg({config:i,infoPlistPath:x,originalAppId:u,options:o}),s.timeEnd("Updating Info.plist"),s.time("Updating Expo.plist"),await bg(i,Ro.default.join(a,"Expo.plist"),n,o),s.timeEnd("Updating Expo.plist"),s.time("Generating app.config");let w=await gi(o,i);await ht.default.copyFile(w,Ro.default.join(a,"EXConstants.bundle","app.config")),s.timeEnd("Generating app.config"),s.time("Creating updated artifact");let f;if(o.outputPath.endsWith(".app")?f=await H_(o,a):f=await ox(o,a),s.timeEnd("Creating updated artifact"),o.iosSigningOptions&&((0,Bi.default)(f.endsWith(".ipa"),"Signing is only supported for .ipa files"),s.time(`Resigning the IPA at ${f}`),await $y(f,o.iosSigningOptions,o),s.timeEnd(`Resigning the IPA at ${f}`)),await ht.default.rename(f,o.outputPath),!o.skipWorkingDirCleanup)try{await ht.default.rm(e,{recursive:!0})}catch{}return o.outputPath}async function $y(t,o,e){let s=await Ze(e),{spawnAsync:i}=s,r=Ro.default.join(s.workingDirectory,"fastlane");await ht.default.mkdir(r,{recursive:!0});let n=tx("resign_ipa",t,o);await ht.default.writeFile(Ro.default.join(r,"Fastfile"),n),await i("fastlane",["resign_ipa"],{cwd:r,env:s.env})}0&&(module.exports={ConsoleLogger,repackAppAndroidAsync,repackAppIosAsync});
46
46
  /*! Bundled license information:
47
47
 
48
48
  sax/lib/sax.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/repack-app",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "description": "Repacking tool for Expo apps",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",