@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.
@@ -1 +1,6 @@
1
- export declare function getProxyUrl(port: number): Promise<string>;
1
+ export interface ProxyContext {
2
+ appId?: string;
3
+ storeId?: string;
4
+ storefrontId?: string;
5
+ }
6
+ export declare function getProxyUrl(port: number, context?: ProxyContext): Promise<string>;
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': {
@@ -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
  }
@@ -2969,5 +2969,5 @@
2969
2969
  ]
2970
2970
  }
2971
2971
  },
2972
- "version": "2.5.1"
2972
+ "version": "2.5.2"
2973
2973
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swell/cli",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
4
4
  "type": "module",
5
5
  "description": "Swell's command line interface/utility",
6
6
  "keywords": [