From d06b288ec47acd9242f9961a9792a8f324963cb3 Mon Sep 17 00:00:00 2001 From: Eric Goldman Date: Fri, 21 Nov 2025 13:19:06 -0500 Subject: [PATCH 1/2] fix: address preview url encoding --- src/shared/previewUtils.ts | 2 +- test/shared/previewUtils.test.ts | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/shared/previewUtils.ts b/src/shared/previewUtils.ts index f5de5279..4df13c2c 100644 --- a/src/shared/previewUtils.ts +++ b/src/shared/previewUtils.ts @@ -239,7 +239,7 @@ export class PreviewUtils { targetOrg?: string ): string[] { let appPath = `lwr/application/e/devpreview/ai/${encodeURIComponent( - 'localdev%2Fpreview' + 'localdev/preview' )}?ldpServerUrl=${ldpServerUrl}&ldpServerId=${ldpServerId}`; if (componentName) { // TODO: support other namespaces diff --git a/test/shared/previewUtils.test.ts b/test/shared/previewUtils.test.ts index 9063f1a8..a0050903 100644 --- a/test/shared/previewUtils.test.ts +++ b/test/shared/previewUtils.test.ts @@ -282,6 +282,25 @@ describe('previewUtils', () => { expect(parsed.values['target-org']).to.be.undefined; }); + it('generatedComponentPreviewLaunchArguments propertly encodes parameters', async () => { + const result = PreviewUtils.generateComponentPreviewLaunchArguments('https://localhost:3333', testLdpServerId); + + const parsed = parseArgs({ + args: result, + options: { + path: { type: 'string' }, + 'target-org': { type: 'string' }, + }, + }); + + for (const v in parsed.values) { + if (v.length === 0) { + continue; + } + expect(decodeURIComponent(v) === decodeURIComponent(decodeURIComponent(v))); + } + }); + it('getTargetOrgFromArguments finds -o flag', async () => { const args = ['command', '-o', 'myOrg', 'otherArg']; const result = PreviewUtils.getTargetOrgFromArguments(args); From dd4579e1aa3145a6c632495091076fdc4ab427d4 Mon Sep 17 00:00:00 2001 From: Eric Goldman Date: Fri, 21 Nov 2025 13:46:25 -0500 Subject: [PATCH 2/2] build: bump for cla confirmation