@absolutejs/absolute 0.20.0-beta.4 → 0.20.0-beta.6
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.
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +341 -22
- package/dist/angular/index.js.map +8 -5
- package/dist/angular/server.js +341 -22
- package/dist/angular/server.js.map +8 -5
- package/dist/build.js +94 -22
- package/dist/build.js.map +9 -9
- package/dist/cli/index.js +986 -557
- package/dist/dev/client/cssUtils.ts +16 -2
- package/dist/dev/client/handlers/rebuild.ts +11 -1
- package/dist/dev/client/hmrTiming.ts +14 -7
- package/dist/index.js +364 -191
- package/dist/index.js.map +17 -17
- package/dist/mobile/browser.js +14 -1
- package/dist/mobile/browser.js.map +3 -3
- package/dist/mobile/index.js +588 -99
- package/dist/mobile/index.js.map +15 -13
- package/dist/mobile/remoteMacAgentEntry.js +8 -8
- package/dist/src/angular/pageHandler.d.ts +3 -0
- package/dist/src/cli/config/server.d.ts +1 -1
- package/dist/src/core/pageHandlers.d.ts +11 -2
- package/dist/src/mobile/androidEmulatorController.d.ts +6 -1
- package/dist/src/mobile/buildPipeline.d.ts +1 -0
- package/dist/src/mobile/capacitorBundle.d.ts +11 -1
- package/dist/src/mobile/client.d.ts +4 -0
- package/dist/src/mobile/index.d.ts +1 -0
- package/dist/src/mobile/nativeAuth.d.ts +17 -0
- package/dist/src/mobile/releaseArtifact.d.ts +2 -0
- package/dist/src/mobile/shellAuth.d.ts +8 -0
- package/dist/src/mobile/shellBootstrap.d.ts +11 -1
- package/dist/src/mobile/shellSync.d.ts +2 -0
- package/dist/src/mobile/staticDocument.d.ts +5 -0
- package/dist/src/mobile/transport.d.ts +9 -1
- package/dist/src/plugins/imageOptimizer.d.ts +1 -1
- package/dist/src/svelte/pageHandler.d.ts +3 -0
- package/dist/src/vue/pageHandler.d.ts +3 -0
- package/dist/svelte/index.js +312 -23
- package/dist/svelte/index.js.map +7 -4
- package/dist/svelte/server.js +307 -18
- package/dist/svelte/server.js.map +7 -4
- package/dist/vue/index.js +312 -23
- package/dist/vue/index.js.map +7 -4
- package/dist/vue/server.js +307 -18
- package/dist/vue/server.js.map +7 -4
- package/package.json +21 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{readFile as pb}from"fs/promises";import{join as tb}from"path";import{createInterface as ob}from"readline";import{resolve as ww}from"path";var fw=/^[A-Za-z][\w]*(?:\.[A-Za-z][\w]*)+$/,yw=/^[a-z][a-z0-9+.-]*$/,
|
|
2
|
+
import{readFile as pb}from"fs/promises";import{join as tb}from"path";import{createInterface as ob}from"readline";import{resolve as ww}from"path";var fw=/^[A-Za-z][\w]*(?:\.[A-Za-z][\w]*)+$/,yw=/^[a-z][a-z0-9+.-]*$/,Pw=/^[A-Z0-9]{10}$/,dw=/^[0-9A-F]{64}$/,gw=/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)(?:\.(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?))*$/,bw=(w,b,$)=>{let A=ww(w),S=ww(A,b);if(S!==A&&!S.startsWith(`${A}/`))throw TypeError(`${$} must remain inside the project root.`);return S},V=(w,b)=>{let $=w.trim();if(!$)throw TypeError(`${b} must not be empty.`);return $},hw=(w)=>{let b=V(w??"/","mobile.entry");if(!b.startsWith("/")||b.startsWith("//"))throw TypeError("mobile.entry must be an absolute application path.");return b},mw=(w)=>{let b=new URL(V(w,"mobile.server.productionOrigin")),$=b.protocol==="http:"&&(b.hostname==="localhost"||b.hostname==="127.0.0.1"||b.hostname==="[::1]");if(b.protocol!=="https:"&&!$)throw TypeError("mobile.server.productionOrigin must use HTTPS, except for a loopback development origin.");if(b.username||b.password||b.pathname!=="/"||b.search||b.hash)throw TypeError("mobile.server.productionOrigin must be an origin without credentials, path, query, or hash.");return b.origin},lw=(w)=>{let b=[...new Set(w??["ios","android"])];if(b.length===0)throw TypeError("mobile.platforms must contain at least one platform.");return b},jw=(w,b)=>{let $=(M)=>{let O=V(M,"mobile.deepLinks.hosts").toLowerCase();if(!gw.test(O))throw TypeError("mobile.deepLinks.hosts entries must be valid hostnames without ports, wildcards, or paths.");return O},A=new URL(b).hostname,S=new Set(A==="[::1]"?[]:[$(A)]);for(let M of w??[])S.add($(M));return[...S].sort()},uw=(w)=>{if(w===void 0)return;let b=V(w,"mobile.deepLinks.apple.appIdPrefix").toUpperCase();if(!Pw.test(b))throw TypeError("mobile.deepLinks.apple.appIdPrefix must contain ten letters or digits.");return b},vw=(w)=>{if(w===void 0)return;let b=V(w,"mobile.ios.version");if(!/^\d+(?:\.\d+){0,2}$/u.test(b))throw TypeError("mobile.ios.version must contain one to three dot-separated integer components, for example 1.4.0.");return b},cw=(w)=>[...new Set((w??[]).map((b)=>V(b,"mobile.deepLinks.android.sha256CertificateFingerprints").replaceAll(":","").toUpperCase()).map((b)=>{if(!dw.test(b))throw TypeError("mobile.deepLinks.android.sha256CertificateFingerprints entries must be SHA-256 certificate fingerprints.");return b.match(/.{2}/g)?.join(":")??b}))].sort(),$w=(w,b)=>{let $=V(w.appId,"mobile.appId");if(!fw.test($))throw TypeError("mobile.appId must use reverse-domain notation, for example com.example.app.");let A=mw(w.server.productionOrigin),S=(w.deepLinks?.scheme??$).trim().toLowerCase();if(S&&!yw.test(S))throw TypeError("mobile.deepLinks.scheme is not a valid URL scheme.");return{androidCertificateFingerprints:cw(w.deepLinks?.android?.sha256CertificateFingerprints),appId:$,appleAppIdPrefix:uw(w.deepLinks?.apple?.appIdPrefix),appName:V(w.appName,"mobile.appName"),bundleDirectory:bw(b,w.bundleDirectory??".absolutejs/mobile/web","mobile.bundleDirectory"),deepLinkHosts:jw(w.deepLinks?.hosts,A),deepLinkScheme:S,engine:"capacitor",entry:hw(w.entry),iosVersion:vw(w.ios?.version),nativeProjectDirectory:bw(b,w.nativeProject?.directory??"mobile","mobile.nativeProject.directory"),platforms:lw(w.platforms),productionOrigin:A}};import{createHash as Nb,randomUUID as Wb}from"crypto";import{access as _b,copyFile as _w,mkdir as y,readFile as j,rename as Ib,rm as s,writeFile as Z}from"fs/promises";import{dirname as Gw,isAbsolute as Ub,join as I,relative as Xb,resolve as u,sep as Hb}from"path";import{access as sw}from"fs/promises";import{homedir as Mw}from"os";import{join as q}from"path";import{existsSync as _$,readFileSync as aw}from"fs";var k=1000;var Aw=60000;var v=2;var h=(w)=>{let b;if(w<k)b=`${w.toFixed(v)}ms`;else if(w<Aw)b=`${(w/k).toFixed(v)}s`;else{let $=Math.round(w/k),A=Math.floor($/60),S=$%60;b=S===0?`${A}m`:`${A}m ${S}s`}return b};var Sw=()=>{try{let w=aw("/proc/version","utf-8");return/microsoft|wsl/i.test(w)}catch{return!1}};var Ow="AbsoluteJS_API_36",nw=(w)=>{try{let b=Bun.spawnSync(w,{stderr:"ignore",stdout:"pipe"});return{exitCode:b.exitCode,stdout:b.stdout.toString()}}catch{return{exitCode:1,stdout:""}}},rw=(w)=>{try{let b=JSON.parse(w);if(typeof b!=="object"||b===null)return!1;let $=Reflect.get(b,"runtimes");if(!Array.isArray($))return!1;return $.some((A)=>typeof A==="object"&&A!==null&&Reflect.get(A,"isAvailable")===!0&&typeof Reflect.get(A,"identifier")==="string"&&String(Reflect.get(A,"identifier")).includes("iOS"))}catch{return!1}},iw=(w)=>{let b=/^([a-z]):[\\/](.*)$/i.exec(w.trim());if(!b)return w.trim().replaceAll("\\","/");return`/mnt/${b[1]?.toLowerCase()}/${b[2]?.replaceAll("\\","/")}`},pw=()=>{try{let w=Bun.spawnSync(["cmd.exe","/d","/c","echo","%LOCALAPPDATA%"],{stderr:"ignore",stdout:"pipe"});if(w.exitCode!==0)return;let b=w.stdout.toString().trim();if(!b||b==="%LOCALAPPDATA%")return;return iw(b)}catch{return}},tw=(w,b=process.env)=>{if(w==="windows")return q(b.LOCALAPPDATA??q(Mw(),"AppData","Local"),"AbsoluteJS","Android","Sdk");if(w==="wsl"){let $=pw();if($)return q($,"AbsoluteJS","Android","Sdk")}return q(Mw(),".absolutejs","android-sdk")},ow=async(w)=>{try{return await sw(w),!0}catch{return!1}},m=(w=process.platform,b=Sw())=>{if(w==="darwin")return"macos";if(w==="win32")return"windows";if(w==="linux"&&b)return"wsl";return"linux"},ew=(w,b)=>{if(w==="wsl")return[`${b}.exe`,`${b}.bat`,b];if(w==="windows")return[b,`${b}.exe`,`${b}.bat`];return[b]},Q=async(w,b,$,A)=>{let M=(await Promise.all(b.map(async(O)=>await $.exists(O)?O:void 0))).find((O)=>O!==void 0);if(M)return M;for(let O of ew(A,w)){let J=$.which(O);if(J)return J}return},T=(w,b,$,A,S)=>A?{id:w,label:b,path:A,platform:$,status:"pass"}:{id:w,label:b,platform:$,remediation:S,status:"fail"},Dw=async(w={})=>{let b=w.env??process.env,$=w.host??m(),A=w.exists??ow,S=w.which??((N)=>Bun.which(N)),M=w.capture??nw,O=w.androidRoot===null?void 0:w.androidRoot??b.ANDROID_HOME??b.ANDROID_SDK_ROOT??tw($,b),J=$==="windows"||$==="wsl",D=(N)=>O?q(O,...N):void 0,C=(N)=>N.filter((B)=>Boolean(B)),x=await Q("adb",C([D(["platform-tools",J?"adb.exe":"adb"])]),{exists:A,which:S},$),K=await Q("emulator",C([D(["emulator",J?"emulator.exe":"emulator"])]),{exists:A,which:S},$),Y=await Q("sdkmanager",C([D(["cmdline-tools","latest","bin",J?"sdkmanager.bat":"sdkmanager"])]),{exists:A,which:S},$),P=await Q("avdmanager",C([D(["cmdline-tools","latest","bin",J?"avdmanager.bat":"avdmanager"])]),{exists:A,which:S},$),U=await Q("java",[],{exists:A,which:S},$),_=[{id:"host",label:`Development host: ${$}`,platform:"host",status:"pass"},T("android.adb","Android Debug Bridge","android",x,"Install Android SDK Platform Tools or expose adb on PATH."),T("android.emulator","Android Emulator","android",K,"Install the Android Emulator from Android Studio SDK Manager."),T("android.sdkmanager","Android SDK Manager","android",Y,"Install Android SDK Command-line Tools (latest)."),T("android.avdmanager","Android Virtual Device Manager","android",P,"Install Android SDK Command-line Tools (latest)."),T("android.java","Java runtime","android",U,"Install the JDK required by the configured Android Gradle plugin.")];if(K){let N=M([K,"-list-avds"]),B=N.exitCode===0&&N.stdout.split(/\r?\n/).includes(Ow);_.push({id:"android.avd",label:`AbsoluteJS Android emulator (${Ow})`,platform:"android",remediation:B?void 0:"Run absolute mobile doctor android --fix to provision the managed emulator.",status:B?"pass":"fail"})}if($==="wsl")_.push({id:"android.virtualization",label:x?.endsWith(".exe")?"Windows-host Android bridge available to WSL":"WSL requires a Windows-host emulator bridge or Linux KVM",platform:"android",remediation:x?.endsWith(".exe")?void 0:"Expose the Windows Android SDK adb.exe to WSL, or enable /dev/kvm for a Linux SDK.",status:x?.endsWith(".exe")?"pass":"warn"});else if($==="linux"){let N=await A("/dev/kvm");_.push({id:"android.virtualization",label:"Linux KVM acceleration",platform:"android",remediation:N?void 0:"Enable KVM and grant the current user access to /dev/kvm.",status:N?"pass":"warn"})}if($!=="macos")return _.push({id:"ios.simulator",label:"iOS Simulator requires macOS and Xcode",platform:"ios",status:"skip"}),_;let G=await Q("xcrun",[],{exists:A,which:S},$),W=await Q("xcodebuild",[],{exists:A,which:S},$);if(_.push(T("ios.xcrun","Xcode command runner","ios",G,"Install Xcode and select it with xcode-select."),T("ios.xcodebuild","Xcode build system","ios",W,"Install Xcode and select it with xcode-select.")),G){let N=M([G,"simctl","list","runtimes","--json"]),B=N.exitCode===0&&rw(N.stdout);_.push({id:"ios.runtime",label:"iOS Simulator runtime",platform:"ios",remediation:B?void 0:"Run absolute mobile doctor ios --fix to download an iOS Simulator runtime.",status:B?"pass":"fail"})}return _};import{access as wb,readFile as bb,rename as $b,writeFile as Ab}from"fs/promises";import{relative as Sb,resolve as Cw}from"path";var Jw="capacitor.config.ts",c=(w,b)=>Sb(w,b).replaceAll("\\","/"),Mb=(w,b)=>`import type { CapacitorConfig } from '@capacitor/cli';
|
|
3
3
|
|
|
4
4
|
const config: CapacitorConfig = {
|
|
5
5
|
appId: ${JSON.stringify(w.appId)},
|
|
@@ -14,16 +14,16 @@ const config: CapacitorConfig = {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export default config;
|
|
17
|
-
`,Ob=async(w)=>{try{return await wb(w),!0}catch{return!1}},xw=async(w,b)=>{let $=Cw(b.projectRoot),A=Cw($,Jw),S=Mb(w,$);if(await Ob(A)){if(await bb(A,"utf8")===S)return{changed:!1,path:A};if(!b.force)throw TypeError(`${Jw} already exists and differs; rerun with --force only after reviewing it.`)}let M=`${A}.${crypto.randomUUID()}.tmp`;return await Ab(M,S,{flag:"wx"}),await $b(M,A),{changed:!0,path:A}};import{createHash as Db}from"crypto";import{access as
|
|
17
|
+
`,Ob=async(w)=>{try{return await wb(w),!0}catch{return!1}},xw=async(w,b)=>{let $=Cw(b.projectRoot),A=Cw($,Jw),S=Mb(w,$);if(await Ob(A)){if(await bb(A,"utf8")===S)return{changed:!1,path:A};if(!b.force)throw TypeError(`${Jw} already exists and differs; rerun with --force only after reviewing it.`)}let M=`${A}.${crypto.randomUUID()}.tmp`;return await Ab(M,S,{flag:"wx"}),await $b(M,A),{changed:!0,path:A}};import{createHash as Db}from"crypto";import{access as L$,copyFile as k$,mkdir as q$,mkdtemp as z$,readdir as Cb,readFile as Jb,rename as R$,rm as f$,stat as y$,writeFile as P$}from"fs/promises";import{dirname as g$,isAbsolute as h$,join as xb,relative as Kw,resolve as m$,sep as l$}from"path";var Kb=new Set(["Pods","DerivedData","build","xcuserdata"]),Nw=async(w,b=w)=>{let $=await Cb(b,{withFileTypes:!0});return(await Promise.all($.sort((S,M)=>S.name.localeCompare(M.name)).map(async(S)=>{let M=xb(b,S.name),O=Kw(w,M).replaceAll("\\","/");if(S.isDirectory()&&(Kb.has(S.name)||O==="App/App/public"))return[];if(S.isDirectory())return Nw(w,M);return S.isFile()?[M]:[]}))).flat()},Ww=async(w)=>{let b=Db("sha256"),$=await Nw(w),A=await Promise.all($.map((S)=>Jb(S)));return $.forEach((S,M)=>{b.update(Kw(w,S).replaceAll("\\","/")),b.update("\x00"),b.update(A[M]??new Uint8Array),b.update("\x00")}),b.digest("hex")};var a="AbsoluteJS iPhone",Iw=180000,Bb=1000,n=1,Vw=1,X=(w)=>typeof w==="object"&&w!==null&&!Array.isArray(w),F=async(w)=>{try{return await _b(w),!0}catch{return!1}},R=(w)=>w?.throwIfAborted(),Gb=(w,b={})=>{try{let $=Bun.spawnSync(w,{cwd:b.cwd,env:b.env,stderr:"pipe",stdin:"ignore",stdout:"pipe"});return{exitCode:$.exitCode,stderr:$.stderr.toString(),stdout:$.stdout.toString()}}catch($){return{exitCode:1,stderr:$ instanceof Error?$.message:String($),stdout:""}}},Yw=async(w,b={})=>{return Bun.spawn(w,{cwd:b.cwd,env:b.env,signal:b.signal,stderr:"inherit",stdin:"inherit",stdout:"inherit"}).exited},Vb=(w,b={})=>{Bun.spawn(w,{cwd:b.cwd,env:b.env,signal:b.signal,stderr:"ignore",stdin:"ignore",stdout:"ignore"})},Uw=async(w,b)=>{let $=w.getReader(),A=new TextDecoder,S="",M=async()=>{let{done:O,value:J}=await $.read();if(O)return;S+=A.decode(J,{stream:!0});let D=S.split(/\r?\n/u);S=D.pop()??"",D.forEach(b),await M()};try{if(await M(),S+=A.decode(),S)b(S)}finally{$.releaseLock()}},Yb=(w,b,$)=>{let A=Bun.spawn(w,{cwd:b.cwd,env:b.env,signal:b.signal,stderr:"pipe",stdin:"ignore",stdout:"pipe"});return Uw(A.stdout,$),Uw(A.stderr,$),{close:async()=>{try{A.kill()}catch{}await A.exited.catch(()=>{return})}}},E=async(w,b,$,A)=>{let S=await $(w,A);if(S!==0)throw Error(`${b} failed with status ${S}.`)},f=(w,b)=>{if(w.exitCode!==0)throw Error(`${b} failed: ${w.stderr.trim()||w.stdout.trim()||`status ${w.exitCode}`}`);return w.stdout.trim()},r=(w,b)=>{try{let $=JSON.parse(w);if(X($))return $}catch{}throw Error(`Invalid ${b} JSON from simctl.`)},Qb=(w)=>{let $=r(w,"device type").devicetypes;if(!Array.isArray($))return[];return $.flatMap((A)=>{if(!X(A))return[];let{identifier:S}=A,{name:M}=A;return typeof S==="string"&&typeof M==="string"?[{identifier:S,name:M}]:[]})},Tb=(w)=>{let b=r(w,"runtime"),{runtimes:$}=b;if(!Array.isArray($))return[];return $.flatMap((A)=>{if(!X(A))return[];let{identifier:S}=A,{name:M}=A,{version:O}=A;if(typeof S!=="string"||typeof M!=="string"||typeof O!=="string")return[];return[{identifier:S,isAvailable:A.isAvailable!==!1,name:M,version:O}]})},Zb=(w)=>{let b=r(w,"device"),{devices:$}=b;if(!X($))return[];return Object.entries($).flatMap(([A,S])=>{if(!Array.isArray(S))return[];return S.flatMap((M)=>{if(!X(M))return[];let{name:O}=M,{state:J}=M,{udid:D}=M;if(typeof O!=="string"||typeof J!=="string"||typeof D!=="string")return[];return[{isAvailable:M.isAvailable!==!1,name:O,runtime:A,state:J,udid:D}]})})},Xw=(w)=>w.split(".").map((b)=>Number(b)),Eb=(w,b)=>{let $=Xw(w),A=Xw(b),S=Math.max($.length,A.length);for(let M=0;M<S;M++){let O=($[M]??0)-(A[M]??0);if(O!==0)return O}return 0},Fb=(w)=>w.filter((b)=>b.isAvailable&&b.identifier.includes("SimRuntime.iOS-")).sort((b,$)=>Eb($.version,b.version))[0],Hw=(w)=>Number(/iPhone\s+(\d+)/u.exec(w)?.[1]??0),Lb=(w)=>w.filter((b)=>b.name.startsWith("iPhone")).sort((b,$)=>{let A=Hw($.name)-Hw(b.name);if(A!==0)return A;let S=$.name.includes("Pro")?1:0,M=b.name.includes("Pro")?1:0;return S-M})[0],Qw=(w)=>{let b=I(w,".absolutejs","mobile","ios-dev-session");return{configBackup:I(b,"capacitor-config.backup"),infoBackup:I(b,"Info.plist.backup"),journal:I(b,"journal.json"),root:b}},Tw=(w)=>I(w,".absolutejs","mobile","ios-native-cache.json"),z=(w,b)=>{let $=Xb(u(w),u(b));return $===""||!$.startsWith(`..${Hb}`)&&$!==".."&&!Ub($)},kb=(w)=>{if(!X(w)||w.format!==n)return null;let{configBackupPath:b}=w,{infoBackupPath:$}=w,{infoPath:A}=w,{nativeConfigPath:S}=w;if(typeof b!=="string"||typeof $!=="string"||typeof A!=="string"||typeof S!=="string")return null;return{configBackupPath:b,format:n,infoBackupPath:$,infoPath:A,nativeConfigPath:S}},l=async(w)=>{let b=Qw(w);if(!await F(b.journal))return await s(b.root,{force:!0,recursive:!0}),!1;let $=await j(b.journal,"utf8").then((A)=>kb(JSON.parse(A))).catch(()=>null);if(!$||!z(w,$.nativeConfigPath)||!z(w,$.infoPath)||!z(b.root,$.configBackupPath)||!z(b.root,$.infoBackupPath))throw Error(`Refusing unsafe or invalid iOS dev journal at ${b.journal}.`);if(await F($.configBackupPath))await _w($.configBackupPath,$.nativeConfigPath);if(await F($.infoBackupPath))await _w($.infoBackupPath,$.infoPath);return await s(b.root,{force:!0,recursive:!0}),!0},qb=(w,b)=>{if(!b)return w;let $=/(<key>NSAllowsArbitraryLoads<\/key>\s*)<false\s*\/>/u;if($.test(w))return w.replace($,"$1<true/>");if(/<key>NSAllowsArbitraryLoads<\/key>\s*<true\s*\/>/u.test(w))return w;let A=/(<key>NSAppTransportSecurity<\/key>\s*<dict>)/u;if(A.test(w))return w.replace(A,`$1
|
|
18
18
|
<key>NSAllowsArbitraryLoads</key>
|
|
19
19
|
<true/>`);return w.replace(/<dict>/u,`<dict>
|
|
20
20
|
<key>NSAppTransportSecurity</key>
|
|
21
21
|
<dict>
|
|
22
22
|
<key>NSAllowsArbitraryLoads</key>
|
|
23
23
|
<true/>
|
|
24
|
-
</dict>`)},zb=async(w,b,$)=>{let A=
|
|
25
|
-
`,{flag:"wx"});let x=new URL(`${$?"https":"http"}://localhost:${b}${w.config.entry}`);x.searchParams.set("__absolute_target","capacitor-ios");let K=D.server;D.server={...
|
|
26
|
-
`),
|
|
27
|
-
`,{flag:"wx"}),await Ib(A,$)}finally{await s(A,{force:!0}).catch(()=>{return})}},
|
|
28
|
-
`);let C=I(w.nativeProjectDirectory,"ios");if(!await
|
|
29
|
-
`),t=(w)=>w instanceof Error?w.message:String(w),zw=(w,b)=>{let $=w.indexOf(b);return $<0?void 0:w[$+1]},eb=(w)=>{let b=Number(zw(w,"--port"));if(!Number.isInteger(b)||b<1||b>65535)throw TypeError("Remote iOS agent requires a valid --port.");return b},w$=(w)=>{let b=zw(w,"--mobile-config");if(!b)throw TypeError("Remote iOS agent requires --mobile-config.");let $=JSON.parse(Buffer.from(b,"base64url").toString("utf8"));if(typeof $!=="object"||$===null)throw TypeError("Remote iOS agent received an invalid mobile config.");return $},
|
|
24
|
+
</dict>`)},zb=async(w,b,$)=>{let A=Qw(w.projectRoot);await l(w.projectRoot);let S=I(w.nativeDirectory,"App","App","capacitor.config.json"),M=I(w.nativeDirectory,"App","App","Info.plist"),[O,J]=await Promise.all([j(S,"utf8"),j(M,"utf8")]),D=JSON.parse(O);if(!X(D))throw Error(`Invalid Capacitor native config at ${S}.`);await y(A.root,{recursive:!0}),await Promise.all([Z(A.configBackup,O,{flag:"wx"}),Z(A.infoBackup,J,{flag:"wx"})]);let C={configBackupPath:A.configBackup,format:n,infoBackupPath:A.infoBackup,infoPath:M,nativeConfigPath:S};await Z(A.journal,`${JSON.stringify(C,null,"\t")}
|
|
25
|
+
`,{flag:"wx"});let x=new URL(`${$?"https":"http"}://localhost:${b}${w.config.entry}`);x.searchParams.set("__absolute_target","capacitor-ios");let K=D.server;D.server={...X(K)?K:{},cleartext:!$,url:x.href},await Promise.all([Z(S,`${JSON.stringify(D,null,"\t")}
|
|
26
|
+
`),Z(M,qb(J,!$))])},Rb=(w)=>{if(!X(w))return null;let{appId:b,fingerprint:$,format:A,installations:S}=w;if(A!==Vw||typeof b!=="string"||typeof $!=="string"||!X(S)||!Object.values(S).every((M)=>typeof M==="string"))return null;return{appId:b,fingerprint:$,format:A,installations:Object.fromEntries(Object.entries(S).map(([M,O])=>[M,String(O)]))}},fb=(w)=>j(Tw(w),"utf8").then((b)=>Rb(JSON.parse(b))).catch(()=>null),yb=async(w,b)=>{let $=Tw(w),A=`${$}.${process.pid}.${Wb()}.tmp`;await y(Gw($),{recursive:!0});try{await Z(A,`${JSON.stringify(b,null,"\t")}
|
|
27
|
+
`,{flag:"wx"}),await Ib(A,$)}finally{await s(A,{force:!0}).catch(()=>{return})}},Pb=async(w)=>Ww(w.nativeDirectory),Zw=(w,b)=>{let $=b([w,"simctl","list","devices","available","-j"]);return Zb(f($,"iOS simulator discovery"))},db=async(w,b)=>{let $=Tb(f(b([w.xcrun,"simctl","list","runtimes","-j"]),"iOS runtime discovery")),A=Fb($);if(!A)throw Error("No available iOS Simulator runtime. Run absolute mobile doctor ios --fix.");let[S]=Zw(w.xcrun,b).filter((D)=>D.isAvailable&&D.name===a&&D.runtime===A.identifier).sort((D,C)=>Number(C.state==="Booted")-Number(D.state==="Booted"));if(S)return{created:!1,device:S};let M=Qb(f(b([w.xcrun,"simctl","list","devicetypes","-j"]),"iOS device-type discovery")),O=Lb(M);if(!O)throw Error("Xcode did not report an iPhone simulator type.");let[J]=f(b([w.xcrun,"simctl","create",a,O.identifier,A.identifier]),"iOS simulator creation").split(/\s/u);if(!J)throw Error("simctl did not return the created simulator UDID.");return{created:!0,device:{isAvailable:!0,name:a,runtime:A.identifier,state:"Shutdown",udid:J}}},gb=async(w,b,$,A,S)=>{let M=Date.now()+Iw,O=async()=>{if(R(S),Zw(w.xcrun,$).find((D)=>D.udid===b)?.state==="Booted")return;if(Date.now()>M)throw Error(`iOS simulator ${b} did not finish booting within ${Iw/1000}s.`);await A(Bb),await O()};return O()},hb=(w,b,$)=>{if(b.state==="Booted")return;f($([w.xcrun,"simctl","boot",b.udid]),"iOS simulator boot")},Bw=(w,b,$)=>{let A=$([w.xcrun,"simctl","get_app_container",b,w.config.appId,"app"]);return A.exitCode===0&&A.stdout.trim()?A.stdout.trim():void 0},mb=async(w,b,$,A,S)=>{let M=I(w.projectRoot,".absolutejs","mobile","ios-derived-data",Nb("sha256").update(w.config.appId).digest("hex").slice(0,16));await y(M,{recursive:!0}),await E([w.xcodebuild,"-workspace",I(w.nativeDirectory,"App","App.xcworkspace"),"-scheme","App","-configuration","Debug","-destination",`platform=iOS Simulator,id=${b}`,"-derivedDataPath",M,"build"],"iOS simulator build",A,{cwd:w.nativeDirectory,signal:S});let O=I(M,"Build","Products","Debug-iphonesimulator","App.app");if(!await F(O))throw Error(`Xcode did not produce the simulator app at ${O}.`);return O},lb=async(w)=>{let b=Bw(w.project,w.udid,w.capture);if(w.cache?.appId===w.project.config.appId&&w.cache.fingerprint===w.fingerprint&&b!==void 0&&w.cache.installations[w.udid]===b)return w.log(`iOS native app is unchanged on ${w.udid}; skipped Xcode build and install.`),!0;w.log("iOS native inputs changed or the installed app is stale; rebuilding."),w.transition("building");let A=await mb(w.project,w.udid,w.fingerprint,w.run,w.signal);R(w.signal),w.transition("installing"),await E([w.project.xcrun,"simctl","install",w.udid,A],"iOS simulator app installation",w.run,{signal:w.signal});let S=Bw(w.project,w.udid,w.capture);if(S)await yb(w.project.projectRoot,{appId:w.project.config.appId,fingerprint:w.fingerprint,format:Vw,installations:{[w.udid]:S}}).catch((M)=>w.log(`iOS native cache could not be saved: ${M instanceof Error?M.message:String(M)}`));return!1},jb=/((?:authorization|cookie|password|secret|token|oauth[_-]?code)\s*[:=]\s*)([^\s,;]+)/giu,ub=new RegExp(String.raw`\bBearer\s+[A-Za-z0-9._~+/-]+=*`,"giu"),vb=/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/gu,cb=new RegExp(String.raw`\s(Debug|Info|Notice|Error|Fault)\s+.*?\[[^\]]+\]\s+\[([^\]]+)\]\s*(.*)$`,"iu"),ab=(w)=>{let b=sb(w).trim();if(!b)return null;let $=cb.exec(b),A=$?.[1]?.toLowerCase();return{level:A==="debug"||A==="error"||A==="fault"||A==="notice"?A:"info",message:$?.[3]?.trim()||b,tag:$?.[2]?.trim()||"App"}},sb=(w)=>w.replaceAll(ub,"Bearer [REDACTED]").replaceAll(vb,"[REDACTED_JWT]").replaceAll(jb,"$1[REDACTED]").replaceAll(/\p{C}/gu,""),nb=(w,b,$)=>{if(!$.nativeLog)return null;return($.startNativeLogs??Yb)([w.xcrun,"simctl","spawn",b,"log","stream","--style","compact","--level","debug","--predicate",'process == "App"'],{signal:$.signal},(S)=>{let M=ab(S);if(M)$.nativeLog?.(M)})},rb=[["syncing","Capacitor sync"],["configuring","dev config"],["fingerprinting","fingerprint"],["booting","simulator"],["connecting","device ready"],["checking-native","app check"],["building","Xcode"],["installing","install"],["launching","launch"],["streaming-logs","logs"]],ib=(w)=>rb.map(([b,$])=>{let A=w[b];return A===void 0?null:`${$} ${h(A)}`}).filter((b)=>b!==null).join(", "),Ew=async(w,b)=>{if(m()!=="macos")throw Error("iOS simulation requires macOS and Xcode.");let $=u(b.projectRoot),A=await Dw({host:"macos"}),S=A.filter((x)=>x.platform==="ios"&&(x.status==="fail"||x.status==="warn"));if(S.length>0)throw Error(`iOS simulation is not ready: ${S.map(({label:x})=>x).join(", ")}.`);let M=A.find((x)=>x.id==="ios.xcrun")?.path,O=A.find((x)=>x.id==="ios.xcodebuild")?.path;if(!M||!O)throw Error("Xcode tools disappeared after readiness checks.");let J=I($,"node_modules",".bin","cap");if(!await F(J))throw Error("Capacitor CLI is not installed. Run absolute mobile init first.");await xw(w,{projectRoot:$}),await y(w.bundleDirectory,{recursive:!0});let D=I(w.bundleDirectory,"index.html");if(!await F(D))await Z(D,`<!doctype html><title>AbsoluteJS mobile development</title>
|
|
28
|
+
`);let C=I(w.nativeProjectDirectory,"ios");if(!await F(C)){if(!b.createNativeProject)throw Error("iOS native project has not been created.");if(await(b.run??Yw)([J,"add","ios"],{cwd:$})!==0)throw Error("Capacitor iOS project creation failed.")}return{cap:J,config:w,nativeDirectory:C,projectRoot:$,xcodebuild:O,xcrun:M}},i=async(w)=>{let{project:b}=w,$=w.capture??Gb,A=w.run??Yw,S=w.sleep??Bun.sleep,M=w.spawn??Vb,O=w.log??console.log,J=performance.now(),D=performance.now(),C={},x="syncing",K=(U)=>{if(U===x){w.onStateChange?.(U);return}let _=performance.now(),G=_-D;C[x]=(C[x]??0)+G,w.onPhaseTiming?.({durationMs:G,phase:x,totalMs:_-J}),x=U,D=_,w.onStateChange?.(U)},Y=null,P=async()=>{let U=Y;Y=null,await U?.close().catch(()=>{return})};try{await l(b.projectRoot),R(w.signal),K("syncing"),await E([b.cap,"sync","ios"],"Capacitor iOS synchronization",A,{cwd:b.projectRoot,signal:w.signal}),K("configuring"),await zb(b,w.port,w.https===!0),R(w.signal);let U=performance.now(),_=Pb(b).then((L)=>{return C.fingerprinting=performance.now()-U,L});K("booting");let{created:G,device:W}=await db(b,$),N=G||W.state!=="Booted";hb(b,W,$),M(["open","-a","Simulator","--args","-CurrentDeviceUDID",W.udid]),K("connecting"),await gb(b,W.udid,$,S,w.signal),await E([b.xcrun,"simctl","bootstatus",W.udid,"-b"],"iOS simulator boot readiness",A,{signal:w.signal});let B=await _;K("checking-native");let o=await lb({cache:await fb(b.projectRoot),capture:$,fingerprint:B,log:O,project:b,run:A,signal:w.signal,transition:K,udid:W.udid});if(R(w.signal),w.nativeLog)K("streaming-logs");Y=nb(b,W.udid,w),K("launching"),await E([b.xcrun,"simctl","launch","--terminate-running-process",W.udid,b.config.appId],"iOS app launch",A,{signal:w.signal}),K("ready"),C.total=performance.now()-J,O(`iOS simulator connected (${W.udid}) with HMR on port ${w.port} in ${h(C.total)} (${o?"native cache hit":"native build installed"}).`),O(`iOS startup: ${ib(C)}.`);let d=!1,e=async()=>{if(d)return;d=!0,K("closing"),await P(),await l(b.projectRoot),K("closed")};return{close:e,nativeCacheHit:o,startedSimulator:N,timings:{...C},udid:W.udid,rebuild:async()=>{if(d)throw Error("iOS development session is closed.");return O("iOS native inputs changed; rebuilding without restarting the dev server."),await e(),i(w)},relaunch:async()=>{if(d)throw Error("iOS development session is closed.");K("launching");try{await E([b.xcrun,"simctl","launch","--terminate-running-process",W.udid,b.config.appId],"iOS app relaunch",A,{signal:w.signal}),K("ready"),O(`iOS app relaunched on ${W.udid}.`)}catch(L){throw K("failed"),L}},screenshot:async(L)=>{let g=u(b.projectRoot,L);if(!z(b.projectRoot,g))throw Error("iOS screenshot destination must remain inside the project.");return await y(Gw(g),{recursive:!0}),await E([b.xcrun,"simctl","io",W.udid,"screenshot",g],"iOS simulator screenshot",A,{signal:w.signal}),g},get state(){return x}}}catch(U){throw K("failed"),await P(),await l(b.projectRoot),U}};var Fw="ABSOLUTE_REMOTE_MAC\t",p=1;var H=(w)=>process.stdout.write(`${Fw}${JSON.stringify({...w,v:p})}
|
|
29
|
+
`),t=(w)=>w instanceof Error?w.message:String(w),zw=(w,b)=>{let $=w.indexOf(b);return $<0?void 0:w[$+1]},eb=(w)=>{let b=Number(zw(w,"--port"));if(!Number.isInteger(b)||b<1||b>65535)throw TypeError("Remote iOS agent requires a valid --port.");return b},w$=(w)=>{let b=zw(w,"--mobile-config");if(!b)throw TypeError("Remote iOS agent requires --mobile-config.");let $=JSON.parse(Buffer.from(b,"base64url").toString("utf8"));if(typeof $!=="object"||$===null)throw TypeError("Remote iOS agent received an invalid mobile config.");return $},Lw=async(w,b)=>{let $=w.getReader(),A=new TextDecoder,S="";try{while(!0){let{done:M,value:O}=await $.read();if(M)break;S+=A.decode(O,{stream:!0});let J=S.split(/\r?\n/u);S=J.pop()??"",J.forEach(b)}}finally{$.releaseLock()}},kw=async(w,b={})=>{let $=Bun.spawn(w,{cwd:b.cwd,env:b.env,signal:b.signal,stderr:"pipe",stdin:"ignore",stdout:"pipe"});return Lw($.stdout,(A)=>H({message:A,type:"log"})),Lw($.stderr,(A)=>H({message:A,type:"log"})),$.exited},b$=(w,b={})=>{try{let $=Bun.spawnSync(w,{cwd:b.cwd,env:b.env,stderr:"pipe",stdin:"ignore",stdout:"pipe"});return{exitCode:$.exitCode,stderr:$.stderr.toString(),stdout:$.stdout.toString()}}catch($){return{exitCode:1,stderr:t($),stdout:""}}},qw=(w)=>({nativeCacheHit:w.nativeCacheHit,startedSimulator:w.startedSimulator,timings:w.timings,type:"ready",udid:w.udid}),$$=async(w)=>{if(process.platform!=="darwin")throw Error("The AbsoluteJS remote iOS agent can run only on macOS.");let b=process.cwd(),$=$w(w$(w),b),A=eb(w),S=await Ew($,{createNativeProject:!1,projectRoot:b,run:kw}),M={capture:b$,https:w.includes("--https"),port:A,project:S,run:kw,log:(D)=>H({message:D,type:"log"}),nativeLog:(D)=>H({entry:D,type:"native-log"}),onPhaseTiming:(D)=>H({...D,type:"timing"}),onStateChange:(D)=>H({state:D,type:"state"}),spawn:(D,C={})=>{Bun.spawn(D,{cwd:C.cwd,env:C.env,signal:C.signal,stderr:"ignore",stdin:"ignore",stdout:"ignore"})}},O=await i(M);H(qw(O));let J=ob({input:process.stdin,terminal:!1});try{for await(let D of J){let C;try{if(C=JSON.parse(D),C.v!==p||typeof C.id!=="string")throw Error("Invalid remote Mac request.");let x;if(C.command==="close")await O.close();else if(C.command==="relaunch")await O.relaunch();else if(C.command==="rebuild")O=await O.rebuild(),x=qw(O);else if(C.command==="screenshot"){let K=tb(".absolutejs","mobile","remote-screenshot.png"),Y=await O.screenshot(K);x={data:(await pb(Y)).toString("base64")}}else throw Error("Unknown remote Mac request.");if(H({id:C.id,ok:!0,result:x,type:"response"}),C.command==="close")return}catch(x){H({error:t(x),id:C?.id??"",ok:!1,type:"response"})}}}finally{J.close(),await O.close().catch(()=>{return})}},Rw=async(w)=>{try{await $$(w)}catch(b){H({error:t(b),type:"fatal"}),process.exitCode=1}};await Rw(process.argv.slice(2));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EnvironmentProviders, Provider } from '@angular/core';
|
|
2
|
+
import type { AbsoluteMobileBuildPageMetadata } from '../mobile/buildMetadata';
|
|
2
3
|
import { type StreamingSlotEnhancerOptions } from '../core/responseEnhancers';
|
|
3
4
|
type AngularPageRenderOptions = StreamingSlotEnhancerOptions & {
|
|
4
5
|
collectStreamingSlots?: boolean;
|
|
@@ -9,6 +10,8 @@ type AngularPageRenderOptions = StreamingSlotEnhancerOptions & {
|
|
|
9
10
|
* passes no generic at all) can omit `requestContext`. */
|
|
10
11
|
type HasNoRequiredContextKeys<Ctx> = keyof Ctx extends never ? true : Partial<Ctx> extends Ctx ? true : false;
|
|
11
12
|
export type AngularPageRequestInput<Ctx = unknown> = AngularPageRenderOptions & {
|
|
13
|
+
/** @internal Build-generated mobile identity. Application code must not set this. */
|
|
14
|
+
__absoluteMobile?: AbsoluteMobileBuildPageMetadata;
|
|
12
15
|
headTag?: `<head>${string}</head>`;
|
|
13
16
|
indexPath: string;
|
|
14
17
|
pagePath: string;
|
|
@@ -391,7 +391,7 @@ export declare const launchConfig: (args: string[], cwd?: string) => Promise<imp
|
|
|
391
391
|
status?: number | keyof import("elysia").StatusMap;
|
|
392
392
|
cookie?: Record<string, import("elysia").BaseCookie>;
|
|
393
393
|
};
|
|
394
|
-
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 500 | 100 | 200 | 400 | 404 | 300 | 304 | 426 | 302 | 101 | 102 | 103 | 201 | 202 | 203 |
|
|
394
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 500 | 100 | 200 | 400 | 404 | 300 | 304 | 426 | 204 | 302 | 101 | 102 | 103 | 201 | 202 | 203 | 205 | 206 | 207 | 208 | 301 | 303 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
|
|
395
395
|
readonly 100: "Continue";
|
|
396
396
|
readonly 101: "Switching Protocols";
|
|
397
397
|
readonly 102: "Processing";
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { type StreamingSlotEnhancerOptions } from './responseEnhancers';
|
|
2
|
+
import type { AbsoluteMobileBuildPageMetadata } from '../mobile/buildMetadata';
|
|
2
3
|
export type StaticPageRequestOptions = StreamingSlotEnhancerOptions;
|
|
3
|
-
export type HTMLPageRequestOptions = StaticPageRequestOptions
|
|
4
|
+
export type HTMLPageRequestOptions = StaticPageRequestOptions & {
|
|
5
|
+
/** @internal Build-generated mobile identity. Application code must not set this. */
|
|
6
|
+
__absoluteMobile?: AbsoluteMobileBuildPageMetadata;
|
|
7
|
+
};
|
|
8
|
+
type HTMXPageRequestOptions = {
|
|
9
|
+
/** @internal Build-generated mobile identity. Application code must not set this. */
|
|
10
|
+
__absoluteMobile?: AbsoluteMobileBuildPageMetadata;
|
|
11
|
+
};
|
|
4
12
|
export declare const handleHTMLPageRequest: (pagePath: string, options?: HTMLPageRequestOptions) => Promise<Response>;
|
|
5
|
-
export declare const handleHTMXPageRequest: (pagePath: string) => Promise<Response>;
|
|
13
|
+
export declare const handleHTMXPageRequest: (pagePath: string, options?: HTMXPageRequestOptions) => Promise<Response>;
|
|
14
|
+
export {};
|
|
@@ -56,6 +56,9 @@ export type StartAbsoluteAndroidDevOptions = {
|
|
|
56
56
|
onPhaseTiming?: (timing: AbsoluteAndroidDevPhaseTiming) => void;
|
|
57
57
|
onStateChange?: (state: AbsoluteAndroidDevState) => void;
|
|
58
58
|
https?: boolean;
|
|
59
|
+
/** Launch the locally embedded production web bundle while forwarding
|
|
60
|
+
* `port` only for its configured backend. No dev-server URL is written. */
|
|
61
|
+
embeddedBundle?: boolean;
|
|
59
62
|
port: number;
|
|
60
63
|
project: AbsoluteAndroidDevProject;
|
|
61
64
|
run?: (command: string[], options?: AbsoluteAndroidCommandOptions) => Promise<number>;
|
|
@@ -67,7 +70,9 @@ export type StartAbsoluteAndroidDevOptions = {
|
|
|
67
70
|
export declare const redactAbsoluteAndroidLog: (value: string) => string;
|
|
68
71
|
export declare const isIgnorableAbsoluteAndroidLog: (entry: AbsoluteAndroidNativeLogEntry) => boolean;
|
|
69
72
|
export declare const parseAbsoluteAndroidLogLine: (line: string) => AbsoluteAndroidNativeLogEntry | null;
|
|
70
|
-
export declare const fingerprintAbsoluteAndroidNativeProject: (project: Pick<AbsoluteAndroidDevProject, "nativeDirectory"
|
|
73
|
+
export declare const fingerprintAbsoluteAndroidNativeProject: (project: Pick<AbsoluteAndroidDevProject, "nativeDirectory">, options?: {
|
|
74
|
+
includePublicBundle?: boolean;
|
|
75
|
+
}) => Promise<string>;
|
|
71
76
|
export declare const repairAbsoluteAndroidDevSession: (projectRoot: string) => Promise<boolean>;
|
|
72
77
|
export declare const parseAdbDevices: (output: string) => string[];
|
|
73
78
|
export type AbsoluteAndroidGradleTask = 'assembleDebug' | 'assembleRelease' | 'bundleRelease';
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import type { NormalizedAbsoluteMobileConfig } from './config';
|
|
2
2
|
import type { AbsoluteMobileCompatibilityArtifact } from './releaseArtifact';
|
|
3
|
+
import type { AbsoluteMobileAuthManifest } from './nativeAuth';
|
|
3
4
|
export type AbsoluteCapacitorBundleOptions = {
|
|
4
5
|
artifact: AbsoluteMobileCompatibilityArtifact;
|
|
6
|
+
auth?: AbsoluteMobileAuthManifest;
|
|
5
7
|
buildDirectory: string;
|
|
6
8
|
config: NormalizedAbsoluteMobileConfig;
|
|
9
|
+
sync?: boolean;
|
|
7
10
|
};
|
|
8
11
|
export declare const materializeAbsoluteCapacitorWebBundle: (options: AbsoluteCapacitorBundleOptions) => Promise<{
|
|
9
|
-
|
|
12
|
+
sync?: {
|
|
13
|
+
socketTickets: true;
|
|
14
|
+
} | undefined;
|
|
10
15
|
appId: string;
|
|
11
16
|
appName: string;
|
|
12
17
|
deepLinkHosts: string[];
|
|
@@ -14,6 +19,7 @@ export declare const materializeAbsoluteCapacitorWebBundle: (options: AbsoluteCa
|
|
|
14
19
|
entry: string;
|
|
15
20
|
format: 1;
|
|
16
21
|
pages: {
|
|
22
|
+
localStylePath?: string | undefined;
|
|
17
23
|
localBundlePath: string;
|
|
18
24
|
bundleHash: string;
|
|
19
25
|
bundlePath: string;
|
|
@@ -21,8 +27,12 @@ export declare const materializeAbsoluteCapacitorWebBundle: (options: AbsoluteCa
|
|
|
21
27
|
framework: import("./pageProtocol").AbsoluteMobilePageFramework;
|
|
22
28
|
pageId: string;
|
|
23
29
|
propsSchemaHash: string;
|
|
30
|
+
styleBundleHash?: string;
|
|
31
|
+
styleBundlePath?: string;
|
|
24
32
|
}[];
|
|
25
33
|
productionOrigin: string;
|
|
26
34
|
routes: import("./releaseArtifact").AbsoluteMobileCompatibilityRoute[];
|
|
27
35
|
runtime: string;
|
|
36
|
+
auth?: AbsoluteMobileAuthManifest | undefined;
|
|
37
|
+
appBuild: string;
|
|
28
38
|
}>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { type AbsoluteMobilePageResult, type AbsoluteMobileUpgradeRequiredResult } from './pageProtocol';
|
|
2
2
|
type AbsoluteMobileClientTarget = {
|
|
3
|
+
__ABSOLUTE_PAGE_DISPOSE__?: () => Promise<void> | void;
|
|
4
|
+
__ABSOLUTE_PAGE_READY__?: Promise<unknown>;
|
|
3
5
|
__ABSOLUTE_PAGE_RENDER_MODE__?: 'client' | 'hydrate';
|
|
6
|
+
__ABS_ANGULAR_REQUEST_CONTEXT__?: Record<string, unknown>;
|
|
4
7
|
__INITIAL_PROPS__?: Record<string, unknown>;
|
|
5
8
|
};
|
|
6
9
|
export type AbsoluteMobilePageLoader = (input: {
|
|
@@ -20,6 +23,7 @@ export declare class AbsoluteMobilePageProtocolError extends Error {
|
|
|
20
23
|
readonly code: 'invalid-envelope' | 'invalid-props' | 'server-error' | 'server-rejected-request';
|
|
21
24
|
constructor(code: AbsoluteMobilePageProtocolError['code'], message: string);
|
|
22
25
|
}
|
|
26
|
+
export declare const disposeAbsoluteMobilePage: (target?: AbsoluteMobileClientTarget) => Promise<void>;
|
|
23
27
|
export declare const activateAbsoluteMobilePage: (value: unknown, options: AbsoluteMobilePageActivationOptions) => Promise<AbsoluteMobileUpgradeRequiredResult | {
|
|
24
28
|
contract: string;
|
|
25
29
|
kind: "rendered";
|
|
@@ -16,6 +16,7 @@ export * from './client';
|
|
|
16
16
|
export * from './compatibilityDispatcher';
|
|
17
17
|
export * from './materializedBundle';
|
|
18
18
|
export * from './nativeDeepLinks';
|
|
19
|
+
export * from './nativeAuth';
|
|
19
20
|
export * from './pageProtocol';
|
|
20
21
|
export * from './producerContext';
|
|
21
22
|
export * from './releaseArtifact';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { NormalizedAbsoluteMobileConfig } from './config';
|
|
2
|
+
export declare const ABSOLUTE_AUTH_PACKAGE: "@absolutejs/auth";
|
|
3
|
+
export declare const ABSOLUTE_NATIVE_AUTH_CLIENTS_ENV: "ABSOLUTE_AUTH_NATIVE_CLIENTS";
|
|
4
|
+
export declare const ABSOLUTE_NATIVE_AUTH_SCOPES: readonly ["openid", "profile"];
|
|
5
|
+
export declare const ABSOLUTE_SYNC_PACKAGE: "@absolutejs/sync";
|
|
6
|
+
export type AbsoluteMobileAuthManifest = {
|
|
7
|
+
clientId: string;
|
|
8
|
+
issuer: string;
|
|
9
|
+
redirectUri: string;
|
|
10
|
+
scopes: string[];
|
|
11
|
+
};
|
|
12
|
+
export declare const createAbsoluteMobileAuthManifest: (config: NormalizedAbsoluteMobileConfig) => AbsoluteMobileAuthManifest;
|
|
13
|
+
export declare const installAbsoluteMobileAuthEnvironment: (projectRoot: string, config: NormalizedAbsoluteMobileConfig) => AbsoluteMobileAuthManifest | undefined;
|
|
14
|
+
export declare const projectUsesAbsoluteAuth: (projectRoot: string) => boolean;
|
|
15
|
+
export declare const projectUsesAbsoluteSync: (projectRoot: string) => boolean;
|
|
16
|
+
export declare const resolveAbsoluteMobileAuthManifest: (projectRoot: string, config: NormalizedAbsoluteMobileConfig) => AbsoluteMobileAuthManifest | undefined;
|
|
17
|
+
export declare const serializeAbsoluteMobileAuthEnvironment: (config: NormalizedAbsoluteMobileConfig, auth: AbsoluteMobileAuthManifest | undefined) => string | undefined;
|
|
@@ -8,6 +8,8 @@ export type AbsoluteMobileCompatibilityPage = {
|
|
|
8
8
|
framework: AbsoluteMobilePageFramework;
|
|
9
9
|
pageId: string;
|
|
10
10
|
propsSchemaHash: string;
|
|
11
|
+
styleBundleHash?: string;
|
|
12
|
+
styleBundlePath?: string;
|
|
11
13
|
};
|
|
12
14
|
export type AbsoluteMobileCompatibilityRoute = {
|
|
13
15
|
method: 'GET' | 'HEAD';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AbsoluteMobileAuthManifest } from './nativeAuth';
|
|
2
|
+
import type { AbsoluteMobileFetch } from './transport';
|
|
3
|
+
export type AbsoluteMobileShellAuth = {
|
|
4
|
+
fetch: AbsoluteMobileFetch;
|
|
5
|
+
redirectUri: string;
|
|
6
|
+
socketTicket: (audience?: string) => Promise<string>;
|
|
7
|
+
};
|
|
8
|
+
export declare const createAbsoluteMobileShellAuth: (config: AbsoluteMobileAuthManifest) => Promise<AbsoluteMobileShellAuth>;
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { type AbsoluteMobileFetch, type AbsoluteMobileClientManifest } from './transport';
|
|
2
|
+
export type AbsoluteMobileShellAuthRuntime = {
|
|
3
|
+
fetch: AbsoluteMobileFetch;
|
|
4
|
+
redirectUri: string;
|
|
5
|
+
socketTicket: (audience?: string) => Promise<string>;
|
|
6
|
+
};
|
|
7
|
+
export type AbsoluteMobileShellOptions = {
|
|
8
|
+
createAuth?: (config: NonNullable<AbsoluteMobileClientManifest['auth']>) => Promise<AbsoluteMobileShellAuthRuntime>;
|
|
9
|
+
installSync?: (auth: AbsoluteMobileShellAuthRuntime) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const startAbsoluteMobileShell: (options?: AbsoluteMobileShellOptions) => Promise<void>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AbsoluteMobileClientManifest, AbsoluteMobileClientPage } from './transport';
|
|
2
|
+
export declare const hashAbsoluteMobileStaticDocument: (source: string) => Promise<string>;
|
|
3
|
+
export declare const rewriteAbsoluteMobileHtmxRequests: (source: string, productionOrigin: string) => string;
|
|
4
|
+
export declare const sanitizeAbsoluteMobileHtmxFragment: (source: string, productionOrigin: string, parse?: (source: string) => Document) => string;
|
|
5
|
+
export declare const installAbsoluteMobileStaticDocument: (manifest: AbsoluteMobileClientManifest, page: AbsoluteMobileClientPage, localUrl: string) => Promise<void>;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { type AbsoluteMobilePageActivationOptions } from './client';
|
|
2
2
|
import type { AbsoluteMobileCompatibilityPage, AbsoluteMobileCompatibilityRoute } from './releaseArtifact';
|
|
3
|
+
import type { AbsoluteMobileAuthManifest } from './nativeAuth';
|
|
3
4
|
export declare const ABSOLUTE_MOBILE_CLIENT_MANIFEST_FORMAT: 1;
|
|
5
|
+
export type AbsoluteMobileFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
4
6
|
export type AbsoluteMobileClientPage = AbsoluteMobileCompatibilityPage & {
|
|
5
7
|
localBundlePath: string;
|
|
8
|
+
localStylePath?: string;
|
|
6
9
|
};
|
|
7
10
|
export type AbsoluteMobileClientManifest = {
|
|
11
|
+
auth?: AbsoluteMobileAuthManifest;
|
|
8
12
|
appBuild: string;
|
|
9
13
|
appId: string;
|
|
10
14
|
appName: string;
|
|
@@ -16,9 +20,12 @@ export type AbsoluteMobileClientManifest = {
|
|
|
16
20
|
productionOrigin: string;
|
|
17
21
|
routes: AbsoluteMobileCompatibilityRoute[];
|
|
18
22
|
runtime: string;
|
|
23
|
+
sync?: {
|
|
24
|
+
socketTickets: true;
|
|
25
|
+
};
|
|
19
26
|
};
|
|
20
27
|
export type AbsoluteMobileTransportOptions = {
|
|
21
|
-
fetch?:
|
|
28
|
+
fetch?: AbsoluteMobileFetch;
|
|
22
29
|
headers?: HeadersInit;
|
|
23
30
|
};
|
|
24
31
|
export declare const createAbsoluteMobilePageRequest: (manifest: AbsoluteMobileClientManifest, path: string, options?: AbsoluteMobileTransportOptions) => Request;
|
|
@@ -29,3 +36,4 @@ export declare const navigateAbsoluteMobilePage: (manifest: AbsoluteMobileClient
|
|
|
29
36
|
pageId: string;
|
|
30
37
|
}>;
|
|
31
38
|
export declare const resolveAbsoluteMobileDeepLink: (manifest: AbsoluteMobileClientManifest, value: string) => string;
|
|
39
|
+
export declare const resolveAbsoluteMobileNavigation: (manifest: AbsoluteMobileClientManifest, value: string, localOrigin: string) => string | undefined;
|
|
@@ -19,7 +19,7 @@ export declare const imageOptimizer: (config: ImageConfig | undefined, buildDir:
|
|
|
19
19
|
status?: number | keyof import("elysia").StatusMap;
|
|
20
20
|
cookie?: Record<string, import("elysia").BaseCookie>;
|
|
21
21
|
};
|
|
22
|
-
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 500 | 100 | 200 | 400 | 404 | 300 | 304 | 426 | 302 | 101 | 102 | 103 | 201 | 202 | 203 |
|
|
22
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 500 | 100 | 200 | 400 | 404 | 300 | 304 | 426 | 204 | 302 | 101 | 102 | 103 | 201 | 202 | 203 | 205 | 206 | 207 | 208 | 301 | 303 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
|
|
23
23
|
readonly 100: "Continue";
|
|
24
24
|
readonly 101: "Switching Protocols";
|
|
25
25
|
readonly 102: "Processing";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Component as SvelteComponent } from 'svelte';
|
|
2
2
|
import type { SveltePropsOf } from '../../types/svelte';
|
|
3
|
+
import type { AbsoluteMobileBuildPageMetadata } from '../mobile/buildMetadata';
|
|
3
4
|
import { type StreamingSlotEnhancerOptions } from '../core/responseEnhancers';
|
|
4
5
|
export type SveltePageRenderOptions = {
|
|
5
6
|
collectStreamingSlots?: boolean;
|
|
@@ -13,6 +14,8 @@ export type SveltePageRenderOptions = {
|
|
|
13
14
|
} & StreamingSlotEnhancerOptions;
|
|
14
15
|
type HasNoSvelteProps<Props> = [Props] extends [never] ? true : keyof Props extends never ? true : false;
|
|
15
16
|
export type SveltePageRequestInput<Component extends SvelteComponent<never> = SvelteComponent<Record<never, never>>> = SveltePageRenderOptions & {
|
|
17
|
+
/** @internal Build-generated mobile identity. Application code must not set this. */
|
|
18
|
+
__absoluteMobile?: AbsoluteMobileBuildPageMetadata;
|
|
16
19
|
indexPath: string;
|
|
17
20
|
pagePath: string;
|
|
18
21
|
/** The incoming Elysia request. When provided, the request's pathname
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Component as VueComponent } from 'vue';
|
|
2
2
|
import type { VuePropsOf } from '../../types/vue';
|
|
3
|
+
import type { AbsoluteMobileBuildPageMetadata } from '../mobile/buildMetadata';
|
|
3
4
|
import { type StreamingSlotEnhancerOptions } from '../core/responseEnhancers';
|
|
4
5
|
type VuePageRenderOptions = StreamingSlotEnhancerOptions & {
|
|
5
6
|
collectStreamingSlots?: boolean;
|
|
@@ -29,6 +30,8 @@ type VuePageClientMode = {
|
|
|
29
30
|
indexPath: string;
|
|
30
31
|
};
|
|
31
32
|
export type VuePageRequestInput<Component extends VueComponent> = VuePageRenderOptions & VuePageClientMode & {
|
|
33
|
+
/** @internal Build-generated mobile identity. Application code must not set this. */
|
|
34
|
+
__absoluteMobile?: AbsoluteMobileBuildPageMetadata;
|
|
32
35
|
headTag?: `<head>${string}</head>`;
|
|
33
36
|
pagePath: string;
|
|
34
37
|
Page?: Component;
|