@swell/cli 2.5.1 → 2.5.2
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/lib/proxy.d.ts +6 -1
- package/dist/lib/proxy.js +9 -1
- package/dist/push-app-command.js +5 -1
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/dist/lib/proxy.d.ts
CHANGED
package/dist/lib/proxy.js
CHANGED
|
@@ -55,8 +55,16 @@ async function startCloudflaredTunnel(port) {
|
|
|
55
55
|
}
|
|
56
56
|
return url;
|
|
57
57
|
}
|
|
58
|
-
export async function getProxyUrl(port) {
|
|
58
|
+
export async function getProxyUrl(port, context) {
|
|
59
59
|
const provider = LOCAL_PROXY_PROVIDER || 'cloudflared';
|
|
60
|
+
// URL template mode: resolve placeholders and return directly
|
|
61
|
+
if (provider.includes('://')) {
|
|
62
|
+
return provider
|
|
63
|
+
.replace('{port}', String(port))
|
|
64
|
+
.replace('{appid}', context?.appId || '')
|
|
65
|
+
.replace('{storeid}', context?.storeId || '')
|
|
66
|
+
.replace('{storefrontid}', context?.storefrontId || '');
|
|
67
|
+
}
|
|
60
68
|
try {
|
|
61
69
|
switch (provider) {
|
|
62
70
|
case 'local': {
|
package/dist/push-app-command.js
CHANGED
|
@@ -787,7 +787,11 @@ export class PushAppCommand extends RemoteAppCommand {
|
|
|
787
787
|
(await getPort({ port: portNumbers(3000, 3100) })) ||
|
|
788
788
|
DEV_SERVER_FALLBACK_PORT;
|
|
789
789
|
// Start proxy
|
|
790
|
-
const proxyUrl = await getProxyUrl(freePort
|
|
790
|
+
const proxyUrl = await getProxyUrl(freePort, {
|
|
791
|
+
appId: this.app.id,
|
|
792
|
+
storeId: localConfig.getDefaultStore(),
|
|
793
|
+
storefrontId: this.storefront?.id,
|
|
794
|
+
});
|
|
791
795
|
await this.updateLocalProxy(proxyUrl, this.storefront?.id);
|
|
792
796
|
return freePort;
|
|
793
797
|
}
|
package/oclif.manifest.json
CHANGED