Skip to content

Commit f6e7304

Browse files
fix: remove label/version to match @salesforce/webapp-experimental 1.x type
- Run yarn install to resolve 1.23.0+ (was 0.2.0 from stale lock) - ProxyServer: use minimal fallback { name, outputDir } per PR #22 - Tests: remove label/version from manifest fixtures - ManifestWatcher tests: fix assertions for simplified type Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent ce709c7 commit f6e7304

6 files changed

Lines changed: 23 additions & 53 deletions

File tree

src/proxy/ProxyServer.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,6 @@ export class ProxyServer extends EventEmitter {
407407
private initializeProxyHandler(): void {
408408
const manifest: WebAppManifest = this.config.manifest ?? {
409409
name: 'webapp',
410-
label: 'WebApp',
411-
version: '1.0.0',
412410
outputDir: 'dist',
413411
};
414412

test/commands/webapp/dev.test.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,6 @@ describe('webapp:dev command integration', () => {
175175
it('should have correct WebAppManifest structure', () => {
176176
const manifest: WebAppManifest = {
177177
name: 'testWebApp',
178-
label: 'Test Web App',
179-
version: '1.0.0',
180178
outputDir: 'dist',
181179
dev: {
182180
url: 'http://localhost:5173',
@@ -210,8 +208,6 @@ describe('webapp:dev command integration', () => {
210208
it('should use manifest dev.url when no explicit URL', () => {
211209
const manifest: WebAppManifest = {
212210
name: 'testWebApp',
213-
label: 'Test Web App',
214-
version: '1.0.0',
215211
outputDir: 'dist',
216212
dev: {
217213
url: 'http://localhost:5173',
@@ -224,8 +220,6 @@ describe('webapp:dev command integration', () => {
224220
it('should use dev.command when no URL provided', () => {
225221
const manifest: WebAppManifest = {
226222
name: 'testWebApp',
227-
label: 'Test Web App',
228-
version: '1.0.0',
229223
outputDir: 'dist',
230224
dev: {
231225
command: 'npm run dev',
@@ -240,8 +234,6 @@ describe('webapp:dev command integration', () => {
240234
it('should validate manifest with dev.url', () => {
241235
const manifest: WebAppManifest = {
242236
name: 'testWebApp',
243-
label: 'Test Web App',
244-
version: '1.0.0',
245237
outputDir: 'dist',
246238
dev: {
247239
url: 'http://localhost:5173',
@@ -250,15 +242,12 @@ describe('webapp:dev command integration', () => {
250242

251243
// Basic validation
252244
expect(manifest.name).to.be.a('string');
253-
expect(manifest.version).to.match(/^\d+\.\d+\.\d+$/);
254245
expect(manifest.dev?.url).to.include('http');
255246
});
256247

257248
it('should validate manifest with dev.command', () => {
258249
const manifest: WebAppManifest = {
259250
name: 'testWebApp',
260-
label: 'Test Web App',
261-
version: '1.0.0',
262251
outputDir: 'dist',
263252
dev: {
264253
command: 'npm run dev',

test/config/ManifestWatcher.test.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ describe('ManifestWatcher', () => {
2929

3030
const validManifest: WebAppManifest = {
3131
name: 'testApp',
32-
label: 'Test Application',
33-
version: '1.0.0',
3432
outputDir: 'dist',
3533
dev: {
3634
command: 'npm run dev',
@@ -160,7 +158,6 @@ describe('ManifestWatcher', () => {
160158
expect(manifest).to.exist;
161159
expect(manifest?.dev?.command).to.equal('npm run dev');
162160
expect(manifest?.name).to.be.undefined;
163-
expect(manifest?.label).to.be.undefined;
164161

165162
await watcher.stop();
166163
});
@@ -216,8 +213,6 @@ describe('ManifestWatcher', () => {
216213
const manifest = watcher.getManifest();
217214
expect(manifest).to.exist;
218215
expect(manifest?.name).to.equal('myApp');
219-
expect(manifest?.label).to.be.undefined;
220-
expect(manifest?.version).to.be.undefined;
221216
expect(manifest?.outputDir).to.be.undefined;
222217

223218
await watcher.stop();
@@ -226,8 +221,6 @@ describe('ManifestWatcher', () => {
226221
it('should accept manifest without optional dev config', async () => {
227222
const minimalManifest = {
228223
name: 'testApp',
229-
label: 'Test App',
230-
version: '1.0.0',
231224
outputDir: 'dist',
232225
};
233226

@@ -284,7 +277,7 @@ describe('ManifestWatcher', () => {
284277

285278
const event = await changePromise;
286279
expect(event.type).to.equal('changed');
287-
expect(event.manifest?.version).to.equal('2.0.0');
280+
expect((event.manifest as unknown as Record<string, unknown>)?.version).to.equal('2.0.0');
288281
await watcher.stop();
289282
});
290283

@@ -370,7 +363,7 @@ describe('ManifestWatcher', () => {
370363
await new Promise((resolve) => setTimeout(resolve, 800));
371364

372365
expect(changeCount).to.equal(1);
373-
expect(watcher.getManifest()?.version).to.equal('1.0.3');
366+
expect((watcher.getManifest() as unknown as Record<string, unknown>)?.version).to.equal('1.0.3');
374367
await watcher.stop();
375368
});
376369
});
@@ -430,7 +423,8 @@ describe('ManifestWatcher', () => {
430423
await new Promise((resolve) => setTimeout(resolve, 300));
431424

432425
expect(eventEmitted).to.be.false;
433-
expect(watcher.getManifest()?.version).to.equal('1.0.0'); // Still old version
426+
// Watcher stopped before write, so manifest unchanged (validManifest has no version)
427+
expect(watcher.getManifest()).to.deep.equal(validManifest);
434428

435429
await watcher.stop();
436430
});

test/config/types.test.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,16 @@ describe('TypeScript Types', () => {
2121
it('should allow valid WebAppManifest', () => {
2222
const manifest: WebAppManifest = {
2323
name: 'testApp',
24-
label: 'Test Application',
25-
version: '1.0.0',
2624
outputDir: 'dist',
2725
};
2826

2927
expect(manifest.name).to.equal('testApp');
30-
expect(manifest.version).to.equal('1.0.0');
28+
expect(manifest.outputDir).to.equal('dist');
3129
});
3230

3331
it('should allow WebAppManifest with dev config', () => {
3432
const manifest: WebAppManifest = {
3533
name: 'testApp',
36-
label: 'Test Application',
37-
version: '1.0.0',
3834
outputDir: 'dist',
3935
dev: {
4036
command: 'npm run dev',
@@ -46,18 +42,6 @@ describe('TypeScript Types', () => {
4642
expect(manifest.dev?.url).to.equal('http://localhost:5173');
4743
});
4844

49-
it('should allow optional description', () => {
50-
const manifest: WebAppManifest = {
51-
name: 'testApp',
52-
label: 'Test Application',
53-
description: 'This is a test app',
54-
version: '1.0.0',
55-
outputDir: 'dist',
56-
};
57-
58-
expect(manifest.description).to.equal('This is a test app');
59-
});
60-
6145
it('should allow WebAppManifest with routing config', () => {
6246
const routing: RoutingConfig = {
6347
rewrites: [{ route: '/api/:id', target: 'api/handler' }],
@@ -68,8 +52,6 @@ describe('TypeScript Types', () => {
6852

6953
const manifest: WebAppManifest = {
7054
name: 'testApp',
71-
label: 'Test Application',
72-
version: '1.0.0',
7355
outputDir: 'dist',
7456
routing,
7557
};

test/proxy/ProxyServer.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ describe('ProxyServer', () => {
122122
salesforceInstanceUrl: 'https://test.salesforce.com',
123123
manifest: {
124124
name: 'test-app',
125-
label: 'Test App',
126-
version: '1.0.0',
127125
outputDir: 'dist',
128126
},
129127
});
@@ -227,17 +225,13 @@ describe('ProxyServer', () => {
227225
salesforceInstanceUrl: 'https://test.salesforce.com',
228226
manifest: {
229227
name: 'test-app',
230-
label: 'Test App',
231-
version: '1.0.0',
232228
outputDir: 'dist',
233229
},
234230
});
235231

236232
// Update manifest with routing config
237233
proxy.updateManifest({
238234
name: 'test-app',
239-
label: 'Test App',
240-
version: '2.0.0',
241235
outputDir: 'dist',
242236
routing: {
243237
trailingSlash: 'always',

yarn.lock

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,6 +1758,19 @@
17581758
resolved "https://registry.npmjs.org/@salesforce/prettier-config/-/prettier-config-0.0.3.tgz"
17591759
integrity sha512-hYOhoPTCSYMDYn+U1rlEk16PoBeAJPkrdg4/UtAzupM1mRRJOwEPMG1d7U8DxJFKuXW3DMEYWr2MwAIBDaHmFg==
17601760

1761+
"@salesforce/sdk-core@^1.29.1":
1762+
version "1.29.1"
1763+
resolved "https://registry.yarnpkg.com/@salesforce/sdk-core/-/sdk-core-1.29.1.tgz#4679e9e2cc8c34fafb302610312f1f8eb249349e"
1764+
integrity sha512-Xc2Hh1yzV+vMj8+Ot4SjBIJgqU8OZJ51H3Hg6clKlzlzcuBzSTprHB4Cw252NWOGJ7UtG0rLGG8Q6F3qEg2SMQ==
1765+
1766+
"@salesforce/sdk-data@^1.29.1":
1767+
version "1.29.1"
1768+
resolved "https://registry.yarnpkg.com/@salesforce/sdk-data/-/sdk-data-1.29.1.tgz#4a1ad906d597d9e0ffca4e8c2991e2e54b90db7d"
1769+
integrity sha512-8TjrB8GiEgMEnVveQahYFd+8ak5Dr5xJgj0DoIDgIkToc1t6UzPVZAP4D/XO+aydPnzYO1ZXSPbemYOa3ar+uA==
1770+
dependencies:
1771+
"@conduit-client/salesforce-lightning-service-worker" "^3.7.0"
1772+
"@salesforce/sdk-core" "^1.29.1"
1773+
17611774
"@salesforce/sf-plugins-core@^11.3.12":
17621775
version "11.3.12"
17631776
resolved "https://registry.npmjs.org/@salesforce/sf-plugins-core/-/sf-plugins-core-11.3.12.tgz"
@@ -1797,13 +1810,13 @@
17971810
resolved "https://registry.npmjs.org/@salesforce/ts-types/-/ts-types-2.0.12.tgz"
17981811
integrity sha512-BIJyduJC18Kc8z+arUm5AZ9VkPRyw1KKAm+Tk+9LT99eOzhNilyfKzhZ4t+tG2lIGgnJpmytZfVDZ0e2kFul8g==
17991812

1800-
"@salesforce/webapp-experimental@^0.2.0":
1801-
version "0.2.0"
1802-
resolved "https://registry.npmjs.org/@salesforce/webapp-experimental/-/webapp-experimental-0.2.0.tgz"
1803-
integrity sha512-+E7b8u88ABJcgj7YSYiwXaF+LY9lCElibtEQbfuBdDXSUXjaMImwdZjhuyUtndIYWSXM+X38kjnIAFiikjqBIQ==
1813+
"@salesforce/webapp-experimental@^1.23.0":
1814+
version "1.29.1"
1815+
resolved "https://registry.yarnpkg.com/@salesforce/webapp-experimental/-/webapp-experimental-1.29.1.tgz#98648cc166b34c1b479f9545e87d10b61dd76adc"
1816+
integrity sha512-i5ZzGs7hrjv3Fbrvmm7v8OTVoJRewWvqzXIB5JRW5l2mcz1HxK2DXriBbLHHOmYRcVSrNdN/VS8PW7YwcTuHZw==
18041817
dependencies:
1805-
"@conduit-client/salesforce-lightning-service-worker" "^3.7.0"
18061818
"@salesforce/core" "^8.23.4"
1819+
"@salesforce/sdk-data" "^1.29.1"
18071820
axios "^1.7.7"
18081821
micromatch "^4.0.8"
18091822
path-to-regexp "^8.3.0"

0 commit comments

Comments
 (0)